/* Course v2 lesson look: the live site's type, 3D keys and spring motion,
   over the course's scenic worlds. */
@font-face { font-family: "Unbounded"; src: url("/fonts/Unbounded-latin.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/InstrumentSans-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("/fonts/Tajawal-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #2B1500; --ink-2: #351c08; --ink-soft: #7A6048; --cream: #FFF8EA; --cream-2: #FFF4DE;
  --gold: #FFB300; --gold-2: #FFC93C; --ar: #B26800; --green: #2EC66D; --green-ink: #157A41; --coral: #E5484D; --miss: #FFE1E1;
  --f-disp: "Unbounded", system-ui, sans-serif; --f-body: "Instrument Sans", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace; --f-ar: "Tajawal", "Noto Sans Arabic", sans-serif;
  --spring: cubic-bezier(.2, 1.35, .35, 1); --ease: cubic-bezier(.22, .8, .25, 1);
  --station: #FFB300; --station-ink: color-mix(in srgb, var(--station) 72%, #2B1500);
  --panel: rgba(255, 251, 243, .9);
  --shadow: 0 1px 2px rgba(53, 35, 15, .08), 0 10px 22px -14px rgba(53, 35, 15, .5);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.v2-body-root { margin: 0; min-height: 100dvh; font: 500 16px/1.5 var(--f-body); color: var(--ink); background: var(--cream); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: var(--station-ink); font-weight: 700; text-underline-offset: 3px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 99; background: #fff; padding: 8px 12px; border-radius: 10px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--station) 70%, #fff); outline-offset: 3px; }

/* ---------- scenic worlds ---------- */
:root { --lesson-chrome: 66px; --lesson-controls-bottom: 132px; }
/* Artwork fills every edge below the progress bar. Position each scene around
   its focal details rather than zooming or framing it inside a smaller box. */
.v2-bg { position: fixed; inset: var(--lesson-chrome) 0 0; z-index: 0; background: var(--cream) center / cover no-repeat; opacity: 0; transition: opacity .6s var(--ease); pointer-events: none; }
.v2-bg.on { opacity: 1; }
.v2-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 248, 234, .1), transparent 30%, rgba(255, 248, 234, .2)); }
.v2-bg[data-scene="welcome"] { background-image: url("bg/welcome-clean.png"); background-position: left top; }
.v2-bg[data-scene="review"] { background-image: url("bg/review-clean.png"); background-position: right 30%; }
.v2-bg[data-scene="words"] { background-image: url("bg/words-clean.png"); background-position: left top; }
/* the library desk, mirrored so it reads as a different room from Review */
.v2-bg[data-scene="sentences"] { background-image: url("bg/review-clean.png"); background-position: right 30%; transform: scaleX(-1); }
.v2-bg[data-scene="match"] { background-image: url("bg/match.webp"); }
.v2-bg[data-scene="sayit"] { background-image: url("bg/sayit.webp"); }
.v2-bg[data-scene="scenario"] { background-image: url("bg/scenario.webp"); }
.v2-bg[data-scene="complete"] { background-image: url("bg/complete-wide.png"); background-position: right center; }
@media (max-width: 760px) {
  .v2-bg[data-scene="welcome"] { background-image: url("bg/welcome-mobile-clean.png"); background-position: center top; }
  .v2-bg[data-scene="complete"] { background-image: url("bg/complete-mobile.png"); background-position: 85% 45%; }
  .v2-bg:is([data-scene="review"], [data-scene="sentences"]) { background-position: 85% 30%; }
}

