/* ============ Wick design system ============ */
:root {
  --bg: #07090d;
  --panel: #0d1118;
  --panel-2: #12171f;
  --line: rgba(255, 255, 255, 0.08);
  --ink: #e9edf5;
  --muted: #8b93a7;
  --green: #16c784;
  --green-dim: rgba(22, 199, 132, 0.14);
  --red: #ff4757;
  --red-dim: rgba(255, 71, 87, 0.14);
  --flame: #ffb648;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--flame); outline-offset: 3px;
}
.acct-form input:focus-visible { outline: none; }
/* make the `hidden` attribute win even against class rules that set display
   (e.g. .tt-layout{display:grid}) — without this, "hidden" panels still render */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
em { font-family: var(--serif); font-style: italic; font-weight: 400; }

#bg-candles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.5;
}

/* ============ entrance animations ============ */
@keyframes blurIn {
  from { opacity: 0; filter: blur(12px); transform: translateY(18px); }
  to { opacity: 1; filter: blur(0); transform: none; }
}
.blur-in { animation: blurIn 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--d, 0) * 130ms); }
.blur-in-scroll { opacity: 0; filter: blur(12px); transform: translateY(18px); transition: all 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.blur-in-scroll.vis { opacity: 1; filter: blur(0); transform: none; }

/* ============ glass ============ */
.glass-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  font-size: 13px; font-weight: 500; color: var(--ink);
  white-space: nowrap;
}

