/* Cal's Number Machine — see DESIGN.md */
:root {
  --bg: oklch(0.16 0.018 195);
  --panel: oklch(0.22 0.021 195 / 0.16);
  --surface: oklch(0.26 0.023 195 / 0.25);
  --surface-2: oklch(0.32 0.026 195 / 0.4);
  --edge: oklch(0.80 0.14 165 / 0.13);
  --edge-strong: oklch(0.80 0.14 165 / 0.28);
  --ink: oklch(0.95 0.01 170);
  --muted: oklch(0.74 0.03 185);
  --line: oklch(0.80 0.14 165);
  --line-dim: oklch(0.55 0.08 175);
  --comet: oklch(0.82 0.13 75);
  --glow-line-50: oklch(0.80 0.14 165 / 0.5);
  --glow-line-55: oklch(0.80 0.14 165 / 0.55);
  --glow-line-70: oklch(0.80 0.14 165 / 0.7);
  --glow-line-80: oklch(0.80 0.14 165 / 0.8);
  --glow-line-12: oklch(0.80 0.14 165 / 0.12);
  --win: oklch(0.85 0.16 145);
  --radius: 16px;
  --font: ui-rounded, 'SF Pro Rounded', -apple-system, 'Segoe UI', system-ui, sans-serif;
  /* z scale */
  --z-fx: 40;
  --z-screen: 30;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------- top bar: device status strip ---------- */
#topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 1rem 1.4rem 0.6rem;
}
#dots { display: flex; gap: 0.55rem; justify-self: center; }
#dots .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface-2);
  transition: background 200ms ease-out, transform 200ms ease-out, box-shadow 200ms ease-out;
}
#dots .dot.now {
  background: var(--comet);
  transform: scale(1.3);
  box-shadow: 0 0 8px oklch(0.82 0.13 75 / 0.7);
}
#dots .dot.done { background: var(--line-dim); }
#streak {
  justify-self: end;
  display: flex; align-items: center; gap: 0.25rem;
  font-size: 1.35rem; font-weight: 800; color: var(--comet);
  min-width: 3.2rem; justify-content: flex-end;
}
#streak.pop { animation: pop 400ms ease-out; }
@keyframes pop { 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- stage: fixed rhythm, everything anchored ---------- */
#stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.1rem, 3.2vh, 2rem);
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 0 1.4rem calc(0.6rem + env(safe-area-inset-bottom));
}