/* ---------- top bar ---------- */
.v2-top { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: 12px max(16px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(255, 248, 234, .92), rgba(255, 248, 234, .72)); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid rgba(255, 255, 255, .6); }
.v2-close { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ink); text-decoration: none; font: 700 22px/1 var(--f-body); box-shadow: var(--shadow); transition: transform .2s var(--spring); }
.v2-close:hover { transform: translateY(-2px); }
.v2-close:active { transform: scale(.94); }
.v2-backbtn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin-left: -6px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; box-shadow: var(--shadow); transition: transform .2s var(--spring), opacity .2s; }
.v2-backbtn:hover:not(:disabled) { transform: translateY(-2px); }
.v2-backbtn:active:not(:disabled) { transform: scale(.94); }
.v2-backbtn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.v2-backbtn svg { margin-left: -2px; }
.v2-steps { flex: 1; display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.v2-steps li { flex: 1; min-width: 0; }
.v2-seg { position: relative; display: block; height: 10px; border-radius: 99px; background: rgba(43, 21, 0, .09); box-shadow: inset 0 1px 2px rgba(43, 21, 0, .12); }
.v2-seg i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 60%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); transition: width .7s var(--spring); overflow: hidden; }
.v2-seg i::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0) 0 8px, rgba(255, 255, 255, .38) 8px 14px); background-size: 28px 100%; opacity: 0; }
.v2-steps li.is-now .v2-seg i::before { opacity: 1; animation: v2Sheen .9s linear infinite; }
@keyframes v2Sheen { to { background-position: 28px 0; } }
.v2-seg::after { content: ""; position: absolute; top: 50%; left: var(--head, 0%); width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--c), 0 0 14px 2px color-mix(in srgb, var(--c) 60%, transparent); opacity: 0; transform: scale(.4); transition: opacity .3s, transform .4s var(--spring), left .7s var(--spring); }
.v2-steps li.is-now .v2-seg::after { opacity: 1; transform: scale(1); animation: v2Beat 1.6s ease-in-out infinite; }
@keyframes v2Beat { 50% { box-shadow: 0 0 0 3px var(--c), 0 0 22px 6px color-mix(in srgb, var(--c) 45%, transparent); } }
.v2-steps li.just-done .v2-seg { animation: v2SegPop .5s var(--spring); }
@keyframes v2SegPop { 40% { transform: scaleY(1.7); } }
.v2-steps em { display: flex; align-items: center; gap: 4px; margin-top: 11px; font: 700 9.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; font-style: normal; color: rgba(43, 21, 0, .38); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s, transform .4s var(--spring); }
.v2-steps li.is-done em::before { content: "✓"; display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; background: var(--c); color: #fff; font-size: 8px; }
.v2-steps li.just-done em::before { animation: v2Pop .5s var(--spring); }
.v2-steps li.is-now em { color: color-mix(in srgb, var(--c) 75%, #2B1500); transform: translateY(-1px); }
.v2-steps li.is-done em { color: rgba(43, 21, 0, .6); }
.v2-no { flex: none; font: 700 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
@media (max-width: 640px) { .v2-steps em { display: none; } .v2-steps li.is-now em { display: block; overflow: visible; } .v2-no { display: none; } }

/* ---------- stage ---------- */
#stage { position: relative; z-index: 2; min-height: 100dvh; display: grid; grid-template-rows: 1fr; justify-items: center; padding: calc(var(--lesson-controls-bottom) + 20px) 16px 150px; outline: 0; }
body.v2-inline-foot #stage { padding-bottom: 36px; }
/* cards sit in the middle of the room; the chat grows from the top */
.v2-screen { margin-block: auto; }
.v2-screen.is-chat { margin-top: 0; }
.v2-screen { grid-area: 1 / 1; width: min(640px, 100%); animation: v2In .55s var(--spring) both; }
.v2-screen.v2-out { animation: v2Out .22s var(--ease) both; pointer-events: none; }
@keyframes v2In { from { opacity: 0; transform: translateY(18px) scale(.975); } }
@keyframes v2Out { to { opacity: 0; transform: translateY(-10px) scale(.985); } }
.v2-panel { position: relative; padding: 30px; border-radius: 28px; background: var(--panel); backdrop-filter: blur(16px) saturate(1.25); -webkit-backdrop-filter: blur(16px) saturate(1.25); border: 1px solid rgba(255, 255, 255, .75); box-shadow: 0 34px 70px -34px rgba(53, 28, 8, .55), inset 0 1px 0 rgba(255, 255, 255, .9); }
.v2-center { text-align: center; }
@media (min-width: 980px) {
  body:is([data-step="welcome"], [data-step="sentences"]) #stage { justify-items: end; padding-right: max(5vw, 32px); }
  body:is([data-step="review"], [data-step="complete"]) #stage { justify-items: start; padding-left: max(5vw, 32px); }
  body:is([data-step="welcome"], [data-step="review"], [data-step="sentences"], [data-step="complete"]) .v2-screen { width: min(580px, 42vw); }
}
/* Leave the character visible above cards while keeping the artwork full screen. */
@media (max-width: 979px) {
  body.v2-body-root #stage { padding-top: max(calc(var(--lesson-controls-bottom) + 20px), calc(var(--lesson-chrome) + clamp(220px, 45dvh, 420px))); }
  body.v2-body-root[data-step="complete"] #stage { padding-top: calc(var(--lesson-chrome) + 60dvh); }
  .v2-screen { margin-block: 0; }
}
@media (max-width: 640px) { #stage { padding-inline: 12px; padding-bottom: 150px; } body.v2-inline-foot #stage { padding-bottom: 28px; } .v2-panel { padding: 22px 18px; border-radius: 24px; } }

/* ---------- type ---------- */
.v2-eyebrow { margin: 0 0 12px; font: 700 11px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--station-ink); }
.v2-h1 { margin: 0 0 14px; font: 800 clamp(30px, 4.6vw, 46px)/1.02 var(--f-disp); letter-spacing: -.045em; color: var(--ink); }
.v2-h2 { margin: 0 0 18px; font: 800 clamp(22px, 3.2vw, 30px)/1.12 var(--f-disp); letter-spacing: -.035em; color: var(--ink); }
.v2-h2--q { font-size: clamp(19px, 2.6vw, 24px); line-height: 1.22; }
.v2-h3 { margin: 26px 0 12px; font: 800 17px/1.2 var(--f-disp); letter-spacing: -.03em; }
.v2-body { margin: 0 0 12px; font: 500 16px/1.55 var(--f-body); color: var(--ink-soft); }
.v2-small { font-size: 14px; }
.v2-quote { color: var(--station-ink); }
.v2-big-num { display: inline-block; min-width: .7em; color: var(--station-ink); }

/* a line: transliteration headline, Arabic under it in gold */
.v2-line { display: flex; align-items: center; gap: 14px; text-align: left; }
.v2-line-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v2-tl { font: 700 19px/1.25 var(--f-body); color: var(--ink); }
.v2-ar { font: 700 20px/1.45 var(--f-ar); color: var(--ar); }
.v2-en { font: 500 14px/1.35 var(--f-body); color: var(--ink-soft); }
.v2-center .v2-line { justify-content: center; text-align: center; }

/* ---------- 3D keys (live site) ---------- */
.v2-key { --top: #FFDA6B; --bot: #FFC11F; --lip: #E39A00; --glow: rgba(255, 179, 0, .55); --txt: var(--ink); --d: 6px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 26px; border: 0; border-radius: 16px; cursor: pointer;
  background: linear-gradient(180deg, var(--top), var(--bot)); color: var(--txt); font: 700 16px/1 var(--f-body); letter-spacing: -.005em; white-space: nowrap;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .65), inset 0 -2px 0 rgba(0, 0, 0, .05), 0 var(--d) 0 var(--lip), 0 calc(var(--d) + 10px) 22px -8px var(--glow);
  transform: translateY(0); transition: transform .14s var(--ease), box-shadow .14s var(--ease), filter .2s; }
.v2-key:hover:not(:disabled) { transform: translateY(-2px); --d: 8px; }
.v2-key:active:not(:disabled) { transform: translateY(5px); --d: 1px; }
.v2-key:disabled { filter: grayscale(.85) opacity(.5); cursor: default; }
.v2-key[hidden] { display: none; }
.v2-key--white { --top: #fff; --bot: #FFF7E8; --lip: #E6D6BC; --glow: rgba(53, 35, 15, .25); }
.v2-key--green { --top: #5EDB90; --bot: #2EC66D; --lip: #1E9A52; --glow: rgba(46, 198, 109, .5); --txt: #fff; }
.v2-key--coral { --top: #FF7A7E; --bot: #E5484D; --lip: #B42A31; --glow: rgba(229, 72, 77, .45); --txt: #fff; }
.v2-key--sea { --top: #45B4F7; --bot: #1C8FE0; --lip: #0B5FA8; --glow: rgba(28, 143, 224, .5); --txt: #fff; }
.v2-key--ink { --top: #4a2a10; --bot: #2B1500; --lip: #120800; --glow: rgba(0, 0, 0, .5); --txt: var(--gold-2); }
.v2-pop { animation: v2Pop .42s var(--spring); }
@keyframes v2Pop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---------- footer ---------- */
.v2-foot { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 26px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(255, 248, 234, 0), rgba(255, 248, 234, .9) 38%); pointer-events: none; }
.v2-foot-in { display: flex; align-items: center; justify-content: flex-end; gap: 12px; width: min(640px, 100%); margin: 0 auto; pointer-events: auto; }
/* The old pinned footer only (test page); inside a lesson the row sits centred under the card. */
body:not(.v2-inline-foot)[data-step="welcome"] .v2-foot-in, body:not(.v2-inline-foot)[data-step="sentences"] .v2-foot-in { width: min(640px, 100%); }
@media (min-width: 980px) { body:not(.v2-inline-foot)[data-step="welcome"] .v2-foot-in, body:not(.v2-inline-foot)[data-step="sentences"] .v2-foot-in { width: min(580px, 46vw); margin-right: max(5vw, 32px); } }
.v2-note { margin-right: auto; font: 600 13px/1.3 var(--f-body); color: var(--ink-soft); }
@media (max-width: 520px) { .v2-foot-in { flex-wrap: wrap; } .v2-note { width: 100%; text-align: center; margin: 0; } .v2-foot-in .v2-key { flex: 1; padding: 0 16px; } }

/* ---------- play buttons ---------- */
.v2-play { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: var(--station); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--station) 70%, #000), 0 12px 20px -10px var(--station); transition: transform .15s var(--ease), box-shadow .15s; }
.v2-play svg { width: 44%; height: 44%; margin-left: 6%; }
.v2-play:hover { transform: translateY(-2px); }
.v2-play:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--station) 70%, #000); }
.v2-play .v2-eq { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 3px; }
.v2-play .v2-eq i { width: 3.5px; height: 42%; border-radius: 2px; background: #fff; animation: v2Eq .9s ease-in-out infinite; }
.v2-play .v2-eq i:nth-child(2) { animation-delay: -.3s; } .v2-play .v2-eq i:nth-child(3) { animation-delay: -.6s; } .v2-play .v2-eq i:nth-child(4) { animation-delay: -.15s; animation-duration: .7s; }
.v2-play.is-playing svg { visibility: hidden; }
.v2-play.is-playing .v2-eq { display: flex; }
@keyframes v2Eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@keyframes v2Ring { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
.v2-play--lg { width: 58px; height: 58px; }
/* The big listen key: a glossy 3D button. Pressed in while it plays, with the
   level bars dancing inside; no rings. */
.v2-play--xl { width: 124px; height: 124px; background: radial-gradient(120% 90% at 30% 18%, color-mix(in srgb, var(--station) 35%, #fff) 0%, var(--station) 55%, color-mix(in srgb, var(--station) 82%, #000) 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .55), inset 0 -6px 12px rgba(0, 0, 0, .12), 0 9px 0 color-mix(in srgb, var(--station) 62%, #000), 0 26px 40px -14px var(--station);
  transition: transform .16s var(--spring), box-shadow .16s var(--ease); }
.v2-play--xl::before { content: ""; position: absolute; left: 18%; right: 18%; top: 8%; height: 34%; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); pointer-events: none; }
.v2-play--xl svg { width: 40%; height: 40%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .18)); }
.v2-play--xl:hover { transform: translateY(-3px) scale(1.03); }
.v2-play--xl:active, .v2-play--xl.is-playing { transform: translateY(6px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .4), inset 0 -3px 10px rgba(0, 0, 0, .18), 0 3px 0 color-mix(in srgb, var(--station) 62%, #000), 0 12px 22px -12px var(--station); }
.v2-play--xl .v2-eq { gap: 6px; }
.v2-play--xl .v2-eq i { width: 7px; height: 38%; border-radius: 4px; }
.v2-play--slow { background: #fff; color: var(--station-ink); box-shadow: 0 4px 0 #E6D6BC, var(--shadow); }
.v2-play--slow svg { margin: 0; }
.v2-listen-big { display: grid; place-items: center; margin: 6px 0 24px; }

/* ---------- mic ---------- */
.v2-mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 20px; }
.v2-mic { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 22px 0 16px; border: 0; border-radius: 999px; cursor: pointer; background: #fff; color: #0B5FA8; font: 700 15px/1 var(--f-body); box-shadow: 0 4px 0 #cfe3f5, 0 14px 24px -14px rgba(11, 95, 168, .6); transition: transform .14s var(--ease), background-color .2s, color .2s; }
.v2-mic svg { width: 22px; height: 22px; }
.v2-mic:hover { transform: translateY(-2px); }
.v2-mic:active { transform: translateY(3px); }
.v2-mic-ring { position: absolute; inset: -5px; border-radius: inherit; border: 2px solid #E5484D; opacity: 0; pointer-events: none; }
.v2-mic.is-rec { background: #E5484D; color: #fff; box-shadow: 0 4px 0 #B42A31, 0 14px 26px -12px rgba(229, 72, 77, .7), 0 0 0 calc(var(--lvl, 0) * 16px) rgba(229, 72, 77, .22); transition: transform .14s var(--ease), box-shadow .08s linear; }
.v2-mic.is-rec .v2-mic-ring { animation: v2Ring 1s ease-out infinite; }
.v2-mic.is-checking { opacity: .75; }
.v2-mic.is-self.is-done { background: var(--green); color: #fff; box-shadow: 0 4px 0 #1E9A52; }
.v2-mic-slot--big .v2-mic { min-height: 64px; padding: 0 30px 0 22px; font-size: 17px; background: linear-gradient(180deg, #45B4F7, #1C8FE0); color: #fff; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 6px 0 #0B5FA8, 0 18px 30px -12px rgba(28, 143, 224, .6); }
.v2-mic-slot--big .v2-mic.is-rec { background: linear-gradient(180deg, #FF7A7E, #E5484D); box-shadow: 0 6px 0 #B42A31, 0 18px 30px -12px rgba(229, 72, 77, .6), 0 0 0 calc(var(--lvl, 0) * 22px) rgba(229, 72, 77, .2); transition: transform .14s var(--ease), box-shadow .08s linear; }
.v2-mic-slot--big .v2-mic svg { width: 26px; height: 26px; }
.v2-mic-chip:empty { display: none; }
.sayit-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 14px; border-radius: 99px; font: 700 12px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; animation: v2Pop .42s var(--spring); }
.sayit-chip.is-good { background: #FFF1C7; color: var(--green-ink); }
.sayit-chip.is-close { background: #FFF1C9; color: #8A5A00; }
.sayit-chip.is-bad { background: var(--miss); color: #A3262B; }
.sayit-chip.is-wait { background: #E8F3FC; color: #0B5FA8; }
.v2-mic-wrap--inline { margin: 6px 0 0; }

/* ---------- welcome ---------- */
.v2-can { margin: 0 0 20px; font: 600 17px/1.45 var(--f-body); color: var(--ink); }
.v2-can span { display: block; margin-bottom: 4px; font: 700 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.v2-bubble { position: relative; padding: 14px 18px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); animation: v2In .6s var(--spring) .15s both; }
.v2-bubble p { margin: 0; font: 600 15.5px/1.45 var(--f-body); color: var(--ink); }
.v2-bubble--guide { margin-bottom: 22px; border-top-left-radius: 6px; }
.v2-saqr-row { display: flex; align-items: flex-end; gap: 10px; margin: 14px 0 22px; }
.v2-saqr { flex: none; width: 84px; height: 84px; object-fit: contain; }
.v2-bubble--saqr { flex: 1; background: #FFF3D0; border-bottom-left-radius: 6px; animation-delay: .35s; }
.v2-route { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.v2-route li { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); border-top: 3px solid var(--c); animation: v2In .5s var(--spring) both; animation-delay: calc(.45s + var(--n) * 60ms); }
.v2-route b { font: 700 13.5px/1.1 var(--f-body); }
.v2-route span { font: 600 11.5px/1.2 var(--f-body); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .v2-route { grid-template-columns: repeat(2, 1fr); } }
.v2-saqr-big { width: 150px; height: 150px; object-fit: contain; margin-top: 6px; mix-blend-mode: multiply; }

/* ---------- review ---------- */
.v2-recall { position: relative; padding: 26px 20px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); transition: background-color .3s, box-shadow .3s; }
.v2-recall-en { margin: 0; font: 800 clamp(20px, 3vw, 26px)/1.2 var(--f-disp); letter-spacing: -.03em; }
.v2-recall-answer { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .5s var(--spring), opacity .35s, margin .4s; }
.v2-recall-answer > * { overflow: hidden; }
.v2-recall.is-open .v2-recall-answer { grid-template-rows: 1fr; opacity: 1; margin-top: 16px; }
.v2-recall.is-got { box-shadow: 0 0 0 3px var(--green), var(--shadow); }
.v2-recall.is-miss { box-shadow: 0 0 0 3px #F5B7A0, var(--shadow); }

/* ---------- flashcards ---------- */
.v2-deck { position: relative; margin: 6px 0 18px; perspective: 1200px; }
.v2-deck-ghost { position: absolute; inset: 0; border-radius: 26px; background: #fff; box-shadow: var(--shadow); }
.v2-deck-ghost.g1 { transform: translateY(10px) rotate(2.4deg) scale(.97); opacity: .75; }
.v2-deck-ghost.g2 { transform: translateY(18px) rotate(-3deg) scale(.94); opacity: .5; }
.v2-flip { position: relative; cursor: pointer; outline-offset: 6px; border-radius: 26px; }
.v2-flip-in { position: relative; display: grid; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3, 1.3, .4, 1); }
.v2-flip.flipped .v2-flip-in { transform: rotateY(180deg); }
.v2-card-enter .v2-flip { animation: v2Deal .65s var(--spring) both; }
/* the next card was already underneath: it lifts off the pile into place */
@keyframes v2Deal { from { transform: translateY(10px) rotate(2.4deg) scale(.97); } }
.v2-card-enter .v2-flip.v2-leave, .v2-flip.v2-leave { animation: none; transition: transform .26s cubic-bezier(.5, 0, .9, .4), opacity .26s; transform: translateX(-115%) rotate(-12deg); opacity: 0; pointer-events: none; }
.v2-flip.v2-nudge .v2-flip-in { animation: v2Nudge .45s var(--spring); }
@keyframes v2Nudge { 40% { transform: rotateY(14deg) scale(1.02); } }
.v2-flip.flipped.v2-nudge .v2-flip-in { animation: none; }
.v2-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 22px; border-radius: 26px; background: #fff; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 1px 2px rgba(53, 35, 15, .08), 0 24px 44px -24px rgba(53, 35, 15, .55); overflow: hidden; }
.v2-front::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--station); }
.v2-flip .v2-face { position: relative; grid-area: 1 / 1; min-width: 0; min-height: 290px; padding-bottom: 114px; }
.v2-card-toggle { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 26px; background: transparent; cursor: pointer; }
.v2-card-toggle:focus-visible { outline: 3px solid var(--station); outline-offset: 5px; }
.v2-card-audio { position: absolute; z-index: 2; bottom: 57px; left: 50%; transform: translateX(-50%); }
.v2-play--card { width: 48px; height: 48px; }
.v2-play--card:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
.v2-face-top { min-height: 58px; margin-bottom: 4px; }
.v2-card-tl { font: 800 clamp(28px, 5vw, 42px)/1.08 var(--f-disp); letter-spacing: -.04em; color: var(--ink); text-align: center; }
.v2-card-ar { font: 700 clamp(26px, 4.4vw, 34px)/1.4 var(--f-ar); color: var(--ar); }
.v2-card-hint { position: absolute; bottom: 22px; left: 0; right: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font: 700 10.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(43, 21, 0, .4); }
.v2-card-hint svg { width: 14px; height: 14px; }
.v2-back { transform: rotateY(180deg); background: linear-gradient(160deg, color-mix(in srgb, var(--station) 88%, #fff), var(--station)); }
.v2-back small { font: 700 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .8); }
.v2-card-en { font: 800 clamp(24px, 4.2vw, 34px)/1.15 var(--f-disp); letter-spacing: -.035em; color: #fff; text-align: center; }
.v2-card-form { font: 700 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
@media (max-width: 640px) { .v2-flip .v2-face { min-height: 250px; } }

.v2-seg-ctl { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(255, 255, 255, .85); box-shadow: var(--shadow); }
.v2-seg-ctl button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 99px; background: transparent; font: 700 13px/1 var(--f-body); color: var(--ink-soft); cursor: pointer; transition: background-color .25s, color .25s, transform .2s var(--spring); }
.v2-seg-ctl button[aria-pressed="true"] { background: var(--station); color: #fff; }
.v2-seg-ctl button:active { transform: scale(.95); }
.v2-wordstrip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.v2-wordstrip span { padding: 8px 12px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); font: 700 14px/1 var(--f-body); animation: v2In .45s var(--spring) both; animation-delay: calc(var(--n) * 55ms + .2s); }

/* ---------- tiles ---------- */
.v2-options { display: grid; gap: 10px; margin-top: 8px; }
.v2-options--two { grid-template-columns: 1fr 1fr; }
.v2-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; padding: 12px 16px; border: 0; border-radius: 16px; background: #fff; color: var(--ink-2); cursor: pointer; text-align: center; box-shadow: var(--shadow); transition: transform .22s var(--spring), background-color .2s, color .2s, box-shadow .2s, opacity .3s; }
.v2-tile:hover:not(:disabled) { transform: translateY(-2px); }
.v2-tile:active:not(:disabled) { transform: scale(.96); }
.v2-tile.sel { background: #FFF6DC; box-shadow: 0 0 0 3px var(--station), var(--shadow); transform: translateY(-2px); }
.v2-tile.done { background: var(--green); color: #fff; box-shadow: 0 4px 0 #1E9A52; }
.v2-tile.done .v2-opt-ar, .v2-tile.done .v2-opt-en { color: rgba(255, 255, 255, .9); }
.v2-tile.miss { animation: v2Shake .42s; background: var(--miss); }
.v2-tile.reveal { box-shadow: 0 0 0 3px var(--green), var(--shadow); }
.v2-tile:disabled:not(.done):not(.reveal) { opacity: .5; cursor: default; }
@keyframes v2Shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.v2-opt-tl { font: 700 17px/1.25 var(--f-body); }
.v2-opt-ar { font: 700 17px/1.4 var(--f-ar); color: var(--ar); }
.v2-opt-en { font: 600 15.5px/1.3 var(--f-body); }

/* ---------- sentences ---------- */
.v2-pattern .v2-h2 { margin-bottom: 12px; }
.v2-explain { margin: 0 0 18px; font: 500 16.5px/1.6 var(--f-body); color: var(--ink); }
.v2-examples { display: grid; gap: 10px; }
.v2-example { padding: 12px 16px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); animation: v2In .5s var(--spring) both; animation-delay: calc(var(--n) * 90ms + .15s); }
.v2-goal { font-size: clamp(20px, 3vw, 26px); }
.v2-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 62px; padding: 9px; margin: 0 0 14px; border-radius: 18px; border: 2px dashed color-mix(in srgb, var(--station) 40%, transparent); background: rgba(255, 255, 255, .55); transition: background-color .35s, border-color .35s; }
.v2-slots.win { background: var(--green); border-color: var(--green); border-style: solid; animation: v2Pop .45s var(--spring); }
.v2-slots.miss { animation: v2Shake .42s; border-color: var(--coral); background: var(--miss); }
.v2-chip { display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; border: 2px solid var(--station); border-radius: 12px; background: #fff; color: var(--ink); font: 700 16px/1 var(--f-body); cursor: pointer; transition: transform .45s var(--spring); }
.v2-slots.win .v2-chip { border-color: #fff; color: var(--green-ink); cursor: default; }
.v2-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; transition: opacity .35s, max-height .4s; }
.v2-bank.is-spent { opacity: 0; max-height: 0; overflow: hidden; }
.v2-tile--word { min-height: 46px; padding: 0 16px; font: 700 16px/1 var(--f-body); }
.v2-tile--word.used { opacity: .25; transform: scale(.92); pointer-events: none; }
.v2-build-after { margin-top: 4px; animation: v2In .5s var(--spring) both; }
.v2-build-after .v2-line { justify-content: center; }

/* ---------- match ---------- */
.v2-match-hud { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.v2-match-hud .v2-eyebrow { margin: 0 auto 0 0; }
.v2-hud-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 99px; background: #fff; box-shadow: var(--shadow); font: 700 13px/1 var(--f-mono); color: var(--ink); }
.v2-hud-pill svg { width: 15px; height: 15px; color: var(--station-ink); }
.v2-combo { background: var(--station); color: #fff; }
.v2-combo[hidden] { display: none; }
/* One shared grid: row N on the left and right always share a height, so a
   long Arabic tile never leaves the English column ending early. */
.v2-pairs { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; gap: 10px; }
.v2-col { display: contents; }
.v2-pairs-head { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: -4px 0 8px; text-align: center; font: 700 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.v2-col:first-child > .v2-tile { grid-column: 1; }
.v2-col:last-child > .v2-tile { grid-column: 2; }
.v2-tile--pair { min-height: 68px; }
.v2-tile--pair .v2-opt-tl { font-size: 16px; }
.v2-tile--pair .v2-opt-ar { font-size: 15px; }
.v2-tile--pair.done { animation: v2Pop .42s var(--spring), v2Gone .4s var(--ease) .7s forwards; }
@keyframes v2Gone { to { opacity: .28; transform: scale(.96); } }
.v2-earlier { position: absolute; top: 6px; right: 8px; font: 700 8.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; font-style: normal; color: var(--station-ink); opacity: .7; }
.v2-result-row { display: flex; justify-content: center; gap: 14px; margin: 6px 0 16px; }
.v2-stat { min-width: 128px; padding: 16px 18px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.v2-stat b { display: block; font: 800 40px/1.05 var(--f-disp); letter-spacing: -.04em; color: var(--station-ink); }
.v2-stat span { font: 700 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- say it ---------- */
.v2-say-card { padding: 22px 18px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.v2-say-en { margin: 0 0 12px; font: 600 15px/1.35 var(--f-body); color: var(--ink-soft); }
.v2-say-card .v2-tl { font: 800 clamp(22px, 3.6vw, 30px)/1.15 var(--f-disp); letter-spacing: -.035em; }
.v2-say-card .v2-ar { font-size: 24px; }
.v2-say-card .v2-line-text { align-items: center; text-align: center; }
.v2-say-after { margin-top: 16px; animation: v2In .45s var(--spring) both; }
.v2-say-verdict { margin: 0 0 10px; font: 700 15px/1.4 var(--f-body); color: var(--ink); }
.v2-say-verdict.is-ok { color: var(--green-ink); }
.v2-say-verdict.is-bad { color: #A3262B; }
.v2-say-model { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 99px; background: #fff; box-shadow: var(--shadow); font: 700 13px/1 var(--f-body); color: var(--ink-soft); }
.v2-vs { font: 700 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.v2-sheet-pair { display: grid; gap: 10px; }
.v2-sheet-pair > div:not(.v2-vs) { padding: 10px 14px; border-radius: 14px; background: var(--cream); }

/* ---------- scenario ---------- */
.v2-avatar { display: grid; place-items: center; width: 92px; height: 92px; margin: 4px auto 12px; border-radius: 50%; background: linear-gradient(160deg, hsl(var(--hue) 75% 64%), hsl(var(--hue) 70% 46%)); color: #fff; font: 800 38px/1 var(--f-disp); box-shadow: 0 6px 0 hsl(var(--hue) 60% 36%), 0 18px 30px -14px hsl(var(--hue) 70% 40%); animation: v2Pop .6s var(--spring); }
.v2-avatar.sm { width: 38px; height: 38px; margin: 0; font-size: 16px; box-shadow: none; animation: none; }
.v2-role { margin: -10px 0 14px; font: 700 11px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.v2-setting { margin: 0; padding: 16px 18px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); font: 600 16px/1.5 var(--f-body); }
.v2-chat-panel { padding: 0; overflow: hidden; }
.v2-chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid rgba(43, 21, 0, .08); background: rgba(255, 255, 255, .7); }
.v2-chat-head b { font: 700 15px/1 var(--f-body); }
.v2-chat-head span:last-child { min-width: 0; font: 700 10.5px/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-chat-head b { flex: none; }
.v2-chat { display: flex; flex-direction: column; gap: 10px; padding: 18px; min-height: 180px; }
.v2-chat-scene { align-self: center; max-width: 92%; margin: 0 0 4px; padding: 8px 14px; border-radius: 14px; background: rgba(255, 255, 255, .55); font: 500 13px/1.45 var(--f-body); color: var(--ink-soft); text-align: center; }
.v2-bub { position: relative; max-width: 86%; padding: 12px 16px; border-radius: 20px; animation: v2Bub .45s var(--spring) both; }
@keyframes v2Bub { from { opacity: 0; transform: translateY(10px) scale(.94); } }
.v2-bub .v2-play { float: right; width: 34px; height: 34px; margin: 0 0 4px 10px; }
.v2-bub b { display: block; font: 700 16.5px/1.3 var(--f-body); }
.v2-bub i { display: block; font: 700 17px/1.45 var(--f-ar); font-style: normal; }
.v2-bub small { display: block; margin-top: 3px; font: 500 13px/1.35 var(--f-body); opacity: .75; }
.v2-bub.them { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.v2-bub.them i { color: var(--ar); }
.v2-bub.you { align-self: flex-end; background: var(--station); color: #fff; border-bottom-right-radius: 6px; }
.v2-bub.you .v2-play { background: #fff; color: var(--station); box-shadow: none; }
.v2-bub.is-twist { box-shadow: 0 0 0 2.5px var(--station), var(--shadow); }
.v2-twist { display: block; margin-bottom: 4px; font: 700 9.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; font-style: normal; color: var(--station-ink); }
.v2-typing { display: flex; gap: 5px; padding: 16px 18px; }
.v2-typing span { width: 8px; height: 8px; border-radius: 50%; background: rgba(43, 21, 0, .35); animation: v2Dot 1s ease-in-out infinite; }
.v2-typing span:nth-child(2) { animation-delay: .15s; } .v2-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes v2Dot { 0%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-5px); opacity: 1; } }
.v2-composer { padding: 0 18px 20px; }
.v2-composer:empty { display: none; }
.v2-composer.v2-rise { animation: v2In .5s var(--spring) both; }
.v2-why { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; background: #FFF1EC; font: 600 14.5px/1.45 var(--f-body); color: #7A2E12; text-align: left; }
.v2-why.v2-rise { animation: v2In .4s var(--spring) both; }
.v2-prompt { margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--station) 12%, #fff); font: 700 14.5px/1.4 var(--f-body); color: var(--ink); text-align: center; }
.v2-q-line { display: flex; justify-content: center; margin: 0 0 18px; padding: 14px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.v2-textarea { width: 100%; padding: 14px 16px; border: 2px solid rgba(43, 21, 0, .12); border-radius: 18px; background: #fff; font: 600 17px/1.45 var(--f-body); color: var(--ink); resize: vertical; transition: border-color .2s, box-shadow .2s; }
.v2-textarea:focus { outline: 0; border-color: var(--station); box-shadow: 0 0 0 4px color-mix(in srgb, var(--station) 20%, transparent); }
.v2-yours .v2-body { margin-top: 12px; }

/* ---------- answer sheet ---------- */
.v2-sheet-scrim { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(43, 21, 0, 0); transition: background-color .25s; }
.v2-sheet-scrim.open { background: rgba(43, 21, 0, .32); }
.v2-sheet { width: min(640px, 100%); padding: 24px 24px calc(22px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: #fff; box-shadow: 0 -20px 50px -20px rgba(43, 21, 0, .45); transform: translateY(105%); transition: transform .42s var(--spring); }
.v2-sheet-scrim.open .v2-sheet { transform: translateY(0); }
.v2-sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.v2-sheet-head h2 { margin: 0; font: 800 22px/1.1 var(--f-disp); letter-spacing: -.035em; }
.v2-sheet-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: #fff; }
.v2-sheet-badge svg { width: 22px; height: 22px; }
.v2-sheet.is-ok { border-top: 6px solid var(--green); }
.v2-sheet.is-ok .v2-sheet-badge { background: var(--green); }
.v2-sheet.is-ok h2 { color: var(--green-ink); }
.v2-sheet.is-bad { border-top: 6px solid var(--coral); }
.v2-sheet.is-bad .v2-sheet-badge { background: var(--coral); }
.v2-sheet.is-bad h2 { color: #A3262B; }
.v2-sheet-why { margin: 0 0 8px; font: 500 15.5px/1.5 var(--f-body); color: var(--ink); }
.v2-sheet-note { margin: 0; font: 600 13px/1.4 var(--f-body); color: var(--ink-soft); }
.v2-sheet-answer { display: flex; flex-direction: column; align-items: flex-start; margin: 0 0 10px; padding: 12px 16px; border-radius: 14px; background: #FFF1C7; }
.v2-sheet-line { margin-bottom: 10px; padding: 12px 14px; border-radius: 14px; background: var(--cream); }
.v2-sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@media (max-width: 520px) { .v2-sheet-actions .v2-key { flex: 1; } }

/* ---------- done ---------- */
.v2-done { text-align: center; }
.v2-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 6px; }
.v2-kpi { padding: 16px 8px 14px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); animation: v2In .5s var(--spring) both; }
.v2-kpi:nth-child(2) { animation-delay: .08s; } .v2-kpi:nth-child(3) { animation-delay: .16s; } .v2-kpi:nth-child(4) { animation-delay: .24s; }
.v2-kpi b { display: block; font: 800 clamp(26px, 4vw, 34px)/1.05 var(--f-disp); letter-spacing: -.04em; color: var(--ink); }
.v2-kpi:first-child b { color: var(--ar); }
.v2-kpi > span { font: 700 10px/1.2 var(--f-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); }
@media (max-width: 560px) { .v2-kpis { grid-template-columns: 1fr 1fr; } }
.v2-keylines { display: grid; gap: 10px; margin-bottom: 16px; }
.v2-mini { height: 86px; perspective: 900px; cursor: pointer; animation: v2In .5s var(--spring) both; animation-delay: calc(.4s + var(--n) * 80ms); border-radius: 18px; }
.v2-mini-in { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.3, 1.3, .4, 1); }
.v2-mini.flipped .v2-mini-in { transform: rotateY(180deg); }
.v2-mini-f, .v2-mini-b { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 16px; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow); }
.v2-mini-f { background: #fff; font: 700 16px/1.3 var(--f-body); }
.v2-mini-f small { display: inline-flex; align-items: center; gap: 5px; font: 700 9.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(43, 21, 0, .4); }
.v2-mini-f small svg { width: 12px; height: 12px; }
.v2-mini-b { transform: rotateY(180deg); background: #FFF1C7; }
.v2-mini-b .v2-play { width: 36px; height: 36px; }
.v2-plan { margin-top: 6px; }
.v2-plan .v2-h3 { margin-bottom: 4px; }

/* ---------- rolling counters ---------- */
.v2-roll { display: inline-flex; align-items: flex-end; font-variant-numeric: tabular-nums; }
/* The reels are spans inside the number, so label rules like ".x span" would
   catch them. Doubled class so the number's own font always wins. */
.v2-roll.v2-roll span { font: inherit; letter-spacing: inherit; color: inherit; text-transform: none; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; animation: none; opacity: 1; white-space: nowrap; }
.v2-roll.v2-roll .v2-reel { display: inline-block; height: 1.08em; overflow: hidden; line-height: 1.08; }
.v2-roll.v2-roll .v2-reel-in { display: flex; flex-direction: column; transition: transform var(--roll-dur, 1.4s) cubic-bezier(.16, .84, .3, 1.04); transition-delay: calc(var(--i) * 70ms); }
.v2-reel i { display: block; height: 1.08em; font-style: normal; }
.v2-roll.go .v2-reel-in { transform: translateY(calc(-1.08em * (10 + var(--d)))); }
.v2-roll.v2-roll .v2-roll-suffix { margin-left: .04em; font-size: .62em; line-height: 1.5; }

/* ---------- loading shell ---------- */
body.next-loading .v2-top, body.next-loading .v2-foot { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =================================================================
   2026-09-29 pass: inline actions, centred cards, coach, new results
   ================================================================= */
/* action row right under the card */
body.v2-inline-foot .v2-foot { display: none; }
.v2-screen > .v2-foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 12px; width: 100%; margin: 18px auto 0; pointer-events: auto; }
.v2-screen > .v2-foot-in.is-empty { display: none; }
.v2-screen > .v2-foot-in .v2-note { order: -1; width: 100%; margin: 0; text-align: center; }
.v2-screen > .v2-foot-in .v2-note:empty { display: none; }
.v2-screen > .v2-foot-in .v2-key { min-width: 180px; }
@media (max-width: 520px) { .v2-screen > .v2-foot-in .v2-key { flex: 1; min-width: 0; } }

/* Reading direction comes from dir="rtl"; card alignment is independent. */
.v2-line .v2-ar, .v2-bub i { text-align: right; }
.v2-center .v2-line .v2-ar,
.v2-say-card .v2-line .v2-ar,
.v2-mini-b .v2-line .v2-ar,
.v2-card-ar, .v2-opt-ar, .v2-cw i { text-align: center; }
.v2-mini-b .v2-line-text { text-align: center; }
.v2-center .v2-line-text { align-items: stretch; }
.v2-say-card .v2-line-text { align-items: center; }

/* pattern card: wide, head beside the examples */
.v2-screen.is-pattern { width: min(900px, 100%); }
.v2-pattern mark { white-space: nowrap; padding: 0 .28em; border-radius: 6px; background: color-mix(in srgb, var(--station) 16%, #fff); color: color-mix(in srgb, var(--station) 70%, #2B1500); font-weight: 700; }
.v2-pattern .v2-h2 { font-size: clamp(24px, 3.4vw, 34px); }
@media (min-width: 900px) {
  .v2-pattern.is-wide { display: grid; grid-template-columns: 1.05fr 1fr; gap: 26px; align-items: start; }
  .v2-pattern.is-wide .v2-explain { margin-bottom: 0; font-size: 15.5px; line-height: 1.55; }
  .v2-pattern.is-wide .v2-examples { grid-template-columns: 1fr 1fr; gap: 8px; }
  .v2-pattern.is-wide .v2-example { padding: 10px 12px; border-radius: 14px; }
  .v2-pattern.is-wide .v2-example .v2-tl { font-size: 16px; }
  .v2-pattern.is-wide .v2-example .v2-en { font-size: 13px; }
}
.v2-example { border-left: 4px solid var(--station); }

/* build: centre stage, and the finished sentence does a wave */
.v2-build .v2-goal { font-size: clamp(22px, 3.4vw, 30px); }
.v2-chip { animation: v2Land .5s var(--spring); }
@keyframes v2Land { 0% { transform: scale(.7) rotate(-4deg); } 60% { transform: scale(1.08) rotate(1deg); } }
.v2-slots.win .v2-chip { animation: v2Wave .6s var(--spring) both; animation-delay: calc(var(--w, 0) * 70ms); }
@keyframes v2Wave { 40% { transform: translateY(-9px) scale(1.06); } }

/* match clock */
.v2-hud-pill { transition: background-color .3s, color .3s; }
.v2-hud-pill.is-low { background: #FFF1C9; color: #8A5A00; animation: v2Beat2 1s ease-in-out infinite; }
.v2-hud-pill.is-over { background: var(--coral); color: #fff; }
.v2-hud-pill.is-over svg { color: #fff; }
@keyframes v2Beat2 { 50% { transform: scale(1.06); } }

/* match result */
.v2-mresult { padding-top: 34px; }
.v2-dial { position: relative; width: 168px; height: 168px; margin: 0 auto 10px; }
.v2-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.v2-dial circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.v2-dial-bg { stroke: rgba(43, 21, 0, .08); }
.v2-dial-fg { stroke: var(--green); stroke-dasharray: 0 100; transition: stroke-dasharray 1.2s var(--ease) .2s; }
.v2-mresult:not(.is-beat) .v2-dial-fg { stroke: var(--coral); }
.v2-dial.go .v2-dial-fg { stroke-dasharray: calc(var(--f) * 100) 100; }
.v2-mresult:not(.is-beat) .v2-dial.go .v2-dial-fg { stroke-dasharray: 100 100; opacity: .25; }
.v2-dial-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.v2-dial-in b { font: 800 48px/1 var(--f-disp); letter-spacing: -.05em; color: var(--ink); }
.v2-dial-in span { margin-top: 4px; font: 700 9.5px/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.v2-mresult-h { margin-bottom: 6px; font-size: clamp(32px, 5vw, 48px); }
.v2-mchips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.v2-mchip { display: inline-flex; align-items: baseline; gap: 6px; padding: 10px 16px; border-radius: 99px; background: #fff; box-shadow: var(--shadow); font: 600 14px/1 var(--f-body); color: var(--ink-soft); animation: v2In .5s var(--spring) both; }
.v2-mchip:nth-child(2) { animation-delay: .1s; } .v2-mchip:nth-child(3) { animation-delay: .2s; }
.v2-mchip b { font: 800 18px/1 var(--f-disp); letter-spacing: -.03em; color: var(--ink); }
.v2-mchip.is-good b { color: var(--green-ink); }

/* say it: the coach */
.v2-coach-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.v2-cw { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; border-radius: 14px; border: 2px solid transparent; animation: v2Pop .45s var(--spring) both; animation-delay: calc(var(--k) * 70ms); }
.v2-cw b { font: 800 clamp(20px, 3.2vw, 26px)/1.15 var(--f-disp); letter-spacing: -.035em; }
.v2-cw i { font: 700 20px/1.35 var(--f-ar); font-style: normal; color: var(--ar); }
.v2-cw.is-ok { background: #FFF1C7; border-color: #9BE3B9; }
.v2-cw.is-ok b { color: var(--green-ink); }
.v2-cw.is-close { background: #FFF1C9; border-color: #FFCE5C; }
.v2-cw.is-close b { color: #8A5A00; }
.v2-cw.is-miss { background: var(--miss); border-color: #F5A3A6; }
.v2-cw.is-miss b { color: #A3262B; text-decoration: underline wavy rgba(163, 38, 43, .5); text-underline-offset: 5px; }
.v2-meter { height: 8px; margin: 2px auto 14px; max-width: 260px; border-radius: 99px; background: rgba(43, 21, 0, .08); overflow: hidden; }
.v2-meter i { display: block; height: 100%; width: var(--p); border-radius: inherit; animation: v2Fill .9s var(--ease) both; }
@keyframes v2Fill { from { width: 0; } }
.v2-meter.is-good i { background: var(--green); } .v2-meter.is-near i { background: var(--gold); } .v2-meter.is-bad i { background: var(--coral); }
.v2-say-verdict { font-size: 17px; }
.v2-say-verdict.is-near { color: #8A5A00; }
.v2-heard { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 8px 14px; border-radius: 12px; background: rgba(43, 21, 0, .05); }
.v2-heard span { font: 700 10px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.v2-heard b { font: 700 18px/1.3 var(--f-ar); color: var(--ink); }
.v2-tips { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; text-align: left; }
.v2-tips li { position: relative; padding: 11px 14px 11px 40px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); font: 600 14.5px/1.45 var(--f-body); color: var(--ink); animation: v2In .45s var(--spring) both; }
.v2-tips li:nth-child(2) { animation-delay: .1s; }
.v2-tips li::before { content: "→"; position: absolute; left: 14px; top: 10px; font-weight: 800; color: var(--station-ink); }
.v2-tips b { color: #8A5A00; }

/* scenario intro: the place as a headline, the partner as a card */
.v2-scene-intro { text-align: left; }
.v2-screen.has-scene-art { width: min(1000px, 100%); }
.v2-scene-layout { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 28px; }
.v2-scene-art { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 20px; background: #fff7e8; }
.v2-scene-copy { min-width: 0; }
.v2-phrase-help { margin: 16px 0; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .85); }
.v2-phrase-help summary { cursor: pointer; font-weight: 700; }
.v2-phrase-help .v2-example { margin-top: 8px; padding: 8px; }
@media (max-width: 800px) {
  .v2-screen.has-scene-art { width: min(640px, 100%); }
  .v2-scene-layout { grid-template-columns: 1fr; gap: 22px; }
  .v2-scene-art { max-width: 420px; margin-inline: auto; }
}
.v2-scene-where { margin-bottom: 10px; font-size: clamp(28px, 4.4vw, 42px); }
.v2-scene-what { margin: 0 0 20px; font: 500 18px/1.55 var(--f-body); color: var(--ink); }
.v2-scene-who { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); animation: v2In .55s var(--spring) .15s both; }
.v2-scene-who .v2-avatar { flex: none; width: 58px; height: 58px; margin: 0; font-size: 24px; box-shadow: 0 4px 0 hsl(var(--hue) 60% 36%); }
.v2-scene-who > div:not(.v2-avatar) { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.v2-scene-who b { font: 800 20px/1.1 var(--f-disp); letter-spacing: -.03em; }
.v2-scene-who span { font: 600 14px/1.2 var(--f-body); color: var(--ink-soft); }
.v2-scene-tag { margin-left: auto; padding: 7px 12px; border-radius: 99px; background: color-mix(in srgb, var(--station) 14%, #fff); font: 700 10.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; font-style: normal; color: var(--station-ink); white-space: nowrap; }
@media (max-width: 480px) { .v2-scene-who { flex-wrap: wrap; } .v2-scene-tag { margin-left: 72px; } }
.v2-narr { font-style: italic; color: var(--ink); background: rgba(255, 255, 255, .8); animation: v2Bub .45s var(--spring) both; }

/* checks */
.v2-why.is-wrong { background: var(--miss); color: #A3262B; }
.v2-why.is-right { background: #FFF1C7; color: var(--green-ink); }

/* done: compact, a seal that stamps in */
.v2-done { padding-top: 26px; }
.v2-seal { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%; position: relative; overflow: hidden;
  background: radial-gradient(110% 90% at 30% 20%, #FFE58A, #FFB300 55%, #D98A00); color: #fff;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), 0 6px 0 #B97300, 0 18px 30px -12px rgba(217, 138, 0, .7); animation: v2Stamp .7s var(--spring) .1s both; }
.v2-seal span { display: grid; width: 42px; height: 42px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); }
.v2-seal svg { width: 100%; height: 100%; }
.v2-seal::after { content: ""; position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .7) 50%, transparent 60%); transform: translateX(-120%); animation: v2Sheen2 .9s var(--ease) .75s both; }
@keyframes v2Stamp { 0% { transform: scale(1.8) rotate(-18deg); opacity: 0; } 60% { transform: scale(.92) rotate(3deg); opacity: 1; } 100% { transform: none; } }
@keyframes v2Sheen2 { to { transform: translateX(120%); } }
.v2-done .v2-h1 { margin-bottom: 16px; }
.v2-done .v2-kpis { gap: 8px; margin: 0 0 14px; }
.v2-done .v2-kpi { padding: 12px 6px 10px; border-radius: 16px; }
.v2-done .v2-kpi b { font-size: clamp(22px, 3.2vw, 28px); }
.v2-done .v2-kpi.is-xp { background: linear-gradient(180deg, #FFF6D6, #FFE7A0); }
.v2-done .v2-kpi.is-xp b { color: #9A5B00; }
@media (max-width: 560px) { .v2-done .v2-kpis { grid-template-columns: repeat(4, 1fr); } .v2-done .v2-kpi > span { font-size: 8.5px; } }
@media (max-width: 560px) {
  .v2-done { padding-top: 18px; }
  .v2-seal { width: 64px; height: 64px; margin-bottom: 8px; }
  .v2-seal span { width: 32px; height: 32px; }
  .v2-done .v2-h1 { margin-bottom: 12px; }
  .v2-done .v2-h3 { margin: 14px 0 8px; }
  .v2-done .v2-keylines { gap: 8px; }
  .v2-done .v2-keylines .v2-mini { height: 62px; }
  .v2-pattern.is-wide .v2-examples { grid-template-columns: 1fr 1fr; gap: 8px; }
  .v2-pattern.is-wide .v2-example { padding: 10px 12px; }
  .v2-pattern.is-wide .v2-example .v2-tl { font-size: 15px; }
  .v2-pattern.is-wide .v2-example .v2-en { font-size: 12.5px; }
}
.v2-unitbar { margin: 0 0 6px; text-align: left; }
.v2-unitbar-top { display: flex; justify-content: space-between; margin-bottom: 6px; font: 700 10.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.v2-unitbar-top b { color: var(--green-ink); }
.v2-unitbar-track { height: 10px; border-radius: 99px; background: rgba(43, 21, 0, .08); overflow: hidden; }
.v2-unitbar-track i { display: block; height: 100%; width: var(--from); border-radius: inherit; background: linear-gradient(90deg, #5EDB90, var(--green)); transition: width 1.1s var(--spring) .9s; }
.v2-unitbar.go i { width: var(--to); }
.v2-done .v2-h3 { margin: 18px 0 10px; }
.v2-done .v2-keylines { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 0; }
.v2-done .v2-mini { height: 92px; }
.v2-done .v2-mini-f { font-size: 14.5px; line-height: 1.25; text-align: center; }
.v2-done .v2-mini-b .v2-tl { font-size: 15px; } .v2-done .v2-mini-b .v2-ar { font-size: 16px; }
.v2-done .v2-mini-b .v2-line-text { align-items: center; }

/* Sound key: the symbol and its Arabic letter head each example card. */
.v2-keysym { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.v2-keysym b { font: 800 22px/1 var(--f-mono); color: var(--ink); }
.v2-keysym span { font: 600 14px/1 var(--f-body); color: var(--ink-soft, #7A6048); }
.v2-keysym i { font: 700 26px/1 var(--f-ar); font-style: normal; color: var(--ar); }
/* Match: a symbol alone on the left, a letter alone on the right. */
.v2-tile--pair .v2-opt-tl.v2-opt-sym { font-family: var(--f-mono); font-size: 28px; }
.v2-tile--pair .v2-opt-ar.v2-opt-letter { font-size: 30px; line-height: 1.1; }

/* Time to spare is good news: the whole dial reads green. */
.v2-mresult.is-beat .v2-dial-bg { stroke: color-mix(in srgb, var(--green) 16%, transparent); }
.v2-mresult.is-beat .v2-dial-in b { color: var(--green-ink); }
.v2-mresult.is-beat .v2-dial-in span { color: var(--green-ink); }

/* The approved scenes can include several speakers. */
.v2-bub .v2-speaker { display: block; margin-bottom: 5px; font: 700 11px/1.3 var(--f-body); opacity: .8; }

/* Phones: the room art keeps a strip at the top (the character's head), and the
   card plus its button fit on one screen without scrolling. */
@media (max-width: 640px) {
  body.v2-body-root #stage { padding-top: max(calc(var(--lesson-controls-bottom) + 12px), calc(var(--lesson-chrome) + clamp(110px, 22dvh, 230px))); }
  .v2-flip .v2-face { min-height: 200px; }
}
@media (max-width: 440px) { .v2-pattern.is-wide .v2-examples { grid-template-columns: 1fr; } }
/* Example cards: the Arabic sits right under the transliteration, not floating mid-card. */
.v2-example .v2-line .v2-ar { text-align: left; }
/* Short phones (iPhone SE): the review Saqr shrinks so Continue stays on screen. */
@media (max-width: 640px) and (max-height: 720px) { .v2-saqr-big { width: 96px; height: 96px; } }

/* Exercise directions stay readable over every lesson illustration. */
.v2-screen > .v2-foot-in .v2-note:not(:empty) { width: auto; max-width: 100%; margin-inline: auto; padding: 8px 14px; border-radius: 12px; background: rgba(255, 248, 234, .96); color: var(--ink); }
