/* Financial Freedom: a family money dojo (engine and styles forked from Latticework).
   Readability first: light by default, 18px body, high-contrast muted text, generous spacing.
   Dark mode is opt-in (☾ button) and remembered per device. */
:root {
  --paper: #F5F6F8;
  --surface: #FFFFFF;
  --ink: #1A1D2B;
  --ink-2: #4A4F63;
  --line: #D6D9E3;
  --violet: #0B7A4B;
  --violet-ink: #FFFFFF;
  --violet-soft: #E2F4EA;
  --lime: #F5C542;
  --lime-soft: #FFF5D6;
  --lime-ink: #2A1E00;
  --coral: #D63A40;
  --coral-soft: #FFE9EA;
  --amber-soft: #FFF3D6;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(26, 29, 43, .05), 0 6px 20px -12px rgba(26, 29, 43, .15);
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --gutter: 16px;
  --maxw: 680px;
}
:root[data-theme="dark"] {
  --paper: #12141F; --surface: #1C1F2E; --ink: #F1F2F8; --ink-2: #C0C5D8; --line: #363C55;
  --violet: #3DD68C; --violet-ink: #0E1A14; --violet-soft: #173A29; --lime: #F5C542; --lime-soft: #3A3014; --lime-ink: #2A1E00;
  --coral: #FF7A7F; --coral-soft: #3F2427; --amber-soft: #3E3520;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px -12px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* the hidden attribute must beat display:grid/flex classes */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 18px; line-height: 1.6;
  min-height: 100dvh; overflow-x: hidden;
}
a { color: var(--violet); }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 5.5vw, 38px); font-weight: 700; }
h2 { font-size: clamp(22px, 4.5vw, 27px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 .9em; }
.muted { color: var(--ink-2); }
.small { font-size: 15.5px; line-height: 1.5; }
.eyebrow { font-family: var(--display); font-weight: 700; font-size: 13.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--surface);
  display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 19px; margin-right: auto; }
.brand-mark { width: 28px; height: 28px; }
.brand-mark rect { fill: var(--violet); }
.brand-mark path { stroke: var(--lime); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.top-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 13px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 15.5px; font-weight: 700; }
.chip.active { background: var(--violet); color: var(--violet-ink); border-color: var(--violet); }
.theme { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
@media (max-width: 520px) {
  /* phones: brand + theme on the first line, the nav chips on their own line below */
  .top { flex-wrap: wrap; row-gap: 6px; padding: 8px var(--gutter) 8px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .brand { font-size: 17px; }
  .brand-mark { width: 24px; height: 24px; }
  .theme { width: 36px; height: 36px; }
  .top-nav { order: 3; width: 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .top-nav::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; min-height: 34px; padding: 4px 12px; }
}
/* notched phones: keep content and the toast clear of the home bar */
.app { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
@media (max-width: 360px) {
  :root { --gutter: 12px; }
  body { font-size: 17px; }
  .stat .n { font-size: 26px; }
  .stat .l { font-size: 13.5px; }
  .btn.big { font-size: 18px; }
}
/* tap feedback on touch screens, no sticky hover states */
@media (hover: none) {
  .btn:hover, .opt:hover, .kid:hover, .lattice.full a.tile:hover { background: inherit; border-color: var(--line); }
  .btn.primary:hover { background: var(--violet); border-color: var(--violet); }
  .btn.lime:hover { background: var(--lime); border-color: var(--lime); }
  .btn.danger:hover { background: var(--coral-soft); }
  .btn.primary, .btn.lime, .btn, .opt, .kid { -webkit-tap-highlight-color: transparent; }
  .btn:active, .opt:active, .kid:active { transform: scale(.98); }
}

/* layout */
.app { max-width: var(--maxw); margin: 0 auto; padding: 22px var(--gutter) 90px; }
.stack > * + * { margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 360px) { .two-up { grid-template-columns: 1fr; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 18px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: 17px; cursor: pointer; text-decoration: none; color: var(--ink); transition: transform .08s ease, background .15s; text-align: center; }
.btn:hover { background: var(--violet-soft); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--violet); color: var(--violet-ink); border-color: var(--violet); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.lime { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn.danger { background: var(--coral-soft); color: var(--coral); border-color: transparent; }
.btn.big { min-height: 62px; font-size: 19px; width: 100%; font-family: var(--display); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { min-height: 42px; font-size: 15.5px; padding: 8px 14px; }
.btn[disabled] { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

/* forms */
label { display: block; font-weight: 700; font-size: 16px; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; min-height: 50px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.radios { display: grid; gap: 8px; }
.radios label { display: flex; gap: 12px; align-items: center; margin: 0; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); font-weight: 400; font-size: 16.5px; cursor: pointer; }
.radios input { accent-color: var(--violet); width: 20px; height: 20px; flex: none; }

/* why-play strip on the picker */
.hooks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hook { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); }
.hook .ico { grid-row: 1 / 3; font-size: 28px; line-height: 1; }
.hook b { font-family: var(--display); font-size: 17px; line-height: 1.2; }
.hook span:not(.ico) { font-size: 14.5px; color: var(--ink-2); line-height: 1.35; }
@media (max-width: 640px) { .hooks { grid-template-columns: 1fr; gap: 8px; } .hook { padding: 10px 12px; } }

/* kid picker */
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.kid { display: grid; gap: 10px; text-align: left; padding: 18px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.kid:hover { border-color: var(--violet); }
.kid .emoji { font-size: 40px; line-height: 1; }
.kid .name { font-family: var(--display); font-weight: 700; font-size: 22px; }
.kid .meta { font-size: 15px; color: var(--ink-2); line-height: 1.4; }
.kid.test { border-style: dashed; }
.kid .badge { vertical-align: middle; font-size: 12px; }

/* the lattice */
.lattice { display: grid; gap: 6px; }
.lattice.mini { grid-template-columns: repeat(9, 1fr); max-width: 170px; gap: 4px; }
.lattice.mini .tile { aspect-ratio: 1; border-radius: 5px; border: 1.5px solid var(--line); background: var(--surface); position: relative; overflow: hidden; }
.lattice.mini .tile .fill { position: absolute; left: 0; right: 0; bottom: 0; height: var(--m, 0%); background: var(--violet); }
.lattice.mini .tile.mastered { border-color: var(--violet); background: var(--violet); }
.lattice.full { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lattice.full .tile { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 10px; padding: 12px 12px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); min-height: 64px; }
.lattice.full a.tile:hover { border-color: var(--violet); }
.lattice.full .tile .num { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px; background: var(--violet-soft); color: var(--violet); }
.lattice.full .tile .name { font-weight: 700; font-size: 15.5px; line-height: 1.2; }
.lattice.full .tile .check { color: var(--violet); font-weight: 700; font-size: 18px; }
.lattice.full .tile .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lattice.full .tile .bar i { display: block; height: 100%; background: var(--violet); transition: width .5s ease; }
.lattice.full .tile.mastered { border-color: var(--violet); background: var(--violet-soft); }
.tile.pulse { animation: pulse .7s ease; }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.06); box-shadow: 0 0 0 6px color-mix(in srgb, var(--lime) 55%, transparent); } 100% { transform: scale(1); } }
.set-label { grid-column: 1 / -1; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); margin-top: 10px; }
.set-label:first-child { margin-top: 0; }

/* reflex questions */
.reflex-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.reflex-row:first-child { border-top: 0; padding-top: 4px; }
.reflex-row .n { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 17px; background: var(--violet-soft); color: var(--violet); }
.reflex-row.zero .n { background: var(--lime-soft); color: var(--lime-ink); }
.reflex-row b { font-size: 18px; line-height: 1.35; display: block; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--paper); border-radius: var(--radius-sm); padding: 14px 10px; text-align: center; }
.stat .n { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; }
.stat .l { font-size: 14.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.3; }

/* quiz */
.progress { display: flex; gap: 5px; margin-bottom: 16px; }
.progress i { flex: 1; height: 7px; border-radius: 4px; background: var(--line); }
.progress i.ok { background: var(--lime); }
.progress i.bad { background: var(--coral); }
.progress i.cur { background: var(--violet); }
.q { font-family: var(--display); font-weight: 700; font-size: clamp(21px, 4.5vw, 25px); line-height: 1.3; margin: 6px 0 20px; }
.options { display: grid; gap: 10px; }
.opt { min-height: 60px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; font-size: 18px; line-height: 1.3; cursor: pointer; color: var(--ink); }
.opt:hover { border-color: var(--violet); }
.opt.right { border-color: var(--lime); background: var(--lime-soft); }
.opt.wrong { border-color: var(--coral); background: var(--coral-soft); }
.opt[disabled] { cursor: default; }
.opt-name { display: block; }
.opt-why { display: block; font-family: var(--body); font-weight: 400; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); margin-top: 4px; }
.verdict { margin-top: 16px; padding: 18px 20px; border-radius: 14px; background: var(--violet-soft); line-height: 1.6; font-size: 17px; color: var(--ink); }
.verdict.bad { background: var(--amber-soft); }
.verdict .h { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.25; margin-bottom: 8px; }
.verdict .lead-line { font-weight: 700; font-size: 17.5px; margin-bottom: 8px; }
.verdict .talk { font-size: 16.5px; line-height: 1.6; }
/* "Say it out loud" / better-question callout: solid card, no italics, strong left accent */
.verdict-say { margin-top: 14px; padding: 12px 15px; border-radius: 12px; background: var(--surface); border-left: 5px solid var(--violet); font-size: 16.5px; line-height: 1.5; }
.verdict.bad .verdict-say { border-left-color: #C9931F; }
.verdict-say b { font-family: var(--display); font-weight: 700; }
.verdict .ask { font-style: italic; margin-top: 10px; }

/* daily checklist */
.checklist { display: flex; gap: 8px; flex-wrap: wrap; }
.checklist span { flex: 1; min-width: 90px; text-align: center; padding: 8px 6px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line); font-weight: 700; font-size: 15px; color: var(--ink-2); }
.checklist span.on { border-color: var(--lime); background: var(--lime-soft); color: var(--lime-ink); }

/* deliberate-practice + zero list + calibration */
.opt.selected { border-color: var(--violet); background: var(--violet-soft); }
.conf-ask { margin-top: 14px; }
.zero-items { margin: 8px 0 0; padding-left: 22px; }
.zero-items li { padding: 3px 0; font-weight: 700; }
.calib { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); font-size: 15.5px; line-height: 1.45; }

