/* ─── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:         #0b0b0b;
  --surface:    #161616;
  --surface2:   #222222;
  --border:     rgba(255, 255, 255, 0.08);
  --text:       #f0f0f0;
  --text2:      #a0a0a0;
  --text3:      #555555;
  --accent:     #e8d5b0;
  --accent-dim: rgba(232, 213, 176, 0.15);
  --green:      #22c55e;
  --red:        #ef4444;
  --radius-lg:  18px;
  --radius-md:  12px;
  --radius-sm:  8px;
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}
main  { flex: 1; animation: fadeUp 0.6s ease; position: relative; z-index: 2; }
a     { text-decoration: none; }

/* ─── Radar background ──────────────────────────────────────────────────────── */
.radar-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(232, 213, 176, 0.05) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(232, 213, 176, 0.03) 2px, transparent 2px);
  background-size: 140px 140px, 280px 280px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.radar-bg::before,
.radar-bg::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(232, 213, 176, 0.08);
  border-radius: 50%;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
}
.radar-bg::before { width: 420px; height: 420px; }
.radar-bg::after  { width: 620px; height: 620px; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  margin: 18px auto;
  width: 95%;
  max-width: 1200px;
  background: rgba(22, 22, 22, 0.88);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 10;
}
.logo {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 0.04em;
}
.logo span { color: var(--text3); }

/* ─── Nav buttons ────────────────────────────────────────────────────────────── */
.nav-buttons { display: flex; gap: 8px; }
.nav-buttons button {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 15px;
  color: var(--text2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.nav-buttons button:hover {
  background: var(--accent);
  color: #000;
  transform: translateY(-2px);
}
.nav-buttons button.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(232, 213, 176, 0.3);
}

.header-auth-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.14);
  color: #9ff7be;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
}

.header-auth-indicator:hover {
  border-color: rgba(34, 197, 94, 0.45);
}

.auth-panel {
  min-width: 250px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface2);
}

.auth-state {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-state[hidden] {
  display: none;
}

.auth-panel input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  padding: 7px 9px;
  outline: none;
}

.auth-panel input:focus {
  border-color: rgba(232, 213, 176, 0.35);
}

.auth-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.auth-buttons button,
#auth-logout-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-buttons button:hover,
#auth-logout-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

#auth-logout-btn {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

#auth-logout-btn:hover {
  background: rgba(220, 38, 38, 0.32);
  color: #ffe4e6;
}

.auth-user-email {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.auth-message {
  min-height: 16px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text3);
}

.auth-message.ok {
  color: var(--green);
}

.auth-message.error {
  color: var(--red);
}

.auth-page-main {
  max-width: 460px;
  margin: 28px auto 0;
  padding: 0 20px 40px;
}

