/* The shared chrome (top bar, buttons, dialogs, stats grid, week strip, toast) is in
   hub/game.css, linked before this file. This sets the tokens it uses and Ballpark's own stage. */
:root {
  color-scheme: light dark;
  --bg: #f6f3ee;
  --bg-2: #efe8de;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --ink: #2a1d16;
  --muted: #6a5a50;
  --line: rgba(42, 29, 22, 0.13);
  --accent: #c2552d; /* white text on it is 4.6:1 */
  --accent-deep: #9e4120;
  --accent-ink: #ffffff;
  --fig: #2a1d16;
  --fig-soft: rgba(42, 29, 22, 0.12);
  --shade: #e08a4f;
  --truth: #2f8a57;
  --t0: #2f8a57;
  --t1: #b58a12;
  --t2: #d0702a;
  --t3: #c23b33;
  --shadow: rgba(90, 50, 20, 0.16);
  --display: Fredoka, 'Arial Rounded MT Bold', system-ui, sans-serif;
  --text: Nunito, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16130f;
    --bg-2: #1d1813;
    --panel: rgba(46, 38, 31, 0.76);
    --panel-solid: #2a221b;
    --ink: #f3e9df;
    --muted: #bba99b;
    --line: rgba(243, 233, 223, 0.13);
    --accent: #f08a5d;
    --accent-deep: #e0703f;
    --accent-ink: #2a1206;
    --fig: #f3e9df;
    --fig-soft: rgba(243, 233, 223, 0.14);
    --shade: #e0874a;
    --truth: #6fd398;
    --t0: #6fd398;
    --t1: #f0c94b;
    --t2: #f39a5a;
    --t3: #ff7f73;
    --shadow: rgba(0, 0, 0, 0.42);
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font: 600 16px/1.4 var(--text);
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, var(--bg), var(--bg-2)) fixed;
}
button { -webkit-tap-highlight-color: transparent; }
.app { width: 100%; max-width: 520px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 16px 8px; display: flex; flex-direction: column; gap: 12px; }
.logo { margin: 0; font: 700 2.1rem/1 var(--display); color: var(--accent-deep); }
@media (prefers-color-scheme: dark) { .logo { color: var(--accent); } }
.day { margin: 4px 0 0; font-size: 0.78rem; color: var(--muted); }

/* ---------------------------------------------------------------- the five rounds */
.play { display: flex; flex-direction: column; gap: 10px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 4px; border-radius: 12px; background: var(--panel); border: 1.5px solid var(--line); }
.step.on { border-color: var(--accent); }
.step.done { background: color-mix(in srgb, var(--tone, var(--muted)) 18%, var(--panel-solid)); border-color: transparent; }
.step-ico { font-size: 1.15rem; line-height: 1.2; }
.step-s { min-height: 1.1em; font: 600 0.82rem/1.2 var(--display); color: var(--tone, var(--muted)); font-variant-numeric: tabular-nums; }

.stage { padding: 14px 14px 16px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 14px 40px -24px var(--shadow); text-align: center; }
.stage .kicker { margin: 0; color: var(--muted); }
.ask { margin: 4px 0 10px; font: 600 1.45rem/1.2 var(--display); }
.view { display: flex; justify-content: center; }
.view.place { touch-action: none; cursor: ew-resize; }
.fig { width: min(78vw, 300px, 40vh); height: auto; aspect-ratio: 1; border-radius: 16px; background: var(--panel-solid); border: 1px solid var(--line); }
.fig.wide { aspect-ratio: auto; width: 100%; max-width: 380px; border: 0; background: none; }
.dot { fill: var(--fig); }
.fig-note { font: 600 12px var(--display); fill: var(--muted); }
.ray { stroke: var(--fig); stroke-width: 1.4; stroke-linecap: round; }
.vertex { fill: var(--fig); }
.arc { fill: none; stroke: var(--truth); stroke-width: 1.4; }
.arc.ask-arc { stroke: var(--muted); stroke-width: 1; }
.shape { fill: var(--fig-soft); }
.shaded { fill: var(--shade); }
.outline { fill: none; stroke: var(--fig); stroke-width: 0.8; stroke-linejoin: round; }
.bar { fill: var(--fig-soft); }
.end { stroke: var(--fig); stroke-width: 1; }
.end-label { font: 600 3.6px var(--display); fill: var(--muted); }
.marker { fill: var(--accent); }
.marker-line { stroke: var(--accent); stroke-width: 0.8; }
.truth { fill: var(--truth); }
.watch { margin: 6px auto 4px; font: 600 3.4rem/1.1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

.answer { margin-top: 10px; }
.pad { display: grid; gap: 8px; justify-items: center; }
.entry { font: 600 2rem/1.2 var(--display); min-width: 4ch; padding: 2px 14px; border-bottom: 2px solid var(--line); font-variant-numeric: tabular-nums; }
.keys-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; max-width: 380px; }
.key { height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel-solid); color: var(--ink); font: 600 1.3rem/1 var(--display); }
.key:active { transform: scale(0.94); }
/* The place round's range input does the keyboard and screen-reader work; dragging is on the
   drawn bar, so the input itself is hidden (but focusable), and its focus rings the bar. */
.slide { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; opacity: 0; }
.stage:has(.slide:focus-visible) .view.place { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.place-tip { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }
.verdict { min-height: 1.4em; margin: 10px 0 0; }
.verdict .score { font: 600 1.4rem/1 var(--display); margin-right: 4px; }
.t0 { color: var(--t0); }
.t1 { color: var(--t1); }
.t2 { color: var(--t2); }
.t3 { color: var(--t3); }
.btn.wide { margin-top: 12px; min-width: 60%; }
.foot { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------------------------------------------------------- help and results */
.how { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; text-align: left; }
.how li { display: flex; gap: 10px; align-items: baseline; font-size: 0.94rem; }
.how-ico { font-size: 1.2rem; }
.kicker { color: var(--muted); }
.res-rounds { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; text-align: left; }
.res-rounds li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rr-ico { font-size: 1.2rem; }
.rr-name { display: flex; flex-direction: column; font-weight: 700; }
.rr-name small { font-weight: 600; color: var(--muted); font-size: 0.8rem; }
.res-rounds .score { font: 600 1.3rem/1 var(--display); font-variant-numeric: tabular-nums; }
.wd.today i { outline: 2px dashed var(--accent); outline-offset: -2px; }
.wd.great i { background: var(--t0); color: #fff; }
.wd.done i { background: var(--fig-soft); }
.toast { z-index: 10; }
@media (max-width: 380px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .keys-grid { gap: 4px; }
  .key { height: 42px; }
}
