/* ============================================================
   NEXPLAY 2.0 — GLOBAL DESIGN SYSTEM
   Design: Competitive dark, electric cyan accent
   Fonts: Bricolage Grotesque (display) + DM Sans (body) + JetBrains Mono (data)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@700;800&family=DM+Sans:wght@400;500;600&family=JetBrains+Mono:wght@500;700&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:        #07070D;
  --bg2:       #0F0F1C;
  --bg3:       #181830;
  --bg4:       #20203A;

  /* Borders */
  --bd:        rgba(255, 255, 255, .07);
  --bd-bright: rgba(255, 255, 255, .14);

  /* Brand */
  --accent:       #22D3EE;  /* electric cyan */
  --accent-dim:   rgba(34, 211, 238, .12);
  --accent-glow:  rgba(34, 211, 238, .25);
  --purple:       #7C3AED;
  --purple-dim:   rgba(124, 58, 237, .15);

  /* Status */
  --win:      #4ADE80;
  --win-dim:  rgba(74, 222, 128, .12);
  --lose:     #F87171;
  --lose-dim: rgba(248, 113, 113, .12);
  --tie:      #FBBF24;
  --tie-dim:  rgba(251, 191, 36, .12);

  /* Text */
  --text:     #ECF0FF;
  --muted:    #6B7A99;
  --faint:    #3D4460;

  /* Fonts */
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Radii */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-pill: 100px;

  /* Transitions */
  --t-fast: .15s ease;
  --t-mid:  .25s ease;
  --t-slow: .4s ease;
}


/* ── CSS Variable Aliases (for game module compatibility) ── */
:root {
  --fg:       var(--text);       /* alias for --text */
  --bg-2:     var(--bg2);        /* alias for --bg2  */
  --bg-3:     var(--bg3);        /* alias for --bg3  */
  --border:   var(--bd);         /* alias for --bd   */
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: var(--font-body); }
input, textarea { font-family: var(--font-body); }

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(7, 7, 13, .88);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--bd);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  letter-spacing: -.02em;
}
.nav-logo .nex { color: var(--accent); }
.nav-logo .play { color: var(--text); }
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 22px;
  border-radius: var(--r-sm); border: none;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--t-mid);
  white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--accent); color: #000;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-primary:hover { background: #38E5FF; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--bd-bright);
}
.btn-secondary:hover { background: var(--bg4); border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--bd);
}
.btn-ghost:hover { color: var(--text); border-color: var(--bd-bright); }

.btn-danger {
  background: var(--lose-dim); color: var(--lose);
  border: 1px solid rgba(248,113,113,.2);
}
.btn-danger:hover { background: rgba(248,113,113,.2); }

.btn-win {
  background: var(--win-dim); color: var(--win);
  border: 1px solid rgba(74,222,128,.25);
}
.btn-win:hover { background: rgba(74,222,128,.2); }

.btn-lg { padding: 15px 32px; font-size: 16px; border-radius: var(--r-md); }
.btn-sm { padding: 7px 14px; font-size: 12px; font-weight: 700; }
.btn-full { width: 100%; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg2); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 24px;
}
.card-sm { padding: 16px; border-radius: var(--r-md); }
.card-accent { border-color: rgba(34,211,238,.25); background: var(--accent-dim); }
.card-win   { border-color: rgba(74,222,128,.25);   background: var(--win-dim); }
.card-lose  { border-color: rgba(248,113,113,.25);  background: var(--lose-dim); }
.card-tie   { border-color: rgba(251,191,36,.25);   background: var(--tie-dim); }

/* ── Typography ───────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  font-size: clamp(36px, 7vw, 72px);
  font-weight: 800; letter-spacing: -.03em;
  line-height: .95;
}
.heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800; letter-spacing: -.02em;
}
.subheading { font-size: 18px; font-weight: 600; }
.label {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.mono { font-family: var(--font-mono); }

/* ── Inputs ───────────────────────────────────────────────── */
.input {
  width: 100%; padding: 13px 16px;
  background: var(--bg3); border: 1.5px solid var(--bd-bright);
  border-radius: var(--r-md); color: var(--text);
  font-family: var(--font-body); font-size: 15px;
  outline: none; transition: border-color var(--t-mid);
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--muted); }
.input-code {
  font-family: var(--font-mono); font-size: 28px; font-weight: 700;
  text-align: center; letter-spacing: .18em; text-transform: uppercase;
}