#promptWrap { text-align: center; }
#promptWrap.swap { animation: slidein 260ms ease-out; }
#prompt .pnum {
  font-size: clamp(3.2rem, 8.5vw, 5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0.02em;
}
#prompt .pjump {
  font-size: clamp(1.4rem, 3.6vw, 1.9rem);
  font-weight: 700;
  color: var(--comet);
  margin-top: 0.15rem;
}
#prompt .pseq {
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}
#prompt .pseq .qmark { color: var(--comet); }
.digit { display: inline-block; transition: color 200ms ease-out; }
.digit.glowed {
  color: var(--comet);
  animation: digitPulse 1.1s ease-out infinite;
}
@keyframes digitPulse {
  0%, 100% { text-shadow: 0 0 0 transparent; transform: scale(1); }
  50% { text-shadow: 0 0 24px oklch(0.82 0.13 75 / 0.85); transform: scale(1.12); }
}
#coach {
  min-height: 2.1rem;
  margin-top: 0.8rem;
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  font-weight: 650;
  color: var(--ink);
}
#coach.swap { animation: slidein 200ms ease-out; }
#coach.warm { color: var(--comet); }
#coach.win { color: var(--win); }
@keyframes slidein {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

/* ---------- the instrument panel: the machine's display ---------- */
#lineWrap {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 1.1rem 0.9rem 0.4rem;
}
#line { width: 100%; height: auto; display: block; overflow: visible; }
.tick { stroke: var(--line-dim); stroke-width: 2; }
.baseline { stroke: var(--line); stroke-width: 3; filter: drop-shadow(0 0 6px var(--glow-line-55)); }
.ticklabel { fill: var(--muted); font-family: var(--font); font-weight: 700; font-size: 22px; text-anchor: middle; }
.gate { stroke: var(--line); stroke-width: 3.5; filter: drop-shadow(0 0 8px var(--glow-line-80)); }
.gatelabel { fill: var(--line); font-family: var(--font); font-weight: 800; font-size: 30px; text-anchor: middle; }
.gate.flash { animation: gateFlash 700ms ease-out; }
@keyframes gateFlash {
  30% { stroke-width: 9; filter: drop-shadow(0 0 26px oklch(0.85 0.16 145 / 1)); }
}
.gate.pulse { animation: gatePulse 1.1s ease-out infinite; }
@keyframes gatePulse {
  50% { stroke-width: 8; filter: drop-shadow(0 0 20px oklch(0.82 0.13 75 / 0.95)); }
}
.marker { fill: var(--comet); filter: drop-shadow(0 0 10px oklch(0.82 0.13 75 / 0.9)); }
.marker-ring { fill: none; stroke: var(--comet); stroke-width: 2; opacity: 0.5; }
.jumparc { fill: none; stroke: var(--comet); stroke-width: 3; stroke-dasharray: 7 8; opacity: 0.9; }
.jumparc.ghost { stroke: var(--muted); opacity: 0.5; }
.arclabel { fill: var(--comet); font-family: var(--font); font-weight: 800; font-size: 26px; text-anchor: middle; }
.landglow { fill: none; stroke: var(--win); stroke-width: 3; opacity: 0; }
.landglow.on { animation: landPing 900ms ease-out; }
@keyframes landPing { 0% { opacity: 1; r: 6; } 100% { opacity: 0; r: 42; } }
.dirarrow { stroke: var(--comet); stroke-width: 5; fill: none; marker-end: url(#arrowhead); animation: arrowSlide 1s ease-out infinite; }
@keyframes arrowSlide { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0.2; } }

/* ---------- answers: one grid vocabulary for every phase ---------- */
#answerArea {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 290px));
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 186px;
  align-content: center;
}
.btn {
  font-family: var(--font);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms ease-out, background 150ms ease-out, border-color 150ms ease-out, opacity 200ms ease-out;
}
.btn:active { transform: scale(0.97); background: var(--surface-2); }
.btn:focus-visible { outline: 3px solid var(--line); outline-offset: 2px; }
@media (hover: hover) {
  .btn:hover { background: var(--surface-2); border-color: var(--edge-strong); }
}
#answerArea .btn { animation: slidein 240ms ease-out backwards; }
#answerArea .btn:nth-child(2) { animation-delay: 40ms; }
#answerArea .btn:nth-child(3) { animation-delay: 80ms; }
#answerArea .btn:nth-child(4) { animation-delay: 120ms; }
.btn-choice {
  min-height: 84px;
  font-size: 2rem;
  font-weight: 800;
}
.btn-est {
  min-height: 88px;
  font-size: 1.55rem;
  font-weight: 750;
}
.btn.dead { opacity: 0.26; pointer-events: none; border-color: transparent; }
.btn.right { border-color: var(--win); background: oklch(0.85 0.16 145 / 0.13); }
.btn.warm { border-color: var(--comet); }