.auth-card {
  background: linear-gradient(170deg, var(--surface) 0%, #111 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.auth-title {
  font-family: 'Space Mono', monospace;
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.auth-page .auth-panel {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
}

.auth-page .auth-state {
  gap: 10px;
}

.auth-page .auth-panel input {
  font-size: 14px;
  padding: 10px 12px;
}

.auth-page .auth-buttons {
  grid-template-columns: 1fr;
}

.auth-page .auth-buttons button,
.auth-page #auth-logout-btn,
.auth-page #auth-home-btn {
  width: 100%;
  font-size: 14px;
  padding: 10px 12px;
}

.auth-page .auth-primary {
  background: var(--accent);
  color: #000;
  border-color: rgba(232, 213, 176, 0.35);
  font-weight: 700;
}

.auth-page .auth-primary:hover {
  opacity: 0.9;
  color: #000;
}

.auth-page .auth-google {
  border-color: rgba(255, 255, 255, 0.2);
}

.auth-page .auth-user-email {
  max-width: 100%;
}

/* ─── Home hero ──────────────────────────────────────────────────────────────── */
.home-hero { text-align: center; padding: 70px 20px 20px; }
.home-title {
  font-family: 'Space Mono', monospace;
  font-size: 48px;
  color: var(--accent);
}
.home-subtitle {
  color: var(--text2);
  max-width: 620px;
  margin: 14px auto 0;
  line-height: 1.6;
}

/* ─── Game mode cards (home) ─────────────────────────────────────────────────── */
.main-buttons {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin: 50px 20px;
}
.game-btn {
  background: linear-gradient(180deg, var(--surface), #111);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 260px;
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}
.game-btn:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(232, 213, 176, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
/* Shimmer on hover */
.game-btn::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 70%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transition: left 0.55s ease;
}
.game-btn:hover::before { left: 140%; }
.game-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.game-btn:disabled:hover { transform: none; box-shadow: none; }
.game-btn-icon  { font-size: 44px; }
.game-btn-title { font-size: 18px; font-weight: 700; }
.game-btn-desc  { font-size: 13px; color: var(--text2); text-align: center; }

.coming-soon-chip {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  color: var(--text3);
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.05em;
}

/* ─── Game layout ────────────────────────────────────────────────────────────── */
.game-container { max-width: 560px; margin: 0 auto; padding: 0 20px 100px; }
.game-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.game-label  { color: var(--accent); font-family: 'Space Mono', monospace; font-size: 14px; }
.streak-badge { color: var(--text2); font-size: 14px; }

/* ─── Airport image ──────────────────────────────────────────────────────────── */
.img-wrap {
  height: 300px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  position: relative;
  background: var(--surface);
}
#airport-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.35s ease;
}
.stage-0 { transform: scale(5);   filter: blur(4px); }
.stage-1 { transform: scale(3.5); filter: blur(2px); }
.stage-2 { transform: scale(2.5); filter: blur(1px); }
.stage-3 { transform: scale(1.8); filter: none; }
.stage-4 { transform: scale(1);   filter: none; }
.stage-solved { filter: blur(4px) brightness(0.72); }

.zoom-chip {
  position: absolute;
  bottom: 12px; left: 12px;
  background: rgba(0, 0, 0, 0.65);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text2);
  pointer-events: none;
}

/* Help button on image */
.help-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.65);
  color: var(--text2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  z-index: 5;
}

.help-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(232, 213, 176, 0.35);
}

/* Help modal */
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.help-modal[hidden] {
  display: none;
}

.help-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.help-modal-card {
  position: relative;
  width: min(480px, 100%);
  max-height: min(80vh, 600px);
  overflow-y: auto;
  background: linear-gradient(165deg, var(--surface) 0%, #121212 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 24px;
  z-index: 1;
  animation: fadeUp 0.25s ease;
}

.help-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.help-modal-close:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.help-modal-title {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 16px;
  padding-right: 40px;
}

.help-modal-content {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.6;
}

.help-modal-content p {
  margin-bottom: 12px;
}

.help-modal-content ul {
  margin: 12px 0;
  padding-left: 20px;
}

.help-modal-content li {
  margin-bottom: 8px;
}

.help-modal-content strong {
  color: var(--text);
}

.help-modal-tip {
  margin-top: 16px;
  padding: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(232, 213, 176, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.daily-result {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0.25) 0%, rgba(8, 8, 8, 0.72) 100%);
  z-index: 3;
}

.daily-result[hidden] {
  display: none;
}

.daily-answer-name {
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 18px;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
  max-width: 90%;
}

/* ─── Clue grid ──────────────────────────────────────────────────────────────── */
.clue-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.clue {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 14px;
  color: var(--text3);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.clue.revealed {
  color: var(--accent);
  border-color: rgba(232, 213, 176, 0.25);
  background: var(--accent-dim);
}

.clue.revealed.revealed-match {
  color: #89f0b6;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
}

.clue.revealed.revealed-match::before {
  content: '✓ ';
  font-weight: 700;
}

/* ─── Input ──────────────────────────────────────────────────────────────────── */
.input-row { position: relative; margin-bottom: 12px; }
#guess-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
#guess-input:focus { border-color: rgba(232, 213, 176, 0.4); }
#guess-input::placeholder { color: var(--text3); }

.guess-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  background: linear-gradient(160deg, var(--surface) 0%, #111 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.guess-suggestions[hidden] {
  display: none;
}

.guess-suggestion-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 11px 14px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.guess-suggestion-item:last-child {
  border-bottom: none;
}

.guess-suggestion-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.btn-primary {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  height: 48px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  cursor: pointer;
  color: #000;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius-md);
  height: 48px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-secondary:hover { background: var(--surface); color: var(--text); }

/* ─── Guess counter ──────────────────────────────────────────────────────────── */
.guess-counter {
  text-align: center;
  color: var(--text3);
  font-size: 14px;
  margin-top: 10px;
}

.game-status {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.game-status.warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #fcdba2;
}

.game-status.error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: #ffb8b8;
}

.game-status.ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #9bf3c1;
}

.daily-leaderboard {
  margin-top: 18px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.daily-leaderboard-title {
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 8px;
}

.daily-leaderboard-note {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 8px;
}

.leaderboard-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.leaderboard-info::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #101010;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--text2);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 30;
}

.leaderboard-info::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%) translateY(4px);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #101010;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 29;
}

