/* Odd One Out — Game CMB
   "Neon Observation Lab" visual style: deep navy/black, glowing objects,
   glass panels, subtle grid, neon accents, futuristic-but-not-childish UI.
   Target audience: US/UK/EU/AU adults — kept restrained, not candy-colored. */

:root {
  --bg-0: #04060d;
  --bg-1: #070b18;
  --panel-bg: rgba(16, 22, 42, 0.62);
  --panel-border: rgba(120, 190, 255, 0.22);
  --accent-cyan: #4fd8ff;
  --accent-violet: #a86bff;
  --accent-pink: #ff5da2;
  --text-hi: #eef4ff;
  --text-mid: #a9b6d6;
  --text-dim: #6d7899;
  --danger: #ff5d6c;
  --good: #58ffb0;
  --radius-lg: 20px;
  --radius-md: 12px;
  --safe-touch: 44px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: 'Rajdhani', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(80, 130, 255, 0.14), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(168, 107, 255, 0.10), transparent 60%),
    var(--bg-1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

a { color: var(--accent-cyan); }

.site-header {
  width: 100%;
  max-width: 960px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', 'Rajdhani', sans-serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-decoration: none;
}
.brand strong { color: var(--accent-cyan); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn.is-active { color: var(--accent-cyan); border-color: var(--accent-cyan); }

.game-title-block {
  text-align: center;
  margin: 6px 0 4px;
}
.game-title-block h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(22px, 5vw, 34px);
  letter-spacing: 0.12em;
  margin: 0;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(79, 216, 255, 0.25);
}
.game-title-block p {
  margin: 4px 0 0;
  color: var(--text-mid);
  font-size: 14px;
}

main { width: 100%; display: flex; flex-direction: column; align-items: center; }

.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ---------- Buttons ---------- */
.btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 14px 26px;
  min-height: var(--safe-touch);
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-hi);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  border: none;
  color: #05070f;
  box-shadow: 0 0 24px rgba(79, 216, 255, 0.35), 0 0 50px rgba(168, 107, 255, 0.18);
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(79, 216, 255, 0.5), 0 0 60px rgba(168, 107, 255, 0.28); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-mid);
}

.icon-btn {
  width: var(--safe-touch);
  height: var(--safe-touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-hi);
  cursor: pointer;
  font-size: 18px;
}
.icon-btn.is-off { opacity: 0.4; }

/* ---------- Start / Game Over / Leaderboard screens ----------
   These render as an overlay ON TOP of the game canvas (inside #gameStage,
   see game.css for the overlay positioning) rather than as separate
   sections below it — so the action buttons are always where the board
   is, never scrolled out of view underneath it. */
.screen-panel {
  width: min(92vw, 560px);
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 28px 24px;
  text-align: center;
}

.mode-select {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0;
}
.mode-btn {
  flex: 1;
  max-width: 220px;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-mid);
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.mode-btn.active {
  color: #05070f;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  border-color: transparent;
}
.mode-btn small { display: block; margin-top: 4px; font-weight: 400; opacity: 0.75; font-size: 10px; }

.best-line { color: var(--text-mid); font-size: 14px; margin: 8px 0 20px; min-height: 1.2em; }

.top-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

/* Result stat grid */
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.result-stat {
  padding: 12px 6px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
}
.result-stat .value {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  color: var(--accent-cyan);
}
.result-stat .label { font-size: 11px; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }

.high-score-banner {
  font-family: 'Orbitron', sans-serif;
  color: var(--good);
  letter-spacing: 0.08em;
  margin: 6px 0 14px;
  text-shadow: 0 0 18px rgba(88, 255, 176, 0.5);
}

.retention-msg { color: var(--text-mid); font-size: 14px; margin: 4px 0 18px; }

.nickname-row {
  display: flex;
  gap: 8px;
  margin: 14px 0 8px;
}
.nickname-row input {
  flex: 1;
  min-height: var(--safe-touch);
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-hi);
  font-size: 15px;
}
.nickname-row input:focus-visible { outline: 2px solid var(--accent-cyan); }
.submit-status { min-height: 1.2em; font-size: 13px; color: var(--text-mid); margin-bottom: 10px; }

.go-actions, .lb-header-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* Leaderboard */
.lb-tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.lb-tabs button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text-mid);
  font-size: 12px;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.lb-tabs button.active { background: var(--accent-cyan); color: #05070f; border-color: transparent; }

#lbList { list-style: none; margin: 0 0 14px; padding: 0; max-height: 340px; overflow-y: auto; text-align: left; }
.lb-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
}
.lb-row:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }
.lb-row.lb-you { background: rgba(79, 216, 255, 0.14); border: 1px solid rgba(79, 216, 255, 0.4); }
.lb-rank { color: var(--text-dim); font-family: 'Orbitron', sans-serif; font-size: 12px; }
.lb-name { color: var(--text-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { color: var(--accent-cyan); font-family: 'Orbitron', sans-serif; }
.lb-loading { text-align: center; color: var(--text-dim); padding: 20px 0; }

/* SEO copy section below the game */
.seo-copy {
  width: min(92vw, 820px);
  margin: 30px auto 50px;
  color: var(--text-mid);
  font-size: 15px;
  line-height: 1.65;
}
.seo-copy h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--text-hi);
  margin: 26px 0 10px;
}
.seo-copy ul { padding-left: 20px; }

.site-footer {
  color: var(--text-dim);
  font-size: 12px;
  padding: 20px;
  text-align: center;
}
.site-footer a { color: var(--text-dim); text-decoration: underline; }

.ad-slot {
  width: min(92vw, 900px);
  min-height: 90px;
  margin: 14px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
}

@media (max-width: 480px) {
  .result-grid { grid-template-columns: repeat(2, 1fr); }
}