/* ── Tag / Badge ──────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
}
.tag-accent { background: var(--accent-dim); color: var(--accent); }
.tag-win    { background: var(--win-dim);    color: var(--win); }
.tag-lose   { background: var(--lose-dim);   color: var(--lose); }
.tag-muted  { background: var(--bg3);        color: var(--muted); }

/* ── Scoreboard ───────────────────────────────────────────── */
.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 18px 24px;
}
.score-side { text-align: center; }
.score-side.left { text-align: left; }
.score-side.right { text-align: right; }
.score-name {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 800;
  letter-spacing: -.01em; margin-bottom: 4px;
}
.score-name.accent { color: var(--accent); }
.score-num {
  font-family: var(--font-mono);
  font-size: 40px; font-weight: 700;
  color: var(--accent); line-height: 1;
}
.score-num.dim { color: var(--muted); }
.score-divider {
  font-size: 24px; font-weight: 700;
  color: var(--faint); text-align: center;
}

/* ── Timer ────────────────────────────────────────────────── */
.timer-wrap { margin-bottom: 4px; }
.timer-bar-bg {
  height: 5px; background: var(--bg4);
  border-radius: var(--r-pill); overflow: hidden;
}
.timer-bar {
  height: 100%; border-radius: var(--r-pill);
  background: var(--accent);
  transition: width .9s linear, background .5s ease;
}
.timer-bar.urgent { background: var(--lose); }
.timer-display {
  font-family: var(--font-mono);
  font-size: 32px; font-weight: 700;
  color: var(--accent); text-align: center; line-height: 1;
  transition: color .3s;
}
.timer-display.urgent { color: var(--lose); }
.timer-display.countdown { color: var(--tie); }

/* ── Status Box ───────────────────────────────────────────── */
.status-box {
  text-align: center; padding: 12px 20px;
  background: var(--bg2); border: 1px solid var(--bd);
  border-radius: var(--r-md); font-size: 14px; font-weight: 600;
  transition: all var(--t-mid);
}
.status-box.active { border-color: rgba(34,211,238,.3); color: var(--accent); background: var(--accent-dim); }
.status-box.win    { border-color: rgba(74,222,128,.3);  color: var(--win);    background: var(--win-dim); }
.status-box.lose   { border-color: rgba(248,113,113,.3); color: var(--lose);   background: var(--lose-dim); }
.status-box.tie    { border-color: rgba(251,191,36,.3);  color: var(--tie);    background: var(--tie-dim); }

/* ── Round Pips ───────────────────────────────────────────── */
.round-pips {
  display: flex; justify-content: center; gap: 6px;
  flex-wrap: wrap;
}
.pip {
  height: 6px; border-radius: var(--r-pill);
  background: var(--bg4); transition: background var(--t-mid), width var(--t-mid);
}
.pip.win  { background: var(--win); }
.pip.lose { background: var(--lose); }
.pip.tie  { background: var(--tie); }
.pip.current { background: rgba(34,211,238,.4); }

/* ── Player Avatar ────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg3); border: 2px solid var(--bd-bright);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 16px; font-weight: 800;
  color: var(--accent); flex-shrink: 0;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }

/* ── Player Row ───────────────────────────────────────────── */
.player-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--r-md);
  background: var(--bg3); border: 1px solid var(--bd);
}
.player-row .player-info { flex: 1; min-width: 0; }
.player-row .player-name { font-weight: 700; font-size: 14px; }
.player-row .player-status { font-size: 12px; color: var(--muted); }
.player-row.connected { border-color: rgba(74,222,128,.2); }
.player-row.ready { border-color: var(--accent); background: var(--accent-dim); }

/* ── Room Code ────────────────────────────────────────────── */
.room-code-display {
  font-family: var(--font-mono); font-size: 48px; font-weight: 700;
  color: var(--accent); letter-spacing: .15em; text-align: center;
  line-height: 1;
}
.room-code-display.sm { font-size: 28px; }

