/* 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 the board. */
:root {
  color-scheme: light dark;
  --bg: #f4f1fa;
  --bg-2: #e9e3f5;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --ink: #221a33;
  --muted: #5f5675;
  --line: rgba(34, 26, 51, 0.13);
  --accent: #6a3fb5; /* white text on it is 6.9:1 */
  --accent-deep: #55308f;
  --accent-ink: #ffffff;
  --floor: #ece6f6;
  --wall: #5f5675;
  --cube: #ffffff;
  --red: #e0457b;
  --blue: #2f7fd6;
  --shadow: rgba(60, 30, 110, 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: #120f1a;
    --bg-2: #181423;
    --panel: rgba(40, 34, 56, 0.78);
    --panel-solid: #241e33;
    --ink: #efe9fa;
    --muted: #b5abcc;
    --line: rgba(239, 233, 250, 0.13);
    --accent: #b392f0;
    --accent-deep: #9d76ea;
    --accent-ink: #1a0f2e;
    --floor: #2b2440;
    --wall: #8c82a6;
    --cube: #f3eefc;
    --red: #ff6f9c;
    --blue: #6aaeff;
    --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); }
.count b { font: 600 1.2rem/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.stage { display: flex; justify-content: center; align-items: flex-start; gap: 10px; }
.board {
  --n: 5;
  width: min(100% - 72px, 400px, 54vh); aspect-ratio: 1;
  display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); gap: 4px; padding: 8px;
  border-radius: 18px; background: var(--panel); box-shadow: 0 14px 40px -22px var(--shadow), inset 0 0 0 1px var(--line);
  touch-action: none; user-select: none;
}
.board:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sq { position: relative; min-width: 0; min-height: 0; border-radius: 8px; background: var(--floor); display: grid; place-items: center; font-size: clamp(0.9rem, 4vw, 1.3rem); }
.sq.wall { background: var(--wall); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2); }
.sq.near { cursor: pointer; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.sq.target::before { content: ''; position: absolute; inset: 22%; border-radius: 50%; border: 3px dashed var(--red); }
.sq.target.blue::before { border-color: var(--blue); }
.sq.target.stamped::before { border-style: solid; background: var(--red); }
.sq.target.blue.stamped::before { background: var(--blue); }
.cube-top {
  position: absolute; z-index: 1; inset: 8%; border-radius: 9px;
  background: var(--cube); box-shadow: 0 4px 0 color-mix(in srgb, var(--cube) 60%, #000), 0 8px 14px -6px var(--shadow);
  transition: transform 0.12s;
}
.ink-top { position: absolute; inset: 18%; border-radius: 6px; }
.ink-top.red, .ink-side.red { background: var(--red); }
.ink-top.blue, .ink-side.blue { background: var(--blue); }
.ink-side { position: absolute; border-radius: 3px; }
.ink-side.s2 { left: 12%; right: 12%; top: 3%; height: 12%; }
.ink-side.s3 { left: 12%; right: 12%; bottom: 3%; height: 12%; }
.ink-side.s4 { top: 12%; bottom: 12%; right: 3%; width: 12%; }
.ink-side.s5 { top: 12%; bottom: 12%; left: 3%; width: 12%; }
.ink-under { position: absolute; inset: 30%; border-radius: 50%; border: 3px dotted var(--red); }
.ink-under.blue { border-color: var(--blue); inset: 38%; }
/* The unfolded cube */
.net { flex: none; display: grid; grid-template-areas: '. n .' 'w t e' '. s .' '. b .'; grid-template-columns: repeat(3, 18px); grid-template-rows: repeat(4, 18px); gap: 2px; margin-top: 8px; }
.net i { border-radius: 4px; background: var(--panel-solid); box-shadow: inset 0 0 0 1px var(--line); }
.net i.red { background: var(--red); }
.net i.blue { background: var(--blue); }
.how-line { margin: 0; min-height: 1.4em; text-align: center; font-size: 0.92rem; color: var(--muted); }
.acts { display: flex; justify-content: center; gap: 8px; }
.foot { display: flex; justify-content: flex-end; }
.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); word-break: break-all; }
.wd.today i { outline: 2px dashed var(--accent); outline-offset: -2px; }
.wd.great i { background: var(--accent); color: var(--accent-ink); }
.wd.done i { background: var(--floor); }
.toast { z-index: 10; }
@media (max-width: 380px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .net { grid-template-columns: repeat(3, 14px); grid-template-rows: repeat(4, 14px); }
}