/* ---------- hint ---------- */
#hintRow { display: flex; justify-content: center; min-height: 52px; }
#hintBtn {
  font-family: var(--font);
  background: none;
  border: 1px solid var(--edge);
  border-radius: 999px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  transition: background 150ms ease-out, border-color 150ms ease-out;
}
#hintBtn:active { background: var(--surface); }
@media (hover: hover) { #hintBtn:hover { border-color: var(--edge-strong); } }
#hintPips { letter-spacing: 0.2em; margin-left: 0.35rem; color: var(--comet); }

/* ---------- shake ---------- */
#stage.shake { animation: shake 450ms ease-out; }
@keyframes shake {
  20% { transform: translateX(-9px); }
  45% { transform: translateX(7px); }
  70% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* ---------- full screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-screen);
  background: var(--bg);
  overflow-y: auto;
  display: flex;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem max(2rem, env(safe-area-inset-bottom));
}
.screen-inner {
  margin: auto;
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.7rem;
  animation: slidein 300ms ease-out;
}
.end-title { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 800; text-align: center; text-wrap: balance; }
.end-sub { text-align: center; color: var(--muted); font-size: 1.1rem; font-weight: 600; margin-top: 0.3rem; }
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.85rem; align-items: stretch; }
.stat {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 1.05rem 0.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}
.stat .big { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.stat .lbl { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.stat.best .big { color: var(--comet); }
.stat .badge {
  font-size: 0.72rem; font-weight: 800;
  color: var(--bg); background: var(--comet);
  border-radius: 999px; padding: 0.18rem 0.6rem; margin-top: 0.25rem;
}
.terr-panel {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.3rem;
}
.terr-title { font-size: 0.95rem; font-weight: 800; letter-spacing: 0.06em; color: var(--line-dim); text-align: center; margin-bottom: 1rem; }
.terr { display: flex; flex-direction: column; gap: 0.7rem; }
.terr-seg { display: flex; align-items: center; gap: 1rem; }
.terr-seg .lbl { flex: 1; font-size: 1rem; font-weight: 700; color: var(--muted); }
.terr-seg.lit .lbl { color: var(--ink); }
.terr-track {
  flex: 1.1;
  height: 13px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.terr-fill { display: block; height: 100%; border-radius: 999px; background: var(--line-dim); }
.terr-seg.lit .terr-fill { background: var(--line); box-shadow: 0 0 12px var(--glow-line-70); }
.btn-primary {
  align-self: center;
  min-width: 270px;
  min-height: 74px;
  font-size: 1.45rem;
  font-weight: 800;
  background: var(--line);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  transition: transform 120ms ease-out, filter 150ms ease-out;
}
.btn-primary:active { transform: scale(0.97); }
@media (hover: hover) { .btn-primary:hover { filter: brightness(1.07); } }
.grownups {
  align-self: center;
  color: var(--line-dim);
  font-size: 0.85rem;
  font-weight: 600;
  background: none; border: none; cursor: pointer; font-family: var(--font);
  padding: 0.6rem 1rem;
}

/* parent view */
.p-title { font-size: 1.6rem; font-weight: 800; }
.p-section { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.p-section h3 { font-size: 0.9rem; font-weight: 800; color: var(--line-dim); letter-spacing: 0.05em; margin-bottom: 0.7rem; }
.p-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; font-size: 1rem; }
.p-row .k { color: var(--muted); font-weight: 600; }
.p-row .v { font-weight: 800; }
.p-err { font-size: 0.95rem; padding: 0.3rem 0; color: var(--muted); }
.p-err b { color: var(--ink); }
.backbtn { align-self: flex-start; }

/* ---------- fx canvas ---------- */
#fx { position: fixed; inset: 0; z-index: var(--z-fx); pointer-events: none; }
#ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#app { position: relative; z-index: 1; }
body { transition: background 600ms ease-out; }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- top-right cluster: streak + sound ---------- */
#topRight { justify-self: end; display: flex; align-items: center; gap: 0.8rem; }
#streak { justify-self: unset; }
#soundBtn, #musicBtn {
  background: none;
  border: 1px solid var(--edge);
  border-radius: 999px;
  width: 44px; height: 44px;
  font-size: 1.1rem;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 150ms ease-out, opacity 150ms ease-out;
}
#soundBtn.off, #musicBtn.off { opacity: 0.45; }
@media (hover: hover) { #soundBtn:hover, #musicBtn:hover { border-color: var(--edge-strong); } }

/* ---------- wrong-jump evidence ---------- */
.ghost-ring {
  fill: none;
  stroke: var(--comet);
  stroke-width: 2.5;
  stroke-dasharray: 5 5;
  opacity: 0.75;
}
.ghost-label {
  fill: var(--comet);
  font-family: var(--font);
  font-weight: 800;
  font-size: 24px;
  text-anchor: middle;
  opacity: 0.85;
}
.btn.dead.warm { opacity: 0.4; border-color: oklch(0.82 0.13 75 / 0.55); }

/* ---------- streak callout: the streak is an event, not a corner detail ---------- */
#stage { position: relative; }
#streakPop {
  position: absolute;
  top: 37%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  color: var(--comet);
  text-shadow: 0 0 24px oklch(0.82 0.13 75 / 0.55);
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}
#streakPop.go { animation: streakUp 1.5s ease-out forwards; }
@keyframes streakUp {
  0% { opacity: 0; transform: translateX(-50%) scale(0.6); }
  18% { opacity: 1; transform: translateX(-50%) scale(1.12); }
  30% { transform: translateX(-50%) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(0.95); }
}

/* ---------- lesson chip in header ---------- */
#lessonBtn {
  justify-self: start;
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.5rem 1rem;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 150ms ease-out, background 150ms ease-out;
}
#lessonBtn:active { background: var(--surface-2); }
@media (hover: hover) { #lessonBtn:hover { border-color: var(--edge-strong); } }

/* difficulty badges, GD-flavored */
.diffTag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  color: var(--bg);
}
.diffTag.d1 { background: oklch(0.80 0.14 165); }
.diffTag.d2 { background: oklch(0.80 0.10 220); }
.diffTag.d3 { background: oklch(0.82 0.13 75); }
.diffTag.d4 { background: oklch(0.72 0.17 45); }
.diffTag.d5 { background: oklch(0.70 0.20 25); color: oklch(0.97 0.01 25); }

/* ---------- lesson menu ---------- */
.menu-brand {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--line-dim);
  margin-bottom: 0.5rem;
}
.lsection h3 {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--line-dim);
  margin-bottom: 0.7rem;
}
.lgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.7rem;
}
.lgrid.boss { grid-template-columns: 1fr; }
.lchip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 1rem 1.1rem;
  min-height: 64px;
  cursor: pointer;
  transition: border-color 150ms ease-out, background 150ms ease-out, transform 120ms ease-out;
}
.lchip:active { transform: scale(0.97); background: var(--surface-2); }
@media (hover: hover) { .lchip:hover { border-color: var(--edge-strong); } }
.lchip.cur { border-color: var(--line); }
.lchip.done { background: oklch(0.80 0.14 165 / 0.08); }
.endBtns { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.endBtns .btn-est { min-height: 74px; min-width: 160px; }

/* ---------- panel heat: the machine runs hotter as the streak climbs ---------- */
#lineWrap { transition: border-color 400ms ease-out, box-shadow 400ms ease-out; }
#lineWrap.heat1 { border-color: var(--edge-strong); }
#lineWrap.heat2 { border-color: var(--glow-line-50); box-shadow: 0 0 24px var(--glow-line-12); }
#lineWrap.heat3 { border-color: oklch(0.82 0.13 75 / 0.6); box-shadow: 0 0 34px oklch(0.82 0.13 75 / 0.18); }

/* ---------- Clocks & Time ---------- */
#prompt .pclock {
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  font-weight: 700;
  color: var(--muted);
}
#prompt .pclock b { color: var(--ink); font-weight: 800; }
#clock {
  display: block;
  margin: 0 auto;
  width: min(84vw, 42vh, 360px);
  height: auto;
  overflow: visible;
  touch-action: none;
  cursor: grab;
}
.cface { fill: oklch(1 0 0 / 0.05); stroke: var(--line); stroke-width: 4; filter: drop-shadow(0 0 8px var(--glow-line-55)); }
.ctick { stroke: var(--line-dim); stroke-width: 2; }
.ctick.big { stroke: var(--line); stroke-width: 3.5; }
.ctick.big.lit { stroke: var(--comet); stroke-width: 6; filter: drop-shadow(0 0 8px oklch(0.82 0.13 75 / 0.9)); }
.cnum { fill: var(--ink); font-family: var(--font); font-weight: 800; font-size: 40px; text-anchor: middle; }
.cmin { fill: var(--comet); font-family: var(--font); font-weight: 800; font-size: 22px; text-anchor: middle; opacity: 0.9; }
.chub { fill: var(--line); }
.hand-h { stroke: var(--ink); stroke-width: 13; stroke-linecap: round; }
.hand-m { stroke: var(--comet); stroke-width: 8; stroke-linecap: round; filter: drop-shadow(0 0 8px oklch(0.82 0.13 75 / 0.7)); }
.hand-m.correct { stroke: var(--win); filter: drop-shadow(0 0 12px oklch(0.85 0.16 145 / 0.9)); }
.hand-h.correct { stroke: var(--win); }
.hand-ghost {
  stroke: var(--comet);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 8 9;
  opacity: 0.65;
  animation: ghostPulse 1.1s ease-out infinite;
}
@keyframes ghostPulse { 50% { opacity: 0.3; } }
.mgrab { fill: oklch(0.82 0.13 75 / 0.28); stroke: var(--comet); stroke-width: 2; cursor: grab; }
.hgrab { fill: oklch(0.95 0.01 170 / 0.15); stroke: var(--ink); stroke-width: 2; cursor: grab; }

