/* ============================================================
   MINIGAMES — App
   Palette: Retro Arcade — neon green on near-black
   Type: Press Start 2P + Space Mono + Space Grotesk
   ============================================================ */

:root {
  --bg:         #05050a;
  --bg2:        #0a0a12;
  --bg3:        #0f0f18;
  --border:     #1a2a1a;
  --border2:    #2a3a2a;
  --green:      #39ff14;
  --green-dim:  #22991a;
  --green-glow: rgba(57,255,20,.12);
  --green-soft: rgba(57,255,20,.06);
  --cyan:       #00e5ff;
  --cyan-glow:  rgba(0,229,255,.12);
  --text:       #e0ffe0;
  --muted:      #3a4a3a;
  --muted2:     #2a3a2a;
  --error:      #ff4444;
  --success:    #39ff14;
  --pixel:      'Press Start 2P', monospace;
  --mono:       'Space Mono', monospace;
  --sans:       'Space Grotesk', sans-serif;
  --sidebar-w:  220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── SCANLINE OVERLAY ───────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.08) 2px,
    rgba(0,0,0,.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: var(--sans); cursor: pointer; }

.hidden { display: none !important; }

/* ── BLINK ANIMATION ─────────────────────────────────────────── */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes neon-pulse {
  0%, 100% { box-shadow: 0 0 4px var(--green), 0 0 10px rgba(57,255,20,.2); }
  50%       { box-shadow: 0 0 8px var(--green), 0 0 20px rgba(57,255,20,.4); }
}

/* ── SCREENS ─────────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ── AUTH ────────────────────────────────────────────────────── */
#screen-auth {
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.auth-wrap {
  display: flex;
  width: 100%;
  max-width: 860px;
  min-height: 500px;
  border: 2px solid var(--green);
  background: var(--bg2);
  box-shadow: 0 0 24px rgba(57,255,20,.15);
}

.auth-brand {
  flex: 1;
  padding: 3rem 2.5rem;
  background: var(--bg3);
  border-right: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-logo {
  font-family: var(--pixel);
  font-size: .9rem;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--green);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 8px var(--green);
}
.auth-logo span { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }

.auth-tagline {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--text);
  line-height: 2;
  margin-bottom: 2.5rem;
}

.auth-ticker {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.ticker-item {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted2);
  color: #4a6a4a;
}
.ticker-item::before {
  content: '> ';
  color: var(--green-dim);
}

.auth-panel {
  flex: 1;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
}
.auth-tab {
  background: transparent;
  border: none;
  color: #4a6a4a;
  font-family: var(--pixel);
  font-size: .55rem;
  letter-spacing: .06em;
  padding: .6rem 1.25rem .6rem 0;
  margin-right: 1.5rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}
.auth-tab.active { color: var(--green); border-bottom-color: var(--green); text-shadow: 0 0 6px var(--green); }
.auth-tab:hover { color: var(--text); }

.auth-form {
  display: none;
  flex-direction: column;
  gap: 1rem;
}
.auth-form.active { display: flex; }

.field { display: flex; flex-direction: column; gap: .4rem; }
.field label {
  font-family: var(--pixel);
  font-size: .5rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green-dim);
}

input[type="text"], input[type="email"], input[type="password"] {
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--green);
  font-family: var(--mono);
  font-size: .95rem;
  padding: .65rem 1rem;
  border-radius: 0;
  outline: none;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
input:focus {
  border-color: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 20px rgba(57,255,20,.2);
}
input::placeholder { color: #2a3a2a; }

.btn-main {
  font-family: var(--pixel);
  font-size: .6rem;
  letter-spacing: .06em;
  background: var(--green);
  color: var(--bg);
  border: 2px solid var(--green);
  padding: .85rem 1.75rem;
  border-radius: 0;
  font-weight: 400;
  transition: all .2s;
  display: inline-block;
  text-shadow: none;
}
.btn-main:hover {
  background: transparent;
  color: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 20px rgba(57,255,20,.3);
}

.auth-error {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--error);
  min-height: 1.2em;
  margin-top: .25rem;
}

/* ── APP LAYOUT ──────────────────────────────────────────────── */
html, body { height: 100%; }

#screen-main { flex-direction: row; height: 100vh; overflow: hidden; }

