/* ============================================================
   WICK · design system — Duolingo's bones, Wick's soul.
   Rules: NO gradient fills. NO emoji icons. Solid fills + hard
   darker "lips" (box-shadow 0 4px 0) = the Duolingo 3D press feel.
   Identity = candlelight in the dark: WARM DARK is the signature
   (default); warm-parchment LIGHT is the opt-in via [data-theme].
   Display type = Fraunces serif (from Wick's original concept);
   UI type = Nunito rounded (keeps the gamified feel).
   ============================================================ */

:root, body.duo {
  /* brand */
  --green: #16c784; --green-lip: #0e9c63; --green-soft: #123a2c;
  --flame: #ff9838; --flame-lip: #d97a1c; --ember: #ffb648;   /* the wick flame — Wick's second accent */
  --blue: #38bdf8; --blue-lip: #219fd6; --blue-soft: #123244; --blue-border: #2f6f8c;
  --red: #ff5a4d; --red-lip: #e23b30; --red-soft: #3d1c18;
  --gold: #f5c451; --gold-lip: #c9993a; --gold-soft: #33290f;
  --orange: #ffb648; --orange-lip: #dd9426;
  --purple: #c084fc; --purple-lip: #9d5fe0; --purple-soft: #2b1f3a;
  /* readable text ON the -soft tints (theme-aware; dark defaults here) */
  --green-ink:#3ef0a8; --red-ink:#ff9a8f; --gold-ink:#f5c451; --purple-ink:#dcb2ff; --blue-ink:#8fd6f2;

  /* WARM CANDLELIT DARK — Wick's signature look (default) */
  --bg: #17120d;             /* warm espresso near-black */
  --wtint: var(--bg);        /* per-world accent, set from JS (learn view) */
  --bg-tint: color-mix(in srgb, var(--wtint) 8%, var(--bg));
  --card: #221a12;           /* warm lifted card */
  --line: #3a2e22;
  --line-strong: #4e3e2f;
  --ink: #f4ece1;            /* warm off-white */
  --ink-strong: #fff8ee;
  --muted: #b7a892;          /* warm wolf */
  --faint: #8a7b68;
  --panel: #1d160f;
  --chart-bg: #140f0a;       /* charts stay dark for candle contrast */
  --scrim: rgba(8,5,2,.68);
  --glow: 0 0 22px rgba(255,152,56,.30);   /* candle glow (soft shadow, not a gradient) */

  --f: "Nunito", "Segoe UI", system-ui, sans-serif;
  --fdisplay: "Fraunces", "Iowan Old Style", Georgia, serif;
  --r: 16px;
  --r-sm: 12px;
}

/* WARM PARCHMENT LIGHT — the opt-in theme */
body.duo[data-theme="light"] {
  --green-soft:#d7f5ea; --blue-soft:#e2f3fb; --red-soft:#ffe4e0; --gold-soft:#fbf0cf; --purple-soft:#f2e6ff;
  --green-ink:#0e7a4f; --red-ink:#c8321f; --gold-ink:#9a7412; --purple-ink:#8a4fd0; --blue-ink:#1f8bc0;
  --blue-border:#8fd6f2;
  --bg:#fbf6ec; --card:#fffdf8; --line:#eadfca; --line-strong:#d9cbad;
  --ink:#453a2c; --ink-strong:#2c2318; --muted:#8a7b62; --faint:#b3a184;
  --panel:#f4eddd; --chart-bg:#17120d; --scrim:rgba(40,30,16,.5);
  --glow: 0 0 18px rgba(255,152,56,.26);
}

