/* ─────────────────────────────────────────────────────────────
   Shared chrome for the Arcade pages.

   Each game page brings its own board markup and its own <style>
   for the board itself; everything around the board — topbar,
   score strip, overlay, touch pad, buttons — lives here so the
   five games look like one arcade instead of five one-offs.

   Palette is violet/green so the Arcade reads as its own place,
   next to Clark's cyan and Bradley's orange.
   ───────────────────────────────────────────────────────────── */

:root {
  --arc-1:    #c084fc;          /* primary neon (violet) */
  --arc-2:    #7c3aed;          /* primary deep          */
  --arc-3:    #4ade80;          /* accent (spring green) */
  --arc-ink:  #e8f0fe;
  --arc-dim:  rgba(205, 220, 255, 0.62);
  --arc-line: rgba(192, 132, 252, 0.22);
  --arc-panel: linear-gradient(160deg, rgba(24, 14, 54, 0.82), rgba(12, 8, 32, 0.86));
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(ellipse at 14% 6%,  rgba(124, 58, 237, 0.34), transparent 40%),
    radial-gradient(ellipse at 86% 12%, rgba(74, 222, 128, 0.18), transparent 38%),
    radial-gradient(ellipse at 50% 96%, rgba(192, 132, 252, 0.20), transparent 46%),
    #080418;
  color: var(--arc-ink);
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 14px 34px;
  -webkit-tap-highlight-color: transparent;
}

/* Nebula blob layout for the arcade pages */
.nebula b:nth-child(1) { width: 420px; height: 420px; top: -90px; left: -70px;
  background: radial-gradient(circle, #7c3aed, transparent 70%); }
.nebula b:nth-child(2) { width: 460px; height: 460px; bottom: -130px; right: -90px;
  background: radial-gradient(circle, #4ade80, transparent 70%); animation-delay: -6s; opacity: 0.18; }
.nebula b:nth-child(3) { width: 340px; height: 340px; top: 42%; left: 40%;
  background: radial-gradient(circle, #c084fc, transparent 70%); animation-delay: -12s; opacity: 0.20; }

/* ── Layout shell ─────────────────────────────────────────── */
.shell {
  position: relative; z-index: 2;
  width: 100%; max-width: 560px;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
}
.shell.wide { max-width: 940px; }

/* ── Top bar ──────────────────────────────────────────────── */
.topbar {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--arc-line);
  background: rgba(16, 10, 40, 0.6);
  color: var(--arc-ink);
  text-decoration: none;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  transition: transform 180ms, border-color 180ms, box-shadow 180ms;
}
.back:hover {
  transform: translateX(-3px);
  border-color: var(--arc-1);
  box-shadow: 0 0 22px rgba(192, 132, 252, 0.35);
}
.game-title {
  font-family: 'Audiowide', 'Orbitron', sans-serif;
  font-size: clamp(20px, 4.4vw, 30px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff 0%, var(--arc-1) 62%, var(--arc-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1;
}

/* ── Score strip ──────────────────────────────────────────── */
.hud {
  width: 100%;
  display: flex; gap: 10px;
}
.stat {
  flex: 1;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--arc-line);
  background: var(--arc-panel);
  text-align: center;
}
.stat-label {
  display: block;
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--arc-1);
}
.stat-value {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(19px, 4.6vw, 26px);
  font-weight: 900;
  margin-top: 2px;
}
.stat-value.bump { animation: statBump 260ms ease-out; }
@keyframes statBump {
  0%   { transform: scale(1);    color: var(--arc-ink); }
  45%  { transform: scale(1.22); color: var(--arc-3); }
  100% { transform: scale(1);    color: var(--arc-ink); }
}

/* ── The board panel + overlay ────────────────────────────── */
.stage {
  position: relative;
  width: 100%;
  padding: 14px;
  border-radius: 22px;
  border: 1.5px solid var(--arc-line);
  background: var(--arc-panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 22px 52px rgba(0,0,0,0.45);
}

.overlay {
  position: absolute; inset: 0;
  z-index: 5;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  padding: 24px;
  border-radius: 22px;
  text-align: center;
  background: rgba(8, 4, 24, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.overlay[hidden] { display: none; }
.overlay h2 {
  font-family: 'Audiowide', 'Orbitron', sans-serif;
  font-size: clamp(22px, 6vw, 34px);
  margin: 0;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #fff, var(--arc-1) 70%, var(--arc-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.overlay p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--arc-dim);
  max-width: 34ch;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 13px 30px;
  border-radius: 999px;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px; font-weight: 900;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: #120726;
  background: linear-gradient(135deg, var(--arc-1), var(--arc-3));
  box-shadow: 0 0 28px rgba(192, 132, 252, 0.45);
  transition: transform 160ms cubic-bezier(.2,.8,.2,1.05), box-shadow 160ms;
}
.btn:hover  { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 38px rgba(192,132,252,0.65); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.ghost {
  color: var(--arc-ink);
  background: rgba(16, 10, 40, 0.7);
  border: 1.5px solid var(--arc-line);
  box-shadow: none;
  font-size: 12px;
  padding: 10px 22px;
}
.btn.ghost:hover { border-color: var(--arc-1); box-shadow: 0 0 22px rgba(192,132,252,0.30); }

.controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ── Touch pad (shown on coarse pointers) ─────────────────── */
.pad {
  display: none;
  grid-template-columns: repeat(3, 62px);
  grid-template-rows: repeat(2, 62px);
  gap: 8px;
  justify-content: center;
}
.pad button {
  appearance: none; cursor: pointer;
  border-radius: 16px;
  border: 1.5px solid var(--arc-line);
  background: rgba(16, 10, 40, 0.75);
  color: var(--arc-1);
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.pad button:active { background: rgba(192, 132, 252, 0.22); }
.pad .up    { grid-column: 2; grid-row: 1; }
.pad .left  { grid-column: 1; grid-row: 2; }
.pad .down  { grid-column: 2; grid-row: 2; }
.pad .right { grid-column: 3; grid-row: 2; }
@media (hover: none), (pointer: coarse) { .pad { display: grid; } }

/* ── Keyboard hint ────────────────────────────────────────── */
.hint {
  font-size: 11px;
  letter-spacing: 0.10em;
  color: rgba(180, 200, 255, 0.45);
  text-align: center;
  margin: 0;
}
.hint kbd {
  display: inline-block;
  padding: 2px 7px;
  margin: 0 2px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  font-family: 'Orbitron', monospace;
  font-size: 10px;
}
@media (hover: none), (pointer: coarse) { .hint.desktop-only { display: none; } }