/* learn-first teaching card */
.learn-card { border: 2px solid var(--violet); box-shadow: 6px 6px 0 var(--violet-soft); }
.learn-card .eyebrow { color: var(--violet); }
.learn-tagline { font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.35; margin: 4px 0 10px; }

/* hints */
.hints { display: grid; gap: 8px; margin-top: 12px; }
.hint-box { padding: 10px 14px; border-radius: 12px; background: var(--amber-soft); font-size: 16px; line-height: 1.45; }
.opt.dim { opacity: .35; text-decoration: line-through; }

/* welcome walkthrough */
.welcome-card { text-align: center; padding: 34px 22px; }
.welcome-ico { font-size: 56px; line-height: 1; margin-bottom: 12px; }
.welcome-card p { font-size: 19px; line-height: 1.55; max-width: 34em; margin: 0 auto; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin-top: 18px; }
.emoji-pick { aspect-ratio: 1; font-size: 28px; line-height: 1; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; display: grid; place-items: center; }
.emoji-pick:hover { border-color: var(--violet); }
.emoji-pick.on { border-color: var(--violet); background: var(--violet-soft); }
@media (max-width: 380px) { .emoji-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); } .emoji-pick { font-size: 24px; } }

/* the race */
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 17px; }
.board li:first-child { border-top: 0; }
.board li.me { background: var(--violet-soft); margin: 0 -8px; padding: 10px 8px; border-radius: 10px; border-top: 0; }
.board .rank { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; background: var(--paper); }
.board li:first-child .rank { background: var(--lime); color: var(--lime-ink); }
.board .pts { font-family: var(--display); font-weight: 700; font-size: 20px; }

/* model page */
.tabs { display: flex; gap: 8px; margin: 14px 0 18px; }
.tabs button { flex: 1; min-height: 46px; padding: 6px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: 15.5px; cursor: pointer; }
.tabs button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.say { font-size: 15.5px; color: var(--ink-2); font-style: italic; }
.ask-line { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.3; padding: 14px 18px; border-left: 5px solid var(--lime); background: var(--paper); border-radius: 0 12px 12px 0; margin: 16px 0; }
.list { padding-left: 22px; margin: 0 0 1em; }
.list li { padding-left: 4px; }
.list li + li { margin-top: 10px; }
.model-row { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.model-row:first-of-type { border-top: 0; }
.model-row .n { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px; background: var(--violet-soft); color: var(--violet); }
.model-row .t { flex: 1; }
.model-row .t b { display: block; font-size: 17px; }
.model-row .t span { font-size: 15.5px; color: var(--ink-2); line-height: 1.4; }
.model-row .m { width: 48px; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; flex: none; }
.model-row .m i { display: block; height: 100%; background: var(--violet); }

/* parent activity strip */
.act-strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: 8px 0 6px; }
.act-day { display: grid; gap: 3px; justify-items: center; }
.act-day i { display: block; width: 100%; aspect-ratio: 1; border-radius: 5px; background: var(--line); }
.act-day.l1 i { background: color-mix(in srgb, var(--violet) 35%, var(--surface)); }
.act-day.l2 i { background: color-mix(in srgb, var(--violet) 65%, var(--surface)); }
.act-day.l3 i { background: var(--violet); }
.act-day.today i { outline: 2px solid var(--ink); outline-offset: 1px; }
.act-day span { font-size: 11px; color: var(--ink-2); line-height: 1; }