.leaderboard-info:focus,
.leaderboard-info:hover {
  color: var(--accent);
  border-color: rgba(232, 213, 176, 0.35);
  outline: none;
}

.leaderboard-info:focus::after,
.leaderboard-info:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.leaderboard-info.is-open::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.leaderboard-info:focus::before,
.leaderboard-info:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.leaderboard-info.is-open::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.daily-leaderboard-status {
  font-size: 13px;
  color: var(--text3);
}

.daily-leaderboard-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: decimal;
  padding-left: 22px;
}

.daily-leaderboard-list[hidden] {
  display: none;
}

.daily-leaderboard-list li {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.4;
}

.daily-leaderboard-list li.is-you {
  color: var(--text);
  background: var(--accent-dim);
  border: 1px solid rgba(232, 213, 176, 0.26);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin-left: -8px;
}

.daily-leaderboard-player {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
  font-weight: 600;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.daily-leaderboard-player:hover {
  color: var(--accent);
  text-decoration: underline;
}

.profile-card {
  max-width: 560px;
}

.profile-last-updated {
  margin-top: -6px;
  margin-bottom: 14px;
  color: var(--text3);
  font-size: 12px;
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface2);
}

.profile-line span {
  color: var(--text3);
  font-size: 12px;
}

.profile-line strong,
.profile-line code {
  color: var(--text);
  font-size: 13px;
}

.profile-line code {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.profile-stats > div {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  padding: 10px;
  text-align: center;
}

.profile-stats strong {
  display: block;
  font-size: 20px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
}

.profile-stats span {
  color: var(--text3);
  font-size: 12px;
}

.profile-actions {
  grid-template-columns: 1fr 1fr;
}

/* ─── Delete Account Section ─────────────────────────────────────────────────── */

.profile-delete-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.profile-delete-btn {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.profile-delete-btn:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(248, 113, 113, 0.6);
}

/* ─── Delete Confirmation Modal ──────────────────────────────────────────────── */

.delete-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.delete-confirm-modal[hidden] {
  display: none;
}

.delete-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.delete-confirm-card {
  position: relative;
  width: min(400px, 100%);
  background: linear-gradient(165deg, var(--surface) 0%, #121212 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 28px;
  z-index: 1;
  animation: fadeUp 0.25s ease;
  text-align: center;
}

.delete-confirm-title {
  font-family: 'Space Mono', monospace;
  font-size: 22px;
  color: #ef4444;
  margin-bottom: 16px;
}

.delete-confirm-warning {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.delete-confirm-warning strong {
  color: #ef4444;
}

.delete-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.delete-confirm-actions .btn-secondary {
  min-width: 100px;
  height: 44px;
}

.btn-danger {
  min-width: 120px;
  height: 44px;
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fecaca;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.35);
  border-color: rgba(248, 113, 113, 0.7);
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Re-authentication Modal ──────────────────────────────────────────────── */

.reauth-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.reauth-modal[hidden] {
  display: none;
}

.reauth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.reauth-card {
  position: relative;
  width: min(400px, 100%);
  background: linear-gradient(165deg, var(--surface) 0%, #121212 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 28px;
  z-index: 1;
  animation: fadeUp 0.25s ease;
  text-align: center;
}

.reauth-title {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  color: #ef4444;
  margin-bottom: 12px;
}

.reauth-message {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.reauth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reauth-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.reauth-input:focus {
  border-color: rgba(239, 68, 68, 0.4);
}

.reauth-error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  margin: 0;
}

.reauth-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.reauth-actions .btn-secondary {
  min-width: 100px;
  height: 44px;
}

.reauth-actions .btn-danger {
  min-width: 140px;
  height: 44px;
}

/* ─── Stats card ─────────────────────────────────────────────────────────────── */
.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  max-width: 480px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.stats-title {
  font-family: 'Space Mono', monospace;
  font-size: 22px;
  color: var(--accent);
}
.stats-row {
  display: flex;
  gap: 36px;
  justify-content: center;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
  font-family: 'Space Mono', monospace;
  font-size: 36px;
  color: var(--text);
  font-weight: 700;
}
.stat-lbl { font-size: 13px; color: var(--text2); margin-top: 4px; }

.countdown-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 999px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--text2);
}

.stats-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.stats-actions .btn-primary  { flex: 1; min-width: 160px; }
.stats-actions .btn-secondary { flex: 1; min-width: 140px; }

/* ─── FAQ ────────────────────────────────────────────────────────────────────── */
.faq-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  padding: 14px;
  cursor: pointer;
  font-size: 16px;
  color: var(--accent);
  font-family: 'Space Mono', monospace;
}

.faq-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.24s ease;
  flex-shrink: 0;
  margin-right: 4px;
}