/* ---------- base ---------- */
body.duo {
  margin: 0; background: var(--bg-tint); color: var(--ink);
  font-family: var(--f); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
body.duo *, body.duo *::before, body.duo *::after { box-sizing: border-box; }
body.duo h1, body.duo h2, body.duo h3, body.duo h4 { margin: 0; color: var(--ink-strong); font-weight: 800; }
body.duo p { margin: 0; }
body.duo button { font-family: var(--f); cursor: pointer; border: 0; background: none; color: inherit; touch-action: manipulation; }
body.duo :focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
body.duo img, body.duo svg { max-width: 100%; }
.dico { display: inline-block; vertical-align: middle; flex: none; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  body.duo *, body.duo *::before, body.duo *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Wick display type (Fraunces serif) on brand moments ---------- */
body.duo .wb-name,
body.duo .fn-title,
body.duo .fn-big h2,
body.duo .q-hero h2,
body.duo .view-head h2,
body.duo .prof-name,
body.duo .lesson-done .card-title,
body.duo .world-next-gate h4 {
  font-family: var(--fdisplay);
  font-weight: 700;
  font-optical-sizing: auto;
  letter-spacing: -.015em;
}

/* ---------- candle glow (soft drop-shadow, no gradient) ---------- */
body.duo .pnode.current .node-candle { filter: drop-shadow(0 0 13px rgba(255,152,56,.55)); }
body.duo .pnode.lit .node-candle { filter: drop-shadow(0 0 6px rgba(22,199,132,.32)); }
body.duo .fn-mascot > .dico, body.duo .q-hero > .dico { filter: drop-shadow(0 0 16px rgba(255,152,56,.28)); }

/* ---------- buttons: the Duolingo 3D press ---------- */
.db {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: var(--r);
  font-weight: 800; font-size: 15px; letter-spacing: .8px; text-transform: uppercase;
  text-decoration: none; user-select: none;
  background: var(--green); color: #fff;
  box-shadow: 0 4px 0 var(--green-lip);
  transition: filter .12s, transform .1s, box-shadow .1s;
}
.db:hover { filter: brightness(1.06); }
.db:active { transform: translateY(4px); box-shadow: 0 0 0 var(--green-lip); }
.db:disabled { background: var(--line); color: var(--faint); box-shadow: 0 4px 0 var(--line-strong); cursor: default; filter: none; }
.db-blue { background: var(--blue); box-shadow: 0 4px 0 var(--blue-lip); }
.db-blue:active { box-shadow: 0 0 0 var(--blue-lip); }
.db-red { background: var(--red); box-shadow: 0 4px 0 var(--red-lip); }
.db-red:active { box-shadow: 0 0 0 var(--red-lip); }
.db-gold { background: var(--gold); box-shadow: 0 4px 0 var(--gold-lip); color: #7a5800; }
.db-gold:active { box-shadow: 0 0 0 var(--gold-lip); }
.db-white { background: var(--card); color: var(--blue); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.db-white:active { box-shadow: 0 0 0 var(--line); }
.db-ghost { background: transparent; color: var(--blue); box-shadow: none; }
.db-ghost:hover { background: var(--blue-soft); filter: none; }
.db-ghost:active { transform: none; }
.db-block { display: flex; width: 100%; }

/* ---------- generic card ---------- */
.dcard { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 20px; }
.dcard-title { font-size: 19px; font-weight: 800; color: var(--ink-strong); display: flex; align-items: center; gap: 10px; }

/* ============================================================
   APP SHELL — 3-column Duolingo PC layout
   ============================================================ */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.center-col { display: flex; justify-content: center; gap: 40px; padding: 24px 24px 96px; }
.feed { width: 100%; max-width: 620px; min-width: 0; }

/* sidebar */
.snav {
  position: sticky; top: 0; height: 100dvh; padding: 16px 14px; z-index: 40;
  border-right: 2px solid var(--line); background: var(--bg);
  display: flex; flex-direction: column; gap: 6px;
}
.snav-brand { display: flex; align-items: center; padding: 10px 12px 18px; }
.snav a.sitem, .snav button.sitem {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r-sm);
  font-weight: 800; font-size: 13.5px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); text-decoration: none; border: 2px solid transparent; min-height: 48px;
}
.snav .sitem:hover { background: var(--panel); }
.snav .sitem.on { background: var(--blue-soft); border-color: var(--blue-border); color: var(--blue); }
.snav .sitem .dico { width: 30px; height: 30px; }
.snav-foot { margin-top: auto; padding: 8px 12px; color: var(--faint); font-size: 12px; font-weight: 700; }

/* right rail */
.rail { width: 372px; flex: none; display: flex; flex-direction: column; gap: 18px; }
.rail-stats { display: flex; justify-content: flex-end; gap: 18px; padding: 4px 2px; position: sticky; top: 0; background: var(--bg-tint); z-index: 5; }
.rstat { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 16px; color: var(--muted); }
.rstat b { color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.rstat .dico { width: 26px; height: 26px; }
.rstat.streak-on b { color: var(--orange); }
.rail .dcard p { color: var(--muted); font-size: 14.5px; font-weight: 600; margin-top: 6px; }
.rail-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rail-link { font-weight: 800; font-size: 13px; letter-spacing: .8px; text-transform: uppercase; color: var(--blue); text-decoration: none; }
.rail-quest { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.rail-quest .dico { width: 34px; height: 34px; }
.rq-body { flex: 1; min-width: 0; }
.rq-title { font-weight: 800; font-size: 14.5px; color: var(--ink-strong); }

/* progress bars (solid fill + solid highlight stripe — no gradients) */
.pbar { position: relative; height: 16px; border-radius: 8px; background: var(--line); overflow: hidden; margin-top: 6px; }
.pbar > i { position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--gold); border-radius: 8px; transition: width .5s ease-out; }
.pbar > i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.45); }
.pbar.green > i { background: var(--green); }
.pbar-n { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--ink-strong); z-index: 1; }

