/* =========================================================
   AxomRank lessons · shared styles (course home + lessons)
   Rang Ghar palette: terracotta, cream, deep indigo.
   ========================================================= */
:root {
  --bg: #F7F0E4; --surface: #FFFCF6; --surface-2: #EFE5D3;
  --ink: #2A2420; --ink-2: #6A5F55; --ink-3: #A09385;
  --line: #E6D9C3; --line-2: #D9C8AC;
  --terra: #C1572F; --terra-dark: #93401F; --terra-soft: #F6E0D3;
  --indigo: #2E3170; --indigo-dark: #1D1F4D; --indigo-soft: #E4E4F3;
  --gold: #D89A1E; --gold-dark: #A9740B; --gold-soft: #FBEBC5;
  --good: #3E9A5F; --good-dark: #2C7346; --good-soft: #DDF1E2; --good-ink: #1F5B36;
  --bad: #D2483E; --bad-dark: #A2322A; --bad-soft: #FADEDA; --bad-ink: #8C2620;
  --river: #6FA8C9; --land: #EADFC8; --hill: #B9A47E;
  --locked: #D8CDBB; --locked-dark: #BDAF98;
  --stage: #E4D6BE;
  --font: "Nunito", "Noto Sans Bengali", system-ui, sans-serif;
  --font-as: "Noto Sans Bengali", "Nunito", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17182F; --surface: #20223F; --surface-2: #2A2C4E; --ink: #F4ECDF; --ink-2: #C6BCAE; --ink-3: #8E8678;
    --line: #34375C; --line-2: #42466F; --terra: #E2774B; --terra-dark: #A9502D; --terra-soft: #3C2833;
    --indigo: #A9ADF5; --indigo-dark: #6E73C9; --indigo-soft: #2C2F5A; --gold: #EDB54A; --gold-dark: #B9851C; --gold-soft: #3A3320;
    --good: #58C080; --good-dark: #3B8D5B; --good-soft: #1E3B2D; --good-ink: #9BE3B5;
    --bad: #F0776C; --bad-dark: #B5473F; --bad-soft: #43252B; --bad-ink: #FFB3AB;
    --river: #4E86A8; --land: #2A2C4E; --hill: #5E5A78; --locked: #3A3D60; --locked-dark: #2B2D4A; --stage: #0E0F1F;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--stage); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
b { font-weight: 900; }
.hidden { display: none !important; }

/* language switch: both languages are in the page, CSS shows one */
#as { position: absolute; opacity: 0; pointer-events: none; }
.as { display: none; font-family: var(--font-as); }
body:has(#as:checked) .en { display: none; }
body:has(#as:checked) .as { display: revert; }

/* phone frame */
.stage { min-height: 100%; display: grid; place-items: center; }
.device { position: relative; width: 100%; height: 100dvh; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
@media (min-width: 560px) {
  .stage { padding: 24px; }
  .device { width: 400px; height: min(860px, calc(100dvh - 48px)); border-radius: 38px; box-shadow: 0 0 0 10px #1a1a20, 0 30px 80px rgba(0,0,0,.35); }
}
.view { display: none; flex: 1; flex-direction: column; min-height: 0; }
.view.on { display: flex; }

/* ---------- lesson path ---------- */
.p-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px 6px; }
.gem { display: inline-flex; align-items: center; gap: 5px; font-weight: 900; color: var(--gold); font-size: 16px; }
.gem svg { width: 22px; height: 22px; }
.spacer { flex: 1; }
.lang { cursor: pointer; border: 2px solid var(--line); border-radius: 10px; font-weight: 900; font-size: 13px; color: var(--ink-3); padding: 4px 8px; min-width: 40px; text-align: center; user-select: none; }
.lang .as { font-family: var(--font); }
.p-scroll { flex: 1; overflow-y: auto; }
.hero { position: relative; margin: 6px 14px 4px; border-radius: 22px; overflow: hidden; background: #2E3170; color: #FFF6EC; box-shadow: 0 4px 0 #1D1F4D; display: flex; align-items: stretch; min-height: 150px; }
.hero img { width: 112px; object-fit: cover; object-position: center 12%; flex: none; }
.hero .txt { padding: 16px 16px 14px; display: flex; flex-direction: column; justify-content: center; }
.hero .eyebrow { font-size: 11.5px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.hero h1 { margin: 4px 0 2px; font-size: 24px; line-height: 1.15; font-weight: 900; }
.hero .reign { font-weight: 800; opacity: .85; font-size: 14px; }
.hero .meter { margin-top: 12px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.2); overflow: hidden; }
.hero .meter i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .5s; }
.hero .count { font-size: 12.5px; font-weight: 800; opacity: .85; margin-top: 6px; }
body:has(#as:checked) .hero .eyebrow { letter-spacing: 0; text-transform: none; font-size: 13px; }
.path { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 60px 0 40px; }
.node-wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.node { --c: var(--locked); --d: var(--locked-dark); position: relative; width: 76px; height: 70px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; background: var(--c); box-shadow: 0 7px 0 var(--d); display: grid; place-items: center; transition: transform .06s, box-shadow .06s; }
.node:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--d); }
.node svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.node.open { --c: var(--terra); --d: var(--terra-dark); }
.node.done { --c: var(--gold); --d: var(--gold-dark); }
.node.test { width: 88px; height: 80px; }
.node.test.open { --c: #2E3170; --d: #1D1F4D; }
.node.locked { color: var(--ink-3); }
.node.cur::before { content: ""; position: absolute; inset: -10px -10px -16px; border-radius: 50%; border: 6px solid var(--line); z-index: -1; }
.node-label { margin-top: 12px; font-weight: 800; font-size: 13.5px; color: var(--ink-2); text-align: center; max-width: 150px; line-height: 1.25; }
.node-label.locked { color: var(--ink-3); }
.bubble { position: absolute; top: -46px; white-space: nowrap; background: var(--surface); color: var(--terra); border: 2px solid var(--line); font-weight: 900; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; padding: 7px 12px; border-radius: 12px; animation: bob 1.6s ease-in-out infinite; z-index: 2; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; background: var(--surface); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateX(-50%) rotate(45deg); }
body:has(#as:checked) .bubble { letter-spacing: 0; text-transform: none; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.pop { position: absolute; top: 88px; z-index: 6; width: 262px; padding: 16px; border-radius: 18px; background: var(--terra); color: #FFF6EC; box-shadow: 0 4px 0 var(--terra-dark), 0 18px 40px rgba(0,0,0,.2); animation: popIn .18s ease; text-align: left; }
.pop.done { background: var(--gold); box-shadow: 0 4px 0 var(--gold-dark), 0 18px 40px rgba(0,0,0,.2); }
.pop.test { background: #2E3170; box-shadow: 0 4px 0 #1D1F4D, 0 18px 40px rgba(0,0,0,.2); }
.pop.locked { background: var(--surface); color: var(--ink-2); border: 2px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.12); }
.pop::before { content: ""; position: absolute; top: -8px; left: 50%; width: 16px; height: 16px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.pop h3 { margin: 0 0 4px; font-size: 18px; font-weight: 900; }
.pop p { margin: 0 0 14px; font-size: 14px; font-weight: 700; opacity: .9; }
.pop .types { display: flex; flex-wrap: wrap; gap: 5px; margin: -6px 0 14px; }
.pop .types span { font-size: 11.5px; font-weight: 800; background: rgba(255,255,255,.18); padding: 2px 8px; border-radius: 99px; }
.pop .btn { --c: #FFF8EF; --d: rgba(0,0,0,.18); --fg: var(--terra); height: 46px; font-size: 15px; }
.pop.done .btn { --fg: var(--gold-dark); } .pop.test .btn { --fg: #2E3170; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.p-foot { text-align: center; color: var(--ink-3); font-size: 12.5px; font-weight: 700; padding: 0 28px 28px; }

/* ---------- play view ---------- */
.top { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px; }
.close { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-3); border-radius: 12px; font-size: 28px; font-weight: 700; line-height: 1; border: 0; background: none; cursor: pointer; }
.bar { flex: 1; height: 16px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--terra); position: relative; overflow: hidden; transition: width .45s cubic-bezier(.3,.8,.3,1); }
.bar i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.35); }
.screen { flex: 1; overflow-y: auto; padding: 10px 18px 24px; font-size: 18px; }
.screen.enter { animation: in .32s cubic-bezier(.2,.8,.2,1); }
@keyframes in { from { opacity: 0; transform: translateX(24px); } }
@media (prefers-reduced-motion: reduce) { .screen.enter { animation: none; } }
.kicker { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--indigo); margin: 4px 0 10px; }
.kicker.story { color: var(--terra); }
.kicker.retry { color: var(--bad); }
.kicker .xp { margin-left: auto; color: var(--gold-dark); letter-spacing: .04em; }
body:has(#as:checked) .kicker { letter-spacing: 0; text-transform: none; font-size: 14px; }
h1.t { font-size: 25px; line-height: 1.2; font-weight: 900; margin: 0 0 14px; }
.prompt { font-size: 22px; line-height: 1.32; font-weight: 800; margin: 0 0 18px; }
body:has(#as:checked) .prompt, body:has(#as:checked) h1.t { line-height: 1.5; }
.help { font-size: 14px; font-weight: 700; color: var(--ink-3); margin: -6px 0 14px; }

/* story */
.frame { width: 100%; aspect-ratio: 4 / 3.1; overflow: hidden; margin: 0 0 18px; border-radius: 50% 50% 22px 22px / 30% 30% 22px 22px; background: var(--surface-2); position: relative; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; animation: kb 9s ease-out both; }
.frame.top img { object-position: center 12%; }
@keyframes kb { from { transform: scale(1.08); } }
.frame .credit { position: absolute; right: 12px; bottom: 10px; font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(20,16,12,.5); padding: 2px 8px; border-radius: 99px; }
.frame.art { display: grid; place-items: center; background: var(--indigo-soft); }
.frame.art svg { width: 70%; height: 70%; }
.frame.art.full svg { width: 100%; height: 100%; }
.frame.mapframe { aspect-ratio: auto; border-radius: 22px; background: none; overflow: visible; }
.story p { font-size: 19px; line-height: 1.55; font-weight: 600; margin: 0 0 10px; }
.story mark { background: linear-gradient(transparent 60%, var(--gold-soft) 60%); color: inherit; font-weight: 800; padding: 0 2px; }
body:has(#as:checked) .story p { line-height: 1.75; }

/* tiles */
.tile { background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; cursor: pointer; font-weight: 800; transition: border-color .12s, background .12s, transform .06s; color: var(--ink); }
.tile:active:not(:disabled) { transform: translateY(2px); }
.tile:disabled { cursor: default; }
.tile.sel { border-color: var(--indigo); background: var(--indigo-soft); color: var(--indigo); }
.tile.right { border-color: var(--good); background: var(--good-soft); color: var(--good-ink); }
.tile.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-ink); }
.opts { display: grid; gap: 12px; }
.opts.grid2 { grid-template-columns: 1fr 1fr; }
.opt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-size: 17px; text-align: left; width: 100%; line-height: 1.3; }
.opts.grid2 .opt { justify-content: center; text-align: center; }
.opts.big .opt { font-size: 21px; font-weight: 900; padding: 16px; }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 10px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 900; color: var(--ink-3); }
.opt.sel .k, .opt.right .k, .opt.wrong .k { border-color: currentColor; color: currentColor; }

/* sentence with a blank inside it */
.sentence { font-size: 23px; line-height: 2; font-weight: 800; margin: 8px 0 18px; }
body:has(#as:checked) .sentence { line-height: 2.1; }
.blank { display: inline-flex; align-items: baseline; border-bottom: 3px solid var(--indigo); margin: 0 4px; padding: 0 2px; min-width: 3.4em; justify-content: center; color: var(--indigo); }
.blank .given { color: var(--indigo); font-weight: 900; }
.blank input { font: inherit; font-weight: 900; color: var(--indigo); background: transparent; border: 0; outline: none; padding: 0; width: calc(var(--n) * .8em); letter-spacing: .04em; }
.blank input::placeholder { color: var(--line-2); letter-spacing: .12em; }
.blank.right, .blank.right input, .blank.right .given { border-color: var(--good); color: var(--good-ink); }
.blank.wrong, .blank.wrong input, .blank.wrong .given { border-color: var(--bad); color: var(--bad-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips .tile { padding: 10px 16px; font-size: 17px; }

/* match */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match .col { display: grid; gap: 12px; align-content: start; }
.match .tile { min-height: 64px; padding: 10px; font-size: 15px; line-height: 1.25; display: grid; place-items: center; text-align: center; }
.match .tile.done { border-color: var(--good); background: var(--good-soft); color: var(--good-ink); opacity: .55; }
.match .tile.no { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-ink); animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* order */
.slots { display: grid; gap: 10px; margin-bottom: 20px; }
.oslot { display: flex; align-items: center; gap: 12px; min-height: 56px; border: 2px dashed var(--line-2); border-radius: 16px; padding: 6px 8px 6px 12px; }
.oslot .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--terra-soft); color: var(--terra); display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.oslot .tile { flex: 1; text-align: left; padding: 10px 14px; font-size: 16px; }
.oslot.right { border-style: solid; border-color: var(--good); }
.oslot.wrong { border-style: solid; border-color: var(--bad); }
.bank { display: grid; gap: 10px; }
.bank .tile { padding: 12px 14px; font-size: 16px; text-align: left; }
.bank .tile.used { visibility: hidden; }

/* who am I */
.clues { display: grid; gap: 10px; margin-bottom: 14px; }
.clue { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: 17px; line-height: 1.4; animation: clueIn .3s ease; }
.clue .n { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--gold-soft); color: var(--gold-dark); display: grid; place-items: center; font-weight: 900; font-size: 13px; margin-top: 1px; }
@keyframes clueIn { from { opacity: 0; transform: translateY(-6px); } }
.more { display: flex; justify-content: center; margin: 0 0 16px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--surface); border-radius: 12px; padding: 7px 14px; font-weight: 800; font-size: 14px; color: var(--gold-dark); cursor: pointer; }
.chip-btn:disabled { opacity: .45; cursor: default; }

/* picture */
.pics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pic { padding: 6px; aspect-ratio: 1 / 1; overflow: hidden; display: block; }
.pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; }

/* true / false */
.statement { background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 24px 20px; font-size: 22px; font-weight: 800; line-height: 1.4; margin: 6px 0 20px; text-align: center; }
body:has(#as:checked) .statement { line-height: 1.6; }
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf .tile { height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 900; font-size: 18px; }
.tf .tile .sym { font-size: 28px; line-height: 1; }
.tf .tile.t .sym { color: var(--good); } .tf .tile.f .sym { color: var(--bad); }

/* unscramble */
.word-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 26px; min-height: 60px; }
.wslot { min-width: 44px; height: 56px; padding: 0 8px; border-radius: 12px; border: 2px dashed var(--line-2); display: grid; place-items: center; font-size: 24px; font-weight: 900; }
.wslot .tile { height: 100%; width: 100%; font-size: 24px; padding: 0 8px; border-radius: 10px; }
.word-slots.right .wslot { border-color: var(--good); border-style: solid; } .word-slots.right .tile { border-color: var(--good); color: var(--good-ink); }
.word-slots.wrong .wslot { border-color: var(--bad); border-style: solid; } .word-slots.wrong .tile { border-color: var(--bad); color: var(--bad-ink); }
.letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.letters .tile { min-width: 48px; height: 56px; padding: 0 10px; font-size: 24px; font-weight: 900; }
.letters .tile.used { visibility: hidden; }

/* spot the error */
.spot { font-size: 22px; line-height: 2.1; font-weight: 800; margin: 6px 0 14px; }
.tok { display: inline; padding: 3px 6px; margin: 0 1px; border-radius: 10px; border: 2px solid transparent; border-bottom: 3px solid var(--line-2); cursor: pointer; background: none; font: inherit; font-weight: 800; color: inherit; }
.tok:hover { background: var(--surface-2); }
.tok.sel { border-color: var(--indigo); background: var(--indigo-soft); color: var(--indigo); }
.tok.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-ink); text-decoration: line-through; }
.tok.right { border-color: var(--good); background: var(--good-soft); color: var(--good-ink); }
.tok:disabled { cursor: default; }
.fix { display: inline-block; margin-left: 4px; color: var(--good-ink); background: var(--good-soft); border-radius: 10px; padding: 0 8px; }