.app-layout {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sidebar-logo {
  font-family: var(--pixel);
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--green);
  text-shadow: 0 0 8px var(--green);
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 2px solid var(--border);
  display: block;
}
.sidebar-logo span { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.snav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem 1.25rem;
  background: transparent;
  border: none;
  color: #4a6a4a;
  font-family: var(--pixel);
  font-size: .5rem;
  transition: all .15s;
  text-align: left;
  position: relative;
  width: 100%;
  border-radius: 0;
  letter-spacing: .05em;
}
.snav-item:hover { color: var(--text); background: var(--bg3); }
.snav-item.active {
  color: var(--green);
  background: var(--bg3);
  text-shadow: 0 0 6px var(--green);
}
.snav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.snav-icon {
  font-size: .9rem;
  width: 1.25rem;
  text-align: center;
  font-family: var(--mono);
}
.snav-label { flex: 1; }

.sidebar-bottom {
  border-top: 2px solid var(--border);
  padding: .75rem 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem 1.25rem;
}
.user-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 0;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--green);
  animation: blink 2s infinite;
}
.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#user-name-label {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#user-persona-label {
  font-family: var(--pixel);
  font-size: .45rem;
  color: var(--cyan);
  letter-spacing: .06em;
  text-shadow: 0 0 4px var(--cyan);
}

.snav-logout { color: #4a4a3a; }
.snav-logout:hover { color: var(--error); }

/* ── CONTENT ─────────────────────────────────────────────────── */
.app-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.mode { display: none; min-height: 0; }
.mode.active { display: flex; flex-direction: column; flex: 1; overflow: hidden; min-height: 0; }

.mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  z-index: 10;
}

.mode-label {
  font-family: var(--pixel);
  font-size: .5rem;
  letter-spacing: .15em;
  color: var(--green);
  text-shadow: 0 0 6px var(--green);
  display: block;
  margin-bottom: .5rem;
}

.mode-title h1 {
  font-family: var(--pixel);
  font-size: .9rem;
  font-weight: 400;
  letter-spacing: .05em;
  line-height: 1.4;
  color: var(--text);
}

/* ── GAME GRID ───────────────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.game-card {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(57,255,20,.03) 2px,
    rgba(57,255,20,.03) 4px
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.game-card:hover {
  border-color: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 20px rgba(57,255,20,.3);
}
.game-card:hover::after { opacity: 1; }

.game-icon {
  font-size: 2.5rem;
  line-height: 1;
  color: var(--green);
  font-family: var(--mono);
  text-shadow: 0 0 8px var(--green);
}

.game-name {
  font-family: var(--pixel);
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
}

.game-desc {
  font-family: var(--mono);
  font-size: .75rem;
  color: #4a6a4a;
  text-align: center;
  line-height: 1.5;
}

.coming-soon-badge {
  position: absolute;
  top: .75rem;
  right: .75rem;
  font-family: var(--pixel);
  font-size: .45rem;
  letter-spacing: .04em;
  padding: .2rem .5rem;
  border: 1px solid var(--green-dim);
  color: var(--green);
  border-radius: 0;
  background: var(--green-soft);
  text-shadow: 0 0 4px var(--green);
  animation: blink 1.5s infinite;
}

/* ── LEADERBOARD ─────────────────────────────────────────────── */
.leaderboard-content {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 600px;
}

.leaderboard-item {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 0;
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lb-rank {
  font-family: var(--pixel);
  font-size: .6rem;
  color: var(--green);
  width: 2rem;
  text-align: center;
  font-weight: 400;
  text-shadow: 0 0 4px var(--green);
}

.lb-name {
  flex: 1;
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--text);
}

.lb-score {
  font-family: var(--pixel);
  font-size: .6rem;
  color: var(--cyan);
  text-shadow: 0 0 4px var(--cyan);
}

.empty-state {
  text-align: center;
  color: #3a5a3a;
  padding: 4rem 2rem;
}
.empty-state-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: .5;
  color: var(--green-dim);
  text-shadow: 0 0 6px var(--green-dim);
  font-family: var(--mono);
}
.empty-state p {
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.9;
  color: #3a5a3a;
}