/* ============================================================
   LEARN — world banner + candle path
   ============================================================ */
.world-banner {
  position: sticky; top: 12px; z-index: 20; border-radius: var(--r);
  color: #fff; padding: 16px 20px; display: flex; align-items: center; gap: 14px;
  background: var(--wcolor, var(--green));
  box-shadow: 0 4px 0 var(--wlip, var(--green-lip));
}
.wb-back { width: 48px; height: 48px; border-radius: var(--r-sm); display: grid; place-items: center; color: #fff; opacity: .9; }
.wb-back:hover { background: rgba(0,0,0,.12); }
.wb-main { flex: 1; min-width: 0; }
.wb-kicker { font-size: 12.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; opacity: .85; }
.wb-name { font-size: 21px; font-weight: 800; line-height: 1.25; }
.wb-count { font-weight: 800; font-size: 14px; background: rgba(0,0,0,.16); border-radius: 10px; padding: 6px 12px; font-variant-numeric: tabular-nums; }

/* world pager row */
.world-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 2px 4px; }
.wp-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; min-height: 44px; border-radius: var(--r-sm);
  font-weight: 800; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--blue); border: 2px solid var(--line); background: var(--card); }
.wp-btn:disabled { color: var(--faint); }
.wp-btn .dico { width: 18px; height: 18px; }

/* the path */
.wpath { position: relative; margin: 8px auto 30px; max-width: 460px; }
.wpath-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wpath-svg .seg { fill: none; stroke-width: 12px; stroke-linecap: round; stroke: var(--line); }
.wpath-svg .seg.lit { stroke: var(--green); }
.pnode { position: absolute; transform: translate(-50%, 0); display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 120px; background: none; border: none; padding: 0; }
.pnode .node-candle { transition: transform .12s; }
.pnode:hover .node-candle { transform: scale(1.05); }
.pnode:active .node-candle { transform: scale(.95); }
.pnode-label { font-size: 13px; font-weight: 800; color: var(--muted); text-align: center; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pnode.locked { cursor: default; }
.pnode.locked .pnode-label { color: var(--faint); }
.pnode.current .node-flame { animation: flick 1.6s ease-in-out infinite; }
@keyframes flick { 0%,100% { transform: scale(1) rotate(-1.5deg); } 50% { transform: scale(1.12) rotate(2deg); } }
.pnode.shake { animation: nshake .4s; }
@keyframes nshake { 0%,100% { transform: translate(-50%,0); } 25% { transform: translate(calc(-50% - 6px),0); } 75% { transform: translate(calc(-50% + 6px),0); } }

/* START speech bubble over the current node */
.start-bub {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 8px 16px;
  color: var(--green); font-weight: 800; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap;
  animation: bob 1.4s ease-in-out infinite;
}
.start-bub::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: var(--line); }
.start-bub::before { content: ""; position: absolute; top: calc(100% - 3px); left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: var(--card); z-index: 1; }
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-6px); } }

/* hidden future world teaser */
.world-next-gate { text-align: center; border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 26px 20px; margin: 6px 0 40px; }
.world-next-gate .dico { width: 44px; height: 44px; }
.world-next-gate h4 { margin-top: 8px; font-size: 16.5px; }
.world-next-gate p { color: var(--muted); font-size: 14px; font-weight: 600; margin-top: 4px; }

/* map summary chip */
.path-summary { text-align: center; color: var(--muted); font-weight: 800; font-size: 13.5px; margin: 14px 0 2px; letter-spacing: .4px; }

/* toast */
#duo-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink-strong); color: var(--bg); font-weight: 800; font-size: 14.5px; padding: 12px 20px; border-radius: 14px;
  pointer-events: none; transition: .25s; z-index: 200; max-width: min(90vw, 480px); text-align: center; }