/* timeline */
.tline { position: relative; margin: 4px 0 20px; padding-left: 34px; }
.tline::before { content: ""; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 4px; border-radius: 99px; background: var(--line); }
.anchor { position: relative; display: flex; align-items: baseline; gap: 10px; padding: 6px 0; font-weight: 800; }
.anchor::before { content: ""; position: absolute; left: -29px; top: 11px; width: 14px; height: 14px; border-radius: 50%; background: var(--terra); box-shadow: 0 0 0 4px var(--bg); }
.anchor .y { font-weight: 900; color: var(--terra); font-size: 18px; min-width: 48px; }
.anchor .l { color: var(--ink-2); font-size: 16px; }
.tslot { position: relative; min-height: 54px; margin: 6px 0; border: 2px dashed var(--line-2); border-radius: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; color: var(--ink-3); font-size: 13.5px; font-weight: 800; }
.tslot::before { content: ""; position: absolute; left: -27px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--line-2); }
.tslot.armed { border-color: var(--indigo); background: var(--indigo-soft); color: var(--indigo); }
.tslot .tile { padding: 8px 12px; font-size: 15px; }
.tslot.right { border-style: solid; border-color: var(--good); } .tslot.wrong { border-style: solid; border-color: var(--bad); }
.tbank { display: flex; flex-wrap: wrap; gap: 8px; }
.tbank .tile { padding: 10px 14px; font-size: 15.5px; }
.tbank .tile.used { display: none; }

