.game-page { width: min(100%, 760px); max-width: 100vw; margin: 0 auto; padding: 12px; }
.game-bar {
  display: grid;
  grid-template-columns: minmax(52px, auto) 44px minmax(66px, auto) minmax(52px, 1fr) minmax(66px, auto);
  gap: 4px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.status-metric { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.status-icon { display: grid; width: 16px; height: 16px; margin-bottom: 2px; place-items: center; }
.status-icon svg { width: 100%; height: 100%; }
.status-metric strong { color: var(--text); font-size: clamp(11px, 3.2vw, 15px); font-variant-numeric: tabular-nums; line-height: 1.15; }
.time-metric strong { min-width: 6ch; }
.score-metric strong, .ghost-metric strong { width: 7ch; }
.game-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent), transparent 78%);
}
.game-button-icon { display: grid; width: 22px; height: 22px; place-items: center; }
.game-button-icon svg { width: 100%; height: 100%; }
.game-button:disabled { opacity: .5; }

.tug-bar {
  --self-share: .5;
  --ghost-share: .5;
  position: relative;
  display: flex;
  min-width: 44px;
  height: 18px;
  align-items: center;
  filter: drop-shadow(0 2px 6px #0008);
}
.tug-side { position: relative; height: 11px; overflow: hidden; background: var(--tug-track); box-shadow: inset 0 0 0 1px var(--tug-line); transition: flex-basis 180ms ease-out; }
.tug-self { flex: 0 0 calc(var(--self-share) * 100%); }
.tug-ghost { flex: 0 0 calc(var(--ghost-share) * 100%); }
.tug-self { border-radius: 7px 1px 1px 7px; }
.tug-ghost { border-radius: 1px 7px 7px 1px; }
.tug-fill { position: absolute; inset: 0; transition: background-color 180ms linear; }
.tug-bar[data-leader="self"] .tug-self-fill, .tug-bar[data-leader="ghost"] .tug-ghost-fill { background: var(--lead); }
.tug-bar[data-leader="self"] .tug-ghost-fill, .tug-bar[data-leader="ghost"] .tug-self-fill { background: var(--trail); }
.tug-center {
  position: absolute;
  z-index: 2;
  left: calc(var(--self-share) * 100%);
  transform: translateX(-50%);
  width: 2px;
  height: 18px;
  background: var(--focus-ring);
  border-radius: 2px;
  box-shadow: 0 0 4px var(--focus-ring), 0 0 10px var(--accent-2), 0 0 16px var(--accent-2);
  animation: tug-center-pulse 1.25s ease-in-out infinite alternate;
}
@keyframes tug-center-pulse { from { opacity: .72; filter: brightness(.95); } to { opacity: 1; filter: brightness(1.45); } }
@media (prefers-reduced-motion: reduce) { .tug-side, .tug-fill { transition: none; } .tug-center { animation: none; } }
.game-zone { position: relative; display: grid; min-height: min(690px, calc(100dvh - 142px)); margin-top: 12px; place-items: center; align-content: center; padding: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(circle at 50% 30%, var(--game-zone-glow), var(--surface) 52%); text-align: center; }
.game-zone-icon { width: 112px; height: 112px; }
.game-zone-icon svg { width: 100%; height: 100%; }
.game-zone h1 { margin: 18px 0 6px; }
.game-zone > p { margin: 0; color: var(--muted); }
.rules-card { width: min(100%, 430px); margin-top: 28px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--rules-bg); }
.rules-card span { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.rules-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; background: var(--countdown-bg); color: var(--accent); font-size: 90px; font-weight: 900; }
.countdown[hidden] { display: none; }
.game-error { width: min(100% - 32px, 520px); margin: 20vh auto; padding: 28px; border: 1px solid var(--danger); border-radius: 22px; background: var(--surface); text-align: center; }
.game-error h1 { color: var(--danger); }
.game-error p { color: var(--muted); }
.game-runtime-error { margin: auto; }
.gesture-surface { position: relative; touch-action: none; -webkit-user-select: none; user-select: none; }
.performance-meter { position: fixed; z-index: 20; right: max(8px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); display: grid; gap: 2px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--surface), transparent 12%); color: var(--muted); pointer-events: none; font-size: 10px; font-variant-numeric: tabular-nums; line-height: 1.15; box-shadow: 0 3px 12px #0005; }
.performance-meter-row { display: grid; grid-template-columns: 26px 24px; gap: 5px; align-items: baseline; color: var(--muted); }
.performance-meter-label { font-weight: 800; }
.performance-meter-row strong { color: inherit; text-align: right; }
.performance-meter-row[data-level="normal"] { color: var(--accent); }
.performance-meter-row[data-level="warning"] { color: var(--warning); }
.performance-meter-row[data-level="critical"] { color: var(--danger); }
.game-result-overlay { display: grid; place-items: center; padding: 18px; text-align: center; }
.result-card { display: grid; width: min(100%, 440px); gap: 10px; padding: clamp(20px, 6vw, 34px); border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: 0 22px 70px #000a; }
.result-outcome-icon { color: var(--accent); font-size: 48px; line-height: 1; text-shadow: 0 0 20px color-mix(in srgb, var(--accent), transparent 40%); }
.game-result-overlay[data-outcome="lose"] .result-outcome-icon { color: var(--danger); }
.game-result-overlay[data-outcome="tie"] .result-outcome-icon { color: var(--even); }
.result-card h1 { margin: 0; font-size: clamp(25px, 7vw, 38px); }
.result-reason { margin: -3px 0 4px; color: var(--muted); }
.result-score { min-width: 7ch; color: var(--accent); font-size: clamp(38px, 12vw, 64px); font-variant-numeric: tabular-nums; line-height: 1.1; }
.result-action { min-height: 48px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); cursor: pointer; color: var(--text); font-weight: 800; }
.result-action.primary { margin-top: 8px; border-color: transparent; background: var(--accent); color: var(--accent-ink); }
.result-action:disabled { cursor: not-allowed; opacity: .5; }
.result-secondary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
@media (max-width: 380px) {
  .game-page { padding: 8px; }
  .game-bar { gap: 2px; padding: 7px 6px; }
  .status-icon { width: 14px; height: 14px; }
  .game-button { width: 42px; height: 42px; }
  .tug-bar { min-width: 38px; }
}
