/* Gameficate cartridge — right-to-left languages (Urdu, Arabic, Hebrew…).
   When the player's language is written right to left, the page gets dir="rtl" and body.rtl (Translator.applyToPage).
   Flexbox and grid then mirror the layout by themselves, and the CSS uses start/end (logical) properties wherever the
   side depends on the reading direction. This file holds what can't mirror on its own: numbers that must keep reading
   left to right, arrows that must point the other way, and pieces placed with left/right. */

/* ---------- Numbers: "2 / 10" stays "2 / 10" (not "10 / 2") ---------- */
body.rtl #qIndex,
body.rtl .mq-num,
body.rtl #progCount,
body.rtl #puNext,
body.rtl #scoreVal,
body.rtl #puVal,
body.rtl #timerVal,
body.rtl #zoomPct,
body.rtl #cursorCoords,
body.rtl .bigscore span {
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- Arrows point the reading way ---------- */
/* Previous is on the right and points right; next is on the left and points left. */
body.rtl #prevBtn svg,
body.rtl #nextBtn svg,
body.rtl .mq-open svg {
  transform: scaleX(-1);
}

/* ---------- Split layout (Explorer): the fold-away tab sits on the panel's edge, now on the right ---------- */
body.rtl .side-toggle {
  left: auto;
  right: calc(var(--panel-w) - 2px);
  border-radius: calc(14px * var(--rs, 1)) 0 0 calc(14px * var(--rs, 1));
  border-left: 2px solid var(--line);
  border-right: 0;
  box-shadow: -6px 0 14px rgba(10, 25, 40, 0.12);
}
/* ‹ and › are "mirrored" characters: in right-to-left text the browser draws them the other way round. The arrow is
   kept left to right so the glyphs below show exactly as written. */
body.rtl .side-toggle .ar {
  direction: ltr;
  unicode-bidi: isolate;
}
body.rtl .side-toggle .ar::before {
  content: '›'; /* fold the panel away to the right */
}
body.rtl.q-collapsed .side-toggle {
  left: auto;
  right: 0;
}
body.rtl.q-collapsed .side-toggle .ar::before {
  content: '‹'; /* bring the panel back from the right */
}