/* ── Result Overlay ───────────────────────────────────────── */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(12px);
  align-items: center; justify-content: center;
  animation: fadeIn .3s ease;
}
.overlay.open { display: flex; }
.overlay-box {
  background: var(--bg2); border: 1px solid var(--bd-bright);
  border-radius: var(--r-xl); padding: 40px 36px;
  text-align: center; max-width: 340px; width: calc(100% - 32px);
  animation: slideUp .35s ease;
}
.overlay-emoji { font-size: 64px; margin-bottom: 14px; line-height: 1; }
.overlay-title {
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  letter-spacing: -.02em; margin-bottom: 6px;
}
.overlay-sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse   { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes shake   { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pop     { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes countIn { from { transform: scale(2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.anim-pulse  { animation: pulse 1.4s ease-in-out infinite; }
.anim-pop    { animation: pop .4s ease; }
.anim-shake  { animation: shake .35s ease; }
.anim-countIn { animation: countIn .3s ease; }

/* ── Utility ──────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-win    { color: var(--win); }
.text-lose   { color: var(--lose); }
.hidden { display: none !important; }
.full-w { width: 100%; }

/* ── Layout containers ────────────────────────────────────── */
.page { max-width: 960px; margin: 0 auto; padding: 32px 20px; }
.page-sm { max-width: 520px; margin: 0 auto; padding: 32px 20px; }
.page-xs { max-width: 420px; margin: 0 auto; padding: 32px 20px; }


/* ============================================================
   LANDING PAGE
   ============================================================ */
.hero {
  min-height: 88vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 60px 24px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 30%, rgba(34,211,238,.1) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 70%, rgba(124,58,237,.07) 0%, transparent 60%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 18px; margin-bottom: 28px;
  border: 1px solid rgba(34,211,238,.25); background: var(--accent-dim);
  border-radius: var(--r-pill); color: var(--accent);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.hero h1 { position: relative; z-index: 1; margin-bottom: 20px; }
.hero h1 .hi { color: var(--accent); }
.hero-sub {
  font-size: clamp(15px, 2vw, 18px); color: var(--muted); line-height: 1.7;
  max-width: 460px; margin: 0 auto 40px; position: relative; z-index: 1;
}
.hero-actions {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  position: relative; z-index: 1;
}
.hero-stats {
  display: flex; gap: 36px; margin-top: 56px;
  position: relative; z-index: 1;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: var(--accent); }
.hero-stat .lbl { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }

.join-modal { width: 100%; }
.join-modal h3 { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin-bottom: 20px; }

.games-showcase {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.game-showcase-card {
  padding: 24px 20px; border-radius: var(--r-lg);
  border: 1px solid var(--bd); background: var(--bg2);
  transition: all var(--t-mid); cursor: default;
}
.game-showcase-card:hover {
  border-color: var(--bd-bright); transform: translateY(-3px);
  background: var(--bg3);
}
.game-showcase-card .gc-icon { font-size: 32px; margin-bottom: 12px; }
.game-showcase-card .gc-name { font-family: var(--font-display); font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.game-showcase-card .gc-desc { font-size: 13px; color: var(--muted); line-height: 1.55; }


/* ============================================================
   LOBBY PAGE
   ============================================================ */
.lobby-header { margin-bottom: 32px; }
.lobby-players { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.lobby-waiting {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px; border: 2px dashed var(--bd-bright); border-radius: var(--r-lg);
  color: var(--muted); font-size: 14px; gap: 8px;
}
.lobby-waiting .icon { font-size: 32px; }

.game-select-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.game-select-card {
  padding: 18px 14px; border-radius: var(--r-md);
  border: 2px solid var(--bd); background: var(--bg2);
  text-align: center; cursor: pointer; transition: all var(--t-mid);
}
.game-select-card:hover { border-color: rgba(34,211,238,.4); transform: translateY(-2px); }
.game-select-card.selected {
  border-color: var(--accent); background: var(--accent-dim);
  box-shadow: 0 0 20px var(--accent-glow);
}
.game-select-card .gs-icon { font-size: 28px; margin-bottom: 8px; }
.game-select-card .gs-name { font-family: var(--font-display); font-size: 13px; font-weight: 800; }
.game-select-card .gs-tag { font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.game-select-card.disabled { opacity: .4; cursor: not-allowed; }
.game-select-card.disabled:hover { transform: none; border-color: var(--bd); }


/* ============================================================
   GAME PAGE
   ============================================================ */
.game-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; margin-bottom: 20px;
  background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--r-lg);
}
.game-header .game-title { font-family: var(--font-display); font-size: 16px; font-weight: 800; }
.game-header .room-badge {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--muted); letter-spacing: .1em;
  margin-left: auto;
}

.game-scoreboard { margin-bottom: 16px; }

.game-timer {
  padding: 16px 20px; margin-bottom: 16px;
  background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--r-lg);
  text-align: center;
}

.game-status { margin-bottom: 16px; }

.game-area {
  background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--r-lg);
  padding: 24px; margin-bottom: 16px;
}

.round-tracker { margin-bottom: 16px; }

/* ── Countdown Splash ──────────────────────────────────────── */
.countdown-splash {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(7,7,13,.95);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}
.countdown-num {
  font-family: var(--font-display);
  font-size: 120px; font-weight: 800; line-height: 1;
  color: var(--accent);
  animation: countIn .4s ease;
}
.countdown-label { font-size: 16px; color: var(--muted); margin-top: 16px; font-weight: 600; }
.countdown-go {
  font-family: var(--font-display);
  font-size: 80px; font-weight: 800;
  color: var(--win);
  animation: countIn .3s ease, pop .4s ease .3s;
}


/* ============================================================
   TTT — TIC TAC TOE
   ============================================================ */
.ttt-board {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; border: 2px solid var(--bd-bright);
  border-radius: var(--r-lg); overflow: hidden;
  max-width: 360px; margin: 0 auto;
}
.ttt-cell {
  aspect-ratio: 1; display: flex;
  align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(36px, 10vw, 54px); font-weight: 800;
  background: var(--bg2); cursor: pointer;
  border-right: 1px solid var(--bd-bright); border-bottom: 1px solid var(--bd-bright);
  transition: background var(--t-fast);
  user-select: none;
}
.ttt-cell:nth-child(3n) { border-right: none; }
.ttt-cell:nth-child(7), .ttt-cell:nth-child(8), .ttt-cell:nth-child(9) { border-bottom: none; }
.ttt-cell:hover:not(.taken):not(.disabled) { background: var(--bg4); }
.ttt-cell.X { color: var(--accent); }
.ttt-cell.O { color: #A78BFA; }
.ttt-cell.win-cell { background: rgba(74,222,128,.08); }
.ttt-cell.taken, .ttt-cell.disabled { cursor: default; }


/* ============================================================
   RPS — ROCK PAPER SCISSORS
   ============================================================ */
.rps-choices {
  display: flex; justify-content: center; gap: 16px;
  flex-wrap: wrap;
}
.rps-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: 110px; padding: 22px 12px;
  background: var(--bg3); border: 2px solid var(--bd-bright);
  border-radius: var(--r-lg); cursor: pointer;
  transition: all var(--t-mid); font-family: var(--font-body);
}
.rps-btn .icon { font-size: 44px; }
.rps-btn .label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rps-btn:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 8px 24px var(--accent-glow); }
.rps-btn.selected { border-color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 20px var(--accent-glow); }
.rps-btn:disabled { opacity: .4; cursor: not-allowed; }

.rps-reveal {
  display: flex; align-items: center; justify-content: space-around;
  padding: 20px 0;
}
.rps-reveal-side { text-align: center; }
.rps-reveal-name { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.rps-reveal-icon { font-size: 56px; }
.rps-reveal-vs { font-size: 24px; font-weight: 800; color: var(--faint); }


/* ============================================================
   WORD RACE
   ============================================================ */
.word-scramble {
  font-family: var(--font-mono); font-size: clamp(28px, 8vw, 48px); font-weight: 700;
  color: var(--accent); letter-spacing: .2em; text-align: center; margin-bottom: 8px;
}
.word-hint { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 20px; }
.word-input {
  font-family: var(--font-mono); font-size: 22px; font-weight: 700;
  text-align: center; text-transform: uppercase; letter-spacing: .1em;
}


/* ============================================================
   QUICK MATH
   ============================================================ */
.math-problem {
  font-family: var(--font-mono); font-size: clamp(32px, 9vw, 58px); font-weight: 700;
  color: var(--text); text-align: center; margin-bottom: 24px;
}
.math-problem .question-mark { color: var(--accent); }
.math-input {
  font-family: var(--font-mono); font-size: 28px; font-weight: 700; text-align: center;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .nav { padding: 12px 16px; }
  .page, .page-sm, .page-xs { padding: 20px 14px; }
  .scoreboard { padding: 14px 16px; }
  .score-num { font-size: 32px; }
  .room-code-display { font-size: 32px; }
  .hero-stats { gap: 20px; }
  .rps-btn { width: 90px; padding: 18px 8px; }
  .rps-btn .icon { font-size: 36px; }
  .overlay-box { padding: 28px 20px; }
  .ttt-cell { font-size: 32px; }
}

@media (max-width: 420px) {
  .nav-logo { font-size: 18px; }
  .hero-stats { gap: 14px; }
  .hero-stat .num { font-size: 22px; }
  .game-select-grid { grid-template-columns: repeat(2, 1fr); }
}