/* menu unit headers */
.unit-head {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--line);
  margin-top: 0.4rem;
}


/* ---------- frosted glass (Mike, 2026-08-30): surfaces are windows, not walls.
   Semi-transparent with backdrop blur; text, lines, and hands stay opaque. ---------- */
#lineWrap, .btn, #hintBtn, #lessonBtn, #soundBtn, #musicBtn,
.stat, .terr-panel, .p-section, .lchip, #streakPop {
  backdrop-filter: blur(9px) saturate(1.3);
  -webkit-backdrop-filter: blur(9px) saturate(1.3);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.09), inset 0 -1px 0 oklch(1 0 0 / 0.02);
}

/* ---------- combo pop styling ---------- */
#streakPop.combo { color: oklch(0.85 0.14 200); text-shadow: 0 0 24px oklch(0.85 0.14 200 / 0.6); }

/* ---------- clock success: every element pulses its own color ---------- */
#clock.win .cface, #clock.win .ctick.big, #clock.win .chub { animation: clockPulse 0.9s ease-out 2; }
#clock.win .cnum { animation: numPulse 0.9s ease-out 2; }
#clock.win .hand-m { animation: handPulse 0.9s ease-out 2; }
#clock.win .hand-h { animation: handPulseH 0.9s ease-out 2; }
@keyframes clockPulse { 50% { filter: drop-shadow(0 0 20px var(--glow-line-80)); } }
@keyframes numPulse { 50% { filter: drop-shadow(0 0 14px var(--glow-line-70)); } }
@keyframes handPulse { 50% { filter: drop-shadow(0 0 22px oklch(0.85 0.16 145 / 1)); } }
@keyframes handPulseH { 50% { filter: drop-shadow(0 0 16px oklch(0.95 0.01 170 / 0.9)); } }

