/* ══════════════════════════════════════════════════════════════
   shadowee — Flashcards: deck overview for both decks (canvas "Deck overview ·
   both decks") + 37a "Stack · recall" review, with phrase and pronunciation
   card faces. Loaded after home-calm.css by flashcard.html only.

   Colour/shadow tokens are organic.css verbatim, same values as
   .path-body in css/path.css (same design system) — duplicated under
   .fl-body rather than shared, exactly how path.css itself duplicates
   them relative to home-calm.css's own --cg-* tokens (each page loads
   only the token set it needs). Type uses the app's own fonts (Nunito
   headings, Plus Jakarta Sans body), not the mockup's Caprasimo/Figtree.
   ══════════════════════════════════════════════════════════════ */

/* css/landing.css's body.landing-body rule (shared by every page, including
   this one — see <body class="landing-body cg-body fl-body">) makes the
   whole page scroll: height:auto; min-height:100vh; overflow-y:auto. That's
   right for a normal scrolling page, but wrong here — it's what let the
   Start button scroll out of view below a long card list. Same selector
   specificity (body.CLASS), so this wins purely by loading after it, and
   restores base.css's own default app-shell behavior (height:100%,
   overflow:hidden on body) — .fl-covers (flex:1) takes the leftover height. */
body.fl-body {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.fl-body {
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-accent: #c67139;
  --color-accent-2: #7a8a5e;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);

  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-400: #c0b6a5;
  --color-neutral-500: #a19786;
  --color-neutral-600: #82796a;
  --color-neutral-700: #645c50;
  --color-neutral-800: #474238;
  --color-neutral-900: #2e2b25;

  --color-accent-100: #fff2eb;
  --color-accent-200: #ffe1d0;
  --color-accent-300: #ffc6a5;
  --color-accent-700: #8c491a;
  --color-accent-800: #643312;

  --color-accent-2-100: #f0fae1;
  --color-accent-2-200: #e1eecc;
  --color-accent-2-300: #ccdbb2;
  --color-accent-2-700: #56633f;
  --color-accent-2-800: #3d472b;

  --font-heading: var(--cg-font-heading, 'Nunito', system-ui, sans-serif);
  --font-body: var(--cg-font-body, 'Plus Jakarta Sans', system-ui, sans-serif);
  --font-system: var(--font, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);

  background: var(--color-bg);
  color: var(--color-text);
}

/* height (not min-height): base.css's html/body are both height:100% with
   overflow:hidden — every page here scrolls internally, never the body
   itself (see .fl-covers below). A min-height let .fl-main grow past the
   viewport instead, so .fl-covers' flex:1 had nothing bounded to size
   against and never actually scrolled — the whole page did (or on some
   mobile browsers, nothing did, leaving the Start button unreachable). */
/* width:100% is required alongside margin:0 auto: body.landing-body is a
   column flex container (css/landing.css), and auto cross-axis margins on a
   flex item disable align-items:stretch, shrinking the item to fit-content
   instead of filling the body's width (same pattern as .cg-container in
   home-calm.css, which needs width:100% for the same reason). Without it,
   .fl-main shrank to its content's natural width, leaving big empty side
   margins instead of a properly centered full-width column. */
.fl-main { width: 100%; max-width: 480px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; font-family: var(--font-body); }
/* Loading skeleton (canvas "Flashcards · loading"). #fl-loading reuses the
   deck overview's own classes (.fl-content/.fl-head/.fl-covers/.fl-cover…),
   so every box sits exactly where the real one will. Sweep + breathe are the
   same motion as home's skeleton (home-calm.css .cg-skel-sweep). */
.fl-skel-bar { display: block; border-radius: 999px; background: var(--cg-track, rgba(46, 42, 38, .09)); }
.fl-skel-lang { width: 65px; height: 34px; }
.fl-skel-today { height: 17px; display: flex; align-items: center; }
.fl-skel-today .fl-skel-bar { width: 162px; height: 12px; }
.fl-skel-cover::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 120px; background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.7) 50%, rgba(255,255,255,0) 100%); animation: om-sweep 1.8s ease-in-out infinite; pointer-events: none; }
.fl-skel-list { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 999px; background: var(--cg-track, rgba(46, 42, 38, .09)); }
.fl-skel-center { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fl-skel-pile { position: relative; width: 240px; max-width: 100%; height: 150px; }
.fl-skel-card { position: absolute; left: 50%; top: 50%; width: 168px; height: 106px; margin: -53px 0 0 -84px; display: flex; flex-direction: column; gap: 8px; padding: 16px 14px; border-radius: 14px; border: 1px solid var(--color-divider); background: #fff; box-shadow: var(--shadow-sm); }
.fl-skel-card span { display: block; height: 10px; border-radius: 999px; background: var(--cg-track, rgba(46, 42, 38, .09)); }
.fl-skel-card span:nth-child(1) { width: 82%; }
.fl-skel-card span:nth-child(2) { width: 56%; }
.fl-skel-card span:nth-child(3) { width: 64%; height: 8px; margin-top: auto; }
.fl-skel-card:nth-child(1) { background: var(--color-accent-200); transform: rotate(-7deg) translate(-6px, 10px); }
.fl-skel-card:nth-child(2) { background: var(--color-accent-100); transform: rotate(5deg) translate(6px, 6px); }
.fl-skel-card:nth-child(3) { animation: fl-skel-shuffle 2.4s cubic-bezier(.45, .05, .25, 1) infinite; }
.fl-skel-eq { display: flex; align-items: center; gap: 4px; height: 16px; }
.fl-skel-eq i { width: 4px; height: 14px; border-radius: 999px; background: var(--color-accent-700); animation: fl-skel-eq .9s ease-in-out infinite; }
.fl-skel-eq i:nth-child(2) { animation-delay: .12s; }
.fl-skel-eq i:nth-child(3) { animation-delay: .24s; }
.fl-skel-eq i:nth-child(4) { animation-delay: .36s; }
.fl-skel-eq i:nth-child(5) { animation-delay: .48s; }
.fl-skel-msg { font: 700 13px var(--font-body); color: var(--color-neutral-700); animation: om-breathe 1.8s ease-in-out infinite; }
.fl-skel-name { width: 176px; max-width: 100%; height: 22px; }
.fl-skel-known { width: 118px; height: 12px; margin-top: 6px; }
.fl-skel-pct { flex: none; width: 41px; height: 27px; background: rgba(194, 87, 31, .16); }
.fl-skel-btn { height: 54px; background: rgba(194, 87, 31, .16); }
.fl-skel-dots .fl-dot-btn { cursor: default; }
.fl-skel-dots .fl-dot-btn:first-child span { width: 28px; }
.fl-skel-dots .fl-dot-btn span { background: var(--cg-track, rgba(46, 42, 38, .09)); }
/* om-sweep / om-breathe also live in home-calm.css; repeated here so this
   page doesn't depend on that file's keyframes staying put. */
@keyframes om-sweep { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
@keyframes om-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes fl-skel-eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes fl-skel-shuffle { 0%, 55%, 100% { transform: none; } 20% { transform: translate(64px, -10px) rotate(9deg); } 36% { transform: translate(-4px, 2px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) {
  .fl-skel-cover::after, .fl-skel-card, .fl-skel-eq i, .fl-skel-msg { animation: none !important; }
}

/* Guests can't use flashcards at all (progress only ever syncs server-side —
   see auth.js's logout()/updateAuthUI()) — same login-gate pattern as
   path.html's .pt-login. */
.fl-login { margin: 40px 20px; padding: 40px 20px; text-align: center; background: var(--color-neutral-100); border-radius: 28px; box-shadow: var(--shadow-md); }
.fl-login[hidden] { display: none; }
.fl-login-title { font: 800 20px var(--font-heading); margin-bottom: 8px; }
.fl-login-sub { font: 400 13px/1.5 var(--font-body); color: var(--color-neutral-700); margin-bottom: 18px; }
.fl-login-btn { padding: 14px 24px; border: 0; border-radius: 999px; background: var(--color-accent-700); color: #fff; font: 800 13px var(--font-body); cursor: pointer; }
.fl-login-btn:hover { background: var(--color-accent-800); }

/* ─── Deck overview (both decks) ──────────────────────────── */
/* min-height:0, not the flex default (auto) — every link in a nested-flex
   chain needs this, not just .fl-covers itself, or this flex item
   refuses to shrink below its own content's natural height and the bound
   from .fl-main above never reaches .fl-covers at all. */
.fl-content { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 14px 20px 24px; gap: 14px; }
.fl-content[hidden] { display: none; }

.fl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fl-title { font: 400 26px/1.1 var(--font-heading); color: var(--color-text); }
/* A pill, not a fixed circle — grows to fit the language code (or "Off")
   next to the globe, same pattern as shadowee.html's playbar translate button. */
.fl-lang-btn { flex: none; display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--color-accent-2-100); color: var(--color-accent-2-800); cursor: pointer; }
.fl-lang-btn:hover { background: var(--color-accent-2-200); }
.fl-lang-label { font: 800 12px var(--font-body); letter-spacing: .02em; }

/* Today: one muted line under the title — cards rated today vs. due + new
   still allowed, both decks together. */
.fl-today { flex: none; margin: -8px 0 0; font: 600 13px var(--font-body); color: var(--color-neutral-700); }

/* Cover carousel. The track is the container's width; each cover is 90px
   narrower so the other deck peeks in at the side. --fl-i (0 or 1, set by
   flRenderCarousel) slides the track: one step = a cover + the 14px gap. */
.fl-covers { position: relative; flex: 1; min-height: 300px; overflow: hidden; margin: 0 -20px; touch-action: pan-y; }
.fl-covers-track { --fl-i: 0; display: flex; gap: 14px; width: 100%; height: 100%; transform: translateX(calc(45px - var(--fl-i) * (100% - 76px))); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.fl-cover { position: relative; flex: 0 0 calc(100% - 90px); height: 100%; border-radius: 32px; overflow: hidden; background: var(--color-neutral-100); border: 1px solid var(--color-divider); box-shadow: var(--shadow-md); opacity: .55; transform: scale(.94); transition: opacity .3s, transform .45s cubic-bezier(.2,.8,.2,1); }
.fl-cover.ph { --fl-tint: var(--color-accent-200); --fl-soft: var(--color-accent-100); --fl-fg: var(--color-accent-800); --fl-btn: var(--color-accent-700); --fl-btn-hover: var(--color-accent-800); }
.fl-cover.pr { --fl-tint: var(--color-accent-2-200); --fl-soft: var(--color-accent-2-100); --fl-fg: var(--color-accent-2-800); --fl-btn: var(--color-accent-2-700); --fl-btn-hover: var(--color-accent-2-800); }
.fl-cover.active { opacity: 1; transform: none; }
.fl-cover-body { height: 100%; display: flex; flex-direction: column; }
.fl-cover-pick { position: absolute; inset: 0; z-index: 2; border: 0; background: transparent; cursor: pointer; }
.fl-cover.active .fl-cover-pick { display: none; }

.fl-cover-list { position: absolute; top: 12px; right: 12px; z-index: 1; width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--color-neutral-100); box-shadow: var(--shadow-sm); color: var(--fl-fg); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fl-cover-list:focus-visible, .fl-cover-btn:focus-visible, .fl-dot-btn:focus-visible { outline: 3px solid var(--color-text); outline-offset: 2px; }

/* The pile: five real cards from the deck (picked once per visit). Each card
   keeps its own color (white, light tint or tint, by its place in the
   markup) wherever it moves; only the shadow marks the top card.
   flRenderPile() sets each card's place in the pile, and a tap scatters them
   for a moment and gathers them back in a new order (flShufflePile). */
.fl-cover-art { position: relative; flex: 1; min-height: 150px; display: flex; align-items: center; justify-content: center; padding: 56px 20px 8px; }
.fl-pile { position: relative; width: 240px; max-width: 100%; height: 200px; padding: 0; border: 0; border-radius: 20px; background: transparent; cursor: pointer; }
.fl-pile:focus-visible { outline: 3px solid var(--color-text); outline-offset: 2px; }
.fl-pile-card { position: absolute; left: 50%; top: 50%; width: 168px; height: 108px; margin: -54px 0 0 -84px; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--color-divider); background: var(--fl-soft); box-shadow: var(--shadow-sm); text-align: left; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.fl-pile-card:nth-child(5n+1), .fl-pile-card:nth-child(5n+4) { background: var(--color-neutral-100); }
.fl-pile-card:nth-child(5n+3) { background: var(--fl-tint); }
.fl-pile-card.top { box-shadow: var(--shadow-md); }
.fl-pile-prompt { font: 400 13.5px/1.25 var(--font-heading); color: var(--color-neutral-800); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fl-pile-answer { margin-top: auto; font: 700 10.5px var(--font-body); color: var(--color-neutral-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fl-cover-foot { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 0 22px 22px; }
.fl-cover-info { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.fl-cover-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fl-cover-name { font: 400 23px/1.1 var(--font-heading); color: var(--color-text); }
.fl-cover-known { font: 700 12.5px var(--font-body); color: var(--fl-fg); }
.fl-cover-pct { flex: none; padding: 6px 10px; border-radius: 999px; background: var(--fl-tint); font: 800 12px var(--font-body); color: var(--fl-fg); }
.fl-cover-next { font: 700 12.5px var(--font-body); color: var(--color-neutral-800); }
.fl-cover-next[hidden] { display: none; }
.fl-start.fl-cover-btn { background: var(--fl-btn); }
.fl-start.fl-cover-btn:hover { background: var(--fl-btn-hover); }

.fl-dots { flex: none; display: flex; justify-content: center; gap: 4px; margin: -6px 0 -10px; }
.fl-dot-btn { width: 44px; height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fl-dot-btn span { width: 10px; height: 10px; border-radius: 999px; background: var(--color-neutral-300); transition: width .3s, background .3s; }
.fl-dot-btn.active span { width: 28px; background: var(--color-text); }

/* Every card in a deck with its status — a centered popup with one plain
   table in the 39 list style (rows + dividers in a white card). */
.fl-list-modal { position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center; padding: 20px; font-family: var(--font-body); }
.fl-list-modal[hidden] { display: none; }
.fl-list-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, #201e1d 40%, transparent); }
.fl-list-dialog { position: relative; width: 100%; max-width: 420px; height: min(620px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 16px; border-radius: 28px; background: var(--color-bg); box-shadow: var(--shadow-lg); }
.fl-list-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-left: 6px; }
.fl-list-titles { display: flex; flex-direction: column; gap: 2px; }
.fl-list-title { font: 400 22px/1.1 var(--font-heading); color: var(--color-text); }
.fl-list-count { font: 700 12.5px var(--font-body); color: var(--color-neutral-700); }
.fl-list-close { flex: none; width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--color-neutral-100); box-shadow: var(--shadow-sm); color: var(--color-text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fl-list-table { flex: 1; min-height: 0; overflow-y: auto; border-radius: 22px; background: var(--color-neutral-100); box-shadow: var(--shadow-sm); padding: 0 16px; }

.fl-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--color-divider); }
.fl-row:first-child { border-top: 0; }
.fl-row-phrase { flex: 1; min-width: 0; font: 700 14.5px var(--font-body); color: var(--color-text); }
.fl-row-meta { flex: none; font: 700 11.5px var(--font-body); }
.fl-row-meta.due { color: var(--color-accent-800); }
.fl-row-meta.learning { color: var(--color-accent-700); }
.fl-row-meta.known { color: var(--color-accent-2-800); }
.fl-row-meta.new { color: var(--color-neutral-700); }

.fl-start { flex: none; height: 54px; border: 0; border-radius: 999px; background: var(--color-accent-700); color: #fff; font: 800 15px var(--font-body); box-shadow: var(--shadow-sm); cursor: pointer; }
.fl-start:hover { background: var(--color-accent-800); }
.fl-start:disabled { opacity: .55; cursor: default; }

/* The review overlay holds both decks' card faces; the session's deck
   (#fl-review[data-deck], set by flStartSession) decides which show. */
.fl-review[data-deck="ph"] .pr-only, .fl-review[data-deck="pr"] .ph-only { display: none !important; }

/* ─── Review session overlay (37a) ───────────────────────────── */
.fl-review { position: fixed; inset: 0; z-index: 600; background: var(--color-bg); display: flex; justify-content: center; font-family: var(--font-body); user-select: none; }
.fl-review[hidden] { display: none; }
.fl-rv-inner { position: relative; width: 100%; max-width: 480px; height: 100%; display: flex; flex-direction: column; overflow: clip; }
.fl-rv-blob.a { position: absolute; right: -70px; top: 110px; width: 190px; height: 190px; border-radius: 999px; background: var(--color-accent-200); opacity: .55; }
.fl-rv-blob.b { position: absolute; left: -60px; top: 560px; width: 130px; height: 130px; border-radius: 999px; background: var(--color-accent-2-200); opacity: .6; }

.fl-rv-head { position: relative; z-index: 2; flex: none; display: flex; align-items: center; gap: 14px; padding: 12px 20px 0; }
.fl-rv-close { flex: none; width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--color-neutral-100); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--color-neutral-800); }
.fl-rv-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--color-surface); overflow: hidden; }
.fl-rv-bar-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--color-accent-2-700); transition: width .5s cubic-bezier(.3,1.2,.5,1); }
.fl-rv-left { flex: none; min-width: 48px; text-align: right; font: 800 12.5px var(--font-body); color: var(--color-accent-800); }

/* The stack sits in a padded, gapped column together with the Show/Rates/
   Review-again row below it — exactly the mockup's nesting (37a's isF
   wrapper: padding 22px 24px 26px, gap 22px around a zero-padding card
   area). The cards themselves go edge-to-edge (inset:0) inside that padding. */
.fl-rv-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 22px; padding: 22px 24px 26px; }
.fl-rv-stack { position: relative; flex: 1; min-height: 0; touch-action: pan-y; } /* horizontal swipes are ours (browse mode) */
.fl-rv-card { position: absolute; inset: 0; border-radius: 32px; }
.fl-rv-behind { background: var(--color-neutral-100); box-shadow: var(--shadow-md); transition: transform .5s cubic-bezier(.22,.8,.3,1) .08s; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 28px; }
.fl-rv-behind[hidden] { display: none; }
.fl-rv-behind.snap { transition: none; }
.fl-rv-behind-def { font: 400 27px/1.25 var(--font-heading); color: var(--color-text); text-wrap: pretty; }
.fl-rv-behind-tr { align-self: flex-start; padding: 8px 13px; border-radius: 14px; background: var(--color-accent-2-100); font: 700 14px var(--font-body); color: var(--color-accent-2-800); }

/* Graduation-status badge (mockup 37a update) — top-right of every stack
   card, front face only (it's a "what am I about to see" cue, not relevant
   once flipped to the answer/rating side). Color matches the card's actual
   FSRS state, same token family as Due/Learning/Known use elsewhere. */
.fl-rv-badge { position: absolute; top: 22px; right: 22px; width: 56px; height: 56px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.fl-rv-badge.new { background: var(--color-neutral-200); }
.fl-rv-badge.learning { background: var(--color-accent-100); }
.fl-rv-badge.known { background: var(--color-accent-2-200); }

/* Always in the DOM, at the very back of the stack (z-index 1) — it's the
   same card that becomes the "All caught up" screen once the queue empties
   and it reaches the front (see flRenderSession's end-card positioning). */
.fl-rv-end { z-index: 1; background: var(--color-accent-2-100); border: 2.5px dashed var(--color-accent-2-300); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; padding: 28px; transition: transform .5s cubic-bezier(.22,.8,.3,1) .08s; }
.fl-rv-end.snap { transition: none; }
.fl-rv-end-badge { width: 64px; height: 64px; border-radius: 999px; background: var(--color-accent-2-200); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; color: var(--color-accent-2-800); }
.fl-rv-end-kicker { font: 800 11.5px var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--color-accent-2-800); }
.fl-rv-end-title { font: 400 30px/1.15 var(--font-heading); color: var(--color-text); }
.fl-rv-end-sub { font: 500 15px/1.5 var(--font-body); color: var(--color-accent-2-800); text-wrap: pretty; }

.fl-rv-top { z-index: 4; perspective: 1400px; cursor: pointer; transition: transform .3s cubic-bezier(.22,.8,.3,1); }
.fl-rv-top[hidden] { display: none; }
.fl-rv-top-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,1.15,.5,1); }
.fl-rv-top.snap, .fl-rv-top.snap .fl-rv-top-inner { transition: none; }
.fl-rv-top.flipped .fl-rv-top-inner { transform: rotateY(180deg); }
.fl-rv-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 32px; background: var(--color-neutral-100); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 16px; padding: 28px; overflow: auto; }
.fl-rv-front { justify-content: center; }
/* Mockup update: the back face is now two zones instead of one flat padded
   column — a hero (phrase + example, moved up here) that can be taller
   than the viewport, and a plain info zone below it, with the "Lesson NN"
   link pinned outside both so it never scrolls out of view. */
.fl-rv-back { transform: rotateY(180deg); flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.fl-rv-back-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.fl-rv-back-hero { position: relative; flex: none; min-height: 54%; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 34px 24px 24px; background: var(--color-accent-2-100); overflow: hidden; }
.fl-rv-back-blob { position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; border-radius: 999px; background: var(--color-accent-2-200); opacity: .55; }
.fl-rv-back-info { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 24px; }
.fl-rv-def { font: 400 27px/1.25 var(--font-heading); color: var(--color-text); text-wrap: pretty; }
/* Translation text uses the device's own system font (not the brand
   webfonts) — Nunito/Plus Jakarta Sans don't have great glyph coverage for
   arbitrary translation languages (Arabic, CJK, etc.); same convention as
   path.css's .pt-h-tr-text. */
.fl-rv-tr-chip { align-self: flex-start; padding: 8px 13px; border-radius: 14px; background: var(--color-accent-2-100); font: 700 14px var(--font-system); color: var(--color-accent-2-800); }
.fl-rv-tr-chip[hidden] { display: none; }
/* Right-to-left translations (Arabic, Persian, Urdu): flSetTrText sets dir="rtl",
   which flips the text; the short chips also move to the right edge. */
.fl-rv-tr-chip[dir="rtl"], .fl-rv-behind-tr[dir="rtl"] { align-self: flex-end; }
.fl-rv-hint { position: absolute; left: 28px; bottom: 24px; font: 700 12.5px var(--font-body); color: var(--color-neutral-700); }

/* The phrase is the single most important thing on this face — never
   truncate it. min-height:54% on .fl-rv-back-hero is a floor, not a cap, so
   wrapping to a second line just grows the hero (the scroll wrapper around
   it already handles anything that doesn't fit the card's fixed height). */
.fl-rv-phrase { position: relative; font: 400 30px/1.1 var(--font-heading); color: var(--color-text); text-wrap: pretty; }
/* Plain text now (was a chip) — moved out of the hero into the info zone,
   directly above the definition. Still --font-system: real translation
   content, same glyph-coverage reasoning as .fl-rv-tr-chip/.fl-rv-def2-tr
   above (the mockup's own Latin-only demo data doesn't surface this). */
.fl-rv-back-tr { font: 800 17px var(--font-system); color: var(--color-accent-2-800); margin-bottom: 8px; }
.fl-rv-def2 { font: 500 15px/1.5 var(--font-system); color: var(--color-neutral-800); text-wrap: pretty; }
.fl-rv-def2-tr { font: 500 14px/1.5 var(--font-system); font-style: italic; color: var(--color-accent-2-800); text-wrap: pretty; }
.fl-rv-def2-tr[hidden] { display: none; }
/* Now a pill inside the hero (was a bare row at the bottom of the card). */
.fl-rv-example { position: relative; margin-top: 16px; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 24px; background: var(--color-neutral-100); }
.fl-rv-play { flex: none; width: 48px; height: 48px; border: 0; border-radius: 999px; background: var(--color-accent-700); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: background .2s; color: #fff; }
.fl-rv-play.playing { background: var(--color-accent-2-700); }
/* Playing swaps the triangle for a 3-bar equalizer that pulses while audio
   plays (mockup 37a's rs-eq keyframes, ported exactly). */
.fl-rv-play-eq { display: none; align-items: center; gap: 3px; height: 18px; }
.fl-rv-play.playing .fl-rv-play-icon { display: none; }
.fl-rv-play.playing .fl-rv-play-eq { display: flex; }
.fl-rv-play-eq span { width: 3px; height: 16px; border-radius: 999px; background: #fff; animation: fl-rv-eq .8s ease-in-out infinite; }
.fl-rv-play-eq span:nth-child(2) { animation-delay: .14s; }
.fl-rv-play-eq span:nth-child(3) { animation-delay: .28s; }
@keyframes fl-rv-eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.fl-rv-sentence { flex: 1; font: 500 15.5px/1.45 var(--font-body); color: var(--color-neutral-800); text-wrap: pretty; }
.fl-rv-sentence b { color: var(--color-text); font-weight: 800; }

/* Level · topic, pinned below the scrollable hero+info zones (flex:none
   sibling of .fl-rv-back-scroll), never scrolls out of view. */
.fl-rv-meta { flex: none; margin: 0 24px; padding: 14px 0 18px; border-top: 1px solid var(--color-divider); font: 700 13px var(--font-body); color: var(--color-neutral-700); }

.fl-rv-show { position: relative; z-index: 5; flex: none; height: 56px; border: 0; border-radius: 999px; background: var(--color-accent-700); color: #fff; font: 800 15px var(--font-body); box-shadow: var(--shadow-sm); cursor: pointer; }
.fl-rv-show:hover { background: var(--color-accent-800); }
.fl-rv-show[hidden] { display: none; }

.fl-rv-rates { position: relative; z-index: 5; flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fl-rv-rates[hidden] { display: none; }
.fl-rv-rate { height: 56px; border: 0; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; transition: transform .12s; }
.fl-rv-rate:active { transform: scale(.95); }
.fl-rv-rate-label { font: 800 13.5px var(--font-body); }
.fl-rv-rate-when { font: 600 11px var(--font-body); opacity: .8; }
.fl-rv-rate[data-rating="0"] { background: var(--color-accent-100); color: var(--color-accent-800); }
.fl-rv-rate[data-rating="1"] { background: var(--color-surface); color: var(--color-neutral-800); }
.fl-rv-rate[data-rating="2"] { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.fl-rv-rate[data-rating="3"] { background: var(--color-accent-2-200); color: var(--color-accent-2-800); }

/* "Review again" takes the Show/Rates row's place once the queue is empty —
   same button style/position as Show the phrase (37a's fDone). */
.fl-rv-again { position: relative; z-index: 5; flex: none; height: 56px; border: 0; border-radius: 999px; background: var(--color-accent-700); color: #fff; font: 800 15px var(--font-body); cursor: pointer; box-shadow: var(--shadow-sm); }
.fl-rv-again:hover { background: var(--color-accent-800); }
.fl-rv-again[hidden] { display: none; }

/* "Review upcoming cards" controls (mockup 37a's mode:'review') — Prev/
   Next circles flank a flip pill, same row as Show/Rates/Again above. */
.fl-rv-browse { position: relative; z-index: 5; flex: none; display: flex; align-items: center; gap: 12px; }
.fl-rv-browse[hidden] { display: none; }
.fl-rv-browse-nav { flex: none; width: 56px; height: 56px; border: 0; border-radius: 999px; background: var(--color-neutral-100); box-shadow: var(--shadow-sm); color: var(--color-neutral-800); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .12s; }
.fl-rv-browse-nav:active { transform: scale(.92); }
.fl-rv-browse-nav:disabled { opacity: .4; cursor: default; }
.fl-rv-browse-flip { flex: 1; height: 56px; border: 0; border-radius: 999px; background: var(--color-accent-700); color: #fff; font: 800 15px var(--font-body); box-shadow: var(--shadow-sm); cursor: pointer; }
.fl-rv-browse-flip:hover { background: var(--color-accent-800); }

@media (prefers-reduced-motion: reduce) {
  .fl-rv-top-inner, .fl-rv-top, .fl-rv-behind, .fl-rv-end, .fl-rv-bar-fill, .fl-covers-track, .fl-cover, .fl-pile-card { transition: none !important; }
  .fl-rv-play-eq span { animation: none !important; }
}

/* ─── Pronunciation card faces (canvas "Pronunciation flashcards · written →
   spoken"): pattern chip, Written box → rule tag → Spoken box (plays the
   phrase) and the sentence row. --pr-bg / --pr-fg are the current card's
   pattern colors, set per card by flashcard.js. ─── */

.pr-chip { align-self: flex-start; padding: 6px 11px; border-radius: 999px; font: 800 11.5px var(--font-body); letter-spacing: .03em; text-transform: uppercase; }
.pr-kicker { font: 800 11px var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--color-neutral-600); }
.pr-kicker.sage { color: var(--color-accent-2-800); }

/* Highlight markup from the JSON: [x] changed sounds, {x} dropped letters. */
.pr-chg { padding: 0 3px; border-radius: 6px; background: var(--color-accent-200); color: var(--color-accent-800); }
.pr-drop { text-decoration: line-through; opacity: .4; }

/* Long phrases step down so they wrap less (class set by prSizeClass). */
.pr-front-written, .pr-behind-written { font: 400 46px/1.05 var(--font-heading); color: var(--color-text); overflow-wrap: anywhere; }
.pr-front-written.long, .pr-behind-written.long { font-size: 36px; }
.pr-front-written.xlong, .pr-behind-written.xlong { font-size: 28px; }

/* ─── Front ─── */
.pr-front { justify-content: center; gap: 18px; }
.pr-front > .pr-chip, .fl-rv-behind > .pr-chip { position: absolute; top: 24px; left: 24px; }
.pr-front-sentence { font: 500 16px/1.5 var(--font-body); color: var(--color-neutral-800); text-wrap: pretty; }
.pr-front-sentence b { font-weight: 800; color: var(--color-text); }

/* ─── Back ─── */
.fl-rv-back.pr-back { padding: 22px; gap: 0; }
.pr-back-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.pr-back-scroll > .pr-chip { flex: none; }

.pr-written-box { flex: none; margin-top: 18px; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 22px; background: var(--color-bg); }
.pr-written { font: 400 32px/1.1 var(--font-heading); color: var(--color-neutral-800); overflow-wrap: anywhere; }
.pr-written.long { font-size: 26px; }
.pr-written.xlong { font-size: 22px; }

.pr-arrow { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 0 8px 22px; color: var(--pr-fg, var(--color-accent-800)); }
.pr-arrow svg { flex: none; }
.pr-tag { padding: 6px 12px; border-radius: 999px; background: var(--pr-bg, var(--color-accent-100)); color: var(--pr-fg, var(--color-accent-800)); font: 800 13px var(--font-body); }

/* The whole Spoken box is the phrase's play button (mockup "Spoken box A"):
   a speaker in the corner shows it's tappable; while playing the box turns a
   deeper sage and the speaker's waves pulse. */
.pr-spoken-box { position: relative; flex: none; display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 18px; border: 0; border-radius: 22px; background: var(--color-accent-2-100); font: inherit; color: inherit; text-align: start; cursor: pointer; overflow: hidden; transition: background .2s, transform .12s; }
.pr-spoken-box:active { transform: scale(.98); }
.pr-spoken-box:focus-visible { outline: 3px solid var(--color-accent-500); outline-offset: 3px; }
.pr-spoken-box.playing { background: var(--color-accent-2-200); }
.pr-spoken-blob { position: absolute; right: -50px; top: -50px; width: 150px; height: 150px; border-radius: 999px; background: var(--color-accent-2-200); opacity: .6; }
.pr-speaker { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 999px; background: var(--color-neutral-100); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; color: var(--color-accent-2-800); }
.pr-spoken-box.playing .pr-wave { animation: pr-wave .7s ease-in-out infinite; }
.pr-spoken-box.playing .pr-wave-2 { animation-delay: .2s; }
@keyframes pr-wave { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
/* The phrase starts just below the corner speaker (margin-top on .pr-spoken),
   so it can use the box's full width instead of reserving room beside it. */
.pr-spoken-text { position: relative; display: flex; flex-direction: column; gap: 4px; }
.pr-spoken-text .pr-spoken { margin-top: 10px; }
/* Always one line — flashcard.js's prFitOneLine shrinks the font size when
   the phrase is wider than the box (46px → min 14px). */
.pr-spoken { display: block; font: 400 46px/1.05 var(--font-heading); color: var(--color-text); white-space: nowrap; overflow: hidden; }
.pr-spoken .pr-chg { border-radius: 8px; }

@keyframes pr-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(198,113,57,.4); } 50% { box-shadow: 0 0 0 14px rgba(198,113,57,0); } }

/* Explanation of the card's pattern — sits at the bottom of the scroll
   area, just above the sentence row's divider (mockup's note line). */
.pr-note { flex: none; margin-top: auto; padding-top: 16px; font: 500 14px/1.5 var(--font-body); color: var(--color-neutral-800); text-wrap: pretty; }
.pr-note[hidden] { display: none; }
/* Translated explanation: the system font covers every script (the brand
   webfonts don't), same as the phrase deck's .fl-rv-def2-tr. */
.pr-note.tr { font-family: var(--font-system); }

.pr-sentence-row { flex: none; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-divider); }
.fl-rv-play.pr-play-sentence { width: 44px; height: 44px; box-shadow: var(--shadow-sm); }
/* The sentence button carries the attention pulse until the sentence has
   been played once for this card. */
.fl-rv-play.pr-play-sentence.unheard:not(.playing) { animation: pr-glow 1.8s ease-in-out infinite; }
.pr-sentence-row .fl-rv-sentence { font-size: 14.5px; }

/* ─── Cards behind the top one ─── */
.fl-rv-behind .pr-chip { align-self: flex-start; }

@media (prefers-reduced-motion: reduce) {
  .fl-rv-play.pr-play-sentence.unheard, .pr-spoken-box.playing .pr-wave { animation: none !important; }
}
