/* Fluid Lab — game chrome. Sky ground, cream cards, cobalt slabs, one gold action per screen.
   Language borrowed from Cloud Bridge Racers: every control is an extruded slab that bottoms out on press. */

:root {
  --topbar-h: 68px;
  --sky: #73b8ff;
  --sky-deep: #075996;
  --blue: #0877c9;
  --blue-hi: #1e92d9;
  --blue-lo: #0876c5;
  --edge: #064782;
  --edge-2: #034a84;
  --rim: #bcefff;
  --rim-2: #d0f5ff;
  --gold: #ffda35;
  --gold-hi: #fff080;
  --gold-lo: #ffc12c;
  --gold-edge: #bb7518;
  --gold-rim: #fff3a2;
  --cream: #f6fcff;
  --cream-2: #fffbed;
  --ink: #073e72;
  --ink-2: #2d5b8a;
  --ink-3: #6f8fb0;
  --green: #50c66b;
  --green-edge: #2c8a44;
  --red: #ed4c47;
  --tray: #0b1024;
  --tray-paper: #fff9f0;
  --font-title: "Lilita One", "Rubik", "Fredoka", ui-rounded, system-ui, sans-serif;
  --font-body: "Nunito", "Rubik", ui-rounded, system-ui, sans-serif;
  --spring: cubic-bezier(.2, .8, .3, 1);
  --land: cubic-bezier(.22, .7, .32, 1);
}
[lang="he"] { --font-title: "Rubik", "Lilita One", system-ui, sans-serif; --font-body: "Rubik", "Nunito", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sky);
  background-image: linear-gradient(0deg, #07599670, transparent 60%), radial-gradient(900px 500px at 15% -10%, #ffffff55, transparent 60%);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-title); font-weight: 400; margin: 0; line-height: 1.05; text-wrap: balance; }
[lang="he"] h1, [lang="he"] h2, [lang="he"] h3 { font-weight: 900; }
p { margin: 0 0 10px; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--blue); font-weight: 900; }
:focus-visible { outline: 3px solid #fffced; box-shadow: 0 0 0 7px #0879cb; border-radius: 16px; }
::selection { background: var(--gold); color: var(--ink); }

/* ---------- slabs ---------- */
.slab, .ctl-btn, .seg button, .ctl-toggle, .nav-btn, .top-btn, .tab, .chapter-map button {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 18px; border-radius: 16px;
  border: 2px solid var(--rim);
  background: linear-gradient(var(--blue-hi), var(--blue-lo));
  color: var(--cream-2);
  font-family: var(--font-body); font-weight: 900; font-size: 16px;
  text-shadow: 0 1px 0 #05315b80;
  box-shadow: inset 0 2px 0 #63bbed, 0 5px 0 var(--edge), 0 9px 18px #00436d40;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  user-select: none; -webkit-user-select: none;
}
.slab:hover, .ctl-btn:hover, .seg button:hover, .ctl-toggle:hover, .nav-btn:hover, .top-btn:hover, .tab:hover, .chapter-map button:hover { transform: translateY(-2px); filter: brightness(1.06); }
.slab:active, .ctl-btn:active, .seg button:active, .ctl-toggle:active, .nav-btn:active, .top-btn:active, .tab:active, .chapter-map button:active { transform: translateY(4px); box-shadow: inset 0 2px 0 #63bbed, 0 1px 0 var(--edge); }
.gi { width: 24px; height: 24px; flex: none; filter: drop-shadow(0 2px 0 #03407365); }
.ic { line-height: 1; filter: drop-shadow(0 2px 0 #03407345); }

/* gold: the one thing to press */
.primary, .ctl-btn.primary, .nav-btn.primary, .seg button[aria-pressed="true"], .chapter-map button[aria-current="true"] {
  background: linear-gradient(165deg, var(--gold-hi) 0, var(--gold) 44%, var(--gold-lo) 100%);
  border-color: var(--gold-rim); color: var(--ink); text-shadow: 0 1px #fff6a6;
  box-shadow: inset 0 3px 0 #fffbd2, inset 0 -4px 0 #ffc02e, 0 5px 0 var(--gold-edge), 0 9px 18px #00436d40;
}
.primary:active, .ctl-btn.primary:active, .nav-btn.primary:active, .seg button[aria-pressed="true"]:active { box-shadow: inset 0 2px 0 #fffbd2, 0 1px 0 var(--gold-edge); }
.primary .gi, .nav-btn.primary .gi, .seg button[aria-pressed="true"] .gi { filter: drop-shadow(0 2px 0 #b2731760); }
.ctl-btn.primary .ic, .seg button[aria-pressed="true"] .ic { filter: drop-shadow(0 2px 0 #b2731760); }

button:disabled { filter: grayscale(.7); opacity: .65; pointer-events: none; }

/* ---------- HUD ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  min-height: var(--topbar-h); padding: 8px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand .logo { font-size: 30px; filter: drop-shadow(0 3px 0 #074579); }
.brand .name {
  font-family: var(--font-title); font-size: 30px; color: #fffdf1; letter-spacing: .01em;
  -webkit-text-stroke: 3px #074579; paint-order: stroke fill;
  text-shadow: 0 3px 0 #074579, 0 5px 0 #063666, 0 8px 16px #05315b55;
}
[lang="he"] .brand .name { -webkit-text-stroke: 1.5px #074579; }
.brand .tag { display: none; }
.chapter-map { display: flex; gap: 6px; flex: 1; justify-content: center; flex-wrap: wrap; }
.chapter-map button { width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 15px; font-family: var(--font-title); font-size: 17px; }
.chapter-map button .ic { font-size: 22px; }
.chapter-map button.seen { background: linear-gradient(#5ec6ff, #2aa2ea); }
.chapter-map button[aria-current="true"] { transform: scale(1.12); }
.tools { display: flex; gap: 8px; }
.top-btn { min-height: 48px; padding: 0 14px; border-radius: 15px; font-size: 15px; }
.top-btn .ic { font-size: 20px; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 20; width: 560px; max-width: calc(100vw - 32px);
  padding: 12px; border-radius: 22px; background: var(--cream); border: 3px solid var(--rim);
  box-shadow: 0 6px 0 var(--edge), 0 22px 50px #00305a66;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.menu-list button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 84px; padding: 8px 6px; border-radius: 16px; border: 2px solid #d8ecff; background: #fff;
  color: var(--ink); font-weight: 900; font-size: 13px; text-align: center; line-height: 1.15;
  box-shadow: 0 3px 0 #b9d6f0; transition: transform 120ms ease;
}
.menu-list button:hover { transform: translateY(-2px); border-color: var(--blue); }
.menu-list button[aria-current="true"] { background: linear-gradient(#fff8c0, #ffe36f); border-color: #e6b130; box-shadow: 0 3px 0 #bd8a20; }
.menu-list button .n { font-family: var(--font-title); font-size: 12px; color: var(--ink-3); }
.menu-list button .ic { font-size: 26px; }

/* ---------- stage ---------- */
.stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px; padding: 12px 18px 16px;
  max-width: 1600px; margin: 0 auto; align-items: start;
}
@media (min-width: 1081px) {
  html, body { height: 100%; overflow: hidden; }
  .stage { height: calc(100vh - var(--topbar-h)); grid-template-rows: minmax(0, 1fr); }
  .lab { display: flex; flex-direction: column; align-items: center; min-height: 0; height: 100%; }
  .lab-stage { flex: none; }
  .lab-controls { flex: none; width: 100%; }
  .lesson { min-height: 0; height: 100%; }
}
@media (max-width: 1080px) {
  .stage { grid-template-columns: 1fr; gap: 14px; padding: 10px 12px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { padding: 6px 12px; gap: 10px; min-height: 60px; }
  .chapter-map { display: none; }
  .brand .name { font-size: 26px; }
  .top-btn { min-height: 44px; padding: 0 12px; font-size: 14px; }
  .top-btn span:not(.ic) { display: none; }
  .top-btn .gi { width: 22px; height: 22px; }
  /* the dock becomes scrollable strips so the water stays high on the screen */
  .lab-controls { padding: 8px 10px; gap: 6px; }
  .ctl-row { flex-wrap: nowrap; overflow-x: auto; padding: 4px 2px 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .ctl-row::-webkit-scrollbar { display: none; }
  .ctl-row > * { flex: none; }
  .ctl-playback { margin-inline-start: 0; }
  .ctl-slider { grid-template-columns: auto minmax(150px, 190px) auto; }
  .ctl-row .ctl { animation: none; }
  /* floating level nav */
  .lesson-foot { position: fixed; inset-inline: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 12; border-radius: 20px; border: 3px solid var(--rim-2); background: var(--cream); box-shadow: 0 6px 0 var(--edge), 0 14px 30px #00305a66; }
  .lesson { overflow: visible; }
  .lesson-body { overflow: visible; }
  .rules-host .ctl-row { flex-wrap: wrap; overflow: visible; }
}
@media (hover: none) {
  .slab:hover, .ctl-btn:hover, .seg button:hover, .ctl-toggle:hover, .nav-btn:hover, .top-btn:hover, .tab:hover, .chapter-map button:hover { transform: none; filter: none; }
}

/* ---------- the water ---------- */
.lab { min-width: 0; }
.lab-stage {
  position: relative; width: 100%;
  border-radius: 26px; overflow: hidden;
  background: var(--tray);
  border: 4px solid var(--rim-2);
  box-shadow: 0 8px 0 var(--edge), 0 24px 60px #00305a66;
  touch-action: none; cursor: crosshair;
}
[data-look="paper"] .lab-stage { background: var(--tray-paper); }
.lab-gl, .lab-overlay { position: absolute; inset: 0; display: block; }
.lab-overlay { pointer-events: none; }
.lab-gl[hidden] { display: none; }
.lab-hint, .lab-toast {
  position: absolute; inset-inline-start: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 16px; pointer-events: none;
  font-family: var(--font-title); font-size: 19px; letter-spacing: .01em;
}
[dir="rtl"] .lab-hint, [dir="rtl"] .lab-toast { transform: translateX(50%); }
.lab-hint { bottom: 16px; background: var(--cream-2); color: var(--ink); border: 3px solid var(--rim); box-shadow: 0 5px 0 var(--edge), 0 10px 24px #0000004d; animation: bob 1.6s ease-in-out infinite; }
.lab-toast { top: 16px; background: linear-gradient(165deg, var(--gold-hi), var(--gold) 50%, var(--gold-lo)); color: var(--ink); border: 3px solid var(--gold-rim); box-shadow: 0 5px 0 var(--gold-edge), 0 10px 24px #0000004d; animation: pop .35s var(--spring) both; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes pop { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }

/* burst shards on the first touch */
.shard { position: absolute; width: 12px; height: 12px; pointer-events: none; clip-path: polygon(50% 0, 100% 40%, 80% 100%, 20% 100%, 0 40%); animation: shard 560ms var(--land) both; }
@keyframes shard { from { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.3); opacity: 0; } }

/* ---------- dock ---------- */
.lab-controls {
  position: relative;
  display: flex; flex-direction: column; gap: 8px; margin-top: 14px;
  padding: 10px 12px; border-radius: 22px;
  background: var(--cream); border: 3px solid var(--rim-2);
  box-shadow: 0 6px 0 var(--edge), 0 14px 30px #00305a55;
}
.lab-controls[hidden] { display: none; }
.ctl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ctl-row-label { flex-basis: 100%; font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.ctl-label { font-weight: 900; font-size: 15px; color: var(--ink); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.ctl-value { font-family: var(--font-title); font-size: 15px; color: var(--ink); min-width: 3.5ch; text-align: end; font-variant-numeric: tabular-nums; }
.ctl-value:empty { display: none; }
.ctl-row .ctl { animation: arrive 440ms var(--land) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes arrive { from { opacity: 0; transform: translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }

.ctl-btn.big, .ctl-toggle.big { min-height: 60px; font-size: 18px; padding: 0 22px; }
.ctl-playback { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-inline-start: auto; }

/* icon-first squircles */
.iconic { flex-direction: column; gap: 0; padding: 4px 8px 3px; width: 62px; min-width: 62px; min-height: 60px; border-radius: 17px; }
.iconic .ic { font-size: 27px; }
.iconic .gi { width: 26px; height: 26px; }
.iconic .cap { font-size: 10px; font-weight: 900; letter-spacing: .02em; line-height: 1.1; margin-top: 3px; max-width: 58px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg.big button.iconic { width: 64px; min-height: 62px; }
.seg button.swatch { width: 52px; min-width: 52px; padding: 0; justify-content: center; }
.seg.big button.swatch { width: 56px; min-width: 56px; min-height: 62px; }
.seg button.swatch::before { content: ''; width: 28px; height: 28px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 -4px 0 #00000030, 0 0 0 3px #ffffffcc; }
.seg button.swatch[aria-pressed="true"] { transform: scale(1.08); }
.seg button span:empty { display: none; }
.ctl-segment { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* toggle */
.ctl-toggle { background: var(--cream-2); color: var(--ink); border-color: #cfe6ff; text-shadow: none; box-shadow: inset 0 2px 0 #fff, 0 5px 0 #a9c7e4, 0 9px 18px #00436d22; }
.ctl-toggle .ic { filter: none; }
.ctl-toggle .sw { position: relative; width: 56px; height: 34px; border-radius: 999px; background: #b9c8d8; flex: none; box-shadow: inset 0 2px 4px #00000030; transition: background .18s ease; }
.ctl-toggle .sw i { position: absolute; top: 4px; inset-inline-start: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 #00000030; transition: transform 180ms var(--spring); }
.ctl-toggle[aria-checked="true"] .sw { background: var(--green); }
.ctl-toggle[aria-checked="true"] .sw i { transform: translateX(22px); }
[dir="rtl"] .ctl-toggle[aria-checked="true"] .sw i { transform: translateX(-22px); }
.ctl-toggle .ctl-state { font-family: var(--font-title); font-size: 12px; letter-spacing: .06em; color: var(--ink-3); min-width: 3ch; }
.ctl-toggle[aria-checked="true"] .ctl-state { color: var(--green-edge); }
.ctl-toggle[aria-checked="true"] { border-color: #a9e6b6; }

/* sliders: cream cards with a fat gold thumb */
.ctl-slider {
  display: grid; grid-template-columns: auto minmax(200px, 260px) auto; grid-template-rows: auto auto auto;
  align-items: center; column-gap: 10px; row-gap: 0;
  min-height: 52px; padding: 6px 14px; border-radius: 18px; border: 2px solid #cfe6ff; background: var(--cream-2);
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 #a9c7e4;
}
.ctl-slider input[type="range"] { width: 100%; cursor: pointer; height: 32px; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; }
.ctl-slider input[type="range"]::-webkit-slider-runnable-track { height: 14px; border-radius: 999px; background: linear-gradient(90deg, #cfe6ff, var(--blue)); box-shadow: inset 0 2px 3px #00000030; }
.ctl-slider input[type="range"]::-moz-range-track { height: 14px; border-radius: 999px; background: linear-gradient(90deg, #cfe6ff, var(--blue)); }
.ctl-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -8px; border-radius: 10px; background: linear-gradient(var(--gold-hi), var(--gold-lo)); border: 2px solid var(--gold-rim); box-shadow: 0 3px 0 var(--gold-edge), 0 6px 10px #00000040; transition: transform .15s var(--spring); }
.ctl-slider input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 10px; background: var(--gold); border: 2px solid var(--gold-rim); box-shadow: 0 3px 0 var(--gold-edge); }
.ctl-slider input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12) translateY(2px); box-shadow: 0 1px 0 var(--gold-edge); }
.ctl-slider .ctl-ends { grid-column: 2; display: flex; justify-content: space-between; font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-top: -4px; }
.ctl-slider .ctl-value { grid-row: 1; }
.ctl-slider .ctl-hint { grid-column: 1 / -1; font-size: 12px; font-weight: 800; color: var(--ink-3); padding-bottom: 2px; }
[dir="rtl"] .ctl-slider input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(270deg, #cfe6ff, var(--blue)); }

/* meters: stat tiles */
.ctl-meter { display: inline-grid; grid-template-columns: auto auto; gap: 2px 12px; align-items: center; padding: 8px 16px; border-radius: 18px; border: 2px solid #cfe6ff; background: var(--cream-2); min-width: 240px; box-shadow: inset 0 2px 0 #fff, 0 4px 0 #a9c7e4; --meter: var(--gold); }
.ctl-meter .ctl-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.ctl-meter .meter-value { font-family: var(--font-title); font-size: 22px; color: var(--ink); text-align: end; font-variant-numeric: tabular-nums; }
.ctl-meter .meter-bar { grid-column: 1 / -1; height: 12px; border-radius: 999px; background: #dbe9f7; overflow: hidden; box-shadow: inset 0 2px 3px #00000025; }
.ctl-meter .meter-bar i { display: block; height: 100%; width: 0; background: var(--meter); border-radius: 999px; transition: width .2s linear; box-shadow: inset 0 -3px 0 #00000022; }

/* peek inside (story tab) */
.peek { border: 2px solid #cfe6ff; border-radius: 18px; background: var(--cream-2); box-shadow: 0 4px 0 #a9c7e4; }
.peek summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-family: var(--font-title); font-size: 18px; color: var(--ink); cursor: pointer; user-select: none; }
.peek summary::-webkit-details-marker { display: none; }
.peek summary::after { content: '▾'; margin-inline-start: auto; transition: transform .2s ease; }
.peek[open] summary::after { transform: rotate(180deg); }
.peek .peek-body { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.peek.science .peek-body p { color: var(--ink-2); font-size: 15px; font-weight: 700; }

/* ---------- side card ---------- */
.lesson {
  display: flex; flex-direction: column;
  background: var(--cream); border: 3px solid var(--rim-2); border-radius: 24px;
  box-shadow: 0 6px 0 var(--edge), 0 14px 30px #00305a55; overflow: hidden;
}
.tabs { display: flex; gap: 8px; padding: 10px 12px 0; flex: none; }
.tab { flex: 1; min-height: 46px; padding: 0 10px; font-size: 15px; }
.tab .ic { font-size: 20px; }
.tab[aria-selected="true"] { background: var(--cream-2); color: var(--ink); border-color: #cfe6ff; text-shadow: none; box-shadow: inset 0 2px 0 #fff, 0 5px 0 #a9c7e4; }
.tab[aria-selected="true"] .gi { filter: drop-shadow(0 2px 0 #a9c7e4); }
.lesson-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px; min-height: 0; overflow-y: auto; flex: 1 1 auto; scrollbar-width: thin; animation: rise .35s ease both; }
.lesson-body[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.lesson-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 2px solid #dcecff; flex: none; }
.rules-host { gap: 8px; }
.rules-host .ctl-slider { grid-template-columns: auto minmax(120px, 1fr) auto; width: 100%; }
.rules-host .ctl-toggle, .rules-host .ctl-btn { width: 100%; justify-content: flex-start; }
.rules-host .ctl-segment { width: 100%; }

.lesson-head { display: flex; align-items: center; gap: 12px; }
.lesson-emoji { width: 62px; height: 62px; border-radius: 18px; background: linear-gradient(var(--gold-hi), var(--gold-lo)); border: 3px solid var(--gold-rim); box-shadow: 0 4px 0 var(--gold-edge); display: inline-flex; align-items: center; justify-content: center; font-size: 34px; flex: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 2px; }
.lesson h1 { font-size: 30px; color: var(--ink); }
.title-letter { display: inline-block; animation: letter-land 620ms var(--land) both; animation-delay: calc(var(--glyph) * 18ms); }
@keyframes letter-land { 0% { opacity: 0; transform: translateY(-14px) scale(1.08, .58); } 55% { opacity: 1; transform: translateY(2px) scale(.94, 1.13); } 100% { transform: none; } }
.invite { font-size: 18px; font-weight: 900; color: var(--ink); margin: 2px 0 0; }
.discover { font-size: 15px; font-weight: 700; color: var(--ink-2); margin: 0; }
.card { border-radius: 18px; padding: 12px 14px; background: #fff; border: 2px solid #ffe9a0; box-shadow: 0 4px 0 #e9cf7a; font-size: 15px; }
.card h3 { font-size: 16px; margin-bottom: 8px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.card li { display: flex; gap: 8px; align-items: flex-start; font-weight: 800; }
.card li::before { content: ''; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 6px; border: 2px solid var(--gold-edge); background: linear-gradient(var(--gold-hi), var(--gold)); }
.card p { margin: 0; }
.card.ask { border-color: #bfe0ff; box-shadow: 0 4px 0 #a9c7e4; }
.finish { padding: 12px 14px; border-radius: 18px; background: linear-gradient(#fff8c0, #ffe36f); border: 2px solid #e6b130; box-shadow: 0 4px 0 #bd8a20; font-family: var(--font-title); font-size: 18px; }
.nav-btn { min-height: 54px; padding: 0 18px; font-size: 16px; }
.nav-btn.primary { font-family: var(--font-title); font-size: 21px; min-height: 60px; padding: 0 22px; }
.nav-count { font-family: var(--font-title); font-size: 16px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.foot-notes { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--ink-3); font-weight: 800; margin-top: auto; padding-top: 6px; }

/* ---------- misc ---------- */
[dir="rtl"] .ctl-value { text-align: start; }
[dir="rtl"] .gi-arrow, [dir="rtl"] .gi-back { transform: scaleX(-1); }
@media (max-width: 640px) {
  .chapter-map button { width: 36px; height: 36px; min-height: 36px; font-size: 13px; }
  .stage { padding: 10px 10px 24px; }
  .lesson h1 { font-size: 26px; }
  .ctl-slider { grid-template-columns: auto minmax(140px, 1fr) auto; }
  .menu-list { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