/* ---------- the menu floats on the fabric of space-time ---------- */
body.menu-open #topbar, body.menu-open #stage, body.menu-open #endScreen { visibility: hidden; }
#menuScreen { background: oklch(0.13 0.02 265 / 0.15); }


/* ---------- EXPERIMENT: 8-bit mode (?pixel=1 to enable, ?pixel=0 to disable) ----------
   Press Start 2P has one weight and runs optically huge, so pixel mode
   re-tunes sizes across the board. Off by default; per-device persisted. */
body.pixel { --font: 'Press Start 2P', monospace; }
body.pixel * { font-weight: 400 !important; letter-spacing: 0 !important; }
body.pixel #prompt .pnum { font-size: clamp(1.9rem, 5.5vw, 3rem); }
body.pixel #prompt .pjump { font-size: clamp(0.8rem, 2.3vw, 1.1rem); margin-top: 0.6rem; }
body.pixel #prompt .pseq { font-size: clamp(1rem, 3.2vw, 1.6rem); line-height: 1.5; }
body.pixel #prompt .pclock { font-size: clamp(0.85rem, 2.4vw, 1.2rem); line-height: 1.6; }
body.pixel #coach { font-size: clamp(0.62rem, 1.9vw, 0.8rem); line-height: 1.7; }
body.pixel .btn-choice { font-size: 1.1rem; }
body.pixel .btn-est { font-size: 0.72rem; line-height: 1.6; }
body.pixel .btn-primary { font-size: 0.9rem; }
body.pixel #lessonBtn { font-size: 0.55rem; }
body.pixel .diffTag { font-size: 0.42rem; padding: 0.2rem 0.5rem; }
body.pixel #streakNum { font-size: 1rem; }
body.pixel #streakPop { font-size: 1.3rem !important; line-height: 1.6; }
body.pixel .ticklabel { font-size: 15px; }
body.pixel .gatelabel { font-size: 19px; }
body.pixel .arclabel { font-size: 16px; }
body.pixel .ghost-label { font-size: 15px; }
body.pixel .cnum { font-size: 25px; }
body.pixel .cmin { font-size: 13px; }
body.pixel .end-title { font-size: clamp(1.1rem, 4vw, 1.7rem); line-height: 1.5; }
body.pixel .end-sub { font-size: 0.7rem; line-height: 1.6; }
body.pixel .stat .big { font-size: 1.1rem; }
body.pixel .stat .lbl { font-size: 0.5rem; }
body.pixel .terr-seg .lbl { font-size: 0.6rem; line-height: 1.5; }
body.pixel .terr-title, body.pixel .menu-brand { font-size: 0.6rem; }
body.pixel .lchip { font-size: 0.62rem; line-height: 1.5; }
body.pixel .unit-head { font-size: 0.75rem; }
body.pixel .lsection h3 { font-size: 0.55rem; }
body.pixel #hintBtn { font-size: 0.62rem; }
body.pixel #brand { font-size: 0.5rem; }

/* menu selections: extra-open glass so the fabric shows through every chip */
body.menu-open .lchip { background: oklch(0.24 0.02 265 / 0.22); }

/* the answered ? pops into place in win green */
#prompt .qmark.filled { color: var(--win); display: inline-block; animation: pop 450ms ease-out; }

/* ---------- times tables: numpad + score ---------- */
.padgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 116px));
  gap: 0.6rem;
  justify-content: center;
}
.padBtn { min-height: 64px; font-size: 1.6rem; font-weight: 800; }
#prompt .entry { color: var(--comet); border-bottom: 4px solid var(--comet); padding: 0 0.35rem; min-width: 1.2em; display: inline-block; }
#prompt .entry.filledE { color: var(--win); border-bottom-color: var(--win); animation: pop 450ms ease-out; }
#score { font-size: 1.05rem; font-weight: 800; color: var(--comet); }
body.pixel .padBtn { font-size: 1rem; }

/* per-table high score on the lesson tile */
.lchip .lcol { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.lchip .hs { font-size: 0.72rem; font-weight: 800; color: var(--comet); letter-spacing: 0.05em; }
body.pixel .lchip .hs { font-size: 0.5rem; }
