/* ============================================================================
   SPORTS — shared styles. Built on /assets/base.css.
   Provides the picker, the game "field" stage, and a toolkit each mini-game can
   use: a responsive <canvas>, a HUD row, a power/timing meter, big tap buttons,
   tap zones, and the result sheet. Per-game accent set on :root by the engine.
   ============================================================================ */

:root { --accent: #8bd450; --accent-ink: #08130a; }

.topbar .brand { cursor: pointer; }
#stage { position: relative; min-height: 64dvh; }

.round { padding: 22px 20px 24px; }
.round .eyebrow { display: block; }
.round h2 { font-size: clamp(1.6rem, 6.5vw, 2.1rem); margin-top: 6px; }
.round .lead { margin-top: 8px; }
.tip { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); text-align: center; margin-top: 14px; letter-spacing: 0.04em; }
.stage-anim { animation: fadeUp 0.4s var(--ease) both; }

/* ---- picker ---- */
.packs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 18px 0 4px; }
.pcard {
  display: flex; align-items: center; gap: 14px; min-width: 0; text-align: left; cursor: pointer;
  padding: 16px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); color: var(--ink);
  transition: transform 0.16s var(--ease-snap), border-color 0.18s, box-shadow 0.22s, background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.pcard:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--pc) 55%, var(--line)); box-shadow: 0 18px 44px -26px color-mix(in oklab, var(--pc) 75%, transparent); background: color-mix(in oklab, var(--pc) 7%, var(--surface)); }
.pcard:active { transform: translateY(0) scale(0.99); }
.pcard .pc-emoji { font-size: 1.9rem; width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 15px; background: color-mix(in oklab, var(--pc) 16%, var(--surface-2)); border: 1px solid color-mix(in oklab, var(--pc) 40%, transparent); }
.pcard .pc-body { flex: 1; min-width: 0; }
.pcard .pc-body b { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; display: block; }
.pcard .pc-blurb { color: var(--ink-dim); font-size: 0.86rem; }
.pcard .pc-go { color: var(--pc); flex: none; font-size: 0.9rem; }

/* ============================================================================
   GAME TOOLKIT — for the mini-games to use inside `api.stage` (.field)
   ============================================================================ */
.field { position: relative; display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }

/* responsive canvas: games set canvas.width/height in device px; CSS sizes it */
.field canvas, .gcanvas {
  display: block; width: 100%; border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in oklab, var(--accent) 9%, transparent), transparent 65%), var(--bg);
  touch-action: none; -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow);
}

/* HUD row (attempt counter / live score) */
.hud { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); padding: 0 2px; }
.hud .hud-score { color: var(--accent); font-weight: 700; font-size: 1rem; }
.hud .pips { display: flex; gap: 6px; }
.hud .pips i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.hud .pips i.good { background: var(--good); }
.hud .pips i.bad { background: var(--bad); }
.hud .pips i.cur { background: var(--accent); transform: scale(1.2); }

/* power / timing meter: <div class="meter"><span class="zone"></span><i class="needle"></i></div>
   or a fill version: <div class="meter"><i class="fill"></i></div> */
.meter { position: relative; height: 22px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 60%, #1b8f7c), var(--accent)); }
.meter .zone { position: absolute; top: 0; bottom: 0; background: color-mix(in oklab, var(--good) 35%, transparent); border-left: 2px solid var(--good); border-right: 2px solid var(--good); }
.meter .needle { position: absolute; top: -2px; bottom: -2px; width: 4px; background: #fff; box-shadow: 0 0 8px #fff; border-radius: 2px; }
.meter.vertical { height: 220px; width: 26px; }
.meter.vertical .fill { left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 0; }

/* big tap button (chunky, mobile) */
.bigbtn {
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  border: none; border-radius: var(--r-lg); padding: 20px; cursor: pointer; width: 100%;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 12px 30px -14px var(--accent-glow); transition: transform 0.1s var(--ease-snap), box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.bigbtn:active { transform: translateY(1px) scale(0.99); }
.bigbtn:disabled { opacity: 0.5; }

/* tap-target zones (e.g. hockey corners) overlaid on a field */
.zone { position: absolute; border-radius: var(--r); cursor: pointer; }

.gprompt { text-align: center; color: var(--ink-dim); font-size: 0.96rem; min-height: 1.2em; }
.gprompt b { color: var(--ink); }
.flash-good { animation: fG 0.5s var(--ease); }
.flash-bad { animation: fB 0.45s var(--ease); }
@keyframes fG { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--good) 60%, transparent); } 40% { box-shadow: 0 0 50px 6px color-mix(in oklab, var(--good) 45%, transparent); } 100% { box-shadow: var(--shadow); } }
@keyframes fB { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* ============================ result sheet =============================== */
.result-head { text-align: center; margin-bottom: 4px; }
.result-head .eyebrow { display: block; }
.result-score { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; font-size: clamp(3rem, 17vw, 4.6rem); line-height: 1; margin: 6px 0 2px; }
.result-score .denom { color: var(--ink-faint); font-size: 0.4em; }
.result-sub { text-align: center; color: var(--accent); font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; margin-bottom: 14px; }
.sheet .share-grid { margin: 4px 0 16px; }
.sheet .stats { margin: 8px 0 16px; }
.sheet-actions { display: grid; gap: 10px; }