/* sightings */
.sight { border-top: 1px solid var(--line); padding: 14px 0; }
.sight:first-of-type { border-top: 0; }
.badge { display: inline-block; font-size: 13.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); white-space: nowrap; }
.badge.approved { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.badge.declined { background: var(--coral-soft); color: var(--coral); border-color: transparent; }
.badge.pending { background: var(--amber-soft); }
.quote { border-left: 3px solid var(--line); padding-left: 12px; color: var(--ink-2); margin: 8px 0; line-height: 1.5; }

/* videos */
.video-wrap { display: grid; grid-template-columns: 148px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.video-wrap:first-of-type { border-top: 0; }
.video-wrap.dim { opacity: .8; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--ink); cursor: pointer; }
.video img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 28px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-wrap:has(.playing) { grid-template-columns: 1fr; }
.video-meta b { display: block; line-height: 1.3; font-size: 16.5px; }
details summary { cursor: pointer; padding: 8px 0; font-weight: 700; }
@media (max-width: 420px) { .video-wrap { grid-template-columns: 120px 1fr; } }

/* flashcards */
.flip { display: block; width: 100%; min-height: 260px; padding: 0; border: 0; background: transparent; cursor: pointer; perspective: 1200px; text-align: left; font: inherit; color: inherit; }
.flip-inner { position: relative; width: 100%; min-height: 260px; transition: transform .55s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; padding: 22px; border-radius: var(--radius); border: 2px solid var(--ink); background: var(--surface); box-shadow: 8px 8px 0 var(--violet-soft); overflow: auto; }
.flip .face.back { transform: rotateY(180deg); background: var(--lime-soft); border-color: var(--lime-ink); }
.flip .face-big { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 6vw, 40px); line-height: 1.1; }
.flip .face-mid { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 4.4vw, 26px); line-height: 1.3; }
.flip:not(.flipped) .face.front::after { content: "tap to flip"; position: absolute; right: 14px; bottom: 10px; font-size: 13px; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } }

/* tutor chat */
.chat { display: grid; gap: 10px; margin-bottom: 12px; }
.bubble { padding: 12px 16px; border-radius: 16px; max-width: 92%; line-height: 1.5; white-space: pre-wrap; }
.bubble.user { background: var(--violet); color: var(--violet-ink); justify-self: end; border-bottom-right-radius: 4px; }
.bubble.tutor { background: var(--paper); border: 1px solid var(--line); justify-self: start; border-bottom-left-radius: 4px; }
.bubble.sys { background: var(--lime-soft); color: var(--lime-ink); font-size: 15.5px; justify-self: stretch; max-width: none; }
.bubble.err { background: var(--coral-soft); color: var(--coral); }
.starters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.starters .chip { cursor: pointer; font-weight: 400; min-height: 36px; }
.askform { display: flex; gap: 8px; align-items: flex-end; }
.askform textarea { flex: 1; min-height: 52px; }
.askform .btn { min-height: 52px; }

/* BS or Not */
.bs-btn { background: var(--ink); color: var(--paper); border-color: var(--ink); flex-direction: column; gap: 2px; line-height: 1.25; }
.bs-btn:hover { filter: brightness(1.15); background: var(--ink); }
.bs-btn.done { background: var(--surface); color: var(--ink); border-color: var(--line); }
.bs-btn .small { color: inherit; opacity: .8; }
.scenario { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 20px; box-shadow: 6px 6px 0 var(--violet-soft); }
.scenario-setup { margin: 6px 0 10px; color: var(--ink-2); font-size: 16.5px; line-height: 1.45; }
.scenario-text { font-family: var(--display); font-weight: 700; font-size: clamp(21px, 4.5vw, 26px); line-height: 1.3; }
.verdicts { display: grid; gap: 10px; }
.verdicts .opt { display: grid; gap: 3px; }
.verdicts .opt span { font-weight: 400; }
.opt.v-bs.on { border-color: var(--coral); background: var(--coral-soft); }
.opt.v-check.on { border-color: #E0A800; background: var(--amber-soft); }
.opt.v-legit.on { border-color: var(--lime); background: var(--lime-soft); }
.opt.qpick { display: flex; gap: 12px; align-items: center; font-weight: 400; font-size: 17px; }
.opt.qpick.on { border-color: var(--violet); background: var(--violet-soft); }
.opt.qpick .qn { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; background: var(--violet-soft); color: var(--violet); }
.opt.qpick.on .qn { background: var(--violet); color: var(--violet-ink); }

.empty { text-align: center; padding: 28px 12px; color: var(--ink-2); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 13px 20px; border-radius: 999px; font-weight: 700; font-size: 16px; box-shadow: var(--shadow); z-index: 20; max-width: calc(100% - 32px); }
#update-banner { position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--violet); color: var(--violet-ink); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 700; max-width: 520px; margin: 0 auto; }
#update-banner button { background: var(--lime); color: var(--lime-ink); border: 0; border-radius: 10px; padding: 8px 16px; font-weight: 700; font-size: 16px; cursor: pointer; white-space: nowrap; }
/* ───────────── the classroom (viewClass / viewLesson) ───────────── */
.class-progress .bar-lg { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 8px; }
.class-progress .bar-lg i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet), color-mix(in srgb, var(--violet) 60%, var(--lime))); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.lesson-next { border: 2px solid var(--violet); box-shadow: 6px 6px 0 var(--violet-soft); }
.lesson-next-emoji { font-size: 44px; line-height: 1; flex: none; }
.unit h3 { font-size: 21px; }
.lesson-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 8px; margin: 0 -8px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); border-radius: 10px; }
.lesson-row:first-of-type { border-top: 0; }
.lesson-row:hover { background: var(--violet-soft); }
.lesson-row .n { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px; background: var(--paper); color: var(--ink-2); }
.lesson-row .t b { display: block; font-size: 17px; line-height: 1.25; }
.lesson-row .t span { display: block; font-size: 15px; color: var(--ink-2); line-height: 1.35; }
.lesson-row .st { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; color: var(--ink-2); }
.lesson-row.done .n { background: var(--violet); color: var(--violet-ink); }
.lesson-row.done .st { background: var(--lime); color: var(--lime-ink); }
.lesson-row.met .n { background: var(--violet-soft); color: var(--violet); }
.lesson-row.met .st { color: var(--violet); }
.lesson-row.next { background: var(--amber-soft); }
.lesson-row.next .st { background: var(--violet); color: var(--violet-ink); }
.lesson-top { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.lesson-top a { text-decoration: none; font-weight: 700; }
.lesson-top .dots { display: flex; gap: 6px; justify-content: center; }
.lesson-top .dots i { width: 9px; height: 9px; border-radius: 999px; background: var(--line); transition: background .3s ease, transform .3s ease; }
.lesson-top .dots i.done { background: var(--lime); }
.lesson-top .dots i.cur { background: var(--violet); transform: scale(1.35); }
@media (max-width: 420px) { .lesson-top > span { display: none; } .lesson-top { grid-template-columns: auto 1fr; } }
.lesson-card { border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--violet-soft); padding: 26px 22px; min-height: 300px; }
.lesson-emoji { font-size: 64px; line-height: 1; margin-bottom: 10px; animation: fxSpring .6s cubic-bezier(.2,1.2,.3,1) both; }
.lesson-hook { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 5vw, 27px); line-height: 1.3; margin: 6px 0 14px; }
.lesson-name { font-size: clamp(34px, 8vw, 46px); font-weight: 800; letter-spacing: -.02em; margin: 2px 0 4px; color: var(--violet); }
.lesson-tagline { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 4.6vw, 23px); line-height: 1.3; margin: 12px 0 10px; }
.lesson-mission { background: var(--lime-soft); border-color: var(--lime); font-size: 17px; line-height: 1.5; margin: 12px 0; }
.btn.lesson-btn { flex-direction: column; gap: 2px; line-height: 1.25; }
.btn.waits { opacity: .75; border-style: dashed; }