.faq-answer-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.faq-answer {
  overflow: hidden;
  font-size: 14px;
  color: var(--text2);
  line-height: 1.55;
  padding: 0 14px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.faq-item.open .faq-answer-wrap {
  grid-template-rows: 1fr;
}

.faq-item.open .faq-answer {
  padding: 0 14px 14px;
  opacity: 1;
}

.faq-item.open .faq-icon {
  transform: rotate(-135deg);
}

/* ─── Result Sheet ───────────────────────────────────────────────────────────── */
.result-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.result-sheet[hidden] {
  display: none;
}

.result-sheet-card {
  width: min(520px, 100%);
  background: linear-gradient(165deg, var(--surface) 0%, #121212 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.result-sheet.show .result-sheet-card {
  transform: translateY(0);
  opacity: 1;
}

.result-sheet-close {
  align-self: flex-end;
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.result-sheet-title {
  font-family: 'Space Mono', monospace;
  font-size: 18px;
  color: var(--accent);
}

.result-sheet-detail {
  color: var(--text2);
  font-size: 14px;
}

.result-sheet-share {
  margin-top: 4px;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
}

.result-sheet-share:hover {
  opacity: 0.9;
}

.result-sheet-share.result-sheet-continue {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(232, 213, 176, 0.35);
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.footer-bar {
  background: rgba(22, 22, 22, 0.9);
  backdrop-filter: blur(10px);
  padding: 24px 40px;
  display: flex;
  justify-content: center;
  gap: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}
.footer-bar a { color: var(--text2); font-size: 14px; transition: color 0.2s; }
.footer-bar a:hover { color: var(--accent); }

/* ─── Toast Notifications ──────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(165deg, var(--surface) 0%, #151515 100%);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: toastIn 0.3s ease;
}

.toast-ok {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(165deg, rgba(34, 197, 94, 0.1) 0%, #111 100%);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(165deg, rgba(239, 68, 68, 0.1) 0%, #111 100%);
}

.toast-message {
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.toast-close {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.toast-close:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

@media (max-width: 600px) {
  .toast-container {
    top: auto;
    bottom: 20px;
    right: 16px;
    left: 16px;
  }
  .toast {
    max-width: none;
  }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .nav-buttons {
    justify-content: center;
  }
  .auth-panel {
    min-width: 0;
    width: 100%;
  }
  .home-title { font-size: 38px; }
  .main-buttons { margin: 38px 14px; gap: 14px; }
  .game-btn { width: 100%; max-width: 340px; }
  .stats-row     { gap: 20px; }
  .stat-num      { font-size: 28px; }
}
@media (max-width: 700px) {
  .main-buttons  { flex-direction: column; align-items: center; }
  .home-title    { font-size: 32px; }
  .header-bar    { flex-direction: column; gap: 12px; }
  .nav-buttons   { flex-wrap: wrap; justify-content: center; }
}