/* ── CHAT PANEL ──────────────────────────────────────────────── */
.chat-panel {
  width: 300px;
  flex-shrink: 0;
  border-left: 2px solid var(--border);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.chat-panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border);
  font-family: var(--pixel);
  font-size: .5rem;
  letter-spacing: .15em;
  color: var(--green);
  text-shadow: 0 0 6px var(--green);
  text-transform: uppercase;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.chat-panel-header::after {
  content: '█';
  animation: blink 1s infinite;
  font-size: .5rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  min-height: 0;
}

.chat-msg {
  max-width: 100%;
  padding: .6rem .9rem;
  line-height: 1.5;
  font-size: .82rem;
  font-family: var(--mono);
  border-radius: 0;
}
.chat-msg.own {
  background: var(--green-soft);
  border: 1px solid var(--green-dim);
  color: var(--green);
  align-self: flex-end;
}
.chat-msg.other {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  align-self: flex-start;
}
.chat-msg-author {
  font-family: var(--pixel);
  font-size: .45rem;
  color: var(--cyan);
  text-shadow: 0 0 4px var(--cyan);
  margin-bottom: .25rem;
  letter-spacing: .04em;
}

.chat-input-wrap {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  padding: 1rem;
  border-top: 2px solid var(--border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--green);
  font-family: var(--mono);
  font-size: .82rem;
  padding: .55rem .85rem;
  border-radius: 0;
  resize: none;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  line-height: 1.5;
  max-height: 100px;
  overflow-y: auto;
}
.chat-input:focus {
  border-color: var(--green-dim);
  box-shadow: 0 0 6px rgba(57,255,20,.2);
}
.chat-input::placeholder { color: #2a4a2a; }

.chat-send {
  background: var(--green);
  color: var(--bg);
  border: 2px solid var(--green);
  border-radius: 0;
  width: 36px;
  height: 36px;
  font-size: .9rem;
  font-weight: 700;
  font-family: var(--mono);
  flex-shrink: 0;
  transition: all .2s;
}
.chat-send:hover {
  background: transparent;
  color: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ── CHIPS ───────────────────────────────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: .35rem; }

.chip {
  font-family: var(--pixel);
  font-size: .45rem;
  letter-spacing: .02em;
  padding: .3rem .7rem;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 0;
  color: #4a6a4a;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.chip:hover { border-color: var(--border2); color: var(--text); }
.chip.selected {
  background: var(--green-soft);
  border-color: var(--green-dim);
  color: var(--green);
  text-shadow: 0 0 4px var(--green);
}

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-box {
  background: var(--bg2);
  border: 2px solid var(--green);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  border-radius: 0;
  box-shadow: 0 0 24px rgba(57,255,20,.2);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .chat-panel { display: none; }
}

@media (max-width: 680px) {
  .auth-wrap { flex-direction: column; }
  .auth-brand { border-right: none; border-bottom: 2px solid var(--border); padding: 2rem 1.5rem; }
  .auth-ticker { display: none; }
  .auth-panel { padding: 2rem 1.5rem; }
  .sidebar { width: 56px; }
  .snav-label, .sidebar-logo span, .user-info, .sidebar-user .user-dot { display: none; }
  .sidebar-logo { font-size: .55rem; padding: 1rem .75rem; letter-spacing: .05em; }
  .snav-item { padding: .65rem 0; justify-content: center; }
  .snav-icon { width: auto; font-size: 1rem; }
  .game-grid { padding: 1rem; gap: .75rem; }
  .mode-header { padding: 1rem; }
}

/* ── OVERLAY ─────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center;
}
.overlay.hidden { display: none; }

.overlay-box {
  background: #0a0a0a;
  border: 2px solid #39ff14;
  padding: 2.5rem;
  max-width: 520px; width: 90%;
  position: relative;
}
.overlay-close {
  position: absolute; top: 1rem; right: 1.2rem;
  background: none; border: none; color: #666;
  font-family: var(--mono); font-size: 1.2rem; cursor: pointer;
}
.overlay-close:hover { color: #fff; }
.overlay-title {
  font-family: var(--pixel); font-size: .85rem;
  color: #39ff14; margin-bottom: 2rem; letter-spacing: .1em;
}

/* ── LOBBY ────────────────────────────────────────────────── */
.lobby-modes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.lobby-mode-btn {
  background: #0a0a0a; border: 2px solid #222;
  padding: 1.5rem 1rem; cursor: pointer; text-align: center;
  transition: border-color .15s;
  color: #fff;
}
.lobby-mode-btn:hover { border-color: #39ff14; }
.lm-icon { font-size: 1.5rem; margin-bottom: .5rem; }
.lm-name { font-family: var(--pixel); font-size: .6rem; color: #39ff14; margin-bottom: .3rem; letter-spacing: .05em; }
.lm-desc { font-family: var(--mono); font-size: .65rem; color: #555; }

.lobby-status { font-family: var(--mono); color: #aaa; margin-bottom: 1.5rem; font-size: .85rem; }
.lobby-room-code {
  font-family: var(--pixel); font-size: 1.2rem; color: #39ff14;
  border: 2px dashed #39ff14; padding: .75rem 1.5rem;
  text-align: center; margin-bottom: 1.5rem; letter-spacing: .2em;
}
.lobby-spinner {
  font-size: 1.5rem; color: #39ff14;
  animation: spin 2s linear infinite; display: inline-block;
  margin-bottom: 1.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

#lobby-join-form { margin-bottom: 1.5rem; }
#lobby-join-form input {
  background: #000; border: 2px solid #333; color: #fff;
  font-family: var(--pixel); font-size: .75rem; padding: .75rem 1rem;
  width: 100%; margin-bottom: .75rem; letter-spacing: .2em;
}
#lobby-join-form input:focus { outline: none; border-color: #39ff14; }

.btn-sec {
  background: none; border: 2px solid #333; color: #666;
  font-family: var(--pixel); font-size: .6rem; padding: .6rem 1.2rem;
  cursor: pointer; letter-spacing: .05em;
}
.btn-sec:hover { border-color: #fff; color: #fff; }

/* ── GAME OVERLAY ────────────────────────────────────────── */
.game-overlay-inner {
  display: flex; flex-direction: column;
  width: 100%; height: 100%;
}
.game-hud {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 2rem;
  background: #000; border-bottom: 2px solid #222;
  flex-shrink: 0;
}
.hud-left, .hud-right {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--mono); font-size: .8rem;
}
.hud-right { flex-direction: row-reverse; }
.hud-score {
  font-family: var(--pixel); font-size: 1.2rem; color: #39ff14;
}
.hud-center {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  font-family: var(--pixel); font-size: .7rem; color: #39ff14;
}
.hud-leave {
  background: none; border: 1px solid #333; color: #555;
  font-family: var(--mono); font-size: .65rem; padding: .2rem .6rem;
  cursor: pointer;
}
.hud-leave:hover { color: #fff; border-color: #fff; }

.game-view {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1rem; overflow: hidden;
}
.game-view.hidden { display: none; }
.game-view canvas { max-width: 100%; max-height: 100%; border: 2px solid #333; }

/* ── GAME OVER ───────────────────────────────────────────── */
.game-over {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2rem;
}
.game-over.hidden { display: none; }
.game-over-title { font-family: var(--pixel); font-size: 1.5rem; color: #39ff14; text-align: center; }
.game-over-scores { font-family: var(--mono); color: #aaa; font-size: .9rem; }
.game-over-btns { display: flex; gap: 1rem; }

/* ── MEMORY ─────────────────────────────────────────────── */
.memory-board {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: .75rem; max-width: 480px; width: 100%;
}
.memory-card {
  aspect-ratio: 1; background: #111; border: 2px solid #333;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-family: var(--mono);
  transition: all .15s; user-select: none;
}
.memory-card.flipped { background: #1a2a1a; border-color: #39ff14; color: #39ff14; }
.memory-card.matched { background: #0a1a0a; border-color: #236b23; color: #236b23; }
.memory-turn {
  font-family: var(--pixel); font-size: .6rem; margin-top: 1rem;
  letter-spacing: .1em;
}

/* ── QUIZ ───────────────────────────────────────────────── */
.quiz-wrap { max-width: 600px; width: 100%; }
.quiz-progress { font-family: var(--pixel); font-size: .55rem; color: #555; margin-bottom: 1rem; letter-spacing: .1em; }
.quiz-question { font-family: var(--mono); font-size: 1rem; color: #fff; margin-bottom: 1.5rem; line-height: 1.5; }
.quiz-answers { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.quiz-answer {
  background: #111; border: 2px solid #333; padding: .9rem 1rem;
  font-family: var(--mono); font-size: .8rem; cursor: pointer; transition: border-color .1s;
}
.quiz-answer:hover:not(.correct):not(.wrong) { border-color: #39ff14; }
.quiz-answer.correct { border-color: #39ff14; background: #0a1a0a; color: #39ff14; }
.quiz-answer.wrong { border-color: #ef4444; background: #1a0a0a; color: #ef4444; }
.quiz-timer { height: 3px; background: #39ff14; transition: width .1s linear; width: 100%; }
.quiz-reveal { font-family: var(--mono); font-size: .8rem; color: #888; margin-top: .75rem; padding: .5rem; border: 1px solid #222; }
.quiz-reveal.hidden { display: none; }

/* ── D-PAD (mobile snake) ───────────────────────────────── */
.dpad { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-top: .75rem; }
.dpad button {
  background: #111; border: 2px solid #333; color: #39ff14;
  font-family: var(--mono); font-size: 1rem; width: 44px; height: 44px; cursor: pointer;
}
.dpad > div { display: flex; gap: .3rem; }

/* ── LEADERBOARD ─────────────────────────────────────────── */
.lb-filters { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; padding: 1.5rem 2rem 0; }
.lb-filter {
  background: none; border: 2px solid #222; color: #555;
  font-family: var(--pixel); font-size: .55rem; padding: .4rem .8rem; cursor: pointer; letter-spacing: .05em;
}
.lb-filter.active, .lb-filter:hover { border-color: #39ff14; color: #39ff14; }
.leaderboard-list { display: flex; flex-direction: column; gap: 0; padding: 0 2rem; overflow-y: auto; flex: 1; }
.lb-row {
  display: grid; grid-template-columns: 40px 1fr 100px 80px;
  align-items: center; padding: .75rem 1rem;
  border-bottom: 1px solid #111; font-family: var(--mono); font-size: .8rem;
}
.lb-row:hover { background: #0a0a0a; }
.lb-rank { color: #333; font-family: var(--pixel); font-size: .55rem; }
.lb-name { color: #fff; }
.lb-game { color: #555; font-size: .7rem; }
.lb-score { color: #39ff14; font-family: var(--pixel); font-size: .8rem; text-align: right; }

/* ── GAME CARD (update existing) ────────────────────────── */
.game-badge {
  font-family: var(--pixel); font-size: .5rem; color: #39ff14;
  border: 1px solid #39ff14; padding: .3rem .6rem; display: inline-block;
  margin-top: .5rem; letter-spacing: .05em;
}
.game-hint {
  font-family: var(--mono); font-size: .7rem; color: #555;
  margin-top: .5rem; text-align: center;
}

/* ── CHASE GAME ─────────────────────────────────────────── */
.chase-wrap {
  width: 100%; max-width: 700px;
  display: flex; flex-direction: column; gap: 1.5rem; padding: 1rem;
}
.chase-track-wrap { position: relative; }
.chase-track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px; height: 64px;
}
.chase-cell {
  background: #111; border: 2px solid #222;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; position: relative; transition: background .2s;
}
.chase-cell.cell-finish { border-color: #39ff14; }
.chase-cell.cell-player { background: #0a1a0a; border-color: #39ff14; }
.chase-cell.cell-jaeger { background: #1a0a0a; border-color: #ef4444; }
.chase-track-labels {
  position: relative; height: 20px; margin-top: 4px;
}
.chase-label {
  position: absolute; font-family: var(--pixel); font-size: .4rem;
  transform: translateX(-50%); transition: left .3s;
  white-space: nowrap;
}
.player-label { color: #39ff14; bottom: 0; }
.jaeger-label { color: #ef4444; bottom: 0; }

.chase-phase {
  font-family: var(--mono); font-size: .8rem; color: #aaa;
  text-align: center; padding: .5rem;
  border: 1px solid #222;
}

.chase-jagd-status {
  font-family: var(--pixel); font-size: .65rem;
  text-align: center; margin-bottom: .75rem;
  letter-spacing: .05em;
}
.chase-jagd-result {
  font-family: var(--mono); font-size: .85rem;
  text-align: center; padding: .6rem; margin-top: .75rem;
  border: 1px solid #333;
}
.chase-jagd-result.hidden { display: none; }

/* Override game-card grid to fit 5 cards */
.game-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.chase-card { border-color: #a855f7 !important; }
.chase-card .game-badge { color: #a855f7; border-color: #a855f7; }