/* ───────────── Today's path + keep-going extras ───────────── */
.path { border: 2px solid var(--violet); box-shadow: 6px 6px 0 var(--violet-soft); }
.path-step { position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; }
.path-step + .path-step::before { content: ""; position: absolute; left: 19px; top: -12px; height: 24px; border-left: 2px dashed var(--line); }
.path-n { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 18px; background: var(--paper); border: 2px solid var(--line); color: var(--ink-2); position: relative; z-index: 1; }
.path-body b { display: block; font-family: var(--display); font-size: 19px; line-height: 1.25; }
.path-body > span { display: block; font-size: 15.5px; color: var(--ink-2); line-height: 1.4; }
.path-body .btn { margin-top: 10px; }
.path-step.cur .path-n { background: var(--violet); border-color: var(--violet); color: var(--violet-ink); box-shadow: 0 0 0 5px var(--violet-soft); }
.path-step.done .path-n { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.path-step.done .path-body b { color: var(--ink-2); }
.path-step.later { opacity: .6; }
.path-again { font-size: 14px; color: var(--ink-2); padding-top: 10px; }
.extra-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 12px 6px; margin: 0 -6px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); border-radius: 10px; }
.extra-row:first-of-type { border-top: 0; }
.extra-row:hover { background: var(--violet-soft); }
.extra-row .ico { font-size: 22px; }
.extra-row b { font-size: 17px; }
.extra-row .pts { font-family: var(--display); font-weight: 800; font-size: 14px; color: var(--lime-ink); background: var(--lime-soft); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.face-link { text-decoration: none; font-size: 1.3em; }

/* demo mode ribbon (demo.js) */
#demo-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: flex; align-items: center; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; font-size: 15px; box-shadow: 0 -6px 20px -12px rgba(0,0,0,.5); }
#demo-bar .dot { width: 9px; height: 9px; border-radius: 999px; background: var(--lime); flex: none; box-shadow: 0 0 0 0 var(--lime); animation: demoPulse 1.8s ease-in-out infinite; }
@keyframes demoPulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lime) 70%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--lime) 0%, transparent); } }
#demo-bar b { font-family: var(--display); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
#demo-bar .say { color: rgba(255,255,255,.8); flex: 1; min-width: 0; }
#demo-bar #demo-exit { flex: none; background: var(--lime); color: var(--lime-ink); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 800; font-size: 15px; cursor: pointer; font-family: var(--display); }
body.has-demo-bar .app { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
body.has-demo-bar .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
body.has-demo-bar #update-banner { display: none; }
@media (max-width: 480px) { #demo-bar .say { display: none; } }

.jar { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--violet); }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ───────────── fx: celebrations + microinteractions (fx.js) ─────────────
   Base styles are the final visible state; animations only handle the entrance,
   so the global reduced-motion rule at the bottom leaves everything readable. */
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 75; } /* above the overlay so the blast lands on top */
.fx-flash { position: fixed; inset: 0; z-index: 76; pointer-events: none; background: #fff; animation: fxFlash .45s ease-out both; }
@keyframes fxFlash { 0% { opacity: .38; } 100% { opacity: 0; } }

/* page + block entrances */
.fx-route { animation: fxRoute .28s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fxRoute { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fx-in { animation: fxIn .38s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fxIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* micro */
.fx-pop { animation: fxPop .45s cubic-bezier(.2,.9,.3,1.4); }
@keyframes fxPop { 0% { transform: scale(1); } 35% { transform: scale(1.06); } 100% { transform: scale(1); } }
.fx-shake { animation: fxShake .42s ease; }
@keyframes fxShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.fx-attn { animation: fxAttn 1.4s ease-in-out infinite; }
@keyframes fxAttn { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--violet) 45%, transparent); } 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--violet) 0%, transparent); } }
.fx-float { position: fixed; z-index: 61; transform: translate(-50%, 0); pointer-events: none; font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--violet); text-shadow: 0 1px 0 var(--surface); animation: fxFloat 1s cubic-bezier(.2,.7,.2,1) both; white-space: nowrap; }
.fx-float.pts { color: var(--lime-ink); background: var(--lime); padding: 2px 12px; border-radius: 999px; font-size: 19px; }
@keyframes fxFloat { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -6px) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -64px) scale(1); } }
/* the one button to press next gets a slow shimmer */
.fx-shimmer { position: relative; overflow: hidden; }
.fx-shimmer::after { content: ""; position: absolute; top: -40%; bottom: -40%; width: 38%; left: -50%; background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,.28) 50%, transparent 100%); transform: skewX(-18deg); animation: fxShimmer 3.2s ease-in-out infinite; }
@keyframes fxShimmer { 0%, 55% { left: -50%; } 100% { left: 130%; } }
/* progress bars settle instead of snapping */
.progress i { transition: background .35s ease, transform .2s ease; }
.progress i.cur { transform: scaleY(1.35); }
/* in-quiz run flare */
.run-flare { display: inline-block; margin: 0 0 8px; padding: 4px 12px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font-family: var(--display); font-weight: 800; font-size: 15px; animation: fxPop .5s cubic-bezier(.2,.9,.3,1.4); }
/* checklist items check themselves off */
.checklist span.on { animation: fxCheck .5s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes fxCheck { 0% { transform: scale(.94); } 55% { transform: scale(1.05); } 100% { transform: scale(1); } }
/* flashcards fly off the way you graded them */
.flip.fx-swipe-right .flip-inner { transition: transform .28s ease-in, opacity .28s ease-in; transform: rotateY(180deg) translateX(60vw) rotate(10deg); opacity: 0; }
.flip.fx-swipe-left .flip-inner { transition: transform .28s ease-in, opacity .28s ease-in; transform: rotateY(180deg) translateX(-60vw) rotate(-10deg); opacity: 0; }

/* the big overlay */
.fx-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--ink) 78%, transparent); animation: fxFade .22s ease both; cursor: pointer; }
.fx-overlay.out { transition: opacity .25s ease; opacity: 0; }
@keyframes fxFade { from { opacity: 0; } to { opacity: 1; } }
.fx-glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--violet) 55%, transparent) 0%, transparent 60%); animation: fxGlow 2.4s ease-in-out infinite; }
.fx-overlay.mega .fx-glow { background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--lime) 55%, transparent) 0%, color-mix(in srgb, var(--violet) 40%, transparent) 35%, transparent 65%); }
@keyframes fxGlow { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: 1; } }
.fx-card { position: relative; text-align: center; color: #fff; max-width: 34em; }
.fx-emoji { font-size: clamp(72px, 20vw, 120px); line-height: 1; animation: fxSpring .7s cubic-bezier(.2,1.2,.3,1) both; filter: drop-shadow(0 8px 24px rgba(0,0,0,.35)); }
@keyframes fxSpring { 0% { transform: scale(0) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.18) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.fx-stamp { display: inline-block; margin: 14px 0 10px; padding: 8px 20px; border: 4px solid var(--lime); border-radius: 12px; color: var(--lime); font-family: var(--display); font-weight: 800; font-size: clamp(26px, 7vw, 44px); letter-spacing: .06em; text-transform: uppercase; transform: rotate(-6deg); animation: fxSlam .55s cubic-bezier(.2,1.1,.3,1) .12s both; box-shadow: 0 0 0 6px color-mix(in srgb, var(--lime) 18%, transparent); }
.fx-overlay.mega .fx-stamp { border-color: #FFC53D; color: #FFC53D; box-shadow: 0 0 0 6px rgba(255,197,61,.2); }
@keyframes fxSlam { 0% { transform: scale(3) rotate(-14deg); opacity: 0; } 70% { transform: scale(.92) rotate(-5deg); opacity: 1; } 100% { transform: scale(1) rotate(-6deg); } }
.fx-title { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 7vw, 42px); line-height: 1.1; margin: 8px 0 6px; color: #fff; animation: fxRise .45s ease .3s both; }
.fx-sub { font-size: clamp(17px, 4.2vw, 20px); line-height: 1.45; margin: 0; color: rgba(255,255,255,.88); animation: fxRise .45s ease .4s both; }
.fx-tap { margin: 22px 0 0; font-size: 14px; color: rgba(255,255,255,.6); animation: fxRise .5s ease 1.1s both; }
@keyframes fxRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* the small win card */
.fx-win { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 65; display: flex; gap: 14px; align-items: center; max-width: min(92vw, 440px); padding: 14px 20px 14px 16px; border-radius: 18px; background: var(--surface); color: var(--ink); border: 2px solid var(--lime); box-shadow: 0 14px 40px -12px rgba(26,29,43,.4), 0 0 0 6px color-mix(in srgb, var(--lime) 22%, transparent); animation: fxWinIn .5s cubic-bezier(.2,1.1,.3,1) both; cursor: pointer; }
.fx-win.out { transition: transform .3s ease, opacity .3s ease; transform: translate(-50%, 30px); opacity: 0; }
@keyframes fxWinIn { 0% { transform: translate(-50%, 60px) scale(.9); opacity: 0; } 100% { transform: translate(-50%, 0) scale(1); opacity: 1; } }
.fx-win-emoji { font-size: 40px; line-height: 1; animation: fxSpring .6s cubic-bezier(.2,1.2,.3,1) .1s both; }
.fx-win b { display: block; font-family: var(--display); font-size: 20px; line-height: 1.2; }
.fx-win span { display: block; font-size: 15.5px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }

/* ranks, picker, mission, mastered */
.rank-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); font-family: var(--display); font-weight: 800; font-size: 14.5px; letter-spacing: .02em; width: fit-content; }
.rank-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.kid.done { border-color: var(--lime); box-shadow: 0 0 0 4px var(--lime-soft), var(--shadow); }
.kid .emoji { transition: transform .25s cubic-bezier(.2,1.2,.3,1); display: inline-block; }
.kid:hover .emoji, .kid:active .emoji { transform: scale(1.18) rotate(-8deg); }
.mission { border: 2px solid var(--lime); box-shadow: 6px 6px 0 var(--lime-soft); }
.mission h3 { font-size: 22px; margin: 4px 0 8px; }
.mission h3 a { color: var(--violet); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.mastered-card { border: 2px solid var(--violet); background: var(--violet-soft); }
.mastered-card h3 { color: var(--violet); margin: 2px 0 6px; }
/* stat numbers count up; keep them from jumping width mid-count */
.stat .n { font-variant-numeric: tabular-nums; }

/* lattice quick-study bubble: hover (or first tap on touch) shows the model's one-line meaning */
.lattice-tip { position: fixed; z-index: 40; max-width: min(320px, calc(100vw - 24px)); padding: 12px 14px 11px; border-radius: 14px; background: var(--surface); color: var(--ink); border: 2px solid var(--violet); font-size: 15.5px; line-height: 1.45; pointer-events: none; filter: drop-shadow(0 10px 22px rgba(26,29,43,.28)); transform-origin: 50% 100%; animation: tipIn .2s cubic-bezier(.2,1.1,.3,1) both; }
.lattice-tip.below { transform-origin: 50% 0; animation-name: tipInBelow; }
.lattice-tip b { display: block; font-family: var(--display); font-size: 17px; line-height: 1.2; color: var(--violet); margin-bottom: 3px; }
.lattice-tip .tag { font-weight: 700; }
.lattice-tip .ask { margin-top: 6px; color: var(--ink-2); }
.lattice-tip .foot { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.lattice-tip::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -9px; width: 14px; height: 14px; background: var(--surface); border: 2px solid var(--violet); border-top: 0; border-left: 0; transform: translateX(-50%) rotate(45deg); }
.lattice-tip.below::after { bottom: auto; top: -9px; border: 2px solid var(--violet); border-bottom: 0; border-right: 0; }
@keyframes tipIn { from { opacity: 0; transform: translateY(6px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes tipInBelow { from { opacity: 0; transform: translateY(-6px) scale(.92); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Flip: progress dots toward "known cold", three honest grades, swipe lean */
.card-dots { display: inline-flex; gap: 5px; }
.card-dots i { width: 11px; height: 11px; border-radius: 999px; background: var(--line); }
.card-dots i.on { background: var(--violet); }
.progress i.mid { background: #E0A800; }
.grade3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grade3 .btn { padding: 10px 8px; font-size: 16px; }
.flip { touch-action: pan-y; transition: transform .15s ease; }
.flip[data-lean="yes"] .face.back { box-shadow: 8px 8px 0 var(--lime); }
.flip[data-lean="no"] .face.back { box-shadow: 8px 8px 0 var(--coral-soft); }
/* quiz: an answer can be changed until the confidence button submits it */
.change-note { margin: 10px 0 0; font-size: 14.5px; color: var(--ink-2); text-align: center; }

/* extra credit: locked until the path is done, then a big obvious card */
.extras.locked { background: var(--paper); border-style: dashed; box-shadow: none; }
.extras.open { border: 2px solid var(--lime); box-shadow: 6px 6px 0 var(--lime-soft); }
.extras.open .extra-btn + .extra-btn { margin-top: 10px; }
.btn.extra-btn { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; text-align: left; align-items: center; min-height: 70px; }
.extra-btn .ico { font-size: 26px; }
.extra-btn .txt b { display: block; font-size: 18px; line-height: 1.2; }
.extra-btn .txt span { display: block; font-family: var(--body); font-weight: 400; font-size: 14.5px; line-height: 1.35; opacity: .85; }
.extra-btn .pts { font-family: var(--display); font-weight: 800; font-size: 14px; background: var(--lime); color: var(--lime-ink); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

/* weekly race: trophies + last week's champion */
.trophy { font-family: var(--display); font-weight: 800; font-size: 14px; color: #9A6B00; background: #FFF3D6; padding: 1px 8px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }
.champ-line { background: #FFF3D6; border-radius: 12px; padding: 10px 14px; margin: 0 0 10px; font-size: 16px; }
.trophy-shelf { display: flex; flex-wrap: wrap; gap: 8px; }
.trophy-shelf span { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 16px; }

/* study mode: learned vs new */
.study-status { padding: 8px 14px; border-radius: 12px; background: var(--amber-soft); font-size: 15.5px; font-weight: 700; }
.study-status.on { background: var(--lime-soft); color: var(--lime-ink); }

/* families */
.fam-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--violet-soft); }
.fam-code b { font-family: var(--display); font-size: 26px; letter-spacing: .08em; color: var(--violet); }
.invlink { font-size: 13px; word-break: break-all; background: var(--paper); padding: 4px 8px; border-radius: 8px; }

/* parent: per-kid age + lesson level */
.profile-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-top: 10px; }
.profile-row label { margin: 0; font-size: 14.5px; display: grid; gap: 4px; }
.profile-row input { width: 76px; min-height: 42px; padding: 8px 10px; }
.profile-row select { width: auto; min-height: 42px; padding: 8px 10px; }

/* leagues: which family a kid on the cross-family board belongs to */
.fam-tag { font-size: 14px; color: var(--ink-2); font-weight: 600; }

/* beat-your-last-week line in the race card */
.pb-line { background: var(--violet-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin: 8px 0; }
/* Monday recap + pinned goal */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 16px; cursor: pointer; }
.chip-btn.on { border-color: var(--violet); background: var(--violet-soft); font-weight: 700; }
.goal-pin { background: var(--lime-soft); }
/* Spot It */
.timebar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; background: var(--violet); transition: width .2s linear; }
.spot-v { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 560px) { .spot-v { grid-template-columns: repeat(3, 1fr); } }

/* ───────────── Rat Race Escape (the board game) ───────────── */
.game-setup .picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.game-setup .picks.dreams { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; line-height: 1.3; }
.pick.on { border-color: var(--violet); background: var(--violet-soft); box-shadow: 0 0 0 2px var(--violet) inset; }
.pick .big-emoji { font-size: 26px; }
.pick .stars { color: #C99400; font-size: 14px; letter-spacing: 1px; }
.game-setup input[type=text] { width: 100%; min-height: 46px; font: inherit; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.how ul { margin: 10px 0 0; padding-left: 20px; } .how li { margin-bottom: 6px; }

div.board { display: grid; /* the 2D game board; ol.board is the race leaderboard */  grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr); gap: 3px; aspect-ratio: 1; width: 100%; max-width: 560px; margin: 0 auto; }
.sq { position: relative; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; line-height: 1.05; text-align: center; overflow: hidden; border: 1.5px solid transparent; }
.sq .sq-e { font-size: clamp(15px, 4.2vw, 24px); }
.sq .sq-n { font-weight: 700; font-size: clamp(8.5px, 1.9vw, 11px); margin-top: 1px; }
.sq.rr { background: var(--surface); border-color: var(--line); }
.sq.ft { background: #FFF6D8; border-color: #F0D98A; }
:root[data-theme="dark"] .sq.ft { background: #3A3014; border-color: #6B5A23; }
.sq-payday { background: var(--violet-soft) !important; border-color: var(--violet) !important; }
.sq-temptation, .sq-oops, .sq-slow { background: var(--coral-soft) !important; }
.sq-learn { background: #E4EEFF !important; } :root[data-theme="dark"] .sq-learn { background: #1E2A44 !important; }
.sq-f-dream { background: var(--lime) !important; }
.sq.now { outline: 3px solid var(--ink); outline-offset: -1px; z-index: 1; }
.toks { position: absolute; inset: auto 0 1px 0; display: flex; justify-content: center; gap: 1px; }
.tok { font-style: normal; font-size: clamp(12px, 3.2vw, 18px); filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.tok.me { animation: tokbob 1s ease-in-out infinite; }
@keyframes tokbob { 50% { transform: translateY(-3px); } }
.board-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: var(--paper); border: 1.5px dashed var(--line); }
.board-mid .dice { font-size: clamp(34px, 10vw, 58px); line-height: 1; }
.board-mid .die { display: inline-block; animation: dieroll .45s ease-out; }
@keyframes dieroll { from { transform: rotate(-200deg) scale(.4); opacity: 0; } }
.board-mid .mid-l { font-family: var(--display); font-weight: 700; font-size: clamp(11px, 2.6vw, 15px); margin-top: 4px; }

.others { display: flex; gap: 8px; overflow-x: auto; }
.other { flex: 1 0 auto; min-width: 120px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.other.me { border-color: var(--violet); background: var(--violet-soft); }

.event h2 { margin-bottom: 12px; }
.payline { background: var(--violet-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.deal { border: 2px solid var(--violet); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.deal.bad { border-color: var(--coral); }
.deal.oops { border-color: #E65100; }
.deal-h { font-size: 20px; margin-bottom: 4px; }
.deal p { margin: 4px 0; }
.deal-nums { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; }
.ask-q { font-weight: 700; color: var(--violet); margin-top: 6px; }
.deal.bad .ask-q { color: var(--coral); }
.result { background: var(--lime-soft); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.result.bad { background: var(--coral-soft); }
.idea-chip { min-height: 32px; font-size: 14px; padding: 3px 10px; text-decoration: none; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.choices.col { flex-direction: column; } .choices.col .btn { width: 100%; justify-content: flex-start; text-align: left; }
.learn-q { font-size: 19px; font-weight: 700; }

.sheet .cash { font-family: var(--display); } .sheet .cash b { font-size: 22px; }
.neg { color: var(--coral); }
.meter { margin: 10px 0 12px; }
.meter-bar { height: 16px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--lime)); border-radius: 999px; transition: width .6s ease; }
.sheet .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .sheet .cols { grid-template-columns: 1fr; } }
.sheet .h { font-weight: 700; margin-bottom: 4px; }
.sheet .ln { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 16px; }
.sheet .ln.tot { font-weight: 700; border-bottom: 0; }
.sheet .ln.payday { margin-top: 8px; padding: 8px 10px; border: 0; border-radius: 10px; background: var(--violet-soft); font-weight: 700; }
.link-btn { border: 0; background: none; color: var(--violet); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 0 0 0 4px; }
.log summary, .how summary { cursor: pointer; }

/* ───────────── Rat Race Escape: the 3D board (board3d.js) ───────────── */
.board3d { position: relative; width: 100%; max-width: 640px; aspect-ratio: 1 / 0.95; margin: 0 auto; border-radius: 22px; overflow: hidden;
  background: #9BDBFF; box-shadow: 0 10px 30px -12px rgba(20, 60, 110, .45), inset 0 0 0 3px rgba(255,255,255,.6); touch-action: pan-y; }
.board3d canvas { display: block; width: 100% !important; height: 100% !important; }
.b3-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.b3-float { position: absolute; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 800; font-size: clamp(22px, 5.5vw, 34px);
  color: #fff; white-space: nowrap; -webkit-text-stroke: 1.5px rgba(0,0,0,.35);
  text-shadow: 0 3px 0 rgba(0,0,0,.25), 0 0 14px rgba(0,0,0,.25); animation: b3float 1.8s ease-out forwards; }
.b3-float.good { color: #7CFFB2; } .b3-float.bad { color: #FF9AA2; } .b3-float.small { font-size: 22px; }
@keyframes b3float { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); }
  30% { transform: translate(-50%, -70%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
.b3-banner { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font-family: var(--display); font-weight: 800; letter-spacing: .02em;
  font-size: clamp(30px, 9vw, 58px); color: #fff; white-space: nowrap; -webkit-text-stroke: 2px rgba(0,0,0,.4);
  text-shadow: 0 5px 0 rgba(0,0,0,.28), 0 0 24px rgba(255,255,255,.5); animation: b3banner 1.6s cubic-bezier(.2,1.6,.4,1) forwards; }
.b3-banner.gold { color: #FFD43B; } .b3-banner.green { color: #5CFF9D; } .b3-banner.red { color: #FF6B6B; }
@keyframes b3banner { 0% { opacity: 0; transform: translateX(-50%) scale(.3) rotate(-8deg); } 18% { opacity: 1; transform: translateX(-50%) scale(1.12) rotate(2deg); }
  30% { transform: translateX(-50%) scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-24px) scale(1); } }
@media (prefers-reduced-motion: reduce) { .b3-float, .b3-banner { animation-duration: .01s; } }

/* ───────────── Rat Race Escape on phones: full screen, no scrolling during a turn ───────────── */
.mini-meter, .sheet-close { display: none; }
@media (max-width: 560px) {
  body.in-game { overflow: hidden; }
  body.in-game .top { display: none; }
  body.in-game .app { padding: 0; animation: none !important; transform: none !important; } /* a transform here would break position:fixed */
  body.in-game #board3d-slot { width: 100%; height: 100%; }
  body.in-game .game > .row.between { flex-wrap: nowrap; }
  body.in-game .game > .row.between > .row { flex-wrap: nowrap; }
  body.in-game .game { position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column; gap: 6px; margin: 0;
    height: 100vh; height: 100dvh; background: var(--paper);
    padding: calc(6px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom)); }
  body.in-game .game > * + * { margin-top: 0; }
  body.in-game .game > .row.between { flex: 0 0 auto; min-height: 36px; }
  body.in-game .game > .row.between .eyebrow { margin: 0; font-size: 12px; }
  body.in-game .game .btn.small { min-height: 34px; padding: 4px 8px; font-size: 14px; }
  body.in-game .others { flex: 0 0 auto; gap: 6px; }
  body.in-game .other { min-width: 0; flex: 1 1 0; padding: 4px 8px; font-size: 14px; line-height: 1.25; }
  body.in-game .other .small { font-size: 12.5px; }
  /* the board takes whatever height is left */
  body.in-game .board-wrap { flex: 1 1 auto; min-height: 150px; display: flex; justify-content: center; align-items: center; overflow: hidden; }
  body.in-game .board3d { aspect-ratio: auto; width: 100%; height: 100%; max-width: none; border-radius: 16px; }
  body.in-game .board-wrap .board { height: 100%; width: auto; max-width: 100%; }
  /* the compact money line */
  body.in-game .mini-meter { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 4px 10px;
    border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
  .mm-who { font-size: 20px; }
  .mm-bar { position: relative; flex: 1; height: 24px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); overflow: hidden; }
  .mm-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--violet), var(--lime)); border-radius: 999px; transition: width .6s ease; }
  .mm-bar b { position: relative; display: block; text-align: center; font-size: 13.5px; line-height: 21px; }
  .mm-cash { font-family: var(--display); font-weight: 800; font-size: 17px; }
  .mm-open { font-size: 18px; }
  /* the turn card: bottom of the screen, scrolls inside itself if a question is long */
  body.in-game .event { flex: 0 1 auto; max-height: 46dvh; overflow-y: auto; padding: 12px 14px; border-radius: 16px; -webkit-overflow-scrolling: touch; }
  body.in-game .event h2 { font-size: 22px; margin-bottom: 8px; }
  body.in-game .event .deal { padding: 8px 10px; margin-bottom: 6px; }
  body.in-game .event .deal p { font-size: 15.5px; line-height: 1.4; }
  body.in-game .event .deal-h { font-size: 18px; }
  body.in-game .event .learn-q { font-size: 17px; line-height: 1.35; margin-bottom: 6px; }
  body.in-game .event .choices { margin-top: 6px; gap: 6px; }
  body.in-game .event .choices .btn { min-height: 48px; flex: 1 1 auto; }
  body.in-game .event .btn.big { min-height: 56px; }
  body.in-game .event .result { font-size: 15.5px; padding: 8px 10px; }
  /* the full money sheet slides up over everything when asked for */
  body.in-game .sheet-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 82dvh; overflow-y: auto;
    transform: translateY(105%); transition: transform .28s ease; padding: 0 8px calc(8px + env(safe-area-inset-bottom)); }
  body.in-game .game.show-sheet .sheet-wrap { transform: none; box-shadow: 0 -12px 40px rgba(0,0,0,.25); }
  body.in-game .sheet-wrap .sheet { margin: 0; border-radius: 18px 18px 14px 14px; padding-top: 54px; }
  body.in-game .sheet-close { display: block; position: sticky; top: 8px; margin: 8px 8px -44px auto; z-index: 1; width: 38px; height: 38px;
    border-radius: 999px; border: 0; background: var(--ink); color: var(--paper); font-size: 16px; cursor: pointer; }
  body.in-game .log { display: none; }
  body.in-game .hide-phone { display: none; }
}

/* hover bubble: the full definition for the kid's age, under the tagline */
.lattice-tip .def { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 15px; line-height: 1.45; }

/* ───────────── Rat Race Escape online ───────────── */
.room-code { display: flex; gap: 8px; margin: 6px 0 12px; }
.room-code span { width: 54px; height: 64px; display: grid; place-items: center; border-radius: 14px; background: var(--violet); color: var(--violet-ink);
  font-family: var(--display); font-weight: 800; font-size: 36px; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.lobby-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.lobby-row:last-child { border-bottom: 0; }
.lobby-row .muted { margin-left: auto; }
.dot { width: 10px; height: 10px; border-radius: 999px; background: var(--line); display: inline-block; }
.dot.on { background: #18B35E; box-shadow: 0 0 0 3px rgba(24,179,94,.2); }
.code-input { width: 120px; min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .18em; text-transform: uppercase; text-align: center; }
.online-card label input { width: 100%; min-height: 46px; font: inherit; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.turn-timer { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--violet-soft); color: var(--ink); font-weight: 800; letter-spacing: 0; }
.turn-timer.low { background: var(--coral-soft); color: var(--coral); animation: fx-pulse .6s ease-in-out infinite alternate; }
@keyframes fx-pulse { to { transform: scale(1.12); } }
.reacts { display: flex; flex-wrap: wrap; gap: 6px; }
.react-btn { width: 48px; height: 48px; font-size: 26px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.react-btn:active { transform: scale(.9); }
.event.waiting h2 { font-size: 21px; }
.net-status { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60; padding: 6px 14px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 15px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.online-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.join-line { display: flex; gap: 8px; flex: 1 1 200px; }
.join-line .code-input { flex: 1; min-width: 0; }

/* ───────────── 5–12 players online ───────────── */
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.others-wrap { display: flex; flex-direction: column; gap: 6px; }
.others.compact { display: flex; gap: 6px; overflow-x: auto; padding: 2px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; scrollbar-width: none; }
.others.compact::-webkit-scrollbar { display: none; }
.chip-p { flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; min-width: 50px; padding: 4px 6px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 18px; line-height: 1.1; }
.chip-p small { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.chip-p.me { border-color: var(--violet); background: var(--violet-soft); }
.chip-p.more { justify-content: center; }
.standings { padding: 8px 12px; max-height: 40vh; overflow-y: auto; }
.standings .ln { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.standings .ln.me { font-weight: 800; }
@media (max-width: 560px) { body.in-game .standings { position: absolute; left: 8px; right: 8px; top: 96px; z-index: 5; box-shadow: 0 12px 30px rgba(0,0,0,.25); } }

/* the class switch: a pill that slides between Critical Thinking (violet) and Financial Freedom (green) */
.class-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface); border: 2px solid var(--line); border-radius: 999px; padding: 5px; }
.class-switch .cs-pill { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 8px); border-radius: 999px; background: #4F35E0;
  box-shadow: 0 4px 14px rgba(26, 29, 43, .18); transition: transform .34s cubic-bezier(.3, 1.35, .5, 1), background-color .34s ease; }
.class-switch[data-pos="money"] .cs-pill { transform: translateX(calc(100% + 6px)); background: #0B7A4B; }
.class-switch a { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 12px; border-radius: 999px;
  font-weight: 700; text-decoration: none; color: var(--ink); font-size: 17px; transition: color .25s ease; }
.class-switch a.on { color: #FFFFFF; }
.class-switch a:not(.on):hover { background: rgba(127, 127, 127, .10); }
.class-switch.no-anim .cs-pill, .class-switch.no-anim a { transition: none; }
@media (prefers-reduced-motion: reduce) { .class-switch .cs-pill, .class-switch a { transition: none; } }

/* Cross-page view transitions between the two classes (same origin): the header and the class pill morph, the rest crossfades. */
@view-transition { navigation: auto; }
.top { view-transition-name: top-bar; }
.class-switch { view-transition-name: class-switch; }
.class-switch .cs-pill { view-transition-name: class-pill; }
::view-transition-group(class-pill) { animation-duration: .4s; animation-timing-function: cubic-bezier(.3, 1.3, .5, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* the race clock: seven day blocks and a big countdown, green → amber → red */
.race-clock { border-radius: 16px; padding: 12px 14px; margin: 4px 0 12px; background: #E7F7EC; border: 2px solid #2E9E5B; }
.race-clock.amber { background: #FFF3D6; border-color: #E0A100; }
.race-clock.red { background: #FFE9EA; border-color: #D63A40; animation: rc-pulse 1.6s ease-in-out infinite; }
.rc-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.rc-big { font-size: 24px; line-height: 1.2; color: #1A1D2B; }
.race-clock.red .rc-big { color: #B3261E; }
.rc-sub { font-size: 16px; color: #4A4F63; }
.rc-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; }
.rc-day { height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.rc-day i { font-style: normal; }
.rc-day.past { background: #C9CDD8; color: #6A6F80; text-decoration: line-through; }
.rc-day.now { background: #1A1D2B; color: #fff; box-shadow: 0 0 0 3px rgba(26, 29, 43, .18); }
.race-clock.red .rc-day.now { background: #D63A40; }
.rc-day.next { background: #fff; color: #1A1D2B; border: 2px solid #C9CDD8; }
@keyframes rc-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 58, 64, 0); } 50% { box-shadow: 0 0 0 6px rgba(214, 58, 64, .18); } }
@media (prefers-reduced-motion: reduce) { .race-clock.red { animation: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rc-big { color: #1A1D2B; } }

/* daily race tabs + stars; level-up offer */
.race-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 10px; }
.race-tabs button { font: inherit; font-weight: 700; font-size: 17px; padding: 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.race-tabs button.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.star-tag { font-size: 14px; font-weight: 700; }
.level-offer { border: 2px solid var(--violet); background: var(--violet-soft); }

/* "Race ends tonight": big, clear, and the seconds tick down */
.race-alert { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label link" "time time"; align-items: center; gap: 2px 12px;
  padding: 14px 18px; border-radius: 16px; text-decoration: none; border: 3px solid; }
.race-alert .ra-label { grid-area: label; font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.race-alert .ra-time { grid-area: time; font-family: var(--display); font-size: clamp(38px, 11vw, 56px); font-weight: 800; line-height: 1.05;
  font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.race-alert .ra-link { grid-area: link; font-size: 16px; font-weight: 700; white-space: nowrap; }
.race-alert.amber { background: #FFF3D6; border-color: #E0A100; color: #6B4A00; }
.race-alert.red { background: #FFE9EA; border-color: #D63A40; color: #A1161D; }
.race-clock .rc-big [data-race-clock] { font-variant-numeric: tabular-nums; }

/* computer players: the kid watches; the turn card can't be tapped during a computer's turn */
.game.bot-turn .event button, .game.bot-turn .event a { pointer-events: none; }
.game.bot-turn .event { box-shadow: 0 0 0 3px var(--lime) inset, var(--shadow); }
.bot-card { border-style: dashed; }