#duo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   QUESTS
   ============================================================ */
.q-hero { border-radius: var(--r); background: var(--purple); box-shadow: 0 4px 0 var(--purple-lip);
  color: #fff; padding: 22px 24px; display: flex; align-items: center; gap: 16px; }
.q-hero h2 { color: #fff; font-size: 24px; }
.q-hero p { opacity: .9; font-weight: 700; margin-top: 4px; }
.q-hero .dico { margin-left: auto; }
.q-sect { display: flex; align-items: center; justify-content: space-between; margin: 26px 4px 10px; }
.q-sect h3 { font-size: 13.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.q-timer { display: flex; align-items: center; gap: 6px; color: var(--orange); font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.q-timer .dico { width: 18px; height: 18px; }
.quest-row { display: flex; align-items: center; gap: 16px; padding: 18px; border: 2px solid var(--line); border-radius: var(--r); background: var(--card); margin-bottom: 12px; }
.quest-row .q-icon { width: 44px; height: 44px; }
.quest-row .q-main { flex: 1; min-width: 0; }
.quest-row .q-title { font-weight: 800; font-size: 16px; color: var(--ink-strong); }
.quest-row .pbar { height: 18px; }
.quest-row.done { border-color: var(--green); }
.quest-row.done .q-title { color: var(--green); }
.q-banner { border-radius: var(--r); background: #12395c; border: 2px solid #0d2c47; padding: 8px 0 0; overflow: hidden; margin-bottom: 12px; }
.q-banner-art { display: block; margin: 0 auto; }

/* ============================================================
   COMPS / MISC shared bits
   ============================================================ */
.view-head { margin: 6px 2px 18px; }
.view-head h2 { font-size: 26px; }
.view-head p { color: var(--muted); font-weight: 600; margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; gap: 10px; margin-top: 12px; }
.field input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 2px solid var(--line); background: var(--panel); color: var(--ink-strong); font: inherit; font-weight: 700; }
.field input::placeholder { color: var(--faint); font-weight: 600; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 2px solid var(--line); }
.friend-row:last-child { border-bottom: 0; }
.friend-av { width: 44px; height: 44px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line); display: grid; place-items: center; font-size: 22px; }
.friend-name { font-weight: 800; color: var(--ink-strong); flex: 1; }
.friend-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.friend-meta .dico { width: 18px; height: 18px; }
.msg { font-size: 14px; font-weight: 700; margin-top: 10px; }
.msg.ok { color: var(--green); } .msg.err { color: var(--red); }

/* misc settings rows */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 4px; border-bottom: 2px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-label { font-weight: 800; color: var(--ink-strong); }
.set-sub { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.seg-ctl { display: flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg-ctl button { padding: 9px 14px; min-height: 44px; font-weight: 800; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.seg-ctl button.on { background: var(--blue-soft); color: var(--blue); }
.avatar-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.avatar-grid button { width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--line); font-size: 24px; display: grid; place-items: center; background: var(--card); }
.avatar-grid button.on { border-color: var(--blue); background: var(--blue-soft); }

/* profile header card */
.prof-head { display: flex; align-items: center; gap: 16px; }
.prof-av { width: 72px; height: 72px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line); display: grid; place-items: center; font-size: 36px; }
.prof-name { font-size: 22px; font-weight: 800; color: var(--ink-strong); }
.prof-mail { color: var(--muted); font-weight: 600; font-size: 14px; }

/* ============================================================
   FUNNEL (onboarding) — full-screen Duolingo flow
   ============================================================ */
.funnel { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; flex-direction: column; overflow-y: auto; }
.fn-top { display: flex; align-items: center; gap: 14px; max-width: 640px; width: 100%; margin: 0 auto; padding: 18px 20px 6px; }
.fn-back { width: 48px; height: 48px; display: grid; place-items: center; color: var(--faint); border-radius: 12px; }
.fn-back:hover { background: var(--panel); color: var(--muted); }
.fn-bar { flex: 1; height: 16px; border-radius: 8px; background: var(--line); overflow: hidden; }
.fn-bar > i { display: block; height: 100%; width: 0%; background: var(--green); border-radius: 8px; transition: width .4s ease-out; position: relative; }
.fn-bar > i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3.5px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.4); }
.fn-body { width: 100%; max-width: 640px; margin: 0 auto; padding: 18px 20px 130px; flex: 1; }
.fn-mascot { display: flex; align-items: flex-end; gap: 14px; margin: 10px 0 26px; }
.fn-bubble { position: relative; border: 2px solid var(--line); border-radius: var(--r); padding: 14px 18px;
  font-size: 18px; font-weight: 800; color: var(--ink-strong); background: var(--card); max-width: 420px; }
.fn-bubble::after { content: ""; position: absolute; left: -12px; bottom: 22px; border: 7px solid transparent; border-right-color: var(--line); }
.fn-bubble::before { content: ""; position: absolute; left: -8px; bottom: 23px; border: 6px solid transparent; border-right-color: var(--card); z-index: 1; }
.fn-title { font-size: 24px; font-weight: 800; color: var(--ink-strong); margin: 4px 0 18px; }
.fn-opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--card);
  padding: 14px 16px; min-height: 56px; font-weight: 800; font-size: 16.5px; color: var(--ink-strong);
  box-shadow: 0 3px 0 var(--line); transition: transform .08s, box-shadow .08s;
}
.opt:hover { background: var(--panel); }
.opt:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.opt.picked { border-color: var(--blue-border); background: var(--blue-soft); color: var(--blue); box-shadow: 0 3px 0 var(--blue-border); }
.opt .dico { width: 34px; height: 34px; }
.opt .opt-side { margin-left: auto; color: var(--muted); font-weight: 700; font-size: 14px; }
.opt.picked .opt-side { color: var(--blue); }
.opt-check { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.opt-check svg { display: none; }                                    /* empty box until picked */
.opt.picked .opt-check { background: var(--blue); border-color: var(--blue); }
.opt.picked .opt-check svg { display: block; }
.opt.picked .opt-check svg path { stroke: #fff; }
.fn-foot { position: fixed; left: 0; right: 0; bottom: 0; border-top: 2px solid var(--line); background: var(--bg); z-index: 10; }
.fn-foot-in { max-width: 640px; margin: 0 auto; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; gap: 12px; }
.fn-foot-in .db { min-width: 160px; }
/* interstitials (enticing / hook / pro) */
.fn-big { text-align: center; padding: 30px 6px 8px; }
.fn-big h2 { font-size: 26px; line-height: 1.3; }
.fn-big .accent { color: var(--purple); }
.fn-big p { color: var(--muted); font-weight: 700; margin-top: 10px; font-size: 16.5px; }
.hook-rows { display: flex; flex-direction: column; gap: 20px; margin-top: 30px; text-align: left; }
.hook-row { display: flex; gap: 16px; align-items: flex-start; }
.hook-row .dico { width: 44px; height: 44px; }
.hook-row h4 { font-size: 17.5px; }
.hook-row p { color: var(--muted); font-weight: 600; margin-top: 2px; font-size: 15px; }
/* auth inside funnel */
.fn-auth input { width: 100%; min-height: 52px; padding: 12px 16px; border-radius: var(--r-sm); border: 2px solid var(--line);
  background: var(--panel); color: var(--ink-strong); font: inherit; font-weight: 700; margin-bottom: 10px; }
.fn-auth input::placeholder { color: var(--faint); font-weight: 600; }
.fn-auth .err { color: var(--red); font-weight: 700; font-size: 14px; min-height: 20px; margin: 2px 0 8px; }
.fn-switch { text-align: center; margin-top: 14px; color: var(--muted); font-weight: 700; font-size: 14.5px; }
.fn-switch button { color: var(--blue); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }

/* ============================================================
   LESSON OVERLAY — restyled Duolingo-clean (player logic untouched)
   ============================================================ */
body.duo .lesson-overlay { position: fixed; inset: 0; z-index: 250; background: var(--bg); overflow-y: auto; }
body.duo .lesson-shell { max-width: 640px; margin: 0 auto; padding: 18px 20px 40px; min-height: 100dvh; display: flex; flex-direction: column; }
body.duo .lesson-top { display: flex; align-items: center; gap: 14px; }
body.duo .lesson-close { order: -1; width: 48px; height: 48px; border-radius: 12px; font-size: 22px; color: var(--faint); display: grid; place-items: center; }
body.duo .lesson-close:hover { background: var(--panel); color: var(--muted); }
body.duo .lesson-bar { flex: 1; height: 16px; border-radius: 8px; background: var(--line); overflow: hidden; }
body.duo .lesson-bar-fill { display: block; height: 100%; background: var(--green); border-radius: 8px; transition: width .4s ease-out; position: relative; }
body.duo .lesson-bar-fill::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3.5px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.4); }
body.duo .lesson-name { display: none; }
body.duo #lesson-hearts { display: flex; align-items: center; gap: 3px; font-weight: 800; color: var(--red); }
body.duo #lesson-hearts .dico { width: 24px; height: 24px; }
body.duo #lesson-combo { color: var(--orange); font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 4px; }
body.duo #lesson-combo .dico { width: 20px; height: 20px; }
body.duo .lesson-body { flex: 1; padding: 26px 0 10px; }
body.duo .card-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: 1.2px;
  color: var(--purple); border: 2px solid var(--purple); border-radius: 9px; padding: 3px 10px; margin-bottom: 14px; text-transform: uppercase; }