/* map */
.map { width: 100%; height: auto; display: block; border-radius: 20px; background: var(--land); border: 2px solid var(--line); }
.map .river { fill: none; stroke: var(--river); stroke-width: 6; stroke-linecap: round; }
.map .hills path { fill: var(--hill); }
.map .lbl { font: 800 11px var(--font); fill: var(--ink-2); }
.map .lbl.big { font-size: 10px; letter-spacing: .14em; fill: var(--ink-3); }
.map .lbl.place { font-size: 12px; fill: var(--ink); }
.map .route { fill: none; stroke: var(--terra); stroke-width: 3; stroke-dasharray: 7 6; stroke-linecap: round; }
.map .dot { fill: var(--indigo); stroke: var(--surface); stroke-width: 3; }
.map .hit { cursor: pointer; }
.map .hit .ring { fill: transparent; stroke: var(--indigo); stroke-width: 2.5; opacity: .35; }
.map .hit .zone { fill: transparent; stroke: transparent; stroke-width: 30; stroke-linecap: round; }
.map .hit.sel .ring { opacity: 1; stroke-width: 4; fill: rgba(46,49,112,.12); }
.map .hit.sel .zone { stroke: rgba(46,49,112,.18); }
.map .hit.right .ring { stroke: var(--good); opacity: 1; stroke-width: 4; fill: rgba(62,154,95,.15); }
.map .hit.right .zone { stroke: rgba(62,154,95,.25); }
.map .hit.wrong .ring { stroke: var(--bad); opacity: 1; stroke-width: 4; fill: rgba(210,72,62,.15); }
.map .hit.wrong .zone { stroke: rgba(210,72,62,.22); }
.map-note { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-align: right; margin: 6px 2px 0; }

