:root {
  /* Duolingo-authentic palette */
  --duo-green: #58cc02;
  --duo-green-dark: #46a302;
  --duo-green-deep: #3a8a00;
  --gold: #ffc800;
  --gold-dark: #e6a700;
  --gold-deep: #c98a00;
  --purple: #ce82ff;
  --purple-dark: #a560e8;
  --purple-deep: #8347c4;
  /* Competition Prep accent — ocean blue */
  --ocean: #1aa3e8;
  --ocean-dark: #1184c6;
  --ocean-deep: #0d6699;
  --rock-accent: #b08968;
  --rock-deep: #6f4e37;
  --dam-accent: #18b6a8;
  --dam-deep: #0f8478;
  --gray-line: #e5e5e5;
  --gray-line2: #d6d6d6;
  --text: #3c3c3c;
  --text-dim: #777777;
  --muted: #afafaf;
  --red: #ff4b4b;
  --red-dark: #d63a3a;
  --skin: #ffa92e;        /* accent that follows the equipped fish color */
  --skin-dark: #d98417;
  --skin-soft: #ffe0b0;
  /* global chrome tint that follows the equipped biome (applyBiomeTheme); neutral until a
     biome background is equipped, at which point .has-biome-theme also activates on body */
  --biome-tint: #3c3c3c;
  --biome-tint-dark: #262626;
  --biome-tint-soft: #e5e5e5;
  --radius: 14px;
  --radius-lg: 18px;
  --font-display: "Baloo 2", "Nunito", "Segoe UI", sans-serif;
  --font-body: "Nunito", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  width: 390px;
  height: 600px;
  background: #fff;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1, h2, h3, h4, .brand, .ub-title, .quiz-prompt, .btn { font-family: var(--font-display); }

#app { display: flex; flex-direction: column; height: 600px; position: relative; overflow: hidden; background: #fff; }
.landing, .quiz-screen, .complete-screen, .path, .fin-scroll { flex: 1 1 auto; min-height: 0; }

/* ---------- screen transitions ---------- */
.screen-enter { animation: screenIn 0.42s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.screen-exit { animation: screenOut 0.2s cubic-bezier(0.4, 0, 1, 0.5) forwards; }
@keyframes screenOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- Landing ---------- */
.landing {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 0; overflow: hidden; padding: 16px 26px; text-align: center;
  background: #fff; gap: 10px;
}
.landing-logo { display: flex; align-items: center; gap: 11px; font-size: 29px; font-weight: 800; color: var(--duo-green); letter-spacing: -0.5px; }
.landing-logo .logo-mark { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.14)); }
.landing .fishwrap { margin: 18px 0 2px; width: 74px; height: 58px; overflow: visible; }
.landing .fishwrap .fish-mascot { width: 100%; height: 100%; transform-origin: center; }
/* the fish swaps outfits: each one flies in from the left, then off to the right */
.landing .fishwrap .outfit-enter { animation: outfitIn 0.55s cubic-bezier(0.34,1.56,0.64,1); }
.landing .fishwrap .outfit-exit { animation: outfitOut 0.42s cubic-bezier(0.5,0,0.75,0) forwards; }
@keyframes outfitIn { 0% { opacity: 0; transform: translateX(-120px) scale(0.65) rotate(-10deg); } 65% { opacity: 1; } 100% { opacity: 1; transform: translateX(0) scale(1) rotate(0); } }
@keyframes outfitOut { 0% { opacity: 1; transform: translateX(0) scale(1) rotate(0); } 100% { opacity: 0; transform: translateX(120px) scale(0.65) rotate(10deg); } }
@media (prefers-reduced-motion: reduce) {
  .landing .fishwrap .outfit-enter, .landing .fishwrap .outfit-exit { animation-duration: 0.01s !important; }
}
.landing h1 { font-size: 25px; margin: 2px 0 0; font-weight: 900; letter-spacing: -0.5px; line-height: 1.15; color: var(--text); }
.landing p.tagline { color: var(--text-dim); font-size: 13px; margin: 0 0 4px; line-height: 1.5; max-width: 320px; }
.mode-choice { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.mode-card {
  display: flex; align-items: center; gap: 13px; text-align: left;
  background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px;
  border-radius: var(--radius-lg); padding: 12px 14px; cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.mode-card.financial:hover { border-color: var(--duo-green); }
.mode-card.competition:hover { border-color: var(--ocean-dark); }
.mode-card:active { transform: translateY(2px); border-bottom-width: 2px; }
.mode-card .icon {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.mode-card.financial .icon { background: #e8fad4; }
.mode-card.competition .icon { background: #e1f3fd; }
.mode-card .icon svg { width: 24px; height: 24px; }
.mode-card .mc-title { font-weight: 800; font-size: 15px; font-family: var(--font-display); color: var(--text); }
.mode-card .mc-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; line-height: 1.35; }

/* ---------- Top bar (flat white, crisp border) ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #fff; border-bottom: 2px solid var(--gray-line);
  transition: border-color 0.3s ease;
}
/* Global biome theming: while a biome background is equipped, shared chrome (top bar,
   bottom nav, secondary text) tints toward that biome's colour (applyBiomeTheme sets
   --biome-tint-* on :root). Screen-specific layouts, incl. Competition Prep's hero, are
   untouched — only shared surfaces every screen sits inside re-skin. */
.has-biome-theme .topbar, .has-biome-theme .bottomnav { border-color: var(--biome-tint-dark); }
.has-biome-theme { --text-dim: var(--biome-tint-dark); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 22px; color: var(--duo-green); letter-spacing: -0.5px; cursor: pointer; }
.brand .logo-mark { flex-shrink: 0; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.12)); }
.brand .coin {
  width: 28px; height: 28px; border-radius: 50%; background: var(--gold);
  border: 2px solid var(--gold-dark); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; flex-shrink: 0;
}
.stats { display: flex; align-items: center; gap: 16px; }
.stat { display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 15px; }
.stat .ico { display: flex; }
.stat.streak { color: #ff9600; }
.stat.coins {
  color: var(--gold-dark); background: none; border: none; cursor: pointer;
  font-family: var(--font-body); padding: 4px 6px; border-radius: 10px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.stat.coins:hover { background: #fff7d6; }
.stat.coins:active { transform: scale(0.94); }
.stat.sound { background: none; border: none; cursor: pointer; padding: 5px; border-radius: 10px; display: flex; transition: background 0.15s ease, transform 0.1s ease; }
.stat.sound:hover { background: #f3f3f3; }
.stat.sound:active { transform: scale(0.9); }

/* floating +coins reward burst */
.coin-float {
  position: fixed; z-index: 90; pointer-events: none; transform: translateX(-50%);
  font-family: var(--font-display); font-weight: 900; font-size: 17px; color: var(--gold-dark);
  text-shadow: 0 1px 0 #fff, 0 2px 6px rgba(201,138,0,0.35);
  animation: coinFloat 1.1s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes coinFloat { 0% { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.7); } 25% { opacity: 1; transform: translateX(-50%) translateY(-4px) scale(1.1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-34px) scale(1); } }

/* ---------- skeleton placeholders (async lists: assignments, rosters) ---------- */
.skel { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skel-row { border-radius: 14px; background: #eef1f4; animation: skelPulse 1.1s ease-in-out infinite alternate; }
@keyframes skelPulse { from { opacity: 0.55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .skel-row { animation: none; } }

/* ---------- Financial Literacy: single scroll, lesson river ---------- */
.fin-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; background: #9bd44a; }

/* solid vibrant unit banner */
.unit-bar { width: 100%; padding: 16px 18px 18px; color: #fff; background: var(--duo-green); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.12); display: flex; align-items: stretch; gap: 12px; transition: background 0.3s ease; }
.has-biome-theme .unit-bar { background: var(--biome-tint); }
.has-biome-theme .fin-scroll { background: var(--biome-tint-soft); }
.unit-bar .ub-main { flex: 1 1 auto; min-width: 0; }
/* Question of the Day — compact button to the right of the unit title (adds no height) */
.unit-bar .daily-chip { flex: 0 0 auto; align-self: stretch; width: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(255,255,255,0.92); border: none; border-radius: 14px; cursor: pointer; padding: 8px 6px; box-shadow: 0 3px 8px rgba(0,0,0,0.14); transition: transform 0.1s ease; }
.unit-bar .daily-chip:active { transform: scale(0.96); }
.unit-bar .daily-chip .dc-star { font-size: 24px; line-height: 1; }
.unit-bar .daily-chip .dc-label { font-family: var(--font-display); font-weight: 800; font-size: 10px; line-height: 1.15; color: var(--text); text-align: center; }
.unit-bar .ub-eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: 0.9; }
.unit-bar .ub-title { font-family: var(--font-display); font-weight: 900; font-size: 23px; letter-spacing: -0.4px; margin-top: 2px; }
.unit-bar .ub-sub { font-size: 12px; opacity: 0.95; margin-top: 5px; font-weight: 700; }
.unit-bar .ub-prog { height: 16px; border-radius: 10px; background: #e5e5e5; overflow: hidden; margin-top: 10px; box-shadow: inset 0 2px 2px rgba(0,0,0,0.12); }
.unit-bar .ub-prog-fill { height: 100%; min-width: 16px; background: var(--skin, #8ee000); border-radius: 10px; position: relative; transition: width 0.4s ease, background 0.3s ease; }
.unit-bar .ub-prog-fill .ub-streak { position: absolute; top: 3px; left: 6px; right: 6px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.85); }

/* the scrolling landscape: background image + nodes + fish. The image + its exact
   tile size are set inline by buildLessonRiver() (the equipped biome swaps the art;
   see BIOMES in popup.js), so only the repeat behavior lives here. */
.lesson-area {
  position: relative; width: 100%;
  background-image: url('background.png');
  background-size: 100% auto; background-repeat: repeat-y; background-position: top center;
}

/* compact section banner — sits in its own clear band, never over a node */
.sec-banner {
  position: absolute; left: 50%; transform: translateX(-50%); top: 0;
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  background: #fff; border: 2px solid var(--duo-green); border-bottom-width: 4px;
  border-radius: 14px; padding: 7px 18px; white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12); z-index: 6; max-width: 90%;
}
.sec-banner.dim { border-color: var(--gray-line2); opacity: 0.85; }
.sec-banner .sec-banner-head { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.sec-banner .sec-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--duo-green-dark); }
.sec-banner.dim .sec-eyebrow { color: var(--muted); }
.sec-banner .sec-title { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--text); }

/* the section-entry test/skip control, folded INTO the section banner card (one unified
   pill, not a second button floating over the map — see buildLessonRiver's `pendingGate`) */
.sec-banner.has-gate { padding-bottom: 9px; gap: 7px; }
.sec-banner .sec-gate-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; cursor: pointer; padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 800; font-size: 11.5px; letter-spacing: 0.2px;
}
.sec-banner .sec-gate-btn .sg-ico { display: inline-flex; }
.sec-banner .sec-gate-btn .sg-ico svg { width: 13px; height: 13px; }
.sec-banner .sec-gate-btn.open, .sec-banner .sec-gate-btn.testout {
  background: var(--gold); color: #6a4a00;
  box-shadow: 0 3px 0 var(--gold-deep), 0 5px 10px rgba(201,138,0,0.38);
  animation: skipBob 1.8s ease-in-out infinite;
}
.sec-banner .sec-gate-btn.passed {
  background: var(--duo-green); color: #fff; cursor: default;
  box-shadow: 0 3px 0 var(--duo-green-deep), 0 5px 8px rgba(58,138,0,0.28);
}
.sec-banner .sec-gate-btn:hover:not(.passed) { filter: brightness(1.04); }
.sec-banner .sec-gate-btn:active:not(.passed) { animation: none; transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-deep), 0 3px 6px rgba(201,138,0,0.36); }
@media (prefers-reduced-motion: reduce) { .sec-banner .sec-gate-btn { animation: none; } }

/* ---------- water overlays ---------- */
.water-flow {
  position: absolute; left: 0; width: 100%; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,0) 0 14px, rgba(255,255,255,0.10) 14px 18px);
  -webkit-mask-image: linear-gradient(90deg, transparent 24%, #000 33%, #000 66%, transparent 76%);
          mask-image: linear-gradient(90deg, transparent 24%, #000 33%, #000 66%, transparent 76%);
  animation: waterShift 2.2s linear infinite; opacity: 0.65;
}
@keyframes waterShift { to { background-position: 0 -32px; } }
/* past the locked dam the world drains to grayscale, fading in from the dam edge */
.dry-veil {
  position: absolute; left: 0; width: 100%; z-index: 1; pointer-events: none;
  -webkit-backdrop-filter: grayscale(0.96) brightness(1.02);
          backdrop-filter: grayscale(0.96) brightness(1.02);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 70px);
          mask-image: linear-gradient(180deg, transparent 0, #000 70px);
}
/* dried gravel bed — an SVG polygon clipped to the river meander; never on land */
.dry-water { display: block; }

/* ---------- lesson nodes = tactile pebble rocks ---------- */
.rock {
  position: absolute; display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; padding: 0; z-index: 3;
  background: #c2cbd1; border: 2px solid #9aa6ad;
  box-shadow: 0 5px 0 #8a969d, 0 7px 9px rgba(0,0,0,0.22);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.rock svg { width: 18px; height: 18px; }
.rock:hover:not(.locked) { box-shadow: 0 7px 0 #8a969d, 0 10px 12px rgba(0,0,0,0.25); }
.rock:active:not(.locked) { transform: rotate(var(--rot,0deg)) translateY(4px); box-shadow: 0 1px 0 #8a969d, 0 3px 6px rgba(0,0,0,0.22); }
.rock.locked { cursor: not-allowed; }
/* Forest (no biome) locked tile: muted grey stone, as before. */
.rock.locked:not([class*="biome-"]) { filter: saturate(0.4) brightness(0.92); }
/* Biome locked-ahead tile: keep the biome's shape AND colour, just faded so it reads as
   "not reached yet" while you can still faintly tell what it is. Opacity (not a filter) so
   it never clobbers the clip-path shapes' drop-shadow filter (crystal/lava). */
.rock.locked[class*="biome-"] { opacity: 0.5; }
.rock.locked svg { width: 16px; height: 16px; opacity: 0.92; }
.rock.complete { background: #58cc02; border-color: var(--duo-green-dark); box-shadow: 0 5px 0 var(--duo-green-deep), 0 7px 9px rgba(58,138,0,0.3); }
.rock.complete:hover { box-shadow: 0 7px 0 var(--duo-green-deep), 0 10px 12px rgba(58,138,0,0.32); }
.rock.current { background: var(--gold); border-color: var(--gold-dark); box-shadow: 0 5px 0 var(--gold-deep), 0 8px 14px rgba(201,138,0,0.4); animation: rockBob 1.8s ease-in-out infinite; }
@keyframes rockBob { 0%,100% { transform: rotate(var(--rot,0deg)) translateY(0); } 50% { transform: rotate(var(--rot,0deg)) translateY(-3px); } }
.rock.current::after {
  content: "START"; position: absolute; top: -26px; left: 50%; transform: translateX(-50%) rotate(calc(-1 * var(--rot,0deg)));
  background: #fff; color: var(--gold-deep); border: 2px solid var(--gold); border-bottom-width: 3px;
  font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 9px; letter-spacing: 0.5px; white-space: nowrap;
  font-family: var(--font-display); box-shadow: 0 3px 6px rgba(0,0,0,0.18);
}

/* ---------- fixed 20-tile biome path: lesson tiles ----------
   Small, material-specific pieces, not a single recolored badge shape — each biome's
   "glyph" (see TILE_THEME in popup.js) picks its own silhouette: gumdrop candies, faceted
   ice, jagged lava rock, leaf pads, shell/coral chunks, glowing hex shells, planet-ring
   dots. Depth is done entirely with `filter: drop-shadow` (not box-shadow) so it still
   reads correctly on the clip-path shapes, not just the rounded ones. Locked-ahead (whole
   section not yet reached) shows only a faint silhouette — no glyph, no pointer events —
   so the path ahead stays visible without spoiling status. */
.biome-tile {
  position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center;
  padding: 0; cursor: pointer; border: none; border-radius: 40%; color: #fff;
  background: linear-gradient(160deg, var(--tile-hi), var(--tile-base));
  /* the halo drop-shadow is a cheap fake "stroke" (clip-path shapes can't take a CSS border)
     — keeps every glyph legible even against pale art like the arctic ice/snow tile */
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 4px 0 var(--tile-sh)) drop-shadow(0 6px 5px rgba(0,0,0,0.28));
  transition: transform 0.1s ease, filter 0.1s ease;
}
.biome-tile::before {
  content: ""; position: absolute; z-index: 0; top: 10%; left: 16%; width: 28%; height: 18%; border-radius: 50%;
  background: rgba(255,255,255,0.55); filter: blur(0.8px); pointer-events: none;
}
.biome-tile svg { width: 15px; height: 15px; position: relative; z-index: 1; }
.biome-tile:hover:not(:disabled) { filter: drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 5px 0 var(--tile-sh)) drop-shadow(0 8px 7px rgba(0,0,0,0.3)); }
.biome-tile:active:not(:disabled) { transform: translateY(3px); filter: drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 1px 0 var(--tile-sh)) drop-shadow(0 2px 3px rgba(0,0,0,0.26)); }
.biome-tile.complete { background: linear-gradient(160deg, #7fe08a, var(--duo-green)); filter: drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 4px 0 var(--duo-green-deep)) drop-shadow(0 6px 5px rgba(58,138,0,0.3)); }
.biome-tile.complete:hover:not(:disabled) { filter: drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 5px 0 var(--duo-green-deep)) drop-shadow(0 8px 7px rgba(58,138,0,0.32)); }
.biome-tile.locked { background: linear-gradient(160deg, var(--tile-hi), var(--tile-base)); opacity: 0.62; cursor: not-allowed; }
.biome-tile.current {
  background: linear-gradient(160deg, #ffe27a, var(--gold));
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 0 1px rgba(0,0,0,0.85)) drop-shadow(0 4px 0 var(--gold-deep)) drop-shadow(0 7px 8px rgba(201,138,0,0.42));
  animation: biomeTilePulse 1.8s ease-in-out infinite; cursor: pointer;
}
@keyframes biomeTilePulse { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.03); } }
.biome-tile.locked-ahead {
  cursor: default; pointer-events: none; opacity: 0.3;
  filter: grayscale(0.6) brightness(1.1) drop-shadow(0 0 1px rgba(0,0,0,0.75)) drop-shadow(0 0 1px rgba(0,0,0,0.75)) drop-shadow(0 3px 0 rgba(0,0,0,0.1));
}
@media (prefers-reduced-motion: reduce) { .biome-tile.current { animation: none; } }

/* ---- per-biome material silhouettes ---- */
/* Coral Reef — rounded shell/coral chunk (domed top, gathered base) */
.biome-tile.glyph-shell { border-radius: 50% 50% 42% 42% / 68% 68% 24% 24%; }
/* Kelp Forest — leaf pad, organic asymmetric swirl */
.biome-tile.glyph-leaf { border-radius: 14% 78% 18% 82% / 82% 18% 78% 14%; }
/* Sunset Lagoon — lily-pad disc with a wedge notch bitten out */
.biome-tile.glyph-flower { clip-path: polygon(50% 50%, 100% 50%, 97% 65%, 88% 80%, 74% 92%, 57% 98%, 40% 96%, 25% 88%, 12% 75%, 4% 58%, 4% 40%, 12% 24%, 25% 11%, 40% 4%, 57% 2%, 74% 8%, 88% 20%); border-radius: 0; }
/* Candy Meadow — round gumdrop with a peppermint-swirl overlay + a little twist nub */
.biome-tile.glyph-candy { border-radius: 50%; }
.biome-tile.glyph-candy::after {
  content: ""; position: absolute; z-index: 0; inset: 0; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,0.4) 0deg 16deg, transparent 16deg 32deg);
  mix-blend-mode: overlay;
}
/* Deep Sea — glowing hex shell badge, not a rock */
.biome-tile.glyph-glow { clip-path: polygon(50% 2%, 90% 25%, 90% 75%, 50% 98%, 10% 75%, 10% 25%); border-radius: 0; }
/* Lava Springs — jagged cooled-lava rock chunk */
.biome-tile.glyph-flame { clip-path: polygon(24% 0%, 72% 4%, 100% 34%, 90% 78%, 58% 100%, 18% 90%, 0% 54%, 6% 20%); border-radius: 0; }
/* Arctic — faceted ice shard */
.biome-tile.glyph-snowflake { clip-path: polygon(50% 0%, 80% 14%, 100% 48%, 84% 88%, 50% 100%, 14% 86%, 0% 46%, 22% 12%); border-radius: 0; }
/* Crystal Cavern — faceted gem */
.biome-tile.glyph-crystal { clip-path: polygon(50% 0%, 86% 20%, 100% 60%, 72% 100%, 28% 100%, 0% 60%, 14% 20%); border-radius: 0; }
/* Galaxy — planet dot with a thin ring */
.biome-tile.glyph-star { border-radius: 50%; }
.biome-tile.glyph-star::after {
  content: ""; position: absolute; z-index: 0; inset: -22% -6%; border: 2px solid rgba(255,255,255,0.55);
  border-radius: 50%; transform: rotate(-18deg) scaleY(0.4); pointer-events: none;
}

/* ---------- fixed 20-tile biome path: ambient animation overlay ----------
   Exactly 3 groups per biome (AMBIENT_LAYOUT), z-index 1 — always below tiles (2), always
   above the painted background (0). Every loop is slow/subtle and respects reduced motion. */
.biome-anim { position: absolute; z-index: 1; pointer-events: none; transform: translate(-50%, -50%); animation-delay: var(--d, 0s); }
.biome-anim svg { display: block; overflow: visible; }

@keyframes ambBub { 0% { opacity: 0; transform: translateY(0) scale(0.7); } 22% { opacity: 0.9; } 75% { opacity: 0.35; } 100% { opacity: 0; transform: translateY(-18px) scale(1.08); } }
.anim-bubbles .bub { animation: ambBub 3.4s ease-in-out infinite; transform-origin: center; }
.anim-bubbles .bub:nth-child(2) { animation-delay: calc(var(--d, 0s) + 0.9s); }
.anim-bubbles .bub:nth-child(3) { animation-delay: calc(var(--d, 0s) + 1.8s); }
.anim-bubbles .bub:nth-child(4) { animation-delay: calc(var(--d, 0s) + 2.5s); }
.anim-bubbles .bub:nth-child(5) { animation-delay: calc(var(--d, 0s) + 1.3s); }

@keyframes coralSway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.anim-coralSway .csway { transform-origin: 50% 100%; animation: coralSway 3s ease-in-out infinite; animation-delay: var(--d, 0s); }
.anim-coralSway path { transform-box: fill-box; }

@keyframes kelpSway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.anim-kelpSway .blade { transform-origin: 50% 100%; animation: kelpSway 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.anim-kelpSway .blade:nth-child(2) { animation-delay: calc(var(--d, 0s) + 0.4s); }

@keyframes ambShimmer { 0% { transform: translateY(-8px); opacity: 0; } 18% { opacity: 0.9; } 82% { opacity: 0.5; } 100% { transform: translateY(80px); opacity: 0; } }
.anim-shimmer .band { animation: ambShimmer 5s ease-in-out infinite; animation-delay: var(--d, 0s); }

@keyframes flowerBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.anim-flowerBob .fbob { transform-origin: center; animation: flowerBob 2.5s ease-in-out infinite; animation-delay: var(--d, 0s); }

@keyframes ambGlowPulse { 0%, 100% { opacity: 0.55; transform: scale(1); } 50% { opacity: 0.95; transform: scale(1.08); } }
.anim-glowPulse .glow { animation: ambGlowPulse 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); transform-origin: center; }

.biome-anim .gmote { position: absolute; left: calc(50% + var(--mx, 0px)); top: 0; width: 2.6px; height: 2.6px; border-radius: 50%;
  background: #9af0ff; opacity: 0; animation: motesRise 6s ease-out infinite; animation-delay: var(--gd, 0s); }
@keyframes motesRise { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 0.85; } 85% { opacity: 0.4; } 100% { opacity: 0; transform: translateY(-35px); } }

.biome-anim .mote { position: absolute; left: calc(50% + var(--mx, 0px)); top: -6px; width: 3px; height: 3px; border-radius: 50%;
  background: #f3fbff; opacity: 0; animation: snowMote 7s ease-in infinite; animation-delay: var(--d, 0s); }
.biome-anim .mote2 { animation-duration: 7.5s; animation-delay: calc(var(--d, 0s) + 2.4s); }
@keyframes snowMote { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 0.8; } 85% { opacity: 0.5; } 100% { opacity: 0; transform: translateY(80px); } }

@keyframes ambFrostShimmer { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
.anim-frostShimmer .shimmer { animation: ambFrostShimmer 3s ease-in-out infinite; animation-delay: var(--d, 0s); }

@keyframes planetBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.anim-planetBob .pbob { animation: planetBob 3.5s ease-in-out infinite; animation-delay: var(--d, 0s); transform-origin: center; }

@keyframes starTwinkle { 0%, 100% { opacity: 0.65; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } }
.anim-starTwinkle .star { animation: starTwinkle 2s ease-in-out infinite; animation-delay: var(--d, 0s); transform-origin: center; transform-box: fill-box; }

@keyframes cloudDrift { 0%, 100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
.anim-cloudDrift .cdrift { animation: cloudDrift 5s ease-in-out infinite; animation-delay: var(--d, 0s); }

@keyframes crystalGlow { 0%, 100% { opacity: 0.35; transform: scale(1); } 50% { opacity: 0.75; transform: scale(1.06); } }
.anim-crystalGlow .glow { animation: crystalGlow 3s ease-in-out infinite; animation-delay: var(--d, 0s); transform-origin: center; }

@keyframes sparklePop { 0%, 40% { opacity: 0; transform: scale(0.3) rotate(0deg); } 55% { opacity: 1; transform: scale(1) rotate(18deg); } 70%, 100% { opacity: 0; transform: scale(0.3) rotate(18deg); } }
.anim-sparklePop .sparkle { animation: sparklePop 4.8s ease-in-out infinite; animation-delay: var(--d, 0s); transform-origin: center; transform-box: fill-box; }

@keyframes lolliWobble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.anim-lolliWobble .lolli { transform-origin: 50% 100%; animation: lolliWobble 2.6s ease-in-out infinite; animation-delay: var(--d, 0s); transform-box: fill-box; }

@keyframes gumSquash { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, 0.96); } }
.anim-gumBounce .gum { animation: gumSquash 2.4s ease-in-out infinite; animation-delay: var(--d, 0s); transform-origin: 50% 100%; transform-box: fill-box; }

@keyframes steamPuff { 0% { opacity: 0; transform: translateY(0) scale(0.55); } 22% { opacity: 0.6; } 100% { opacity: 0; transform: translateY(-24px) scale(1.5); } }
.anim-steamVent .puff { animation: steamPuff 2.4s ease-out infinite; animation-delay: var(--d, 0s); transform-origin: center; }
.anim-steamVent .puff:nth-child(2) { animation-delay: calc(var(--d, 0s) + 0.8s); }
.anim-steamVent .puff:nth-child(3) { animation-delay: calc(var(--d, 0s) + 1.6s); }

@keyframes lavaGlow { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.8; } }
.anim-lavaGlow .lglow { animation: lavaGlow 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); }

@media (prefers-reduced-motion: reduce) {
  .biome-anim * { animation: none !important; }
}

/* ---------- section gate (test / skip-ahead pill) ----------
   Replaces the old wood-plank dam. A single rounded pill, centered on the river: gold
   for an open / test-out gate (the only one the player can reach), green for a cleared one.
   Deeper, not-yet-reached gates render nothing (the section is simply grayed ahead). */
.skip-gate { position: absolute; z-index: 5; transform: translateX(-50%);
  background: none; border: none; padding: 0; cursor: pointer; }
.skip-gate .sg-inner { display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: 999px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 800; font-size: 12px; letter-spacing: 0.2px; }
.skip-gate .sg-ico { display: inline-flex; }
.skip-gate .sg-ico svg { width: 15px; height: 15px; }
.skip-gate.open .sg-inner, .skip-gate.testout .sg-inner {
  background: var(--gold); color: #6a4a00;
  box-shadow: 0 4px 0 var(--gold-deep), 0 6px 13px rgba(201,138,0,0.42);
  animation: skipBob 1.8s ease-in-out infinite; }
.skip-gate.open .sg-ico, .skip-gate.testout .sg-ico { color: #6a4a00; }
.skip-gate.passed { cursor: default; }
.skip-gate.passed .sg-inner {
  background: var(--duo-green); color: #fff;
  box-shadow: 0 4px 0 var(--duo-green-deep), 0 6px 10px rgba(58,138,0,0.3); }
.skip-gate:hover:not(.passed) .sg-inner { filter: brightness(1.04); }
.skip-gate:active:not(.passed) .sg-inner { animation: none; transform: translateY(2px);
  box-shadow: 0 1px 0 var(--gold-deep), 0 3px 7px rgba(201,138,0,0.4); }
@keyframes skipBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .skip-gate .sg-inner { animation: none; } }

/* ---------- unit mega-rock (final hurdle) ---------- */
.mega {
  position: absolute; z-index: 5; width: 92px; padding: 0; border: none; background: none;
  display: flex; flex-direction: column; align-items: center; cursor: default;
}
.mega .mega-rock {
  width: 78px; height: 64px; border-radius: 46% 54% 42% 58% / 58% 46% 54% 42%;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; font-weight: 900;
  background: linear-gradient(160deg, #9aa6ad 0%, #6a767d 100%); border: 3px solid #555f65;
  box-shadow: 0 7px 0 #4c555a, 0 11px 16px rgba(0,0,0,0.32);
}
.mega .mega-rock svg { width: 26px; height: 26px; }
.mega .mega-label { margin-top: 8px; font-size: 10px; font-weight: 800; color: var(--text-dim); background: rgba(255,255,255,0.92); padding: 3px 9px; border-radius: 9px; white-space: nowrap; box-shadow: 0 2px 5px rgba(0,0,0,0.15); }
.mega.locked .mega-rock svg { width: 22px; height: 22px; }
.mega.open { cursor: pointer; }
.mega.open .mega-rock { background: linear-gradient(160deg, #ffd54a 0%, #f0a800 100%); border-color: var(--gold-dark); box-shadow: 0 7px 0 var(--gold-deep), 0 12px 18px rgba(201,138,0,0.4); color: #6a4a00; animation: megaBob 2s ease-in-out infinite; }
@keyframes megaBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.mega.open:active .mega-rock { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-deep), 0 5px 10px rgba(201,138,0,0.4); }
.mega.passed .mega-rock { background: linear-gradient(160deg, #6fdc2c 0%, #3f9a00 100%); border-color: var(--duo-green-dark); box-shadow: 0 7px 0 var(--duo-green-deep), 0 11px 16px rgba(58,138,0,0.34); }

/* ---------- goldfish mascot ---------- */
/* overflow visible so tall hats / big fins / extras are never clipped by the viewBox */
.fish-mascot { display: block; overflow: visible; }
/* rainbow color: continuously cycle the body's hue */
.fish-mascot.rainbow .fish-body { animation: hueCycle 7s linear infinite; }
@keyframes hueCycle { to { filter: hue-rotate(360deg); } }
.fish-swim {
  position: absolute; width: 58px; height: 40px; z-index: 4; pointer-events: none;
  transform-origin: center; filter: drop-shadow(0 3px 3px rgba(0,0,0,0.28)); animation: fishBob 3s ease-in-out infinite;
}
/* calm default: the fish just bobs gently up and down */
@keyframes fishBob { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-5px) rotate(-2deg); } }
/* occasional, randomly-chosen tricks (driven from JS, one at a time) */
.fish-swim.trick-1 { animation: trickHop 1.25s cubic-bezier(0.34,1.56,0.64,1); }
.fish-swim.trick-2 { animation: trickFlip 1.4s cubic-bezier(0.45,0,0.3,1); }
.fish-swim.trick-3 { animation: trickWiggle 1.2s ease-in-out; }
.fish-swim.trick-4 { animation: trickSpin 1.5s cubic-bezier(0.5,0,0.3,1); }
.fish-swim.trick-5 { animation: trickDart 1.3s cubic-bezier(0.7,0,0.3,1); }
@keyframes trickHop { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-22px) rotate(-6deg); } 70% { transform: translateY(-6px) rotate(4deg); } }
@keyframes trickFlip { 0% { transform: translateY(0) rotate(0); } 45% { transform: translateY(-18px) rotate(200deg); } 100% { transform: translateY(0) rotate(360deg); } }
@keyframes trickWiggle { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 45% { transform: rotate(12deg); } 70% { transform: rotate(-8deg); } 88% { transform: rotate(5deg); } }
@keyframes trickSpin { 0% { transform: rotate(0) scale(1); } 55% { transform: rotate(540deg) scale(1.1); } 100% { transform: rotate(720deg) scale(1); } }
@keyframes trickDart { 0% { transform: translateX(0); } 30% { transform: translateX(14px) scaleX(1.08); } 60% { transform: translateX(-10px) scaleX(0.96); } 100% { transform: translateX(0); } }
.fish-mascot .fish-tail { transform-origin: 42px 20px; animation: fishTail 0.55s ease-in-out infinite; }
.fish-mascot .fish-pec { transform-origin: 24px 23px; animation: fishPec 0.6s ease-in-out infinite; }
.fish-mascot .fish-dorsal { transform-origin: 28px 8px; animation: fishDorsal 1.1s ease-in-out infinite; }
.fish-mascot .fish-anal { transform-origin: 30px 33px; animation: fishPec 0.7s ease-in-out infinite; }
.fish-mascot .fish-bubbles { animation: fishBubbles 2.4s ease-in infinite; }
@keyframes fishTail { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(14deg); } }
@keyframes fishPec { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(20deg); } }
@keyframes fishDorsal { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(0.8); } }
@keyframes fishBubbles { 0% { opacity: 0; transform: translate(0,4px) scale(0.6); } 30% { opacity: 0.9; } 100% { opacity: 0; transform: translate(-5px,-12px) scale(1.1); } }
/* interactive shop extras */
.fish-mascot .x-aura { transform-box: fill-box; transform-origin: center; animation: xSpin 6s linear infinite; }
.fish-mascot .x-bubbles { animation: xBub 2.2s ease-in infinite; }
.fish-mascot .x-sparkle { transform-box: fill-box; transform-origin: center; animation: xSpark 1.8s ease-in-out infinite; }
.fish-mascot .x-pet { transform-box: fill-box; transform-origin: center; animation: xPet 2.6s ease-in-out infinite; }
@keyframes xSpin { to { transform: rotate(360deg); } }
@keyframes xBub { 0% { opacity: 0; transform: translateY(6px) scale(0.6); } 35% { opacity: 0.95; } 100% { opacity: 0; transform: translateY(-12px) scale(1.1); } }
@keyframes xSpark { 0%,100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes xPet { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* ---------- generic list ---------- */
.path { overflow-y: auto; overflow-x: hidden; padding: 16px 14px 24px; display: flex; flex-direction: column; gap: 12px; background: #fff; }

/* ---------- Units overview ---------- */
.units-page { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 16px 28px; background: #fff; display: flex; flex-direction: column; gap: 12px; }
.units-head { margin-bottom: 6px; }
.uh-eyebrow { font-family: var(--font-display); font-weight: 800; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-dim); }
.uh-title { font-family: var(--font-display); font-weight: 900; font-size: 25px; letter-spacing: -0.03em; color: var(--text); margin: 2px 0; }
.uh-sub { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.uh-sub b { color: var(--text); font-family: var(--font-display); }
/* six segments, one per unit, each filling with that unit's own color — the course at a glance */
.uh-track { display: flex; gap: 5px; margin-top: 11px; }
.uh-seg { flex: 1; height: 10px; border-radius: 6px; background: color-mix(in srgb, var(--uc) 14%, #f2f4f2); overflow: hidden; }
.uh-seg-fill { display: block; height: 100%; border-radius: 6px; background: var(--uc); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.14); transition: width 0.3s ease; }

.unit-card {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 18px;
  padding: 14px 16px; cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.34, 1.4, 0.64, 1), border-color 0.15s ease, box-shadow 0.15s ease;
}
.unit-card:hover:not(.locked) {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--uc) 55%, var(--gray-line));
  box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--uc) 60%, transparent);
}
.unit-card:active:not(.locked) { transform: translateY(1px); border-bottom-width: 2px; }
.unit-card:focus-visible { outline: 3px solid var(--uc, var(--ocean)); outline-offset: 2px; }
.unit-card.current { border-color: color-mix(in srgb, var(--uc) 55%, #fff); background: color-mix(in srgb, var(--uc) 4%, #fff); }
.unit-card.locked { cursor: not-allowed; }
.unit-card.locked .uc-info, .unit-card.locked .uc-ring { opacity: 0.55; filter: saturate(0.35); }

.uc-ring { position: relative; flex: none; width: 54px; height: 54px; }
.uc-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.ucr-track { fill: none; stroke: color-mix(in srgb, var(--uc) 15%, #eef0ee); stroke-width: 5; }
.ucr-fill { fill: none; stroke: var(--uc); stroke-width: 5; stroke-linecap: round; }
.ucr-center { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 19px; color: var(--uc); }
.ucr-center svg { width: 17px; height: 17px; }
.unit-card.passed .ucr-center { inset: 9px; background: var(--uc); border-radius: 50%; }
.unit-card.locked .ucr-center { inset: 9px; background: #c3c7c9; border-radius: 50%; }
.unit-card.locked .ucr-center svg { width: 15px; height: 15px; }

.uc-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.uc-eyebrow { font-family: var(--font-display); font-weight: 800; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--uc) 70%, #5a646d); }
.uc-title { font-family: var(--font-display); font-weight: 900; font-size: 16px; letter-spacing: -0.01em; color: var(--text); line-height: 1.15; }
.uc-desc { font-size: 12px; font-weight: 600; color: var(--text-dim); line-height: 1.45; }
.uc-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.uc-bar { flex: 1 1 auto; max-width: 230px; height: 8px; border-radius: 5px; background: #f0f2f0; overflow: hidden; }
.uc-bar-fill { display: block; height: 100%; border-radius: 5px; background: var(--uc); }
.uc-count { font-family: var(--font-display); font-weight: 800; font-size: 11px; color: var(--uc); }
.uc-locknote { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 3px; }

/* quiet inline shortcut straight to the unit's mega-rock test */
.uc-test { align-self: flex-start; margin-top: 5px; padding: 2px 0; background: none; border: none; cursor: pointer; font-family: var(--font-display); font-weight: 800; font-size: 11.5px; color: var(--uc); }
.uc-test:hover { text-decoration: underline; }
.uc-test:active { transform: translateY(1px); }
.uc-test:focus-visible { outline: 2px solid var(--uc); outline-offset: 2px; border-radius: 4px; }

.uc-side { flex: none; }
.uc-chip { display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.uc-chip.go { background: var(--uc); color: #fff; box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--uc) 75%, transparent); }
.uc-chip.start { background: color-mix(in srgb, var(--uc) 10%, #fff); color: color-mix(in srgb, var(--uc) 80%, #222); border: 1.5px solid color-mix(in srgb, var(--uc) 35%, #fff); }
.uc-chip.passed { background: #eef7e6; color: var(--duo-green-dark); }
.uc-chip.locked { background: #f3f3f3; color: var(--muted); }

/* ---------- Bottom nav ---------- */
.bottomnav { display: flex; justify-content: space-around; align-items: center; border-top: 2px solid var(--gray-line); background: #fff; padding: 9px 4px; }
.navbtn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); font-weight: 800;
  background: none; border: none; cursor: pointer; font-family: var(--font-display);
  transition: color 0.15s ease, transform 0.1s ease; padding: 5px 10px; border-radius: 10px;
}
.navbtn:hover { color: var(--text-dim); }
.navbtn:active { transform: scale(0.92); }
.navbtn.active { color: var(--skin-dark, var(--duo-green)); }
.navbtn .icon { display: flex; }
/* Competition Prep: short label in the extension's bottom bar, full name on the web rail */
.navbtn .nav-long { display: none; }
/* quick-action cards for the web sidebar; never shown in the extension's bottom bar */
.rail-widgets { display: none; }
/* pending-assignments count pinned to the Assignments tab */
.nav-badge {
  position: absolute; top: -2px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 900; font-size: 10.5px; color: #fff;
  background: #ff3b30; box-shadow: 0 2px 6px rgba(255,59,48,0.5); pointer-events: none;
}

/* ---------- Quiz screen ---------- */
.quiz-screen { display: flex; flex-direction: column; min-height: 540px; background: #fff; }
.quiz-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border-bottom: 2px solid var(--gray-line); }
.quiz-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
.quiz-bar { flex: 1; height: 16px; background: var(--gray-line); border-radius: 10px; overflow: hidden; }
.quiz-bar-fill { height: 100%; background: var(--duo-green); border-radius: 10px; transition: width 0.3s ease; position: relative; }
.quiz-bar-fill::after { content: ""; position: absolute; top: 3px; left: 6px; right: 6px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.5); }
.quiz-bar-fill.ocean { background: var(--ocean-dark); }
.quiz-bar-fill.gw { background: var(--gold); }
.gw-count { font-weight: 800; font-size: 13px; color: var(--text-dim); }

.gw-banner { padding: 9px 16px; font-size: 12px; font-weight: 800; text-align: center; color: #fff; }
.gw-banner.section { background: var(--dam-accent); }
.gw-banner.unit { background: var(--gold-dark); }

.quiz-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding: 20px 16px; animation: questionIn 0.25s ease; }
@keyframes questionIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.quiz-tag {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-weight: 800; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.6px; margin-bottom: 16px; font-family: var(--font-display); padding: 5px 12px; background: #f3f3f3; border-radius: 8px; width: fit-content;
}
.quiz-prompt { font-size: 19px; font-weight: 800; line-height: 1.45; margin-bottom: 22px; letter-spacing: -0.2px; color: var(--text); }

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  border: 2px solid var(--gray-line); border-bottom-width: 4px; background: #fff; border-radius: var(--radius);
  padding: 15px 18px; font-size: 15px; font-weight: 700; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; transition: border-color 0.12s ease, transform 0.08s ease, background 0.12s ease;
}
.option:hover { background: #f7f7f7; }
.option:active { transform: translateY(2px); border-bottom-width: 2px; }
.option.selected { border-color: #84d8ff; background: #ddf4ff; color: #1899d6; }
.option.correct { border-color: var(--duo-green-dark); background: #d7ffb8; color: var(--duo-green-dark); }
.option.incorrect { border-color: var(--red-dark); background: #ffdfe0; color: var(--red-dark); }
.option .key { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--gray-line2); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }

.quiz-footer { padding: 16px; border-top: 2px solid var(--gray-line); display: flex; align-items: center; gap: 12px; }
.quiz-footer .btn { flex: 1 1 auto; }
.hint-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--gold-deep); background: #fff6d8; border: 2px solid var(--gold); border-bottom-width: 4px; border-radius: 14px; padding: 12px 16px; cursor: pointer; transition: transform 0.1s ease; }
.hint-btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.option.eliminated { opacity: 0.36; pointer-events: none; text-decoration: line-through; filter: grayscale(0.6); }
.quiz-bar.redeem .quiz-bar-fill { background: var(--gold); }
.test-intro.placement .ti-emblem.pl { background: var(--purple); box-shadow: 0 5px 0 var(--purple-deep); color: #fff; font-size: 30px; }
.gw-banner.placement { background: var(--purple); }
.gw-banner.daily { background: var(--gold); color: #5a3e00; }

/* ---------- settings screen ---------- */
.settings-page { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 16px 30px; background: #fff; }
.settings-title { font-family: var(--font-display); font-size: 22px; font-weight: 900; letter-spacing: -0.02em; color: var(--text); margin-bottom: 14px; }
.set-sect { font-family: var(--font-display); font-weight: 800; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-dim); margin: 2px 2px 8px; }
.set-sect.danger { color: var(--red-dark); }
.set-card { background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 16px; padding: 2px 14px; margin-bottom: 16px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.set-card .set-row + .set-row { border-top: 1.5px solid var(--gray-line); }
.set-row.time { border-top: 1.5px solid var(--gray-line); }
.join-row.set-join { margin-top: 10px; max-width: 340px; }
.set-row.dim { opacity: 0.5; }

/* ---------- notification settings popup ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150; background: rgba(20, 30, 26, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: modalFade 0.18s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative; width: 100%; max-width: 400px; max-height: 88%; overflow-y: auto;
  background: #fff; border-radius: 20px 20px 0 0; padding: 22px 18px 26px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.22);
  animation: modalUp 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-close {
  position: absolute; top: 16px; right: 14px; background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--text-dim); padding: 4px; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-close:focus-visible { outline: 2.5px solid var(--ocean); outline-offset: 2px; border-radius: 6px; }
.modal-sub { font-size: 12.5px; font-weight: 600; color: var(--text-dim); line-height: 1.5; margin: 0 0 16px; padding-right: 26px; }
@media (min-width: 500px) {
  .modal-overlay { align-items: center; }
  .modal-card { border-radius: 20px; }
}
.set-info { flex: 1 1 auto; min-width: 0; }
.set-name { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--text); }
.set-sub { font-size: 11.5px; font-weight: 600; color: var(--text-dim); line-height: 1.3; margin-top: 2px; }
.toggle { flex: none; width: 52px; height: 30px; border-radius: 16px; border: none; background: var(--gray-line2); position: relative; cursor: pointer; transition: background 0.15s ease; }
.toggle.on { background: var(--duo-green); }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.15s ease; }
.toggle.on .knob { transform: translateX(22px); }
.time-select { flex: none; font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--text); border: 2px solid var(--gray-line); border-radius: 10px; padding: 8px 10px; background: #fff; cursor: pointer; }

.complete-screen .badge.warn { background: var(--gold); box-shadow: 0 6px 0 var(--gold-deep); color: #5a3e00; font-weight: 900; }
.complete-screen .badge.fail { background: var(--red); box-shadow: 0 6px 0 var(--red-dark); color: #fff; font-weight: 900; }
.btn {
  width: 100%; padding: 15px; border-radius: 14px; border: 2px solid transparent; border-bottom-width: 4px;
  font-weight: 800; font-size: 15px; cursor: pointer; letter-spacing: 0.4px; text-transform: uppercase;
  font-family: var(--font-display); transition: transform 0.1s ease, border-width 0.1s ease, filter 0.12s ease;
}
.btn:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.btn-primary { background: var(--duo-green); border-color: var(--duo-green-dark); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.04); }
.btn-primary:disabled { background: #e5e5e5; border-color: #d6d6d6; color: #afafaf; cursor: not-allowed; }
.btn-ocean { background: var(--ocean); border-color: var(--ocean-dark); color: #fff; }
.btn-ocean:hover:not(:disabled) { filter: brightness(1.04); }
.btn-ocean:disabled { background: #e5e5e5; border-color: #d6d6d6; color: #afafaf; cursor: not-allowed; }
.btn-gold { background: var(--gold); border-color: var(--gold-dark); color: #5a3e00; }
.btn-gold:hover:not(:disabled) { filter: brightness(1.04); }
.btn-gold:disabled { background: #e5e5e5; border-color: #d6d6d6; color: #afafaf; cursor: not-allowed; }
.btn-ghost { background: #fff; border-color: var(--gray-line); border-bottom-width: 4px; color: var(--text-dim); margin-top: 10px; }

.feedback-banner { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 800; font-size: 14px; border-radius: var(--radius); font-family: var(--font-display); animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1); margin: 0 16px; }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.feedback-banner.correct { background: #d7ffb8; color: var(--duo-green-dark); }
.feedback-banner.incorrect { background: #ffdfe0; color: var(--red-dark); }

/* "Why" / answer takeaway shown under the feedback banner */
.explain {
  margin: 10px 0 0; padding: 11px 14px; border-radius: var(--radius);
  background: #f3f7ff; border: 2px solid #dbe7ff; border-left-width: 5px;
  font-size: 13px; line-height: 1.5; color: var(--text);
  max-height: 132px; overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.explain .explain-label {
  display: inline-block; font-family: var(--font-display); font-weight: 800;
  font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase;
  color: #3b82c4; margin-right: 7px; vertical-align: 1px;
}
.explain .explain-text { font-weight: 700; }

/* ---------- complete / result screens ---------- */
.complete-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 540px; padding: 32px 24px; text-align: center; gap: 18px; background: #fff; }
.complete-screen .badge { display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; background: var(--duo-green); border-radius: 50%; box-shadow: 0 6px 0 var(--duo-green-deep); color: #fff; animation: badgeIn 0.5s cubic-bezier(0.34,1.56,0.64,1); font-size: 40px; }
.complete-screen .badge svg { width: 44px; height: 44px; }
.complete-screen .badge.ocean { background: var(--ocean); box-shadow: 0 6px 0 var(--ocean-deep); }
@keyframes badgeIn { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.complete-screen h2 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.4px; color: var(--text); }
.complete-stats { display: flex; gap: 28px; margin: 8px 0; }
.complete-stat { display: flex; flex-direction: column; align-items: center; }
.complete-stat .val { font-size: 22px; font-weight: 900; color: var(--duo-green); line-height: 1.2; }
.complete-stat .lbl { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 6px; }

.gw-result .gw-art { width: 100px; height: 100px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 46px; font-weight: 900; color: #fff; animation: badgeIn 0.5s cubic-bezier(0.34,1.56,0.64,1); }
.gw-art.section.win { background: var(--duo-green); box-shadow: 0 6px 0 var(--duo-green-deep); }
.gw-art.unit.win { background: var(--gold); color: #5a3e00; box-shadow: 0 6px 0 var(--gold-deep); }
.gw-art.lose { background: var(--muted); box-shadow: 0 6px 0 #8a8a8a; }
.gw-art svg { width: 44px; height: 44px; }
.gw-result.lose .complete-stat .val { color: var(--text); }
.gw-result.win.gw-result .complete-stat:nth-child(3) .val { color: var(--gold-dark); }

.practice-streak { font-weight: 800; color: var(--ocean-dark); font-size: 13px; }

/* ---------- question meta ---------- */
.q-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.difficulty { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; padding: 4px 11px; border-radius: 20px; font-family: var(--font-display); }
.difficulty.easy { background: #d7ffb8; color: #4ca800; }
.difficulty.medium { background: #fff0c2; color: #b07d00; }
.difficulty.hard { background: #ffdfe0; color: #d63a3a; }
.flag-btn { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 3px; color: var(--text-dim); font-weight: 800; font-size: 12px; font-family: var(--font-display); padding: 4px 11px; border-radius: 14px; cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease; }
.flag-btn:hover { border-color: var(--gold-dark); color: var(--gold-dark); }
.flag-btn.on { background: #fff0c2; border-color: var(--gold); color: #b07d00; }

/* ---------- card options ---------- */
.options.cards { flex-direction: row; flex-wrap: wrap; gap: 12px; }
.options.cards .option.card { flex: 1 1 calc(50% - 12px); min-height: 80px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; font-size: 16px; font-weight: 800; position: relative; }
.options.cards .option.card .key { position: absolute; top: 8px; right: 10px; }

/* ---------- fill-in-the-blank ---------- */
.blank-sentence { font-size: 18px; font-weight: 700; line-height: 2.1; color: var(--text); margin-bottom: 22px; font-family: var(--font-display); }
.blank-slot { display: inline-block; min-width: 84px; padding: 2px 10px; margin: 0 2px; border-bottom: 3px solid #84d8ff; text-align: center; color: var(--text); vertical-align: middle; border-radius: 6px 6px 0 0; }
.blank-slot.filled { background: #ddf4ff; }
.blank-slot.correct { border-color: var(--duo-green-dark); background: #d7ffb8; color: var(--duo-green-dark); }
.blank-slot.incorrect { border-color: var(--red-dark); background: #ffdfe0; color: var(--red-dark); }
.bank { display: flex; flex-wrap: wrap; gap: 10px; }
.bank-chip { background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 12px; padding: 9px 16px; font-size: 15px; font-weight: 700; color: var(--text); cursor: pointer; font-family: var(--font-display); transition: transform 0.08s ease, border-width 0.08s ease; }
.bank-chip:hover:not(.used):not(.done) { background: #f7f7f7; }
.bank-chip:active:not(.used):not(.done) { transform: translateY(2px); border-bottom-width: 2px; }
.bank-chip.used { opacity: 0.3; pointer-events: none; }
.bank-chip.correct { border-color: var(--duo-green-dark); color: var(--duo-green-dark); background: #d7ffb8; opacity: 1; }
.bank-chip.done { cursor: default; }

/* ---------- Competition home ---------- */
.comp-home { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 16px 8px; display: flex; flex-direction: column; gap: 7px; background: #fff; }
/* crisp flat title header (no banner) */
.comp-head { display: flex; flex-direction: column; gap: 1px; padding-bottom: 2px; border-bottom: 2px solid var(--gray-line); }
.comp-h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); font-family: var(--font-display); }
.comp-sub { margin: 0 0 5px; font-size: 12.5px; color: var(--text-dim); font-weight: 700; }
.comp-back { align-self: flex-start; background: none; border: none; color: var(--ocean-dark); font-weight: 800; font-size: 14px; cursor: pointer; font-family: var(--font-display); padding: 0; }
/* Duolingo-style cards: white, thick bottom border, press-down on tap */
.comp-card { display: flex; align-items: center; gap: 13px; text-align: left; width: 100%; background: #fff; border: 2px solid var(--gray-line2); border-bottom-width: 4px; border-radius: 14px; padding: 8px 14px; cursor: pointer; transition: transform 0.1s ease, border-color 0.15s ease, background 0.12s ease; }
.comp-card:hover { background: #f9f9f9; }
.comp-card:active { transform: translateY(2px); border-bottom-width: 2px; }
/* bigger fish, no background badge — the fish itself is the icon */
.comp-card .cc-icon { width: 62px; height: 50px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: none; }
.comp-card .cc-icon .cc-fish { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: visible; }
.comp-card .cc-icon .cc-fish .fish-mascot { width: 60px; height: 46px; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2)); }
/* lifetime competition stats row, pinned to the bottom of the page */
.comp-stats { margin-top: auto; display: flex; gap: 7px; padding-top: 2px; }
.comp-stats .cs { flex: 1; text-align: center; background: #f7f7f7; border: 2px solid var(--gray-line); border-radius: 12px; padding: 6px 2px; }
.comp-stats .cs-v { font-family: var(--font-display); font-weight: 900; font-size: 17px; line-height: 1.1; color: var(--text); }
.comp-stats .cs-v.right { color: var(--duo-green-dark); }
.comp-stats .cs-v.wrong { color: var(--red-dark); }
.comp-stats .cs-v.acc { color: var(--ocean-dark); }
.comp-stats .cs-l { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dim); margin-top: 2px; }
.comp-card .cc-body { flex: 1; min-width: 0; }
.comp-card .cc-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -0.02em; color: var(--text); }
.comp-card .cc-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.35; font-weight: 600; }
.comp-card .cc-arrow { color: var(--muted); }
/* chevron: optically centered (glyph metrics sit it high without line-height:1) */
.comp-card .cc-arrow { font-size: 21px; line-height: 1; color: var(--ocean-dark); font-weight: 800; flex-shrink: 0; display: flex; align-items: center; }

/* numeric badge for the test-length picker — the count IS the icon, so make it
   read as an intentional, tactile chip instead of bare text in the fish slot */
.comp-card.test .cc-num {
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 900; font-size: 19px; letter-spacing: -0.5px;
  color: #fff; background: var(--ocean); border: 2px solid var(--ocean-dark);
  box-shadow: 0 3px 0 var(--ocean-deep);
}
.comp-card.test .cc-num.three { font-size: 15px; } /* 3-digit "100" */
.comp-card.test:active .cc-num { box-shadow: 0 1px 0 var(--ocean-deep); transform: translateY(2px); }

/* ---------- Competition dashboard (hero scene + 2x2 action grid) ---------- */
.cp-home { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: #fff; padding: 10px 12px 12px; gap: 11px; }

/* Hero: the equipped fish in its equipped background, with a stats glass widget */
.cp-hero { position: relative; height: 172px; flex-shrink: 0; border-radius: 20px; overflow: hidden;
  box-shadow: 0 8px 18px -8px rgba(13,102,153,0.5), inset 0 0 0 2px rgba(255,255,255,0.35); }
.cp-scene { position: absolute; inset: 0; background: linear-gradient(180deg, #5ec6f0 0%, #2a93d6 55%, #1c6fae 100%); overflow: hidden; }
.cp-scene .biome-scene { z-index: 0; }
/* soft top light + floor shadow so the fish reads as sitting in a scene, any background */
.cp-hero-glow { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,0.45), transparent 55%),
              radial-gradient(90% 55% at 50% 118%, rgba(0,0,0,0.28), transparent 70%); }
.cp-hero-fish { position: absolute; left: 0; right: 0; top: 4px; bottom: 40px; z-index: 2;
  display: flex; align-items: center; justify-content: center; }
.cp-hero-fish .fish-mascot { width: 168px; height: 130px; overflow: visible;
  filter: drop-shadow(0 7px 7px rgba(0,0,0,0.28)); animation: cpSwim 13s ease-in-out infinite; }
/* lazy patrol: drifts to one edge of the hero scene, flips, drifts back */
/* Base fish art faces LEFT (eye at x≈11, tail at x≈42). So while travelling RIGHT
   (translateX increasing, 0%→47%) it must be flipped — scaleX(-1) — to face right; while
   travelling LEFT (50%→97%) it keeps its native scaleX(1) and faces left. */
@keyframes cpSwim {
  0%   { transform: translateX(-86px) scaleX(-1) translateY(0); }
  10%  { transform: translateX(-60px) scaleX(-1) translateY(-5px); }
  25%  { transform: translateX(-10px) scaleX(-1) translateY(2px); }
  40%  { transform: translateX(50px) scaleX(-1) translateY(-3px); }
  47%  { transform: translateX(86px) scaleX(-1) translateY(0); }
  50%  { transform: translateX(86px) scaleX(1) translateY(0); }
  60%  { transform: translateX(50px) scaleX(1) translateY(-5px); }
  75%  { transform: translateX(-10px) scaleX(1) translateY(2px); }
  90%  { transform: translateX(-60px) scaleX(1) translateY(-3px); }
  97%  { transform: translateX(-86px) scaleX(1) translateY(0); }
  100% { transform: translateX(-86px) scaleX(-1) translateY(0); }
}
/* semi-transparent stats widget pinned to the bottom of the hero scene */
.cp-statbar { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3;
  display: flex; gap: 2px; padding: 6px 4px; border-radius: 13px;
  background: rgba(14,28,46,0.46); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.cp-statbar .cp-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  position: relative; }
.cp-statbar .cp-stat + .cp-stat::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 1px; background: rgba(255,255,255,0.16); }
.cp-statbar .cp-sv { font-family: var(--font-display); font-weight: 900; font-size: 16px; line-height: 1;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.cp-statbar .cp-sv.right { color: #8ef07a; }
.cp-statbar .cp-sv.wrong { color: #ff9a8f; }
.cp-statbar .cp-sv.acc { color: #ffe27a; }
.cp-statbar .cp-sl { font-size: 8.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
  color: rgba(255,255,255,0.82); }

/* 2x2 arcade action grid */
.cp-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr; gap: 11px; }
/* Sleeker horizontal cards: shrunk fish on the left, title + subtitle stacked on
   the right. No heavy borders — a soft fish-tinted fill with a low, color-cast
   drop shadow carries the depth instead. */
.cp-tile { position: relative; display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
  gap: 10px; text-align: left; padding: 10px 12px; cursor: pointer; overflow: hidden;
  background: var(--tile-tint, #eef4ff); border: none; border-radius: 16px;
  box-shadow: 0 5px 14px -6px var(--tile-shadow, rgba(0,0,0,0.2)), inset 0 0 0 1px rgba(255,255,255,0.55);
  transition: transform 0.12s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.15s ease; }
.cp-tile:hover { transform: translateY(-2px);
  box-shadow: 0 10px 20px -6px var(--tile-shadow, rgba(0,0,0,0.3)), inset 0 0 0 1px rgba(255,255,255,0.7); }
.cp-tile:active { transform: translateY(1px);
  box-shadow: 0 3px 9px -5px var(--tile-shadow, rgba(0,0,0,0.28)), inset 0 0 0 1px rgba(255,255,255,0.5); }
.cp-tile:focus-visible { outline: 3px solid var(--tile-edge, var(--ocean)); outline-offset: 2px; }
.cp-tile .cp-tile-fish { flex-shrink: 0; width: 54px; height: 46px; display: flex; align-items: center; justify-content: center; }
.cp-tile .cp-tile-fish .fish-mascot { width: 54px; height: 46px; overflow: visible;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.2)); }
.cp-tile .cp-tile-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cp-tile .cp-tile-title { font-family: var(--font-display); font-weight: 900; font-size: 14px;
  letter-spacing: -0.02em; color: var(--text); line-height: 1.1; }
.cp-tile .cp-tile-desc { font-size: 10px; font-weight: 600; color: #8b9099; line-height: 1.25; }
/* per-tile fish-matched fill + accent */
.cp-tile.test     { --tile-tint:#e6f4ff; --tile-edge:var(--ocean);      --tile-shadow:rgba(17,132,198,0.3); }
.cp-tile.practice { --tile-tint:#fff4d8; --tile-edge:var(--gold-dark);  --tile-shadow:rgba(201,138,0,0.28); }
.cp-tile.review   { --tile-tint:#f4eaff; --tile-edge:var(--purple-dark);--tile-shadow:rgba(131,71,196,0.28); }
.cp-tile.flagged  { --tile-tint:#ffeae6; --tile-edge:var(--red);        --tile-shadow:rgba(214,58,58,0.28); }
/* dynamic alert badge (e.g. missed-question count) — vibrant red, top-right */
.cp-alert { position: absolute; top: 6px; right: 7px; z-index: 2; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 900; font-size: 11px; color: #fff;
  background: #ff3b30; box-shadow: 0 2px 6px rgba(255,59,48,0.55);
  animation: cpAlertPulse 1.8s ease-in-out infinite; }
@keyframes cpAlertPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) {
  .cp-hero-fish .fish-mascot, .cp-alert { animation: none; }
}

/* ---------- The Finery Shop (full page, like Units) ---------- */
.shop-page { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: #fff; }
@keyframes walletShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
#coinShop.nope { animation: walletShake 0.4s ease; }
/* ---------- Shop hero: a clean fish-preview card beside a glassmorphism info card ---------- */
/* The two halves sit on a soft ambient backdrop (NOT the literal biome photo — that's what
   made the old single-box layout read as cluttered) so the glass card's blur has something
   to read against, and the fish gets a quiet, undistracted stage. */
.shop-preview {
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 10px;
  padding: 14px 16px 16px;
  background:
    radial-gradient(120% 140% at 12% 0%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(160deg, #eef7ff 0%, #dcecff 55%, #cfe2fb 100%);
  border-bottom: 2px solid var(--gray-line); flex-shrink: 0;
}
.shop-preview .shop-fish-box {
  position: relative; min-height: 112px; border-radius: 18px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(85% 85% at 50% 38%, #ffffff 0%, #eef5ff 70%, #e3edfb 100%);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(40,80,150,0.06), 0 8px 16px -6px rgba(40,80,150,0.22);
}
.shop-preview .shop-fish-box::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 84%, rgba(40,80,150,0.1), transparent 70%);
}
.shop-preview .shop-fish-box .fish-mascot { width: 78%; height: 78%; position: relative; z-index: 1; overflow: visible; filter: drop-shadow(0 6px 5px rgba(20,45,85,0.2)); }

/* ---------- equipped background scenes (behind the fish) ---------- */
/* Real biome artwork, cover-fit (never the cropped/zoomed look a fixed viewBox gave at
   odd aspect ratios). Feather the edges so the scene melts into the surrounding panel. */
.fish-bg { position: absolute; inset: -4px; z-index: 0; border-radius: inherit; overflow: hidden;
  -webkit-mask-image: radial-gradient(115% 105% at 50% 46%, #000 32%, rgba(0,0,0,0.55) 68%, transparent 100%);
  mask-image: radial-gradient(115% 105% at 50% 46%, #000 32%, rgba(0,0,0,0.55) 68%, transparent 100%); }
/* the photo itself breathes: a slow Ken-Burns drift (transform only, GPU-cheap) */
.fish-bg .fish-bg-img { position: absolute; inset: -10px;
  background-size: cover; background-position: center;
  animation: bgSceneDrift 19s ease-in-out infinite alternate; }
@keyframes bgSceneDrift {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.09) translate(-6px, -4px); }
}
/* ---------- abstract hand-drawn biome scene (Competition-Prep hero) ---------- */
/* Layered dioramas (see the SCENE_BUILD comment in popup.js): px-sized sprites anchored
   by %, a stretchable floor band, full-width traveler lanes and full-height particle
   fields. Everything animates transform/opacity only. */
.biome-scene { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.biome-scene .bs-spr { position: absolute; pointer-events: none; }
.biome-scene .bs-spr svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* floor: the only stretched layer — gentle dune curves tolerate horizontal stretch.
   62px tall so the crest line clears the ~46px statbar glass; sprite bases fade under. */
.biome-scene .bs-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; }
.biome-scene .bs-floor svg { display: block; width: 100%; height: 100%; }

/* travelers: the full-width lane translates -150px → 100% of its own (= hero) width, so
   its sprite crosses the whole hero at ANY width; nested .bs-trav bobs independently */
.biome-scene .bs-lane { position: absolute; left: 0; right: 0; height: 0;
  animation: bsCross var(--lt, 30s) linear infinite; animation-delay: var(--ld, 0s); }
.biome-scene .bs-lane.rev { animation-name: bsCrossRev; }
.biome-scene .bs-lane.rev svg { transform: scaleX(-1); }
.biome-scene .bs-lane .bs-trav { position: absolute; left: 0; top: 0; animation: bsTravBob 3.4s ease-in-out infinite; }
.biome-scene .bs-lane.cloud .bs-trav { animation: none; }
@keyframes bsCross    { from { transform: translateX(-150px); } to { transform: translateX(100%); } }
@keyframes bsCrossRev { from { transform: translateX(100%); } to { transform: translateX(-150px); } }
@keyframes bsTravBob  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
/* comets cross fast then hold offscreen for the rest of the cycle */
.biome-scene .bs-lane.comet { animation-name: bsCometCross; animation-timing-function: ease-in; }
.biome-scene .bs-lane.comet .bs-trav { animation: none; }
@keyframes bsCometCross { 0% { transform: translateX(-160px); } 16% { transform: translateX(calc(100% + 60px)); } 100% { transform: translateX(calc(100% + 60px)); } }

/* risers: jellyfish / crystal shards climbing the full height on a slow loop */
.biome-scene .bs-riser { position: absolute; bottom: -60px;
  animation: bsRiserUp var(--rt, 36s) linear infinite; animation-delay: var(--rd, 0s); }
.biome-scene .bs-riser svg { display: block; width: 100%; height: 100%; overflow: visible; }
@keyframes bsRiserUp { 0% { transform: translateY(0); opacity: 0; } 6% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateY(-260px); opacity: 0; } }

/* particle fields — deterministic scatter, full-height travel */
.biome-scene .bs-parts { position: absolute; inset: 0; pointer-events: none; }
.biome-scene .bs-parts i { position: absolute; width: var(--ps, 4px); height: var(--ps, 4px); border-radius: 50%;
  animation-delay: var(--pd, 0s); animation-duration: var(--pt, 7s);
  animation-timing-function: linear; animation-iteration-count: infinite; }
.biome-scene .p-rise i { bottom: -12px; background: rgba(255,255,255,0.85);
  box-shadow: inset 1px 1px 1px rgba(0,60,90,0.15); animation-name: bsRise; }
@keyframes bsRise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 12% { opacity: 0.85; }
  55% { transform: translateY(-105px) translateX(5px); } 88% { opacity: 0.8; }
  100% { transform: translateY(-195px) translateX(-3px); opacity: 0; } }
.biome-scene .p-fall i { top: -12px; background: #fff; animation-name: bsFall; }
@keyframes bsFall { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: 0.85; }
  55% { transform: translateY(105px) translateX(6px); } 90% { opacity: 0.8; }
  100% { transform: translateY(195px) translateX(-4px); opacity: 0; } }
.biome-scene .p-ember i { bottom: -10px; background: #ffb24d; box-shadow: 0 0 6px 1px rgba(255,150,40,0.6); animation-name: bsEmberRise; }
@keyframes bsEmberRise { 0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; } 10% { opacity: 0.95; }
  50% { transform: translateY(-95px) translateX(-8px) scale(0.8); opacity: 0.75; }
  100% { transform: translateY(-190px) translateX(6px) scale(0.5); opacity: 0; } }
.biome-scene .p-twinkle i { background: #fff; animation-name: bsTwinkle; animation-timing-function: ease-in-out; }
@keyframes bsTwinkle { 0%, 100% { opacity: 0.15; transform: scale(0.6); } 50% { opacity: 0.95; transform: scale(1.15); } }
.biome-scene .p-glow i { background: #57e0c8; box-shadow: 0 0 6px 1px rgba(87,224,200,0.5);
  animation-name: bsTwinkle; animation-timing-function: ease-in-out; }
.biome-scene .p-sprinkle i { top: -14px; border-radius: 2px; width: calc(var(--ps) * 0.7); height: calc(var(--ps) * 2); animation-name: bsSprinkle; }
.biome-scene .p-sprinkle i:nth-child(4n+1) { background: #ff5f6d; }
.biome-scene .p-sprinkle i:nth-child(4n+2) { background: #57c7ff; }
.biome-scene .p-sprinkle i:nth-child(4n+3) { background: #ffce4a; }
.biome-scene .p-sprinkle i:nth-child(4n)   { background: #7ddb8a; }
@keyframes bsSprinkle { 0% { transform: translateY(0) rotate(0deg); opacity: 0; } 10% { opacity: 0.95; }
  90% { opacity: 0.9; } 100% { transform: translateY(195px) rotate(300deg); opacity: 0; } }
.biome-scene .p-pop i { background: #ffcf5a; box-shadow: 0 0 8px 2px rgba(255,150,40,0.5);
  animation-name: bsPop; animation-timing-function: ease-out; }
@keyframes bsPop { 0% { transform: scale(0.3); opacity: 0; } 30% { opacity: 0.9; transform: scale(0.8); }
  60% { transform: scale(1.15); opacity: 0.8; } 70% { transform: scale(1.35); opacity: 0; } 100% { opacity: 0; } }
/* per-scene particle tints */
.scene-kelp .p-fall i { background: #7fe08a; border-radius: 20% 70% 20% 70%; }
.scene-deep .p-fall i { background: rgba(207,230,255,0.6); }
.scene-sunset .p-twinkle i { background: #ffd9ec; }
.scene-sunset .p-rise i { background: rgba(255,255,255,0.5); box-shadow: none; }
.scene-candy .p-rise i { background: rgba(255,255,255,0.9); box-shadow: none; }
.scene-arctic .p-fall i { box-shadow: 0 0 4px rgba(255,255,255,0.8); }
.scene-galaxy .p-twinkle i { box-shadow: 0 0 5px 1px rgba(255,255,255,0.45); }

/* light fx layers */
.biome-scene .bs-light { position: absolute; pointer-events: none; }
/* drifting caustic ribbons near the surface (open / reef) */
.biome-scene .l-caustic { left: -10%; right: -10%; top: 6px; height: 34px; filter: blur(2px);
  background: linear-gradient(100deg, transparent 12%, rgba(255,255,255,0.30) 18%, transparent 24%,
    transparent 34%, rgba(255,255,255,0.22) 41%, transparent 47%,
    transparent 60%, rgba(255,255,255,0.26) 66%, transparent 72%,
    transparent 84%, rgba(255,255,255,0.2) 90%, transparent 96%);
  animation: bsDriftX 9s ease-in-out infinite alternate; }
.biome-scene .l-caustic.c2 { top: 36px; height: 22px; opacity: 0.5; animation-duration: 13s; animation-direction: alternate-reverse; }
@keyframes bsDriftX { from { transform: translateX(-26px); } to { transform: translateX(26px); } }
/* kelp god rays: static tilt (from --tilt), breathing opacity */
.biome-scene .l-ray { top: -12px; width: 68px; height: 130px; filter: blur(3px);
  background: linear-gradient(180deg, rgba(240,255,220,0.55), rgba(240,255,220,0));
  transform: rotate(var(--tilt, 9deg)); transform-origin: 50% 0;
  animation: bsBreathe 6.5s ease-in-out infinite; }
.biome-scene .l-ray.r2 { animation-delay: 2.2s; animation-duration: 8s; }
@keyframes bsBreathe { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.65; } }
/* sunset light bands on the water */
.biome-scene .l-band { left: -8%; right: -8%; height: 7px; border-radius: 4px; filter: blur(1px);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.32) 30%, rgba(255,255,255,0.12) 55%, transparent 85%);
  animation: bsDriftX 8s ease-in-out infinite alternate; }
.biome-scene .l-band.b2 { height: 5px; opacity: 0.7; animation-duration: 12s; animation-direction: alternate-reverse; }
/* deep-sea moonbeam: static tilt, breathing opacity */
.biome-scene .l-beam { top: -10px; width: 90px; height: 130px; filter: blur(5px);
  background: linear-gradient(180deg, rgba(120,190,255,0.3), transparent);
  transform: rotate(14deg); transform-origin: 50% 0;
  animation: bsBreathe 9s ease-in-out infinite; }
/* lava heat shimmer bands */
.biome-scene .l-heat { left: -10%; right: -10%; bottom: 52px; height: 26px; filter: blur(3px);
  background: linear-gradient(90deg, transparent, rgba(255,170,80,0.22) 25%, transparent 45%, rgba(255,170,80,0.18) 70%, transparent 92%);
  animation: bsDriftX 7s ease-in-out infinite alternate; }
.biome-scene .l-heat.h2 { bottom: 88px; opacity: 0.6; animation-duration: 10s; animation-direction: alternate-reverse; }
/* aurora ribbons */
.biome-scene .l-aurora { left: -6%; right: -6%; height: 26px; filter: blur(4px);
  background: linear-gradient(90deg, transparent, rgba(112,255,190,0.55) 18%, rgba(140,190,255,0.35) 42%, rgba(190,140,255,0.5) 68%, transparent);
  transform-origin: 50% 0; animation: bsAurora 12s ease-in-out infinite alternate; }
.biome-scene .l-aurora.a2 { animation-duration: 17s; animation-direction: alternate-reverse;
  background: linear-gradient(90deg, transparent, rgba(190,140,255,0.4) 25%, rgba(112,255,190,0.4) 60%, transparent); }
@keyframes bsAurora { 0% { transform: translateX(-30px) scaleY(1); opacity: 0.55; } 50% { opacity: 0.95; } 100% { transform: translateX(30px) scaleY(1.35); opacity: 0.7; } }
/* galaxy nebulae */
.biome-scene .l-nebula { width: 200px; height: 110px; border-radius: 50%; filter: blur(14px);
  background: radial-gradient(closest-side, rgba(255,106,200,0.35), transparent 70%);
  animation: bsNebula 26s ease-in-out infinite alternate; }
.biome-scene .l-nebula.n2 { animation-duration: 34s; animation-direction: alternate-reverse;
  background: radial-gradient(closest-side, rgba(87,224,255,0.28), transparent 70%); }
@keyframes bsNebula { from { transform: translate(-18px, -6px) scale(1); } to { transform: translate(18px, 8px) scale(1.15); } }

/* motif motion classes (applied to svg groups; transform-box keeps origins local) */
.biome-scene .m-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: bsSway 3.6s ease-in-out infinite; }
.biome-scene .m-pulse { transform-box: fill-box; transform-origin: center; animation: bsPulse 2.8s ease-in-out infinite; }
.biome-scene .m-squash { transform-box: fill-box; transform-origin: 50% 100%; animation: bsSquash 2.2s ease-in-out infinite; }
.biome-scene .m-glint { transform-box: fill-box; transform-origin: center; animation: bsGlintSweep 3.6s ease-in-out infinite; }
.biome-scene .m-glint.g2 { animation-delay: 1.2s; } .biome-scene .m-glint.g3 { animation-delay: 2.1s; }
.biome-scene .m-jelly { transform-box: fill-box; transform-origin: 50% 20%; animation: bsJellyPulse 2.6s ease-in-out infinite; }
.biome-scene .m-flap { transform-box: fill-box; transform-origin: center; animation: bsFlap 0.9s ease-in-out infinite; }
.biome-scene .m-crack { animation: bsCrackGlow 2.4s ease-in-out infinite; }
.biome-scene .m-crack.c2 { animation-delay: 1.1s; }
.biome-scene .m-spin { animation: bsSpin 16s linear infinite; }
.biome-scene .m-spin.sp2 { animation-duration: 22s; animation-direction: reverse; }
.biome-scene .m-spin.sp3 { animation-duration: 19s; }
.biome-scene .s2 { animation-delay: 0.7s; }
.biome-scene .s3 { animation-delay: 1.3s; }
.biome-scene .b2 { animation-delay: 1.8s; }
/* HTML-level bob (icebergs, planets) */
.biome-scene .bs-spr.m-bob, .biome-scene svg .m-bob { transform-box: fill-box; transform-origin: center; animation: bsBob 5.2s ease-in-out infinite; }
@keyframes bsSway { 0%, 100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }
@keyframes bsPulse { 0%, 100% { opacity: 0.45; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes bsSquash { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.07, 0.93); } }
@keyframes bsGlintSweep { 0%, 58%, 100% { opacity: 0; transform: translateX(-4px); } 72% { opacity: 0.9; } 84% { opacity: 0; transform: translateX(5px); } }
@keyframes bsJellyPulse { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(0.88, 1.1); } }
@keyframes bsFlap { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.55); } }
@keyframes bsCrackGlow { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.95; } }
@keyframes bsSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes bsBob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-4px) rotate(1.2deg); } }
/* anemone tentacles / seagrass rustle with staggered per-blade delays */
.biome-scene .s-anem { stroke: #7fe0c8; stroke-width: 2; fill: none; stroke-linecap: round; }
.biome-scene .s-anem path { transform-box: fill-box; transform-origin: 50% 100%; animation: bsSway 2.3s ease-in-out infinite; }
.biome-scene .s-anem path:nth-child(2) { animation-delay: 0.3s; }
.biome-scene .s-anem path:nth-child(3) { animation-delay: 0.55s; }
.biome-scene .s-anem path:nth-child(4) { animation-delay: 0.15s; }
.biome-scene .s-grassy path { transform-box: fill-box; transform-origin: 50% 100%; animation: bsGrassRustle 1.7s ease-in-out infinite; }
.biome-scene .s-grassy path:nth-child(2) { animation-delay: 0.2s; }
.biome-scene .s-grassy path:nth-child(3) { animation-delay: 0.4s; }
@keyframes bsGrassRustle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
/* volcano smoke puffs */
.biome-scene .m-plume circle { transform-box: fill-box; transform-origin: center; animation: bsPlume 2.6s ease-out infinite; }
.biome-scene .m-plume circle:nth-child(2) { animation-delay: 0.6s; }
.biome-scene .m-plume circle:nth-child(3) { animation-delay: 1.3s; }
.biome-scene .m-plume.p2 circle { animation-delay: 1s; }
.biome-scene .m-plume.p2 circle:nth-child(2) { animation-delay: 1.9s; }
@keyframes bsPlume { 0% { opacity: 0; transform: translateY(0) scale(0.5); } 25% { opacity: 0.75; } 100% { opacity: 0; transform: translateY(-26px) scale(1.6); } }
/* seabed bioluminescence / ice glints */
.biome-scene .f-glow circle { transform-box: fill-box; transform-origin: center; animation: bsPulse 3s ease-in-out infinite; }
.biome-scene .f-glow circle:nth-child(2) { animation-delay: 1s; }
.biome-scene .f-glow circle:nth-child(3) { animation-delay: 2s; }
/* moon orbit: dims + shrinks on the far half so it reads as passing behind the planet */
.biome-scene .m-moon { transform-box: fill-box; transform-origin: center; animation: bsMoonOrbit 9s linear infinite; }
@keyframes bsMoonOrbit {
  0%   { transform: translate(24px, 6px) scale(1); opacity: 1; }
  25%  { transform: translate(0, 13px) scale(1.12); opacity: 1; }
  50%  { transform: translate(-24px, 6px) scale(1); opacity: 1; }
  62%  { transform: translate(-15px, 0) scale(0.88); opacity: 0.35; }
  75%  { transform: translate(0, -4px) scale(0.8); opacity: 0.3; }
  88%  { transform: translate(16px, 1px) scale(0.9); opacity: 0.4; }
  100% { transform: translate(24px, 6px) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .biome-scene * { animation: none !important; }
  .biome-scene .bs-lane, .biome-scene .bs-riser, .biome-scene .bs-parts { display: none; }
}
/* background swatch in the shop grid */
.shop-thumb .bg-swatch { position: relative; width: 50px; height: 40px; border-radius: 10px; overflow: hidden; border: 2px solid rgba(0,0,0,0.12); box-shadow: inset 0 -3px 5px rgba(0,0,0,0.12); }
.shop-thumb .bg-none-x { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: #f1f1f1; color: #b9b9b9; font-size: 18px; }
/* new animated extras */
.x-hearts { animation: xFloat 2.6s ease-in-out infinite; transform-origin: center; }
.x-notes  { animation: xFloat 2.2s ease-in-out infinite; transform-origin: center; }
@keyframes xFloat { 0%,100% { transform: translateY(0); opacity: 0.85; } 50% { transform: translateY(-3px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .x-hearts, .x-notes { animation: none; } }

/* ---------- power-ups (consumables) ---------- */
.pu-list { display: flex; flex-direction: column; gap: 10px; }
.pu-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 14px; padding: 12px 14px; }
.pu-icon { font-size: 34px; flex: none; width: 44px; text-align: center; }
.pu-info { flex: 1 1 auto; min-width: 0; }
.pu-name { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--text); }
.pu-count { color: var(--duo-green-dark); font-size: 13px; }
.pu-desc { font-size: 11.5px; font-weight: 600; color: var(--text-dim); line-height: 1.3; margin-top: 2px; }
.pu-action { flex: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.pu-buy { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-display); font-weight: 800; font-size: 14px; color: #fff; background: var(--gold-dark); border: 2px solid var(--gold-deep); border-bottom-width: 4px; border-radius: 12px; padding: 8px 14px; cursor: pointer; transition: transform 0.1s ease; }
.pu-buy .ico { display: inline-flex; } .pu-buy .ico svg { width: 14px; height: 14px; }
.pu-buy.cant { background: var(--muted); border-color: #9a9a9a; }
.pu-buy.use { background: var(--duo-green); border-color: var(--duo-green-dark); }
.pu-buy:active { transform: translateY(2px); border-bottom-width: 2px; }
.pu-active { font-family: var(--font-display); font-weight: 800; font-size: 12.5px; color: var(--duo-green-dark); background: #f1ffe6; border: 2px solid #cdeab0; border-radius: 10px; padding: 6px 10px; }
.shop-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 16px 18px; }
.shop-cat { margin-bottom: 18px; }
/* In-flow section divider — purely decorative now; the always-visible category
   name lives in the separate `.shop-sticky-label` bar above the scroll area, so
   there's no CSS `position:sticky` here and no row can ever poke through it. */
.shop-cat-label {
  background: #fff; margin: 0 -16px 10px; padding: 10px 16px 7px;
  font-family: var(--font-display); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim);
  box-shadow: 0 1px 0 var(--gray-line); }
/* Fixed bar (sibling of the scroll area, not inside it) showing the category
   currently in view — no stacking/poke-through possible by construction. */
.shop-sticky-label { flex-shrink: 0; overflow: hidden;
  background: #fff; padding: 9px 16px 8px; max-height: 34px;
  font-family: var(--font-display); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim);
  box-shadow: 0 1px 0 var(--gray-line); position: relative; z-index: 5;
  transition: max-height 0.15s ease, padding 0.15s ease, box-shadow 0.15s ease; }
/* Collapsed while the first in-flow category label is still on screen, so its name
   never appears twice in a row (once here, once as the section divider below). */
.shop-sticky-label[data-hidden="1"] { max-height: 0; padding-top: 0; padding-bottom: 0; box-shadow: none; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.shop-card { background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 14px; padding: 12px 6px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; transition: transform 0.1s ease, border-color 0.15s ease; overflow: visible; }
.shop-card:hover { border-color: var(--duo-green); }
.shop-card:active { transform: translateY(2px); border-bottom-width: 2px; }
.shop-card.equipped { border-color: var(--duo-green); background: #f3ffe7; }
.shop-thumb { width: 100%; height: 52px; display: flex; align-items: flex-end; justify-content: center; overflow: visible; }
.shop-thumb .shop-thumb-fish { width: 62px; height: 46px; overflow: visible; }
.shop-thumb .swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.12); box-shadow: inset 0 -3px 5px rgba(0,0,0,0.15); }
.shop-thumb .swatch.rainbow { background: conic-gradient(from 0deg, #ff5f5f, #ffd25f, #7bff8a, #5fd0ff, #a25bff, #ff5fb0, #ff5f5f); }
.shop-name { font-size: 11px; font-weight: 800; color: var(--text); font-family: var(--font-display); text-align: center; line-height: 1.1; }
.shop-cta { font-size: 11px; font-weight: 800; }
.shop-price { display: inline-flex; align-items: center; gap: 3px; color: var(--gold-dark); }
.shop-price svg { width: 12px; height: 12px; }
.shop-price.cant { color: var(--muted); }
.shop-tag.eq { color: var(--duo-green-dark); }
.shop-tag.own { color: var(--text-dim); }

/* ---------- quiz reaction fish (happy celebrations + sad) ---------- */
.feedback-react { display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 16px 0 0; }
.feedback-react .feedback-banner { flex: 1; margin: 0; }
.react-fish { width: 58px; height: 44px; flex-shrink: 0; transform-origin: center bottom; }
.react-fish .fish-mascot { width: 100%; height: 100%; filter: drop-shadow(0 4px 5px rgba(0,0,0,0.22)); }
.react-fish.react-sad { animation: fishSad 0.9s cubic-bezier(0.22,1,0.36,1) both; }
.react-fish.react-sad .fish-mascot { filter: grayscale(0.5) drop-shadow(0 4px 5px rgba(0,0,0,0.18)); }
.react-fish.react-sad .fish-tear { animation: fishTearDrop 1.1s ease-in 0.3s infinite; }
.react-fish.cel-1 { animation: cel1 0.8s cubic-bezier(0.34,1.56,0.64,1) both; }
.react-fish.cel-2 { animation: cel2 0.85s ease both; }
.react-fish.cel-3 { animation: cel3 0.7s ease-in-out both; }
.react-fish.cel-4 { animation: cel4 0.9s cubic-bezier(0.34,1.56,0.64,1) both; }
.react-fish.cel-5 { animation: cel5 0.85s ease-out both; }
@keyframes fishSad { 0% { transform: translateY(-6px); } 60% { transform: translateY(4px) rotate(-4deg); } 100% { transform: translateY(3px) rotate(-5deg); opacity: 0.92; } }
@keyframes fishTearDrop { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(7px); } }
@keyframes cel1 { 0% { transform: scale(0.4) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.15) rotate(6deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes cel2 { 0% { transform: translateY(0); } 25% { transform: translateY(-22px) rotate(8deg); } 50% { transform: translateY(0) rotate(0); } 72% { transform: translateY(-12px) rotate(-6deg); } 100% { transform: translateY(0); } }
@keyframes cel3 { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-16deg); } 45% { transform: rotate(14deg); } 70% { transform: rotate(-9deg); } 88% { transform: rotate(5deg); } }
@keyframes cel4 { 0% { transform: translateY(0) rotate(0); } 45% { transform: translateY(-26px) rotate(180deg); } 75% { transform: translateY(-6px) rotate(330deg); } 100% { transform: translateY(0) rotate(360deg); } }
@keyframes cel5 { 0% { transform: scale(1); } 30% { transform: scale(1.28); } 48% { transform: scale(0.92); } 66% { transform: scale(1.14); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .react-fish.cel-1, .react-fish.cel-2, .react-fish.cel-3, .react-fish.cel-4, .react-fish.cel-5, .react-fish.react-sad { animation: none; }
}

/* ---------- test landing screen (fits the compact viewport, no scroll) ---------- */
.test-intro { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 24px 16px; text-align: center; gap: 7px; background: #fff; }
.test-intro .ti-emblem { width: 58px; height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; color: #fff; animation: badgeIn 0.5s cubic-bezier(0.34,1.56,0.64,1); flex-shrink: 0; }
.test-intro.section .ti-emblem { background: var(--dam-accent); box-shadow: 0 5px 0 var(--dam-deep); }
.test-intro.unit .ti-emblem { background: var(--gold); color: #5a3e00; box-shadow: 0 5px 0 var(--gold-deep); }
.test-intro .ti-emblem svg { width: 30px; height: 30px; }
.test-intro .ti-eyebrow { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-top: 2px; }
.test-intro .ti-title { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -0.5px; color: var(--text); }
.test-intro .ti-desc { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.45; max-width: 290px; }
.test-intro .ti-target { display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 4px 0 0; padding: 9px 28px; border-radius: 16px; background: #f7f7f7; border: 2px solid var(--gray-line); }
.test-intro .ti-num { font-family: var(--font-display); font-size: 32px; font-weight: 900; line-height: 1; color: var(--text); letter-spacing: -1px; }
.test-intro.section .ti-num { color: var(--dam-accent); }
.test-intro.unit .ti-num { color: var(--gold-dark); }
.test-intro .ti-num span { font-size: 18px; color: var(--muted); }
.test-intro .ti-lbl { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); }
.test-intro .ti-meta { display: flex; gap: 22px; margin: 3px 0 6px; }
.test-intro .ti-chip { display: flex; flex-direction: column; align-items: center; }
.test-intro .ti-chip-v { font-family: var(--font-display); font-size: 17px; font-weight: 900; color: var(--text); }
.test-intro .ti-chip-l { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-top: 2px; }
.test-intro .btn { max-width: 290px; padding: 13px; }
.test-intro .btn-ghost { margin-top: 6px; }

/* ---------- shop two-step action ---------- */
.shop-action { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; min-height: 30px; }
.shop-hint { font-size: 12px; font-weight: 700; color: var(--text-dim); text-align: center; }
/* resting state of the action panel: the currently equipped loadout */
.shop-hint.eq-summary { display: flex; flex-direction: column; gap: 7px; align-items: stretch; width: 100%; }
.shop-hint.eq-summary > b { font-family: var(--font-display); font-weight: 800; font-size: 12.5px; color: var(--text); text-align: center; }
.shop-hint.eq-summary small { font-size: 10.5px; font-weight: 600; text-align: center; }
.eq-list { display: flex; flex-direction: column; gap: 4px; }
.eq-row { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; }
.eq-row .eq-cat { font-weight: 700; color: var(--text-dim); }
.eq-row .eq-name { font-family: var(--font-display); font-weight: 800; color: var(--text); text-align: right; }
.shop-sel-name { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--text); }

/* ---------- shop hero glass card (Shop screen ONLY — never the map) ---------- */
.shop-glass {
  position: relative; justify-content: center; padding: 14px 12px; border-radius: 18px;
  background: rgba(255,255,255,0.42);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(40,80,150,0.06), 0 10px 20px -8px rgba(40,80,150,0.28);
}
.shop-glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(155deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 40%);
}
.shop-glass .shop-sel-name, .shop-glass .shop-hint { position: relative; z-index: 1; }
.shop-glass .shop-commit { position: relative; z-index: 1; }
.shop-commit {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 150px; padding: 10px 18px; border-radius: 14px; cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 14px; letter-spacing: 0.3px;
  color: #fff; border: 2px solid transparent; border-bottom-width: 4px;
  background: var(--duo-green); border-color: var(--duo-green-dark);
  box-shadow: 0 4px 10px rgba(88,204,2,0.28); transition: transform 0.1s ease, border-width 0.1s ease, filter 0.12s ease;
}
.shop-commit:hover { filter: brightness(1.04); }
.shop-commit:active { transform: translateY(2px); border-bottom-width: 2px; }
.shop-commit .cta-label { display: block; line-height: 1.1; }
.shop-commit .cta-price { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; opacity: 0.92; }
.shop-commit .ico { display: inline-flex; }
.shop-commit .ico svg { width: 13px; height: 13px; }
.shop-commit.equip { background: var(--purple); border-color: var(--purple-dark); box-shadow: 0 4px 10px rgba(206,130,255,0.3); }
.shop-commit.cant { background: var(--gold-dark); border-color: var(--gold-deep); box-shadow: 0 4px 10px rgba(201,138,0,0.28); }
.shop-commit.done { background: #eef7e6; color: var(--duo-green-dark); border-color: #cdeab0; box-shadow: none; cursor: default; }
.shop-card.selected { border-color: var(--purple-dark); background: #f7f0ff; box-shadow: 0 0 0 2px rgba(165,96,232,0.18); }
.shop-pop { animation: shopPop 0.32s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes shopPop { 0% { transform: scale(0.82); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---------- shop / trophies sub-tabs (compact + light so the catalog stays open) ---------- */
.shop-subtabs { display: flex; gap: 7px; padding: 7px 16px 6px; background: #fff; flex-shrink: 0; }
.shop-subtab {
  flex: 1; padding: 6px 10px; border-radius: 9px; cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 12.5px;
  color: var(--text-dim); background: #f4f4f4; border: 1.5px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.shop-subtab:hover { color: var(--text); }
.shop-subtab.active { color: var(--duo-green-dark); background: #f3ffe7; border-color: var(--duo-green); }
.shop-subtab .subtab-count { font-size: 10px; font-weight: 800; color: var(--gold-dark); background: #fff6d8; padding: 1px 6px; border-radius: 8px; }

/* ---------- trophy case ---------- */
.trophy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.trophy-card {
  position: relative; background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px;
  border-radius: 14px; padding: 12px 10px 11px; display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 4px; overflow: hidden;
}
.trophy-card.earned { border-color: var(--gold); background: linear-gradient(180deg, #fffdf3 0%, #fff6d8 100%); }
.trophy-card.locked { filter: grayscale(0.9); opacity: 0.72; }
.trophy-icon { font-size: 30px; line-height: 1; margin-bottom: 2px; }
.trophy-card.earned .trophy-icon { animation: trophyPop 0.4s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes trophyPop { 0% { transform: scale(0.5); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.trophy-name { font-family: var(--font-display); font-weight: 800; font-size: 12.5px; color: var(--text); line-height: 1.15; }
.trophy-desc { font-size: 10.5px; font-weight: 600; color: var(--text-dim); line-height: 1.35; }
.trophy-tag { margin-top: 3px; font-family: var(--font-display); font-weight: 800; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--gold-deep); background: #fff; border: 1.5px solid var(--gold); border-radius: 8px; padding: 1px 8px; }

/* ---------- achievement toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 18px; z-index: 120; transform: translate(-50%, 16px);
  display: inline-flex; align-items: center; gap: 8px; max-width: 330px;
  padding: 10px 16px; border-radius: 13px; pointer-events: none;
  background: #23232a; color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,0.28);
  font-family: var(--font-display); font-weight: 800; font-size: 12.5px; line-height: 1.25;
  opacity: 0; transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .toast-ico { font-size: 16px; }
@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity 0.2s ease; transform: translate(-50%, 0); }
  .trophy-card.earned .trophy-icon { animation: none; }
}

/* ---------- streak loop, idle flip, idle bubble ---------- */
.react-fish.loop360 { animation: loop360 0.8s cubic-bezier(0.34,1.56,0.64,1) both !important; }
@keyframes loop360 { 0% { transform: rotate(0) scale(1); } 55% { transform: rotate(360deg) scale(1.18); } 100% { transform: rotate(360deg) scale(1); } }
.fish-mascot.idle-flip { animation: idleFlip 1.1s ease-in-out; }
@keyframes idleFlip { 0% { transform: rotate(0); } 30% { transform: translateY(-6px) rotate(-12deg); } 60% { transform: translateY(-3px) rotate(8deg); } 100% { transform: rotate(0); } }
.idle-bubble { position: fixed; width: 9px; height: 9px; border-radius: 50%; z-index: 80; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #fff, rgba(173,225,255,0.5)); border: 1px solid rgba(120,190,230,0.6);
  animation: idleBubble 1s ease-in forwards; }
@keyframes idleBubble { 0% { opacity: 0; transform: translateY(0) scale(0.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px) scale(1.1); } }

/* ---------- cross-tab swim transition (full-cover, slow hyperbolic) ---------- */
.swim-trans { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
/* opaque water panel that sweeps to fully cover the popup, holds, then recedes */
.swim-trans .st-cover {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(135deg, #6fc6ff 0%, #34a7f0 45%, #1f8fe0 100%);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.12);
}
.swim-trans .st-cover { opacity: 0; }
/* the water blends in to fully cover, holds while content swaps, then slowly blends out */
.swim-trans.to-right .st-cover, .swim-trans.to-left .st-cover { animation: coverFade 2s ease-in-out both; }
@keyframes coverFade { 0% { opacity: 0; } 22% { opacity: 1; } 50% { opacity: 1; } 100% { opacity: 0; } }
.swim-trans .st-fish { position: absolute; top: 42%; width: 92px; height: 66px; filter: drop-shadow(0 6px 8px rgba(0,0,0,0.28)); }
.swim-trans .st-fish .fish-mascot { width: 100%; height: 100%; }
.swim-trans.to-right .st-fish { left: -120px; animation: dashR 2s cubic-bezier(0.45,0,0.55,1) both; }
.swim-trans.to-left .st-fish { right: -120px; animation: dashL 2s cubic-bezier(0.45,0,0.55,1) both; }
@keyframes dashR { 0% { transform: translateX(0) scaleX(1); } 50% { transform: translateX(250px) scaleX(1.12) translateY(-6px); } 100% { transform: translateX(560px) scaleX(1.15); } }
@keyframes dashL { 0% { transform: translateX(0) scaleX(-1); } 50% { transform: translateX(-250px) scaleX(-1.12) translateY(-6px); } 100% { transform: translateX(-560px) scaleX(-1.15); } }
.swim-trans .st-bubble { position: absolute; width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, rgba(173,225,255,0.55)); border: 1px solid rgba(255,255,255,0.6); opacity: 0; }
.swim-trans.to-right .st-bubble { left: -12px; animation: bubR 1.9s ease-out both; animation-delay: calc(var(--i) * 0.07s); }
.swim-trans.to-left .st-bubble { right: -12px; animation: bubL 1.9s ease-out both; animation-delay: calc(var(--i) * 0.07s); }
@keyframes bubR { 0% { opacity: 0; transform: translateX(0) scale(0.5); } 30% { opacity: 0.85; } 100% { opacity: 0; transform: translateX(470px) scale(1.15); } }
@keyframes bubL { 0% { opacity: 0; transform: translateX(0) scale(0.5); } 30% { opacity: 0.85; } 100% { opacity: 0; transform: translateX(-470px) scale(1.15); } }

/* ---------- within-tab ring transition ---------- */
.ring-trans { position: absolute; inset: 0; z-index: 60; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.ring-trans .rt-ring { position: relative; width: 64px; height: 64px; animation: rtSpin 0.66s cubic-bezier(0.16,1,0.3,1); }
@keyframes rtSpin { from { transform: rotate(0); } to { transform: rotate(260deg); } }
.ring-trans .rt-dot { position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, rgba(173,225,255,0.6)); border: 1px solid rgba(120,190,230,0.5);
  transform: rotate(var(--a)) translateX(26px); animation: rtDot 0.66s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes rtDot { 0% { opacity: 0; transform: rotate(var(--a)) translateX(6px) scale(0.4); } 45% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(34px) scale(1.05); } }

/* ---------- dam-break flourish on a cleared section test ---------- */
.gw-art.dambreak { position: relative; overflow: hidden; }
.gw-art.dambreak .db-plank { position: absolute; left: 50%; top: 50%; width: 46px; height: 9px; border-radius: 3px; background: #8a5a30; }
.gw-art.dambreak .db-plank:nth-child(1) { animation: plankFly1 0.7s ease-in both; }
.gw-art.dambreak .db-plank:nth-child(2) { animation: plankFly2 0.7s ease-in both; }
.gw-art.dambreak .db-water { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, #6fc6ff, #2aa0ef); animation: damFlood 0.8s ease-out 0.15s both; }
@keyframes plankFly1 { 0% { transform: translate(-50%,-50%) rotate(0); opacity: 1; } 100% { transform: translate(-160%,-180%) rotate(-90deg); opacity: 0; } }
@keyframes plankFly2 { 0% { transform: translate(-50%,-50%) rotate(0); opacity: 1; } 100% { transform: translate(60%,-160%) rotate(70deg); opacity: 0; } }
@keyframes damFlood { 0% { height: 0; opacity: 0.85; } 60% { height: 100%; opacity: 0.5; } 100% { height: 100%; opacity: 0; } }

.comp-card.review .cc-icon { font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  .swim-trans .st-fish, .swim-trans .st-wipe, .swim-trans .st-bubble, .ring-trans .rt-ring, .ring-trans .rt-dot,
  .react-fish.loop360, .fish-mascot.idle-flip, .idle-bubble, .gw-art.dambreak .db-plank, .gw-art.dambreak .db-water { animation-duration: 0.01s !important; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #d6d6d6; border-radius: 6px; }
::-webkit-scrollbar-track { background: #f3f3f3; }

/* ================= ACCOUNTS, CLASSES & TEACHER DASHBOARD ================= */
.acct-scroll { background: #fff; padding: 16px 16px 26px; }

/* small utility button used inside settings rows */
.btn-mini { width: auto; flex: none; padding: 9px 16px; font-size: 12px; border-radius: 11px; background: var(--duo-green); border: 2px solid var(--duo-green-dark); border-bottom-width: 4px; color: #fff; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; cursor: pointer; transition: transform 0.1s ease, border-width 0.1s ease, filter 0.12s ease; }
.btn-mini:hover { filter: brightness(1.04); }
.btn-mini:active { transform: translateY(2px); border-bottom-width: 2px; }
.btn-mini.danger { background: #fff; border-color: #ffd2d2; color: var(--red); }
.set-card.danger { border-color: #ffd2d2; }

/* ---------- auth screen ---------- */
.auth-screen { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 12px 26px 24px; background: #fff; text-align: center; }
.auth-head { width: 100%; display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 2px; }
.auth-head .quiz-close { position: absolute; left: -8px; top: 2px; }
.landing-logo.sm { font-size: 22px; gap: 8px; }
.auth-fish { width: 92px; height: 76px; margin: 10px 0 4px; }
.auth-fish svg { width: 100%; height: 100%; }
.role-tabs { display: flex; gap: 6px; background: #f3f3f3; border-radius: 14px; padding: 5px; margin: 8px 0 4px; }
.role-tab { flex: 1 1 auto; border: 2px solid transparent; border-radius: 10px; background: transparent; padding: 8px 10px; font-family: var(--font-display); font-weight: 800; font-size: 12.5px; color: var(--text-dim); cursor: pointer; transition: transform 0.1s ease; white-space: nowrap; }
.role-tab:hover { color: var(--text); }
.role-tab:active { transform: scale(0.97); }
.role-tab.active { background: #fff; border-color: var(--duo-green); color: var(--duo-green-dark); box-shadow: 0 2px 0 rgba(70,163,2,0.25); }
.auth-title { font-size: 21px; font-weight: 900; margin: 8px 0 2px; color: var(--text); }
.auth-sub { font-size: 12.5px; font-weight: 600; color: var(--text-dim); line-height: 1.5; margin: 0 0 12px; }
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.finput { width: 100%; padding: 13px 14px; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 14px; font-family: var(--font-body); font-weight: 700; font-size: 14px; color: var(--text); background: #fff; outline: none; transition: border-color 0.12s ease; }
.finput::placeholder { color: var(--muted); font-weight: 600; }
.finput:focus-visible { border-color: var(--duo-green); }
.finput.code { text-transform: uppercase; letter-spacing: 6px; font-family: var(--font-display); font-weight: 800; font-size: 17px; text-align: center; }
.auth-error { min-height: 16px; font-size: 12px; font-weight: 700; color: var(--red); text-align: center; }
.auth-error.shown { padding: 10px 0; }
.auth-switch { border: none; background: none; margin-top: 12px; font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--text-dim); cursor: pointer; padding: 8px; border-radius: 8px; }
.auth-switch b { color: var(--ocean-dark); }
.auth-switch:hover b { text-decoration: underline; }
.auth-switch:focus-visible, .role-tab:focus-visible, .btn-mini:focus-visible { outline: 2.5px solid var(--ocean); outline-offset: 2px; }
.demo-banner { margin-top: 12px; width: 100%; background: #fff8e1; border: 2px dashed var(--gold-dark); border-radius: 12px; padding: 9px 12px; font-size: 11.5px; font-weight: 600; color: #7a5b00; line-height: 1.45; text-align: center; }
.demo-banner code { font-size: 11px; background: #fff; border-radius: 5px; padding: 1px 4px; }

/* ---------- account hub ---------- */
.acct-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #eaf9ff, #f2fbe8); border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.acct-fish { flex: none; width: 76px; height: 64px; }
.acct-fish svg { width: 100%; height: 100%; }
.acct-who { min-width: 0; text-align: left; }
.acct-name { font-family: var(--font-display); font-weight: 900; font-size: 19px; color: var(--text); line-height: 1.15; }
.acct-email { font-size: 11.5px; font-weight: 600; color: var(--text-dim); margin: 1px 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip { display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 11px; padding: 4px 10px; border-radius: 999px; }
.role-chip.student { background: #e2f4ff; color: var(--ocean-deep); }
.role-chip.teacher { background: #ffe9e0; color: #b04a2b; }
.role-chip.individual { background: #f2e8ff; color: #7d3fd4; }
.acct-stats, .class-stats { display: flex; gap: 8px; margin-bottom: 12px; }
.acct-stat { flex: 1 1 0; background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 14px; padding: 10px 6px; text-align: center; }
.as-v { font-family: var(--font-display); font-weight: 900; font-size: 16px; color: var(--text); display: flex; align-items: center; justify-content: center; gap: 3px; }
.as-dim { color: var(--muted); font-size: 12px; font-weight: 800; }
.as-l { font-size: 10px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-dim); margin-top: 2px; }
.acct-class-cta { width: 100%; display: flex; align-items: center; gap: 12px; background: #fff; border: 2px solid var(--duo-green); border-bottom-width: 4px; border-radius: 16px; padding: 14px; margin-bottom: 12px; cursor: pointer; text-align: left; transition: transform 0.1s ease, border-width 0.1s ease; }
.acct-class-cta:hover { background: #f6fff0; }
.acct-class-cta:active { transform: translateY(2px); border-bottom-width: 2px; }
.acct-class-cta:focus-visible { outline: 2.5px solid var(--ocean); outline-offset: 2px; }
.acc-ico { font-size: 24px; }
.acc-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.acc-txt b { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--text); }
.acc-txt small { font-size: 11.5px; font-weight: 600; color: var(--text-dim); }
.acc-arrow { font-size: 22px; font-weight: 800; color: var(--muted); }

/* student class card / join form */
.class-card { padding: 14px; }
.cc-head { font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.cc-name { font-family: var(--font-display); font-weight: 900; font-size: 17px; color: var(--text); }
.cc-teacher { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-top: 2px; }
.cc-leave { border: none; background: none; color: var(--red); font-weight: 700; font-size: 12px; cursor: pointer; padding: 8px 0 2px; font-family: var(--font-body); }
.cc-leave:hover { text-decoration: underline; }
.join-row { display: flex; gap: 8px; margin-top: 10px; }
.join-row .finput { flex: 1 1 auto; min-width: 0; }
.join-btn { width: auto; flex: none; padding: 12px 18px; font-size: 13px; }

/* ---------- teacher dashboard ---------- */
.dash-who { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 2px solid var(--gray-line); }
.dash-who-name { font-family: var(--font-display); font-weight: 900; font-size: 16px; color: var(--text); line-height: 1.2; }
.dash-who-email { font-size: 11.5px; font-weight: 600; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-signout { flex: none; width: auto; margin-top: 0; padding: 9px 14px; font-size: 12px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.dash-head .settings-title { margin-bottom: 0; }
.dash-new { width: auto; flex: none; padding: 10px 14px; font-size: 12px; }
.dash-loading { text-align: center; color: var(--text-dim); font-weight: 700; font-size: 13px; padding: 26px 0; }
.dash-empty { text-align: center; padding: 22px 18px; background: #fafafa; border: 2px dashed var(--gray-line2); border-radius: 16px; margin-top: 10px; }
.dash-empty-fish { width: 84px; height: 70px; margin: 0 auto 6px; }
.dash-empty-fish svg { width: 100%; height: 100%; }
.dash-empty-title { font-family: var(--font-display); font-weight: 900; font-size: 16px; color: var(--text); }
.dash-empty-sub { font-size: 12px; font-weight: 600; color: var(--text-dim); line-height: 1.5; margin-top: 4px; }
.new-class-form { margin-top: 10px; }
.class-row { width: 100%; display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 16px; padding: 13px 14px; margin-top: 10px; cursor: pointer; text-align: left; transition: transform 0.1s ease, border-width 0.1s ease; }
.class-row:hover { border-color: var(--duo-green); }
.class-row:active { transform: translateY(2px); border-bottom-width: 2px; }
.class-row:focus-visible { outline: 2.5px solid var(--ocean); outline-offset: 2px; }
.cr-main { flex: 1 1 auto; min-width: 0; }
.cr-name { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-sub { font-size: 11.5px; font-weight: 600; color: var(--text-dim); margin-top: 1px; }
.code-chip { flex: none; font-family: var(--font-display); font-weight: 800; font-size: 12px; letter-spacing: 1.5px; background: #eef7ff; border: 1.5px solid #cfe8fb; color: var(--ocean-deep); border-radius: 8px; padding: 5px 8px; }

/* class detail */
.dash-back { border: none; background: none; font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--text-dim); cursor: pointer; padding: 2px 0 10px; }
.dash-back:hover { color: var(--text); }
.class-hero { text-align: center; background: linear-gradient(160deg, var(--ocean), var(--ocean-deep)); border-radius: 18px; padding: 16px 14px 14px; margin-bottom: 12px; box-shadow: 0 6px 14px rgba(13,102,153,0.28); }
.ch-name { font-family: var(--font-display); font-weight: 900; font-size: 17px; color: #fff; }
.ch-code-label { font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,0.75); margin: 10px 0 6px; }
.ch-code { display: flex; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; width: 100%; padding: 0; }
.ch-code span { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 44px; background: #fff; border-radius: 9px; font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--ocean-deep); box-shadow: 0 3px 0 rgba(0,0,0,0.18); transition: transform 0.1s ease; }
.ch-code:hover span { transform: translateY(-1px); }
.ch-code:active span { transform: translateY(1px); }
.ch-code:focus-visible span { outline: 2.5px solid #fff; outline-offset: 1px; }
.ch-hint { font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,0.85); margin-top: 8px; }

/* roster */
.roster { display: flex; flex-direction: column; gap: 8px; }
.roster-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 14px; padding: 10px 12px; }
.rr-rank { flex: none; width: 22px; text-align: center; font-family: var(--font-display); font-weight: 900; font-size: 13px; color: var(--muted); }
.rr-rank.top { color: var(--gold-dark); }
.rr-fish { flex: none; width: 42px; height: 34px; }
.rr-fish svg { width: 100%; height: 100%; }
.rr-main { flex: 1 1 auto; min-width: 0; }
.rr-name { font-family: var(--font-display); font-weight: 800; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-bar { height: 7px; background: #efefef; border-radius: 5px; margin: 4px 0 3px; overflow: hidden; }
.rr-bar-fill { height: 100%; background: linear-gradient(90deg, var(--duo-green), #89e219); border-radius: 5px; }
.rr-sub { font-size: 10.5px; font-weight: 600; color: var(--text-dim); }
.rr-side { flex: none; text-align: right; }
.rr-streak { display: flex; align-items: center; justify-content: flex-end; gap: 2px; font-family: var(--font-display); font-weight: 900; font-size: 13px; color: var(--text); }
.rr-active { font-size: 10px; font-weight: 700; color: var(--muted); margin-top: 2px; }

/* ==========================================================================
   LIVING BACKGROUNDS — ambient particle layers (transform/opacity only).
   .fish-bg-fx  = over the equipped-scene photo (shop preview / landing).
   .path-weather = full-height veil over the lesson path.
   Families: rise (bubbles), fall (snow/petals), twinkle (stars/sparks),
   ember (lava sparks), leaf (forest drift).
   ========================================================================== */
.fish-bg-fx, .path-weather { position: absolute; inset: 0; pointer-events: none; }
.path-weather { z-index: 3; }
.fish-bg-fx i, .path-weather i {
  position: absolute; display: block;
  width: var(--fxs, 4px); height: var(--fxs, 4px);
  border-radius: 50%; opacity: 0;
  animation: fxRise var(--fxt, 5s) linear var(--fxd, 0s) infinite;
}

/* bubbles: glassy dot with a highlight rim */
.fx-rise i, .pw-rise i {
  background: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.95), rgba(255,255,255,0.28) 55%, rgba(255,255,255,0.05) 72%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
  animation-name: fxRise;
}
@keyframes fxRise {
  0%   { opacity: 0; transform: translateY(26px) translateX(0); }
  14%  { opacity: 0.85; }
  55%  { transform: translateY(-8px) translateX(3px); }
  86%  { opacity: 0.55; }
  100% { opacity: 0; transform: translateY(-40px) translateX(-2px); }
}

/* falling snow / petals */
.fx-fall i, .pw-fall i { background: rgba(255,255,255,0.92); animation-name: fxFall; }
.fx-candy i, .pw-candy i { background: #ffd2e6; box-shadow: 0 0 0 1px rgba(255,255,255,0.5) inset; border-radius: 40% 60% 55% 45%; }
@keyframes fxFall {
  0%   { opacity: 0; transform: translateY(-24px) translateX(0) rotate(0deg); }
  12%  { opacity: 0.9; }
  55%  { transform: translateY(10px) translateX(6px) rotate(120deg); }
  88%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(42px) translateX(-4px) rotate(200deg); }
}

/* twinkle: stars / crystal sparks / sunset shimmer */
.fx-twinkle i, .pw-twinkle i { animation-name: fxTwinkle; background: #fff; }
.fx-galaxy i, .pw-galaxy i { background: #ffe9b0; box-shadow: 0 0 6px 1px rgba(255,233,176,0.65); }
.fx-crystal i, .pw-crystal i { background: #e6ccff; box-shadow: 0 0 6px 1px rgba(202,166,255,0.7); }
.fx-sunset i, .pw-sunset i { background: #ffd9a0; box-shadow: 0 0 6px 1px rgba(255,190,120,0.6); }
@keyframes fxTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50%      { opacity: 0.95; transform: scale(1.15); }
}

/* embers: hot sparks that rise fast and gutter out */
.fx-ember i, .pw-ember i {
  background: radial-gradient(circle, #ffd23f 0%, #ff8a1a 55%, rgba(255,90,10,0.25) 80%);
  box-shadow: 0 0 7px 2px rgba(255,138,26,0.55);
  animation-name: fxEmber;
}
@keyframes fxEmber {
  0%   { opacity: 0; transform: translateY(20px) translateX(0) scale(0.7); }
  18%  { opacity: 1; }
  60%  { opacity: 0.8; transform: translateY(-14px) translateX(4px) scale(1); }
  100% { opacity: 0; transform: translateY(-38px) translateX(-3px) scale(0.5); }
}

/* forest leaves: soft green flecks that drift down-stream */
.pw-leaf i {
  background: linear-gradient(135deg, #8fce4e, #5da630);
  border-radius: 62% 38% 55% 45%;
  width: calc(var(--fxs, 4px) + 2px); height: var(--fxs, 4px);
  animation-name: fxLeaf;
}
@keyframes fxLeaf {
  0%   { opacity: 0; transform: translateY(-18px) translateX(0) rotate(0deg); }
  15%  { opacity: 0.75; }
  55%  { transform: translateY(14px) translateX(10px) rotate(140deg); }
  88%  { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(44px) translateX(2px) rotate(220deg); }
}

/* deep-sea motes glow cyan; kelp bubbles pick up a green cast */
.fx-deep i, .pw-deep i { box-shadow: 0 0 7px 2px rgba(127,233,255,0.5), inset 0 0 0 1px rgba(210,250,255,0.5); }
.fx-kelp i, .pw-kelp i { box-shadow: inset 0 0 0 1px rgba(210,255,225,0.45); }

/* tiny shop swatches: no particles, no drift — just the still photo */
.bg-swatch .fish-bg-fx { display: none; }
.bg-swatch .fish-bg-img { animation: none; inset: 0; }

@media (prefers-reduced-motion: reduce) {
  .fish-bg .fish-bg-img, .fish-bg-fx i, .path-weather i { animation: none !important; }
  .fish-bg-fx i, .path-weather i { opacity: 0.45; }
}

/* ==========================================================================
   v1.3 — INDIVIDUAL ACCOUNTS, ASSIGNMENTS, TEACHER DASHBOARD, TEACH CARDS
   ========================================================================== */

/* ---------- landing: the one-question start ---------- */
.landing-q { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--text); margin: 14px 0 2px; }
.landing .mode-card { position: relative; }
.landing .mc-arrow { margin-left: auto; font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--muted); flex: none; }
.landing-skip, .landing-login {
  background: none; border: none; cursor: pointer; font-family: var(--font-body, inherit);
  font-size: 12.5px; font-weight: 600; color: var(--text-dim); padding: 6px 10px; border-radius: 10px;
}
.landing-skip { margin-top: 12px; }
.landing-skip.explore { margin-top: 0; }

/* ---------- weekly recap (individual accounts, welcome-back screen) ---------- */
.week-recap { width: 100%; background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 16px; padding: 12px 14px 11px; margin-bottom: 12px; text-align: left; }
.wr-head { font-family: var(--font-display); font-weight: 800; font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-dim); }
.wr-stats { display: flex; gap: 8px; margin: 9px 0 8px; }
.wr-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; background: #f5f9fb; border-radius: 12px; padding: 8px 4px 7px; }
.wr-stat b { font-family: var(--font-display); font-weight: 900; font-size: 17px; color: var(--text); }
.wr-stat span { font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.wr-note { font-size: 11.5px; font-weight: 700; color: var(--text-dim); }

/* one-off CTA inside an empty state (e.g. "Enter a class code") */
.dash-empty-cta { width: auto; margin: 14px auto 0; padding: 12px 22px; display: inline-block; }
.landing-skip b, .landing-login b { color: var(--ocean-dark, #0f7ab5); font-weight: 800; }
.landing-skip:hover, .landing-login:hover { background: #eef7fc; }
.landing-skip:focus-visible, .landing-login:focus-visible { outline: 3px solid var(--ocean); outline-offset: 2px; }
.landing-skip:active, .landing-login:active { transform: scale(0.98); }

/* ---------- compact mistakes chip on the Learn path ---------- */
.mistake-chip {
  display: inline-flex; align-items: center; gap: 7px; width: fit-content;
  margin: 10px 14px 0; padding: 6px 12px 6px 10px; cursor: pointer;
  background: #f6efff; border: 2px solid #ddc7f8; border-bottom-width: 3px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 800; font-size: 12px; color: #5b2ea6;
  transition: transform 0.12s ease;
}
.mistake-chip:hover { transform: translateY(-1px); }
.mistake-chip:active { transform: scale(0.96); }
.mistake-chip:focus-visible { outline: 3px solid var(--purple, #a560f0); outline-offset: 2px; }
.mistake-chip svg { flex: none; }
.mistake-chip .mc-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; background: #7d3fd4; color: #fff; font-size: 11px; }

/* ---------- teach cards (library lesson intro) ---------- */
.teach-screen { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #fff; }
.teach-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 18px 16px; display: flex; flex-direction: column; }
/* auto margins center the teach group on tall screens, collapse to 0 when it overflows */
.teach-body .teach-eyebrow { margin-top: auto; }
.teach-body .teach-dots { margin-bottom: auto; }
.teach-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 800; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--topic, var(--duo-green)); }
.teach-eyebrow .te-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--topic, var(--duo-green)); }
.teach-lesson-title { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; color: var(--text); margin: 6px 0 12px; }
.teach-card {
  position: relative; border-radius: 18px; padding: 18px 18px 16px;
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--topic, #58cc02) 9%, #fff), #fff 60%);
  border: 2px solid color-mix(in srgb, var(--topic, #58cc02) 30%, #e8e8e8);
  border-bottom-width: 4px;
  box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--topic, #58cc02) 55%, transparent);
}
.teach-card .tc-step { font-family: var(--font-display); font-weight: 800; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: color-mix(in srgb, var(--topic, #58cc02) 80%, #333); margin-bottom: 6px; }
.teach-card .tc-h { font-family: var(--font-display); font-weight: 800; font-size: 17.5px; line-height: 1.25; letter-spacing: -0.01em; color: var(--text); margin: 0 0 8px; }
.teach-card .tc-t { font-size: 13.5px; line-height: 1.7; color: #4b4b4b; margin: 0 0 12px; }
.teach-card .tc-ex {
  display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; line-height: 1.6; color: #3d5245;
  background: color-mix(in srgb, var(--topic, #58cc02) 7%, #f7faf7);
  border-left: 4px solid color-mix(in srgb, var(--topic, #58cc02) 55%, #fff);
  border-radius: 0 10px 10px 0; padding: 9px 12px;
}
.teach-card .tc-ex-label { font-family: var(--font-display); font-weight: 800; font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: color-mix(in srgb, var(--topic, #58cc02) 75%, #333); }
.teach-dots { display: flex; justify-content: center; gap: 7px; margin-top: 16px; }
.teach-dots span { width: 8px; height: 8px; border-radius: 50%; background: #e3e3e3; transition: transform 0.2s ease, opacity 0.2s ease; }
.teach-dots span.on { background: var(--topic, var(--duo-green)); transform: scale(1.35); }
.teach-dots span.done { background: color-mix(in srgb, var(--topic, #58cc02) 45%, #ddd); }
.teach-footer { gap: 10px; }
.quiz-bar-fill.teach { background: var(--topic, var(--duo-green)); }
.screen-enter .teach-card { animation: teachIn 0.4s cubic-bezier(0.34, 1.4, 0.64, 1); }
@keyframes teachIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen-enter .teach-card { animation: none; } }

/* ---------- kind chips (shared: teacher rows + student rows) ---------- */
.kind-chip {
  flex: none; display: inline-flex; align-items: center; font-family: var(--font-display);
  font-weight: 800; font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 7px; color: #fff; background: var(--duo-green);
}
.kind-chip.test { background: #6b7f92; }
.kind-chip.lesson { background: var(--ocean); }

/* ---------- class page tabs ---------- */
.class-tabs { display: flex; gap: 6px; margin: 14px 0 12px; background: #f2f2f2; border-radius: 14px; padding: 4px; }
.class-tab {
  flex: 1; border: none; background: none; cursor: pointer; padding: 9px 4px; border-radius: 11px;
  font-family: var(--font-display); font-weight: 800; font-size: 12.5px; color: var(--text-dim);
  transition: color 0.12s ease;
}
.class-tab:hover { color: var(--text); }
.class-tab:focus-visible { outline: 3px solid var(--ocean); outline-offset: 1px; }
.class-tab:active { transform: scale(0.98); }
.class-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

/* ---------- teacher assignments tab ---------- */
.assign-new { width: 100%; margin-bottom: 12px; }
.assign-list { display: flex; flex-direction: column; gap: 10px; }
.assign-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px;
  background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 14px; padding: 12px 12px 10px;
}
.assign-row .ar-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.assign-row .ar-title { font-family: var(--font-display); font-weight: 800; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-row .ar-bar { height: 7px; background: #efefef; border-radius: 5px; margin: 7px 0 4px; overflow: hidden; }
.assign-row .ar-bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--duo-green), #89e219); }
.assign-row .ar-sub { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.ar-actions { display: flex; flex-direction: column; gap: 6px; }
.ar-btn {
  border: 2px solid var(--gray-line); background: #fff; cursor: pointer; border-radius: 9px;
  font-family: var(--font-display); font-weight: 800; font-size: 11px; color: var(--text-dim); padding: 5px 10px;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.ar-btn:hover { color: var(--text); border-color: #c9c9c9; }
.ar-btn:focus-visible { outline: 3px solid var(--ocean); outline-offset: 1px; }
.ar-btn:active { transform: scale(0.96); }
.ar-btn.ar-del:hover { color: #d33; border-color: #f0b9b9; }
.ar-detail { grid-column: 1 / -1; border-top: 2px dashed var(--gray-line); margin-top: 8px; padding-top: 8px; }
.ad-row { display: flex; align-items: center; gap: 9px; padding: 4px 2px; font-size: 12.5px; color: var(--text-dim); }
.ad-row .ad-check { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #eee; color: #aaa; font-weight: 800; font-size: 11px; }
.ad-row.done .ad-check { background: #d7f5c0; color: var(--duo-green-dark, #46a302); }
.ad-row .ad-name { flex: 1; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-row .ad-score { font-family: var(--font-display); font-weight: 800; font-size: 12px; }
.ad-row.done .ad-score { color: var(--duo-green-dark, #46a302); }

/* ---------- insights tab ---------- */
.ins-note { font-size: 12.5px; line-height: 1.6; color: var(--text-dim); margin-bottom: 12px; }
.ins-list { display: flex; flex-direction: column; gap: 10px; }
.ins-row { background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 14px; padding: 12px 14px; }
.ins-row.weak { border-color: #f2c1c1; background: #fffafa; }
.ins-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ins-title { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--text); }
.ins-pct { font-family: var(--font-display); font-weight: 900; font-size: 15px; color: var(--text); }
.ins-bar { height: 9px; background: #efefef; border-radius: 6px; margin: 8px 0 5px; overflow: hidden; }
.ins-bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--duo-green), #89e219); }
.ins-bar-fill.mid { background: linear-gradient(90deg, #ffc800, #ffdd57); }
.ins-bar-fill.low { background: linear-gradient(90deg, #ff6b6b, #ff9a8a); }
.ins-sub { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.ins-sub b { color: #c0392b; }
.ins-boost {
  margin-top: 9px; width: 100%; text-align: left; cursor: pointer;
  border: 2px solid #f2c1c1; background: #fff; border-radius: 10px; padding: 8px 12px;
  font-family: var(--font-display); font-weight: 800; font-size: 12px; color: #c0392b;
  transition: transform 0.12s ease;
}
.ins-boost:hover { transform: translateY(-1px); }
.ins-boost:focus-visible { outline: 3px solid var(--ocean); outline-offset: 1px; }
.ins-boost:active { transform: scale(0.98); }

/* ---------- assign picker ---------- */
.pick-sub { font-size: 12.5px; line-height: 1.65; color: var(--text-dim); margin: 4px 0 14px; }
.pick-topic { border: 2px solid color-mix(in srgb, var(--topic, #888) 28%, #eee); border-radius: 16px; padding: 12px; margin-bottom: 14px; background: #fff; }
.pick-topic.focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--topic, #888) 35%, transparent); }
.pt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pt-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--topic, #888); }
.pt-title { font-family: var(--font-display); font-weight: 800; font-size: 14.5px; color: var(--text); }
.pt-blurb { font-size: 11.5px; font-weight: 600; color: var(--text-dim); }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 2px dashed #f0f0f0; }
.pk-main { flex: 1; min-width: 0; text-align: left; background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 10px; }
.pk-main:hover { background: color-mix(in srgb, var(--topic, #888) 7%, #fff); }
.pk-main:focus-visible { outline: 3px solid var(--ocean); outline-offset: 1px; }
.pk-main.static { cursor: default; }
.pk-main.static:hover { background: none; }
.pk-title { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--text); }
.pk-blurb { font-size: 11.5px; line-height: 1.5; color: var(--text-dim); margin: 2px 0; }
.pk-meta { font-size: 10.5px; font-weight: 700; color: color-mix(in srgb, var(--topic, #888) 80%, #555); }
.pk-assign {
  flex: none; cursor: pointer; border: none; border-radius: 11px; padding: 9px 14px;
  font-family: var(--font-display); font-weight: 800; font-size: 12px; color: #fff;
  background: var(--duo-green); box-shadow: 0 3px 0 var(--duo-green-dark, #46a302);
  transition: transform 0.12s ease;
}
.pk-assign:hover { transform: translateY(-1px); }
.pk-assign:focus-visible { outline: 3px solid var(--ocean); outline-offset: 2px; }
.pk-assign:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--duo-green-dark, #46a302); }
.pk-assign.done, .pk-assign:disabled { background: #eef7e6; color: var(--duo-green-dark, #46a302); box-shadow: none; cursor: default; transform: none; }

/* ---------- lesson preview ---------- */
.preview-scroll .teach-card { margin-bottom: 10px; }
.prev-hero { border-radius: 16px; padding: 16px; background: radial-gradient(130% 120% at 0% 0%, color-mix(in srgb, var(--topic, #58cc02) 12%, #fff), #fff 65%); border: 2px solid color-mix(in srgb, var(--topic, #58cc02) 30%, #e8e8e8); border-bottom-width: 4px; margin-bottom: 14px; }
.prev-hero .kind-chip { background: var(--topic, var(--duo-green)); }
.prev-title { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--text); margin: 8px 0 4px; }
.prev-blurb { font-size: 13px; line-height: 1.65; color: #4b4b4b; margin: 0 0 8px; }
.prev-meta { font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--topic, #58cc02) 75%, #444); }
.prev-label { font-family: var(--font-display); font-weight: 800; font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-dim); margin: 16px 0 8px; }
.prev-note { font-weight: 600; text-transform: none; letter-spacing: 0; font-family: var(--font-body, inherit); font-size: 11px; }
.prev-q { background: #fff; border: 2px solid var(--gray-line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.pq-prompt { font-weight: 800; font-size: 12.5px; color: var(--text); margin-bottom: 6px; }
.pq-opt { font-size: 12px; color: var(--text-dim); padding: 4px 8px; border-radius: 7px; }
.pq-opt.right { background: #e9f8db; color: var(--duo-green-dark, #46a302); font-weight: 800; }
.prev-assign { width: 100%; margin: 10px 0 16px; }

/* ---------- student assignments screen ---------- */
.asg-label { font-family: var(--font-display); font-weight: 800; font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-dim); margin: 14px 0 8px; }
.asg-label.done { margin-top: 20px; }
.stu-assign {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 14px;
  padding: 12px; margin-bottom: 8px;
}
.stu-assign.done { opacity: 0.75; }
.sa-main { flex: 1; min-width: 0; }
.sa-title { font-family: var(--font-display); font-weight: 800; font-size: 13.5px; color: var(--text); }
.sa-sub { font-size: 11.5px; font-weight: 600; color: var(--text-dim); margin-top: 1px; }
.sa-start { flex: none; padding: 9px 16px; font-size: 12.5px; width: auto; }
.sa-done { flex: none; font-family: var(--font-display); font-weight: 800; font-size: 12px; color: var(--duo-green-dark, #46a302); }
.acc-count { flex: none; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; background: #ff6b6b; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 12px; }
.rr-weak { color: #c0392b; font-weight: 700; }

/* ==========================================================================
   v1.3.1 — quiz builder, grading + feedback, student pages, student view
   ========================================================================== */

/* class hero: student-view button */
.ch-preview {
  margin-top: 10px; cursor: pointer; border: 2px solid rgba(255,255,255,0.55); background: rgba(255,255,255,0.14);
  color: #fff; border-radius: 999px; padding: 7px 16px;
  font-family: var(--font-display); font-weight: 800; font-size: 12px;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.ch-preview:hover { background: rgba(255,255,255,0.26); transform: translateY(-1px); }
.ch-preview:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ch-preview:active { transform: scale(0.97); }

/* persistent "student view" reminder — injected as #app's first child on every
   screen for the whole preview session (see injectPreviewBanner in popup.js), so a
   teacher previewing a lesson/quiz always has a reminder + a way out. flex:none
   keeps it its natural height; the screen block below (flex:1 1 auto) shrinks to fit. */
.sv-badge {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  flex: none; background: #fff7df; border-bottom: 2px dashed #ecc94b;
  padding: 8px 12px; font-size: 11.5px; font-weight: 600; color: #7a5b00; line-height: 1.35;
}
.sv-badge b { font-weight: 800; }
.sv-badge-exit {
  flex: none; cursor: pointer; border: none; background: #7a5b00; color: #fff; border-radius: 9px;
  font-family: var(--font-display); font-weight: 800; font-size: 11px; padding: 6px 12px; white-space: nowrap;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.sv-badge-exit:hover { background: #5e4600; }
.sv-badge-exit:focus-visible { outline: 3px solid var(--ocean); outline-offset: 2px; }
.sv-badge-exit:active { transform: scale(0.96); }

/* teacher assignment CTAs */
.assign-cta-row { display: flex; gap: 8px; margin-bottom: 12px; }
.assign-cta-row .assign-new { flex: 1; margin-bottom: 0; }
.btn.btn-ocean { background: var(--ocean); box-shadow: 0 4px 0 var(--ocean-dark, #1184c6); color: #fff; }
.btn.btn-ocean:active { box-shadow: 0 1px 0 var(--ocean-dark, #1184c6); }

/* quiz builder */
.qb-title { margin-bottom: 12px; font-weight: 800; }
.qb-q { background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.qb-q-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.qb-num { font-family: var(--font-display); font-weight: 900; font-size: 13px; color: var(--ocean-dark, #1184c6); }
.qb-prompt { margin-bottom: 8px; resize: vertical; }
.qb-opt { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.qb-opt input[type="radio"] { width: 19px; height: 19px; flex: none; accent-color: var(--duo-green); cursor: pointer; }
.qb-opt .qb-opt-text { flex: 1; }
.qb-hint { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.qb-add { width: 100%; margin-bottom: 10px; }
.qb-save { width: 100%; margin: 6px 0 18px; }

/* grading pane under a quiz assignment row */
.ad-row.gradable { cursor: pointer; border-radius: 8px; }
.ad-row.gradable:hover { background: #f6fbff; }
.ad-fb-flag { flex: none; font-size: 12px; color: var(--ocean-dark, #1184c6); }
.ad-grade { border-left: 3px solid var(--gray-line); margin: 2px 0 8px 8px; padding: 6px 0 2px 12px; }
.ga-q { padding: 6px 8px; border-radius: 8px; margin-bottom: 5px; background: #fafafa; }
.ga-q.right { background: #f4fbec; }
.ga-q.wrong { background: #fdf3f3; }
.ga-prompt { font-size: 12px; font-weight: 800; color: var(--text); }
.ga-picked { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.ga-q.right .ga-picked { color: var(--duo-green-dark, #46a302); }
.ga-q.wrong .ga-picked { color: #c0392b; }
.ga-fb-status:empty { display: none; }
.ga-fb-sent {
  margin-top: 8px; font-size: 11.5px; font-weight: 800; color: var(--duo-green-dark, #46a302);
  background: #f2faf0; border-left: 3px solid var(--duo-green); border-radius: 0 8px 8px 0; padding: 5px 10px;
}
.ga-fb { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.ga-fb-text { flex: 1; resize: vertical; font-size: 12.5px; }
.ga-fb-save { flex: none; width: auto; padding: 9px 14px; font-size: 12px; }

/* student: feedback on assignment rows + quiz review */
.sa-feedback {
  margin-top: 6px; font-size: 12px; line-height: 1.55; color: #3d5245;
  background: #f2faf0; border-left: 3px solid var(--duo-green); border-radius: 0 8px 8px 0; padding: 6px 10px;
}
.sa-feedback.big { font-size: 13px; margin-top: 10px; }
.sa-fb-who { font-family: var(--font-display); font-weight: 800; color: var(--duo-green-dark, #46a302); }
.prev-q.missed { border-color: #f2c1c1; }
.pq-opt.mine-wrong { background: #fdecec; color: #c0392b; font-weight: 700; }
.pq-you { font-size: 10.5px; font-weight: 800; opacity: 0.8; }
.kind-chip.quiz { background: #8a5bd6; }

/* student performance page (teacher) */
.roster-row.clickable { width: 100%; text-align: left; cursor: pointer; font-family: inherit; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.roster-row.clickable:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(20, 60, 90, 0.35); }
.roster-row.clickable:focus-visible { outline: 3px solid var(--ocean); outline-offset: 2px; }
.roster-row.clickable:active { transform: scale(0.99); }
.rr-arrow { flex: none; font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--muted); }
.sd-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; }
.sd-fish { flex: none; width: 74px; height: 56px; }
.sd-fish svg { width: 100%; height: 100%; }
.sd-name { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; color: var(--text); }
.sd-sub { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.sd-review { background: #fff; border: 2px solid var(--gray-line); border-bottom-width: 4px; border-radius: 14px; padding: 12px 14px; margin: 12px 0 4px; }
.sd-review .prev-label { margin: 0 0 6px; }
.sd-review-text { font-size: 13px; line-height: 1.7; color: #4b4b4b; margin: 0 0 4px; }
.sd-review .ins-boost { margin-top: 8px; }