body.duo .card-kind[data-k="quiz"], body.duo .card-kind[data-k="spot"] { color: var(--blue); border-color: var(--blue); }
body.duo .card-kind[data-k="call"], body.duo .card-kind[data-k="play"] { color: var(--orange); border-color: var(--orange); }
body.duo .card-kind[data-k="note"] { color: var(--green); border-color: var(--green); }
body.duo .card-kind[data-k="lightning"] { color: var(--flame); border-color: var(--flame); }
body.duo .card-title { font-size: 23px; margin: 2px 0 10px; }
body.duo .card-text { font-size: 17px; font-weight: 600; color: var(--ink); }
body.duo .card-q { font-size: 21px; font-weight: 800; color: var(--ink-strong); margin: 4px 0 16px; }
body.duo .card-again { display: inline-block; color: var(--orange); font-weight: 800; font-size: 13px; letter-spacing: .8px; text-transform: uppercase; margin: 0 0 8px 10px; }
body.duo .card-chart { background: var(--chart-bg); border-radius: var(--r-sm); border: 2px solid var(--line); padding: 10px; margin: 14px 0; }
body.duo .card-chart svg { display: block; width: 100%; height: 190px; }
body.duo .card-chart.tall svg { height: 240px; }
body.duo .quiz-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
body.duo .quiz-opt { display: block; width: 100%; text-align: left; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--card);
  padding: 14px 16px; min-height: 52px; font-weight: 800; font-size: 16px; color: var(--ink-strong); box-shadow: 0 3px 0 var(--line); }
