/* 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, the van and the tray. */
:root {
  color-scheme: light dark;
  --bg: #f6f2ea;
  --bg-2: #ece4d6;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --ink: #2a2014;
  --muted: #6b5d4b;
  --line: rgba(42, 32, 20, 0.13);
  --accent: #b5651d; /* white text on it is 4.6:1 */
  --accent-deep: #8f4f15;
  --accent-ink: #ffffff;
  --floor: #e7dcc9;
  --body: #9aa3ab;
  --shadow: rgba(80, 50, 20, 0.18);
  --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: #15120d;
    --bg-2: #1c1812;
    --panel: rgba(46, 39, 30, 0.78);
    --panel-solid: #29231a;
    --ink: #f4ecdf;
    --muted: #c0b29c;
    --line: rgba(244, 236, 223, 0.13);
    --accent: #f0a35c;
    --accent-deep: #e48c3c;
    --accent-ink: #2a1505;
    --floor: #3a3226;
    --body: #5e666e;
    --shadow: rgba(0, 0, 0, 0.45);
  }
}
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: 10px; }
.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); }

.play { display: flex; flex-direction: column; gap: 10px; }
.meta { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; font-size: 0.85rem; color: var(--muted); }
.clock { font: 600 1rem/1 var(--display); font-variant-numeric: tabular-nums; color: var(--ink); }
.van-wrap { display: flex; justify-content: center; }
.van {
  --w: 6; --h: 5;
  width: min(100%, calc(var(--w) * 64px)); aspect-ratio: var(--w) / var(--h);
  display: grid; grid-template-columns: repeat(var(--w), 1fr); grid-template-rows: repeat(var(--h), 1fr); gap: 3px; padding: 8px;
  border-radius: 14px 26px 14px 14px; background: var(--body); box-shadow: 0 14px 34px -20px var(--shadow);
  touch-action: manipulation; user-select: none;
}
.van:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.cell { border-radius: 5px; background: var(--floor); min-width: 0; min-height: 0; transition: background 0.12s; }
.cell.body { background: transparent; }
.cell.ghost { box-shadow: inset 0 0 0 3px var(--accent); }
.cell.ghost.no { box-shadow: inset 0 0 0 3px #d1495b; }
.cell.cur { outline: 2px dashed var(--accent); outline-offset: -2px; }
.cell.bad { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.tools { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.parcel { position: relative; padding: 8px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel-solid); display: grid; place-items: center; min-width: 58px; min-height: 58px; }
.parcel.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); transform: translateY(-3px); }
.pn { position: absolute; top: 2px; left: 6px; font-size: 0.68rem; color: var(--muted); }
.mini { display: grid; grid-template-columns: repeat(var(--w), 12px); grid-template-rows: repeat(var(--h), 12px); gap: 2px; }
.mini i { border-radius: 3px; }
.mini i.anchor::after { content: ''; display: block; width: 4px; height: 4px; margin: 4px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); }
.how-line { margin: 0; min-height: 1.4em; text-align: center; font-size: 0.9rem; color: var(--muted); }
.foot { display: flex; justify-content: space-between; }
.how { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; text-align: left; font-size: 0.92rem; }
.btn.wide { margin-top: 16px; }
.kicker { color: var(--muted); }
.res-line { margin: 0 0 6px; font-size: 1.05rem; }
.res-note { margin: 0 0 10px; font-size: 0.88rem; color: var(--muted); }
.wd.today i { outline: 2px dashed var(--accent); outline-offset: -2px; }
.wd.great i { background: var(--accent); color: var(--accent-ink); font-size: 0.62rem; }
.wd.done i { background: var(--floor); font-size: 0.62rem; }
.toast { z-index: 10; }
@media (max-width: 380px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .mini { grid-template-columns: repeat(var(--w), 10px); grid-template-rows: repeat(var(--h), 10px); }
}