/* foot + feedback */
.foot { position: relative; padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); background: var(--bg); }
.foot.fb-good { background: var(--good-soft); border-color: transparent; }
.foot.fb-bad { background: var(--bad-soft); border-color: transparent; }
.fb { display: none; margin-bottom: 14px; animation: up .25s ease; }
.foot.fb-good .fb, .foot.fb-bad .fb { display: block; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }
.fb-head { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 900; margin-bottom: 6px; }
.fb-badge { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 20px; font-weight: 900; flex: none; }
.fb-good .fb { color: var(--good-ink); } .fb-good .fb-badge { color: var(--good); }
.fb-bad .fb { color: var(--bad-ink); } .fb-bad .fb-badge { color: var(--bad); }
.fb-xp { margin-left: auto; font-size: 15px; }
.fb-ans { font-weight: 900; font-size: 16px; margin-bottom: 4px; }
.fb-ans small { display: block; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.fb-why { font-weight: 600; font-size: 15px; line-height: 1.45; max-height: 26vh; overflow-y: auto; }
.btn { --c: var(--terra); --d: var(--terra-dark); --fg: #FFF8EF; display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; border-radius: 16px; border: 0; cursor: pointer; background: var(--c); color: var(--fg); font-weight: 900; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 4px 0 var(--d); transition: transform .06s, box-shadow .06s; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--d); }
.btn:disabled { --c: var(--surface-2); --d: var(--line-2); --fg: var(--ink-3); cursor: default; }
.fb-good .btn { --c: var(--good); --d: var(--good-dark); }
.fb-bad .btn { --c: var(--bad); --d: var(--bad-dark); }
body:has(#as:checked) .btn { letter-spacing: 0; text-transform: none; font-size: 17px; }

/* unit complete */
.done-wrap { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 30px 18px 20px; text-align: center; }
.done-art { width: 150px; height: 124px; margin: 10px 0 12px; flex: none; }
.done-wrap h1 { color: var(--gold-dark); font-size: 28px; margin: 0 0 4px; font-weight: 900; }
@media (prefers-color-scheme: dark) { .done-wrap h1 { color: var(--gold); } }
.sub { color: var(--ink-2); font-weight: 700; margin: 0 0 18px; font-size: 16px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-bottom: 16px; }
.stat { border: 2px solid var(--c); border-radius: 16px; overflow: hidden; background: var(--surface); }
.stat .h { background: var(--c); color: #fff; font-size: 11.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 5px 4px; }
.stat .v { font-size: 22px; font-weight: 900; padding: 12px 4px; color: var(--c); }
.card { width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-weight: 700; font-size: 15px; }
.learned li::before { content: "✓"; color: var(--good); font-weight: 900; margin-right: 8px; }
.mistakes li { border-left: 3px solid var(--bad); padding-left: 10px; }
.mistakes li .q { display: block; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; display: none; }
.confetti.on { display: block; }
.confetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; animation: fall 2.8s ease-in forwards; }
.confetti i:nth-child(5n+1) { background: var(--terra); } .confetti i:nth-child(5n+2) { background: var(--gold); }
.confetti i:nth-child(5n+3) { background: var(--indigo); } .confetti i:nth-child(5n+4) { background: var(--good); } .confetti i:nth-child(5n) { background: #E2774B; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none !important; } }

/* exit sheet */
.backdrop { position: absolute; inset: 0; background: rgba(15,12,30,.45); z-index: 9; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--bg); border-radius: 26px 26px 0 0; padding: 22px 18px 24px; text-align: center; animation: up .25s ease; }
.sheet h2 { margin: 0 0 6px; font-size: 21px; font-weight: 900; }
.sheet p { margin: 0 0 18px; color: var(--ink-2); font-weight: 700; }
.link { display: block; width: 100%; margin-top: 10px; background: none; border: 0; font-weight: 900; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); cursor: pointer; padding: 10px; }

/* ---------- shared top-bar pieces ---------- */
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-3); border-radius: 12px; border: 0; background: none; cursor: pointer; text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.off { opacity: .5; }
.fire { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; font-size: 16px; color: var(--ink-3); }
.fire.on { color: var(--terra); }
.fire svg { width: 22px; height: 22px; }

/* practise-your-mistakes card on the lesson path */
.mistake-card { display: flex; align-items: center; gap: 12px; margin: 10px 14px 0; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; cursor: pointer; width: calc(100% - 28px); text-align: left; }
.mistake-card .ic { flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); display: grid; place-items: center; font-weight: 900; font-size: 18px; }
.mistake-card b { display: block; font-size: 16px; }
.mistake-card span.s { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.mistake-card .go { margin-left: auto; color: var(--ink-3); font-size: 22px; font-weight: 900; }

/* ---------- course home ---------- */
.c-hero { position: relative; margin: 6px 14px 14px; padding: 18px 18px 16px; border-radius: 22px; background: var(--terra); color: #FFF6EC; box-shadow: 0 4px 0 var(--terra-dark); overflow: hidden; }
.c-hero .roof { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 26px; opacity: .35; }
.c-hero .eyebrow { margin-top: 6px; font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.c-hero h1 { margin: 4px 0 4px; font-size: 26px; line-height: 1.15; font-weight: 900; }
.c-hero p { margin: 0; font-weight: 700; opacity: .9; font-size: 14.5px; }
body:has(#as:checked) .c-hero .eyebrow { letter-spacing: 0; text-transform: none; font-size: 13px; }
.era { margin: 18px 18px 8px; font-size: 12.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
body:has(#as:checked) .era { letter-spacing: 0; text-transform: none; font-size: 14px; }
.kings { display: grid; gap: 10px; padding: 0 14px 18px; }
.king { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; text-decoration: none; color: var(--ink); position: relative; }
.king .face { flex: none; width: 54px; height: 54px; border-radius: 50%; overflow: hidden; background: var(--surface-2); border: 3px solid var(--line); }
.king .face img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.king .n { position: absolute; left: 50px; top: 46px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; background: var(--ink-3); color: var(--bg); font-size: 11.5px; font-weight: 900; display: grid; place-items: center; }
.king .who { flex: 1; min-width: 0; }
.king .who b { display: block; font-size: 16.5px; line-height: 1.2; }
.king .who .sub2 { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.king .bar2 { display: block; margin-top: 6px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.king .bar2 i { display: block; height: 100%; background: var(--terra); border-radius: 99px; }
.king .state { flex: none; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; padding: 6px 10px; border-radius: 12px; }
body:has(#as:checked) .king .state { letter-spacing: 0; text-transform: none; font-size: 13px; }
.king.open { border-color: var(--terra); }
.king.open .face { border-color: var(--terra); }
.king.open .n { background: var(--terra); }
.king.open .state { background: var(--terra); color: #FFF8EF; box-shadow: 0 3px 0 var(--terra-dark); }
.king.done .face { border-color: var(--gold); }
.king.done .n { background: var(--gold); }
.king.done .state { background: var(--gold-soft); color: var(--gold-dark); }
.king.locked, .king.soon { cursor: default; }
.king.locked .face img, .king.soon .face img { filter: grayscale(1); opacity: .55; }
.king.locked .who b, .king.soon .who b { color: var(--ink-2); }
.king.locked .state, .king.soon .state { color: var(--ink-3); background: var(--surface-2); }
.king .badge { position: absolute; right: 10px; top: -8px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 99px; }
.toast { position: absolute; left: 50%; top: 64px; transform: translate(-50%, -8px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 99px; font-size: 14px; font-weight: 700; transition: .2s; z-index: 20; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- connections between units and lessons ---------- */
.linkback { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; margin: 6px 0 4px; padding: 12px 14px; border-radius: 16px; border: 2px dashed var(--indigo); background: var(--indigo-soft); color: var(--ink); cursor: pointer; font: inherit; font-size: 15px; font-weight: 700; line-height: 1.45; }
.linkback .ic { flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--surface); color: var(--indigo); display: grid; place-items: center; }
.linkback svg, .linkchip svg, .pop .builds svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.linkback small { display: block; font-size: 11.5px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--indigo); margin-bottom: 2px; }
body:has(#as:checked) .linkback small { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.linkchip { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; border: 2px solid var(--indigo-soft); background: var(--indigo-soft); color: var(--indigo); border-radius: 99px; padding: 2px 9px 2px 6px; font: inherit; font-size: 11.5px; font-weight: 900; letter-spacing: .02em; text-transform: none; cursor: pointer; max-width: 58%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.linkchip svg { width: 14px; height: 14px; }
.kicker .linkchip + .xp { margin-left: 8px; }
.pop .builds { display: flex; align-items: flex-start; gap: 6px; margin: -6px 0 12px; font-size: 13px; font-weight: 800; opacity: .95; }
.pop .builds svg { width: 15px; height: 15px; margin-top: 2px; }
.hero .builds-on { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 800; color: #F6E7C4; text-decoration: underline; text-underline-offset: 3px; }
.sheet.left { text-align: left; }
.sheet .grab { width: 42px; height: 5px; border-radius: 99px; background: var(--line-2); margin: -8px auto 14px; }
.sheet .note { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 14px; line-height: 1.5; }
.sheet .recap { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.sheet .recap li { font-weight: 700; font-size: 15px; padding-left: 26px; position: relative; }
.sheet .recap li::before { content: "✓"; position: absolute; left: 4px; color: var(--good); font-weight: 900; }
.sheet a.btn { text-decoration: none; }

/* ---------- mountain passes on maps ---------- */
.map .pass { fill: var(--gold); stroke: var(--surface); stroke-width: 3; }
.map .pass-glow { fill: var(--gold); opacity: .3; animation: passPulse 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.map .pass-mark { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map .lbl.passlbl { fill: var(--gold-dark); font-weight: 900; font-size: 12.5px; }
@media (prefers-color-scheme: dark) { .map .lbl.passlbl { fill: var(--gold); } }
@keyframes passPulse { 50% { transform: scale(1.35); opacity: .12; } }
@media (prefers-reduced-motion: reduce) { .map .pass-glow { animation: none; } }
.map .lbl { paint-order: stroke; stroke: var(--land); stroke-width: 4px; stroke-linejoin: round; }
.map .lbl.passlbl { font-size: 11.5px; }

/* ---------- app shell additions: offline, install, account, errors ---------- */
.offline-btn { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #FFF6EC; border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.offline-btn:disabled { cursor: default; opacity: .9; }
.offline-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chip-top { display: inline-flex; align-items: center; gap: 5px; border: 2px solid var(--line); background: var(--surface); color: var(--terra); border-radius: 10px; padding: 4px 9px; font: inherit; font-size: 12.5px; font-weight: 900; cursor: pointer; }
.chip-top svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.icon-btn.signed-in { color: var(--good); }
.load-error { padding: 60px 26px; text-align: center; }
.load-error h2 { font-size: 22px; font-weight: 900; margin: 0 0 10px; }
.load-error p { color: var(--ink-2); font-weight: 700; margin: 0 0 20px; }
.load-error .btn { text-decoration: none; max-width: 260px; margin: 0 auto; }