body.duo .quiz-opt:hover { background: var(--panel); }
body.duo .quiz-opt:active { transform: translateY(3px); box-shadow: none; }
body.duo .quiz-opt.right { border-color: var(--green); background: var(--green-soft); color: var(--green-lip); box-shadow: 0 3px 0 var(--green); }
body.duo .quiz-opt.wrong { border-color: var(--red); background: var(--red-soft); color: var(--red-lip); box-shadow: 0 3px 0 var(--red); }
body.duo .card-why { margin-top: 16px; border-radius: var(--r-sm); padding: 14px 16px; font-weight: 700; font-size: 15.5px;
  background: var(--panel); border: 2px solid var(--line); color: var(--ink); }
body.duo .card-why.good { background: var(--green-soft); border-color: var(--green); color: var(--green-lip); }
body.duo .card-why.bad { background: var(--red-soft); border-color: var(--red); color: var(--red-lip); }
body.duo .lesson-footer { display: flex; gap: 12px; justify-content: flex-end; padding: 14px 0 4px; border-top: 2px solid var(--line); }
body.duo .lesson-footer .btn-primary, body.duo .lesson-footer .btn-ghost { min-width: 150px; }
/* map old button classes (used inside player) onto the new system */
body.duo .btn-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px;
  border-radius: var(--r); font-weight: 800; font-size: 15px; letter-spacing: .8px; text-transform: uppercase;
  background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-lip); border: 0; transition: filter .12s, transform .1s, box-shadow .1s; }
body.duo .btn-primary:hover { filter: brightness(1.06); }
body.duo .btn-primary:active { transform: translateY(4px); box-shadow: 0 0 0 var(--green-lip); }
body.duo .btn-ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px;
  border-radius: var(--r); font-weight: 800; font-size: 15px; letter-spacing: .8px; text-transform: uppercase;
  background: var(--card); color: var(--blue); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