/* ============ topbar ============ */
.topbar {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px clamp(20px, 5vw, 56px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand-mark {
  width: 14px; height: 26px; border-radius: 4px; background: var(--green);
  position: relative;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  width: 3px; background: var(--flame); border-radius: 2px;
}
.brand-mark::before { top: -6px; height: 6px; }
.brand-mark::after { bottom: -6px; height: 6px; }
.top-right { display: flex; gap: 10px; align-items: center; }
.sound-toggle { cursor: pointer; font-size: 14px; padding: 8px 12px; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.sound-toggle:hover { background: rgba(255, 255, 255, 0.1); }

/* ============ hero ============ */
.hero {
  position: relative; z-index: 1;
  text-align: center;
  padding: clamp(48px, 9vh, 110px) 20px clamp(40px, 6vh, 80px);
  max-width: 900px; margin: 0 auto;
}
.hero-pills { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.hero h1 {
  font-size: clamp(44px, 7.5vw, 84px);
  line-height: 1.04; letter-spacing: -0.035em; font-weight: 800;
}
.hero h1 em { color: var(--flame); font-weight: 400; }
.hero-sub {
  margin: 26px auto 0; max-width: 560px;
  color: var(--muted); font-size: clamp(15px, 2vw, 18px); line-height: 1.65;
}
.hero-cta { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.cta-note { color: var(--muted); font-size: 13px; }

/* chunky game buttons: hard bottom edge, press-down on click (Duolingo depth) */
.btn-primary {
  cursor: pointer; border: none; border-radius: 16px;
  padding: 16px 34px; font-size: 16px; font-weight: 800; font-family: var(--sans);
  color: #04301d; background: linear-gradient(180deg, #23e39c, #17c987);
  box-shadow: 0 5px 0 #0d9a63, 0 14px 34px rgba(22, 199, 132, 0.3);
  transition: transform 0.1s, box-shadow 0.1s, filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 6px 0 #0d9a63, 0 16px 38px rgba(22, 199, 132, 0.4); }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #0d9a63; }
.btn-ghost {
  cursor: pointer; border-radius: 16px; padding: 16px 28px;
  font-size: 15px; font-weight: 700; font-family: var(--sans); color: var(--ink);
  background: #1b2333; border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 4px 0 #0c111c;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}
.btn-ghost:hover { background: #222b3e; }
.btn-ghost:active { transform: translateY(3px); box-shadow: 0 1px 0 #0c111c; }

/* ============ trade link (header) ============ */
.trade-link { text-decoration: none; cursor: pointer; font-weight: 700; }
.trade-link:hover { background: rgba(255, 255, 255, 0.1); }
.trade-live {
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 99px;
  background: var(--green-dim); color: var(--green); border: 1px solid rgba(22, 199, 132, 0.4);
  animation: livePulse 2s infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ============ account chip (header) ============ */
.account-chip { position: relative; }
.account-login, .account-me { cursor: pointer; font-weight: 600; }
.account-me:hover, .account-login:hover { background: rgba(255, 255, 255, 0.1); }
.acct-caret { opacity: 0.6; font-size: 10px; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; min-width: 190px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.account-email { color: var(--muted); font-size: 12px; margin-bottom: 10px; word-break: break-all; }
.account-menu button {
  width: 100%; padding: 9px; min-height: 44px; border-radius: 10px; cursor: pointer;
  background: rgba(255, 71, 87, 0.12); border: 1px solid rgba(255, 71, 87, 0.3);
  color: var(--red); font-family: var(--sans); font-weight: 600; font-size: 13px;
}

/* ============ learn gate ============ */
.learn-gate {
  text-align: center; margin-bottom: 30px; padding: 26px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid rgba(255, 182, 72, 0.25); border-radius: 20px;
}
.learn-gate p { color: var(--muted); font-size: 14px; margin: 14px 0 18px; }

/* ============ account overlay ============ */
.account-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(4, 6, 9, 0.9); backdrop-filter: blur(12px);
  display: grid; place-items: center; animation: fadeIn 0.25s;
}
.account-overlay[hidden] { display: none; }
.account-shell {
  position: relative;
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: linear-gradient(180deg, #131926, var(--panel));
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 26px;
  padding: 26px 28px 30px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
  animation: cardPop 0.4s cubic-bezier(0.2, 1.4, 0.3, 1);
}
.acct-brand { justify-content: center; margin-bottom: 18px; font-size: 17px; }
.account-shell .lesson-close { position: absolute; top: 16px; right: 16px; }
.acct-head { text-align: center; margin-bottom: 20px; }
.acct-kicker { color: var(--flame); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.acct-head h3 { font-size: 22px; letter-spacing: -0.02em; margin: 8px 0 6px; }
.acct-sub { color: var(--muted); font-size: 13.5px; line-height: 1.55; }

.oauth-row { display: flex; flex-direction: column; gap: 10px; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px; border-radius: 13px; cursor: pointer;
  background: #fff; color: #1a1a1a; border: none;
  font-family: var(--sans); font-weight: 600; font-size: 14.5px;
  transition: filter 0.12s;
}
.oauth-btn:hover { filter: brightness(0.94); }
.oauth-apple { background: #000; color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.oauth-apple::before { content: ""; }
.oauth-g {
  font-weight: 800; font-size: 16px;
  background: conic-gradient(from -45deg, #ea4335, #fbbc05, #34a853, #4285f4, #ea4335);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.acct-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acct-form { display: flex; flex-direction: column; gap: 11px; }
.acct-form input {
  padding: 14px 16px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  color: var(--ink); font-family: var(--sans); font-size: 15px;
}
.acct-form input:focus { outline: none; border-color: rgba(22, 199, 132, 0.5); }
.acct-err { color: var(--red); font-size: 13px; min-height: 18px; line-height: 1.4; }
.acct-submit { width: 100%; }
.acct-switch { text-align: center; margin-top: 16px; color: var(--muted); font-size: 13.5px; }
.acct-switch button { background: none; border: none; color: var(--green); font-weight: 700; cursor: pointer; font-size: 13.5px; font-family: var(--sans); }

/* ============ survey ============ */
.survey-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.survey-dots { display: flex; gap: 6px; }
.survey-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); transition: background 0.3s, transform 0.3s; }
.survey-dots .dot.past { background: var(--green); }
.survey-dots .dot.now { background: var(--flame); transform: scale(1.3); }
.survey-count { color: var(--muted); font-size: 12px; font-weight: 700; }
.survey-q { font-size: 20px; letter-spacing: -0.02em; line-height: 1.3; }
.survey-sub { color: var(--muted); font-size: 13px; margin-top: 8px; }
.survey-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.survey-opt {
  text-align: left; padding: 15px 17px; border-radius: 14px; cursor: pointer;
  background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line);
  color: var(--ink); font-family: var(--sans); font-size: 15px; font-weight: 500;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.survey-opt:hover { border-color: rgba(22, 199, 132, 0.5); transform: translateX(3px); }
.survey-opt.picked { border-color: var(--green); background: var(--green-dim); color: var(--green); font-weight: 700; }
.survey-done { text-align: center; padding: 20px 0 6px; }
.survey-done h3 { font-size: 22px; margin-bottom: 8px; }
.survey-done .btn-primary { margin-top: 20px; }

/* ============ version badge ============ */
.version {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  font-weight: 700; font-size: 11px; color: var(--flame); letter-spacing: 0.03em;
}

/* ============ hero cta ============ */
.btn-trade {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding: 18px 38px; border-radius: 16px;
  font-family: var(--sans); font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
  color: #062d1f; text-decoration: none;
  background: linear-gradient(120deg, var(--green), #12e08f);
  box-shadow: 0 10px 40px rgba(22, 199, 132, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-trade:hover { transform: translateY(-3px); box-shadow: 0 16px 52px rgba(22, 199, 132, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn-trade:active { transform: translateY(0) scale(0.98); }
.btn-trade-arrow { transition: transform 0.15s; }
.btn-trade:hover .btn-trade-arrow { transform: translateX(4px); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ============ learn / path ============ */
.learn-section { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 40px 20px 70px; }
.learn-head { text-align: center; margin-bottom: 38px; }
.learn-head h2 { font-size: clamp(28px, 4.5vw, 42px); letter-spacing: -0.03em; font-weight: 800; }
.learn-head h2 em { color: var(--flame); }
.learn-head p { color: var(--muted); margin-top: 10px; font-size: 15px; }
/* ---- the wick roadmap ---- */
.map-summary { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.map-summary b { color: var(--flame); font-size: 15px; }
.world { margin-bottom: 40px; }
.world-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 16px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--w) 12%, transparent), transparent 70%);
  border: 1px solid color-mix(in srgb, var(--w) 30%, transparent);
  border-radius: 16px;
}
.world-icon { font-size: 22px; }
.world-head h3 { font-size: 17px; letter-spacing: -0.01em; }
.world-progress { color: var(--w); font-weight: 800; font-size: 13px; margin-left: auto; }
.world-bar { flex-basis: 100%; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.world-bar i { display: block; height: 100%; background: var(--w); border-radius: 99px; transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }

/* ---- the winding road ---- */
.road { position: relative; max-width: 640px; margin: 0 auto; }
.road-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.seg { fill: none; stroke-width: 5; stroke-linecap: round; }
.seg-lit { stroke: rgba(22, 199, 132, 0.75); filter: drop-shadow(0 0 6px rgba(22, 199, 132, 0.45)); }
.seg-dim { stroke: rgba(127, 47, 58, 0.4); stroke-dasharray: 2 10; }

.wick-node {
  position: absolute; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 64px; min-height: 64px; padding: 8px 10px 6px;
  border-radius: 16px; cursor: pointer;
  background: transparent; border: 1px solid transparent;
  color: var(--ink); font-family: var(--sans);
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
  z-index: 1;
}
.wick-node:hover { transform: translateX(-50%) translateY(-3px); background: rgba(255, 255, 255, 0.035); border-color: color-mix(in srgb, var(--w) 40%, transparent); }
.wick-node:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; }
.wick-candle { display: flex; flex-direction: column; align-items: center; height: 56px; justify-content: flex-end; }
.wick-flame {
  width: 11px; height: 15px; margin-bottom: 1px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 75%, #fff4c1, #ffb648 55%, #ff6b4a);
  box-shadow: 0 0 10px rgba(255, 182, 72, 0.8), 0 0 22px rgba(255, 182, 72, 0.35);
  transform-origin: 50% 90%;
}
.wick-string { width: 2.5px; height: 7px; background: #6b7280; border-radius: 2px; }
.wick-wax { width: 20px; height: 32px; border-radius: 5px; }
.wick-title {
  font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center;
  color: var(--muted); max-width: 110px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* locked: dark red, dim, clearly not yet yours */
.wick-node.locked { opacity: 0.5; cursor: not-allowed; }
.wick-node.locked .wick-flame { visibility: hidden; }
.wick-node.locked .wick-wax { background: #6e2531; box-shadow: inset 0 -8px 12px rgba(0, 0, 0, 0.45); }
.wick-node.locked .wick-string { background: #4b5563; }

/* open (dev-code hop): unlit but available */
.wick-node.open .wick-flame { visibility: hidden; }
.wick-node.open .wick-wax { background: #8a4b57; }
.wick-node.open .wick-string { background: #6b7280; }

/* burning: the next lesson — the road points here */
.wick-node.burning { z-index: 2; }
.wick-node.burning .wick-candle { transform: scale(1.25); }
.wick-node.burning::before {
  content: ""; position: absolute; top: -4px; width: 74px; height: 74px; border-radius: 50%;
  border: 2px solid rgba(255, 182, 72, 0.55);
  animation: burnRing 1.6s ease-out infinite;
}
.wick-node.burning .wick-wax { background: #d9a514; box-shadow: 0 0 16px rgba(250, 204, 21, 0.4); }
.wick-node.burning .wick-flame { animation: flameDance 0.9s infinite alternate; }
.wick-node.burning .wick-title { color: var(--flame); font-weight: 700; }

/* lit: done — green and glowing */
.wick-node.lit .wick-wax { background: var(--green); box-shadow: 0 0 14px rgba(22, 199, 132, 0.35); }
.wick-node.lit .wick-flame { transform: scale(0.85); animation: flameDance 2.2s infinite alternate; }
.wick-node.lit .wick-title { color: var(--ink); }

/* the per-world review node */
.wick-node.review .wick-wax { border-radius: 50% 50% 8px 8px; }
.wick-node.review-open .wick-wax { background: #b78ce8; box-shadow: 0 0 12px rgba(183, 140, 232, 0.35); }
.wick-node.review-open .wick-flame { visibility: hidden; }
.wick-node.review.locked .wick-wax { background: #4a3a5c; }

.wick-node.shake { animation: nodeShake 0.35s; }
@keyframes nodeShake {
  0%, 100% { transform: translateX(-50%); }
  25% { transform: translateX(calc(-50% - 6px)); }
  75% { transform: translateX(calc(-50% + 6px)); }
}
@keyframes burnRing {
  from { transform: scale(0.75); opacity: 0.9; }
  to { transform: scale(1.35); opacity: 0; }
}
@keyframes flameDance {
  from { transform: scaleY(1) rotate(-3deg); }
  to { transform: scaleY(1.25) rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .wick-node.burning::before, .wick-node.burning .wick-flame, .wick-node.lit .wick-flame { animation: none; }
}

#map-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1a1f2a; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px;
  padding: 10px 18px; font-size: 13.5px; color: var(--ink); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
}
#map-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ lesson overlay ============ */
.lesson-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 6, 9, 0.88); backdrop-filter: blur(12px);
  display: grid; place-items: center;
  animation: fadeIn 0.25s;
}
.lesson-overlay[hidden] { display: none; }
.lesson-shell {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #11161f, var(--panel));
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 24px;
  padding: 20px 22px; overflow: hidden;
  animation: cardPop 0.4s cubic-bezier(0.2, 1.4, 0.3, 1);
}
.lesson-top { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.lesson-close {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05);
  color: var(--muted); cursor: pointer; font-size: 13px;
  position: relative;
}
/* visual size stays 32px but the tappable area grows to 44px via an invisible hit-slop */
.lesson-close::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
}
.lesson-close:hover { color: var(--ink); }
.lesson-bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.lesson-bar-fill { height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.lesson-name { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.lesson-body { overflow-y: auto; padding: 14px 2px 6px; }
.card-title { font-size: 21px; letter-spacing: -0.02em; margin-bottom: 10px; }
.card-text { color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.card-chart {
  margin-top: 16px; height: 170px; border-radius: 14px; overflow: hidden;
  background: #0a0d13; border: 1px solid var(--line);
}
.card-chart.tall { height: 220px; }
.card-chart svg { width: 100%; height: 100%; display: block; }
.card-q { font-size: 16.5px; font-weight: 600; line-height: 1.55; margin-bottom: 16px; }
.quiz-opts { display: flex; flex-direction: column; gap: 11px; }
.quiz-opt {
  text-align: left; padding: 15px 17px; border-radius: 15px; cursor: pointer;
  background: #161e2c; border: 2px solid rgba(255, 255, 255, 0.13);
  color: var(--ink); font-family: var(--sans); font-size: 15px; font-weight: 700;
  line-height: 1.45; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.12s, background 0.15s;
}
.quiz-opt:hover { transform: translateY(-2px); border-color: rgba(255, 182, 72, 0.55); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4); }
.quiz-opt:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }
.quiz-opt.right {
  border-color: transparent; background: linear-gradient(180deg, #23e39c, #14b97b);
  color: #04301d; box-shadow: 0 4px 0 #0d9a63;
}
.quiz-opt.right::before { content: "\2713  "; font-weight: 900; }
.quiz-opt.wrong {
  border-color: transparent; background: linear-gradient(180deg, #ff5f72, #f0384e);
  color: #fff; box-shadow: 0 4px 0 #b91c30;
}
.quiz-opt.wrong::before { content: "\2715  "; font-weight: 900; }
.card-why {
  margin-top: 14px; padding: 13px 15px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.045); border-left: 3px solid var(--flame);
  color: var(--muted); font-size: 13.5px; line-height: 1.6;
}
.card-why.good { border-left-color: var(--green); }
.card-why.bad { border-left-color: var(--red); }
.call-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.call-controls .btn-call { padding: 15px 0; font-size: 16px; }
.lesson-footer { display: flex; justify-content: flex-end; padding-top: 14px; min-height: 66px; }
.lesson-footer .btn-primary { padding: 13px 30px; font-size: 15px; }
.lesson-done { text-align: center; padding: 26px 0 10px; }
.done-burst { font-size: 44px; margin-bottom: 12px; }

/* ============ game ============ */
.game-section { position: relative; z-index: 1; padding: 10px 16px 90px; display: flex; justify-content: center; }
.game-card {
  width: 100%; max-width: 580px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 24px;
  padding: 18px 18px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.game-card.shake { animation: shake 0.45s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}

.game-status {
  display: flex; align-items: center; gap: 14px;
  padding: 4px 6px 14px; font-size: 14px; font-weight: 600;
}
.stat { color: var(--muted); }
.streak-stat { color: var(--ink); font-size: 16px; display: flex; align-items: center; gap: 4px; }
.flame { filter: grayscale(1) opacity(0.5); transition: filter 0.3s, transform 0.3s; }
.flame.lit { filter: none; }
.flame.hot { filter: none; transform: scale(1.25); }
.timer-wrap { margin-left: auto; position: relative; width: 44px; height: 44px; }
.timer-ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.09); stroke-width: 4; }
.ring-fg {
  fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 119.4; stroke-dashoffset: 0;
}
.timer-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
}

.chart-wrap {
  position: relative; border-radius: 16px; overflow: hidden;
  background: #0a0d13; border: 1px solid var(--line);
  height: 300px;
}
#chart { width: 100%; height: 100%; display: block; }
.chart-veil {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center;
  background: rgba(7, 9, 13, 0.72); backdrop-filter: blur(6px);
}
.chart-veil[hidden] { display: none; }
.reveal-chip {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.55); border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
}

.result-banner { padding: 14px 8px 0; text-align: center; min-height: 74px; }
.result-banner[hidden] { display: block; visibility: hidden; }
.result-title { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.result-title.win { color: var(--green); }
.result-title.win::before { content: "\2713  "; }
.result-title.loss { color: var(--red); }
.result-title.loss::before { content: "\2715  "; }
.result-lesson { margin-top: 7px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.btn-call {
  cursor: pointer; border: none; border-radius: 18px;
  padding: 20px 0; font-size: 20px; font-weight: 800; font-family: var(--sans);
  letter-spacing: 0.02em;
  transition: transform 0.1s, box-shadow 0.1s, filter 0.12s, opacity 0.2s;
}
.btn-call:disabled { opacity: 0.35; cursor: default; }
.btn-call:not(:disabled):hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-call:not(:disabled):active { transform: translateY(4px); box-shadow: none !important; }
.btn-up { background: linear-gradient(180deg, #23e39c, #14b97b); color: #04301d; box-shadow: 0 5px 0 #0d9a63; }
.btn-down { background: linear-gradient(180deg, #ff5f72, #f0384e); color: #fff; box-shadow: 0 5px 0 #b91c30; }
.keys-hint { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 10px; opacity: 0.7; }

/* ============ vision ============ */
.vision { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 30px 24px 110px; text-align: center; }
.vision h2 { font-size: clamp(28px, 4.5vw, 44px); letter-spacing: -0.03em; font-weight: 800; margin-bottom: 44px; }
.vision h2 em { color: var(--flame); }
.vision-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; text-align: left; }
.vision-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 20px; padding: 26px;
}
.vision-icon { font-size: 26px; margin-bottom: 14px; }
.vision-card h3 { font-size: 17px; margin-bottom: 8px; letter-spacing: -0.01em; }
.vision-card p { color: var(--muted); font-size: 14px; line-height: 1.65; }

/* ============ verdict ============ */
.verdict-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(4, 6, 9, 0.8); backdrop-filter: blur(10px);
  animation: fadeIn 0.3s;
}
.verdict-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.verdict-card {
  width: min(440px, calc(100vw - 40px));
  background: linear-gradient(180deg, #131926, var(--panel));
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 26px;
  padding: 34px 30px 28px; text-align: center;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
  animation: cardPop 0.5s cubic-bezier(0.2, 1.4, 0.3, 1);
}
@keyframes cardPop { from { transform: scale(0.85) translateY(20px); opacity: 0; } }
.verdict-kicker { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.verdict-rank {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(30px, 6vw, 38px); color: var(--flame);
  margin: 12px 0 10px; line-height: 1.1;
}
.verdict-roast { color: var(--muted); font-size: 14.5px; line-height: 1.6; max-width: 340px; margin: 0 auto; }
.verdict-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 26px 0; padding: 18px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.verdict-stats span { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.verdict-stats label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.verdict-actions { display: flex; gap: 10px; justify-content: center; }
.verdict-teaser { margin-top: 20px; color: var(--muted); font-size: 12.5px; opacity: 0.8; }

/* ============ footer ============ */
footer {
  position: relative; z-index: 1;
  text-align: center; padding: 40px 24px 50px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; line-height: 1.8;
}

@media (max-width: 560px) {
  .hero-pills .glass-pill { font-size: 11.5px; padding: 6px 12px; }
  .chart-wrap { height: 250px; }
  .day-streak { display: none; }
}

/* ---- lesson player additions (combo, retry tag, end-screen stats) ---- */
#lesson-combo { margin-left: auto; font-weight: 800; font-size: 14px; color: var(--flame); font-variant-numeric: tabular-nums; }
.card-again {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: #b78ce8; background: rgba(183, 140, 232, 0.12);
  border: 1px solid rgba(183, 140, 232, 0.3); border-radius: 99px; padding: 3px 10px; margin-bottom: 10px;
}
.done-stats { display: flex; gap: 28px; justify-content: center; margin: 18px 0 6px; }
.done-stats span { display: block; font-size: 26px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.done-stats label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---- gamification: level pill + completion celebration ---- */
#xp-pill { position: relative; overflow: hidden; }
#xp-pill::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px;
  width: var(--lvl-pct, 0%); background: var(--flame); border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
#xp-lvl {
  font-weight: 800; font-size: 11px; color: #062d1f;
  background: var(--flame); border-radius: 99px; padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}
.done-burst { position: relative; display: inline-block; }
.spark {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-radius: 50%;
  background: var(--flame);
  animation: sparkFly var(--d, 0.6s) ease-out both;
  transform: rotate(var(--a)) translateY(0);
}
@keyframes sparkFly {
  from { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); }
  to { opacity: 0; transform: rotate(var(--a)) translateY(-74px) scale(0.4); }
}
@media (prefers-reduced-motion: reduce) { .spark { animation: none; opacity: 0; } }

/* ---- daily mission card ---- */
.mission-card {
  max-width: 720px; margin: 0 auto 40px; padding: 18px 22px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(255, 182, 72, 0.1), transparent 65%);
  border: 1px solid rgba(255, 182, 72, 0.3); border-radius: 18px;
}
.mission-kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: var(--flame); text-transform: uppercase; }
.mission-text { flex: 1 1 260px; font-size: 14.5px; line-height: 1.5; }
.mission-text b { color: var(--flame); }
.mission-card .btn-ghost { padding: 10px 18px; font-size: 13.5px; }

/* ---- avatar picker ---- */
.avatar-label { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin: 4px 0 6px; }
.avatar-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 10px; }
.avatar-opt {
  font-size: 17px; padding: 6px 0; min-height: 44px; border-radius: 9px; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid transparent;
}
.avatar-opt:hover { background: rgba(255,255,255,0.1); }
.avatar-opt.on { border-color: var(--flame); background: rgba(255,182,72,0.12); }

/* ============ game juice: brighter, warmer, less "AI dashboard" ============ */
:root {
  --ink: #f3f7fd;
  --muted: #9aa6bd;
  --panel: #10151f;
  --panel-2: #171e2c;
  --line: rgba(255, 255, 255, 0.11);
}
body {
  background-image:
    radial-gradient(900px 420px at 15% -5%, rgba(22, 199, 132, 0.10), transparent 60%),
    radial-gradient(800px 380px at 85% -5%, rgba(255, 182, 72, 0.09), transparent 60%);
  background-repeat: no-repeat;
}
.glass-pill { background: rgba(255, 255, 255, 0.09); font-weight: 600; }
.hero h1 em { text-shadow: 0 0 36px rgba(255, 182, 72, 0.4); }
.hero-sub, .learn-head p, .vision-card p, .card-text, .result-lesson { color: #bac4d8; }

/* worlds: each section wears its own color */
.world {
  padding: 18px 18px 28px; border-radius: 26px; margin-bottom: 30px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--w) 9%, transparent), transparent 60%);
  border: 1px solid color-mix(in srgb, var(--w) 20%, transparent);
}
.world-head { background: transparent; border: none; padding: 4px 6px 14px; }
.world-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: color-mix(in srgb, var(--w) 24%, transparent); font-size: 24px;
}
.world-head h3 { font-size: 18px; font-weight: 800; }
.world-bar { height: 8px; }
.world-bar i { box-shadow: 0 0 12px color-mix(in srgb, var(--w) 65%, transparent); }
.map-summary { font-size: 14px; color: #bac4d8; }
.map-summary b { font-size: 18px; }

/* road: louder candles, brighter trail */
.wick-wax { width: 24px; height: 38px; }
.wick-title { color: #bac4d8; font-size: 11.5px; }
.wick-node.lit .wick-wax { box-shadow: 0 0 20px rgba(22, 199, 132, 0.55); }
.seg-lit { stroke-width: 6; }

/* lesson: bolder frame */
.lesson-bar { height: 10px; }
.lesson-bar-fill { box-shadow: 0 0 14px rgba(22, 199, 132, 0.65); }
.card-q { font-size: 18px; }
.card-title { font-size: 23px; }
.done-stats div:nth-child(1) span { color: var(--green); }
.done-stats div:nth-child(2) span { color: var(--flame); }
.done-stats div:nth-child(3) span { color: #ff8a3d; }

/* arcade status: stat chips instead of gray text */
.game-status .stat {
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 13px; border-radius: 99px; font-variant-numeric: tabular-nums; color: #cfd7e6;
}
.game-status .streak-stat { background: rgba(255, 140, 60, 0.14); border-color: rgba(255, 140, 60, 0.3); color: #ffb07a; }

/* mission card pops */
.mission-card {
  background: linear-gradient(90deg, rgba(255, 182, 72, 0.17), rgba(255, 182, 72, 0.04));
  border-color: rgba(255, 182, 72, 0.45);
  box-shadow: 0 14px 44px rgba(255, 182, 72, 0.09);
}

/* ============ interactive lesson cards ============ */
.spot-prompt {
  font-size: 18px; font-weight: 800; line-height: 1.4; margin-bottom: 14px;
  color: #f3f7fd;
}
.spot-chart { position: relative; }
.spot-hint {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: rgba(255,255,255,0.55); animation: hintPulse 1.6s ease-in-out infinite;
}
@keyframes hintPulse { 0%,100%{opacity:0.4} 50%{opacity:0.85} }
.flash-good { animation: flashGood 0.5s ease-out; }
.flash-bad  { animation: flashBad 0.5s ease-out; }
@keyframes flashGood { 0%{box-shadow:0 0 0 0 rgba(22,199,132,0.8)} 100%{box-shadow:0 0 0 22px rgba(22,199,132,0)} }
@keyframes flashBad  { 0%{box-shadow:0 0 0 0 rgba(255,71,87,0.8)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} 100%{box-shadow:0 0 0 22px rgba(255,71,87,0); transform:none} }

.play-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.play-btn {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: none; font-size: 17px; color: #04301d;
  background: linear-gradient(180deg, #3ef0a8, #14b97b);
  box-shadow: 0 4px 0 #0d9a63; transition: transform 0.1s, box-shadow 0.1s;
}
.play-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0d9a63; }
#pl-scrub {
  flex: 1; height: 8px; border-radius: 99px; -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.14); cursor: pointer;
}
#pl-scrub::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #ffb648; box-shadow: 0 2px 6px rgba(0,0,0,0.5); cursor: grab;
}
#pl-scrub::-moz-range-thumb { width: 22px; height: 22px; border: none; border-radius: 50%; background: #ffb648; cursor: grab; }
.play-opts { display: flex; flex-direction: column; gap: 11px; margin-top: 16px; }

/* brighter lesson surface so it stops reading as a dark AI dashboard */
.lesson-shell { background: linear-gradient(180deg, #18202e, #10151f); border-color: rgba(255,255,255,0.14); }
.card-text { color: #c3cde0; }

/* ============ lesson gamification layer ============ */
.lesson-top { position: relative; }

/* card type badge */
.card-kind {
  display: inline-block; margin-bottom: 10px; padding: 4px 11px; border-radius: 99px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.09em;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); color: #aeb9cf;
}
.card-kind[data-k="spot"]   { background: rgba(34, 211, 238, 0.14); border-color: rgba(34, 211, 238, 0.4); color: #6fe3f7; }
.card-kind[data-k="play"]   { background: rgba(192, 132, 252, 0.14); border-color: rgba(192, 132, 252, 0.4); color: #d3a8ff; }
.card-kind[data-k="quiz"]   { background: rgba(255, 182, 72, 0.14); border-color: rgba(255, 182, 72, 0.4); color: #ffcd85; }
.card-kind[data-k="recall"] { background: rgba(251, 113, 133, 0.14); border-color: rgba(251, 113, 133, 0.4); color: #ff9aac; }
.card-kind[data-k="note"]   { background: rgba(22, 199, 132, 0.14); border-color: rgba(22, 199, 132, 0.4); color: #5fe0af; }
.card-kind[data-k="call"]   { background: rgba(94, 160, 255, 0.14); border-color: rgba(94, 160, 255, 0.4); color: #9cc2ff; }

/* hearts */
#lesson-hearts { display: inline-flex; gap: 2px; margin-left: 10px; font-size: 14px; }
#lesson-hearts .hrt { font-style: normal; transition: transform 0.15s; }
#lesson-hearts .hrt.lost { animation: heartPop 0.45s ease-out; filter: grayscale(0.2); opacity: 0.75; }
@keyframes heartPop { 0% { transform: scale(1.6) rotate(-12deg); } 60% { transform: scale(0.85); } 100% { transform: scale(1); } }

/* floating XP reward */
.xp-fly {
  position: absolute; right: 14px; top: 30px; z-index: 5; pointer-events: none;
  font-weight: 900; font-size: 19px; color: var(--green);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  animation: xpFly 0.9s ease-out both;
}
.xp-fly.bad { color: var(--red); }
@keyframes xpFly { 0% { opacity: 0; transform: translateY(8px) scale(0.8); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-34px) scale(1); } }

/* recall card */
.recall-card {
  background: rgba(251, 113, 133, 0.07); border: 1px solid rgba(251, 113, 133, 0.25);
  border-radius: 16px; padding: 18px;
}
.recall-front { font-size: 17px; font-weight: 700; line-height: 1.5; color: #f3f7fd; margin: 0; }
.recall-back { margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(255, 255, 255, 0.18); }
.recall-back h4 { margin: 0 0 6px; font-size: 15px; color: #ff9aac; }
.recall-back p { margin: 0; color: #c3cde0; line-height: 1.6; font-size: 14.5px; }
.recall-grade { display: flex; gap: 10px; margin-top: 14px; }
.recall-grade .quiz-opt { flex: 1; text-align: center; }

/* handwritten notecard — the screenshottable summary */
.note-card {
  position: relative; margin: 6px auto 0; max-width: 440px; padding: 26px 22px 20px 30px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.05)),
    repeating-linear-gradient(180deg, #fdf7e7 0px, #fdf7e7 27px, #e8dcc0 28px),
    #fdf7e7;
  border-radius: 4px; transform: rotate(-0.7deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  color: #33302a;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
}
.note-card::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 18px; width: 1.5px;
  background: rgba(255, 71, 87, 0.35);
}
.note-tape {
  position: absolute; top: -11px; left: 50%; width: 92px; height: 24px;
  transform: translateX(-50%) rotate(1.6deg);
  background: rgba(255, 226, 140, 0.75); border-left: 1px dashed rgba(0,0,0,0.12); border-right: 1px dashed rgba(0,0,0,0.12);
}
.note-kicker { font-size: 11px; font-weight: 700; text-transform: lowercase; letter-spacing: 0.06em; color: #8a7f63; margin-bottom: 2px; }
.note-title { margin: 0 0 10px; font-size: 21px; line-height: 1.25; color: #23211c; text-decoration: underline; text-decoration-color: rgba(255, 182, 72, 0.8); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.note-bullets { margin: 0; padding-left: 4px; list-style: none; }
.note-bullets li { position: relative; padding-left: 22px; margin-bottom: 9px; font-size: 14.5px; line-height: 1.5; }
.note-bullets li::before { content: "✗"; position: absolute; left: 2px; color: #d97706; font-weight: 700; }
.note-take {
  margin: 12px 0 0; padding: 3px 8px; display: inline-block; font-size: 13.5px; line-height: 1.5;
  background: linear-gradient(104deg, rgba(255, 224, 90, 0) 0.9%, rgba(255, 224, 90, 0.85) 2.4%, rgba(255, 224, 90, 0.6) 97%, rgba(255, 224, 90, 0) 98%);
  border-radius: 3px; color: #2b2620; font-weight: 600;
}
.note-hint { text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* end-screen bonus chips */
.done-bonuses { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 12px; }
.done-bonus {
  padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
  background: rgba(255, 182, 72, 0.12); border: 1px solid rgba(255, 182, 72, 0.35); color: #ffcd85;
}

@media (prefers-reduced-motion: reduce) {
  .xp-fly, #lesson-hearts .hrt.lost { animation: none; }
  .note-card { transform: none; }
  .blur-in, .blur-in-scroll { animation: none !important; transition: none !important; opacity: 1; filter: none; transform: none; }
  .trade-live { animation: none; }
  .wick-node.shake, .game-card.shake { animation: none; }
  .flash-good, .flash-bad { animation: none; }
  .spot-hint { animation: none; opacity: 0.7; }
  #lesson-hearts .hrt.lost { filter: none; }
  .account-overlay, .lesson-overlay, .verdict-overlay { animation: none; }
  .account-shell, .lesson-shell, .verdict-card { animation: none; }
}
