/* Light, like every sibling game: the shared home screen paints its own white
   and a dark page around it made curling the odd one out. */
:root {
  --ink: #17212b;
  --muted: #6b7c8c;
  --line: rgba(23,33,43,0.12);
  --accent: #d0343a;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #fff; color: var(--ink);
  font: 500 15px/1.35 ui-sans-serif, -apple-system, 'SF Pro Text', Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;          /* a pull that leaves the canvas must not scroll the page */
}

/* Both classes set display themselves, which outranks the UA rule for [hidden]. */
.home, .stage { position: fixed; inset: 0; }
.home[hidden], .stage[hidden] { display: none; }
.home { overflow-y: auto; }
.stage {
  display: flex; flex-direction: column; align-items: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.bar {
  width: 100%; max-width: 560px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 8px 14px;
}
/* Floating, not in the bar: the phone layout drops the bar entirely and the
   only way off the ice has to survive that. */
.back {
  position: fixed; z-index: 2;
  top: calc(env(safe-area-inset-top) + 8px); left: 10px;
  width: 34px; height: 34px; padding: 0 3px 2px 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 20px; line-height: 1;
  color: var(--ink); background: rgba(255,255,255,0.82);
  box-shadow: 0 1px 4px rgba(23,33,43,.16);
}
.ice { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.shots {
  flex: 0 0 auto; display: flex; gap: 6px; padding: 2px 14px 8px;
  font-variant-numeric: tabular-nums;
}
.shot {
  min-width: 62px; padding: 5px 8px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 13px; text-align: center; color: var(--muted);
}
.shot.now { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.shot.done { background: rgba(23,33,43,0.06); color: var(--ink); border-color: transparent; }
.shot.out { color: var(--accent); }

.rinkwrap { flex: 1 1 auto; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
canvas {
  display: block; touch-action: none; cursor: grab;
  border-radius: 14px; box-shadow: 0 6px 24px rgba(23,33,43,.14), 0 0 0 1px var(--line);
}
canvas.dragging { cursor: grabbing; }

.controls {
  flex: 0 0 auto; width: 100%; max-width: 560px;
  padding: 10px 14px 16px; display: flex; flex-direction: column;
  align-items: center; gap: 10px; min-height: 44px;
}
.hint { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }

[hidden] { display: none !important; }

/* Sits in the shared home card's `belowActions` slot. Deliberately quieter
   than Play: the daily puzzle is still the front door. */
.versus-btn {
  appearance: none; cursor: pointer; font: inherit; font-weight: 600;
  margin: 14px auto 0; padding: 12px 22px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.versus-btn:active { transform: scale(.97); }
.shot.won { background: var(--accent); color: #fff; }

/* Phone: the board and nothing else. The ice label, the shot pills and the
   hint are all chrome the rink was paying for in height; the score and the
   replay prompt are drawn on the ice instead (see drawResultOverlay in
   js/game.js), so nothing here is the only place that information lives. */
@media (max-width: 700px) {
  .bar, .shots, .controls { display: none; }
}