body.duo .btn-ghost:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
body.duo .btn-call { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 26px;
  border-radius: var(--r); font-weight: 800; font-size: 16px; letter-spacing: .8px; text-transform: uppercase; border: 0; color: #fff; }
body.duo .btn-up { background: var(--green); box-shadow: 0 4px 0 var(--green-lip); }
body.duo .btn-down { background: var(--red); box-shadow: 0 4px 0 var(--red-lip); }
body.duo .btn-up:active, body.duo .btn-down:active { transform: translateY(4px); box-shadow: none; }
body.duo .call-controls { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
/* recall + note cards */
body.duo .recall-card { border: 2px solid var(--line); border-radius: var(--r); padding: 22px; background: var(--card); }
body.duo .recall-front { font-size: 19px; font-weight: 800; color: var(--ink-strong); }
body.duo .recall-back { margin-top: 14px; border-top: 2px solid var(--line); padding-top: 14px; }
body.duo .recall-back h4 { font-size: 17px; margin-bottom: 6px; }
body.duo .recall-back p { color: var(--ink); font-weight: 600; }
body.duo .recall-grade { display: flex; gap: 10px; margin-top: 16px; }
body.duo .recall-grade .quiz-opt { flex: 1; text-align: center; }
body.duo .recall-yes.quiz-opt { border-color: var(--green); color: var(--green-lip); box-shadow: 0 3px 0 var(--green); }
body.duo .recall-no.quiz-opt { border-color: var(--gold-lip); color: var(--gold-lip); box-shadow: 0 3px 0 var(--gold-lip); }
body.duo .note-card { position: relative; background: #fdf6dd; border: 2px solid #e8d8a0; border-radius: 10px; padding: 22px 22px 18px;
  font-family: "Segoe Print", "Comic Sans MS", cursive; color: #4a3f22;
  background-image: repeating-linear-gradient(transparent, transparent 27px, #e9ddb6 27px, #e9ddb6 28px); }
body.duo .note-tape { position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-2deg); width: 90px; height: 20px; background: #f3e9c8; border: 1px solid #e0d3a4; opacity: .9; }
body.duo .note-kicker { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; opacity: .7; margin-bottom: 6px; }
body.duo .note-title { font-size: 20px; color: #3d3418; margin-bottom: 8px; font-family: inherit; }
body.duo .note-bullets { margin: 0; padding-left: 20px; font-size: 15.5px; line-height: 28px; }
body.duo .note-take { margin-top: 10px; font-weight: 700; background: #fff3a6; display: inline-block; padding: 2px 8px; border-radius: 6px; }
body.duo .note-hint { color: var(--muted); font-weight: 700; font-size: 13.5px; margin-top: 12px; text-align: center; }
/* spot/play mounts (lesson-interactive.js class names) */
body.duo .spot-prompt { font-size: 19px; font-weight: 800; color: var(--ink-strong); margin: 4px 0 10px; }
body.duo .spot-hint { display: inline-block; color: var(--blue); font-weight: 800; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 8px; }
body.duo .play-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
body.duo .play-bar input[type="range"] { flex: 1; accent-color: var(--green); min-height: 44px; }
body.duo .play-btn { min-width: 52px; min-height: 48px; border-radius: var(--r-sm); background: var(--green); color: #fff;
  font-weight: 800; font-size: 15px; letter-spacing: .5px; box-shadow: 0 3px 0 var(--green-lip); }
body.duo .play-btn:active { transform: translateY(3px); box-shadow: none; }
body.duo .play-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
/* lightning round */
body.duo .lr-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 10px; }
body.duo .lr-round { font-weight: 800; font-size: 12.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
body.duo .lr-combo { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--flame); }
body.duo .lr-combo svg { width: 18px; height: 18px; }
body.duo .lr-note { margin-top: 12px; font-weight: 700; font-size: 15px; min-height: 22px; }
body.duo .lr-note.good { color: var(--green-ink); }
body.duo .lr-note.bad { color: var(--red-ink); }
body.duo .lr-done { text-align: center; padding: 22px 0 10px; }
/* completion screen */
body.duo .lesson-done { text-align: center; padding: 26px 0 10px; }
body.duo .done-burst { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 90px; margin-bottom: 8px; }
body.duo .done-stats { display: flex; justify-content: center; gap: 14px; margin: 20px 0 8px; flex-wrap: wrap; }
body.duo .done-stats > div { border: 2px solid var(--line); border-radius: var(--r-sm); padding: 12px 18px; min-width: 104px; background: var(--card); }
body.duo .done-stats span { font-size: 21px; font-weight: 800; color: var(--green); display: flex; align-items: center; justify-content: center; gap: 4px; font-variant-numeric: tabular-nums; }
body.duo .done-stats label { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
body.duo .done-bonuses { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
body.duo .done-bonus { border: 2px solid var(--gold); color: var(--gold-lip); background: var(--gold-soft); font-weight: 800; font-size: 13px; border-radius: 10px; padding: 5px 12px; }
body.duo .spark { display: none; }
body.duo .xp-fly { position: absolute; right: 10px; top: 46px; font-weight: 800; color: var(--green); animation: flyup .95s ease-out forwards; z-index: 5; }
body.duo .xp-fly.bad { color: var(--red); }
@keyframes flyup { from { opacity: 0; transform: translateY(8px); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-26px); } }
body.duo .lesson-top { position: relative; }

/* ============================================================
   ACCOUNT OVERLAY (legacy onboard.js) — keep it usable in app
   ============================================================ */
body.duo .account-overlay { position: fixed; inset: 0; z-index: 260; background: var(--scrim); display: grid; place-items: center; padding: 20px; }
body.duo .account-shell { position: relative; width: 100%; max-width: 440px; background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 26px; }
body.duo .account-shell .lesson-close { position: absolute; top: 10px; right: 10px; }
body.duo .acct-brand { display: none; }
body.duo .acct-head h3 { font-size: 21px; margin: 4px 0 6px; }
body.duo .acct-kicker { color: var(--muted); font-weight: 800; font-size: 12.5px; letter-spacing: 1px; text-transform: uppercase; }
body.duo .acct-sub { color: var(--muted); font-weight: 600; font-size: 14.5px; }
body.duo .acct-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
body.duo .acct-form input { min-height: 50px; padding: 12px 14px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--panel); color: var(--ink-strong); font: inherit; font-weight: 700; }
body.duo .acct-err { color: var(--red); font-weight: 700; font-size: 14px; min-height: 18px; }
body.duo .acct-submit { width: 100%; }
body.duo .acct-switch { text-align: center; margin-top: 14px; color: var(--muted); font-weight: 700; font-size: 14px; }
body.duo .acct-switch button { color: var(--blue); font-weight: 800; }
body.duo .survey-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
body.duo .survey-dots { display: flex; gap: 5px; }
body.duo .survey-dots .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
body.duo .survey-dots .dot.past { background: var(--green); }
body.duo .survey-dots .dot.now { background: var(--blue); }
body.duo .survey-count { color: var(--muted); font-weight: 800; font-size: 12.5px; }
body.duo .survey-q { font-size: 19px; margin: 6px 0 4px; }
body.duo .survey-sub { color: var(--muted); font-weight: 600; font-size: 14px; }
body.duo .survey-opts { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
body.duo .survey-opt { text-align: left; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--card); padding: 12px 14px; min-height: 48px; font-weight: 800; font-size: 15px; color: var(--ink-strong); box-shadow: 0 3px 0 var(--line); }
body.duo .survey-opt.picked { border-color: var(--blue-border); background: var(--blue-soft); color: var(--blue); }
body.duo .survey-done { text-align: center; padding: 10px 0; }
body.duo .oauth-row { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
body.duo .oauth-btn { min-height: 48px; border: 2px solid var(--line); border-radius: var(--r-sm); font-weight: 800; background: var(--card); color: var(--ink-strong); box-shadow: 0 3px 0 var(--line); }
body.duo .acct-or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-weight: 700; font-size: 13px; margin: 12px 0 2px; }
body.duo .acct-or::before, body.duo .acct-or::after { content: ""; flex: 1; height: 2px; background: var(--line); }

/* ============================================================
   RESPONSIVE — mobile-first end state: sidebar → bottom tab bar
   ============================================================ */
@media (max-width: 1140px) { .rail { display: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .snav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around;
    border-right: 0; border-top: 2px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .snav-brand, .snav-foot, .snav .sitem .slabel { display: none; }
  .snav a.sitem, .snav button.sitem { padding: 8px 14px; min-width: 56px; justify-content: center; }
  .center-col { padding: 14px 12px 110px; }
  .world-banner { top: 8px; }
  .fn-bubble { font-size: 16px; }
}
@media (max-width: 480px) {
  .pnode { width: 104px; }
  .wb-name { font-size: 18px; }
  .q-hero .dico { display: none; }
}
