/* Arenadle — daily sports geography */
:root {
  --bg: #070d16;
  --bg-2: #0a1420;
  --panel: #0f1b2a;
  --panel-2: #122234;
  --line: rgba(150, 180, 220, 0.13);
  --line-strong: rgba(160, 195, 235, 0.22);
  --text: #e9f1fb;
  --muted: #8da2ba;
  --muted-2: #6d8098;
  --lime: #c8f45a;
  --lime-bright: #d8ff74;
  --orange: #ff7a45;
  --yellow: #ffd75e;
  --blue: #5aa7ff;
  --radius: 20px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --font: "Inter", "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 12% -12%, rgba(200, 244, 90, 0.10), transparent 62%),
    radial-gradient(820px 600px at 104% 104%, rgba(90, 167, 255, 0.10), transparent 60%),
    radial-gradient(600px 500px at 50% 50%, rgba(20, 40, 65, 0.4), transparent 70%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 75%);
}

main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── top bar ─────────────────────────────────────────────────── */
.topbar {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--lime);
  background: rgba(200, 244, 90, 0.06);
  border: 1px solid rgba(200, 244, 90, 0.22);
}

.brand-text { display: flex; flex-direction: column; gap: 1px; }

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--muted-2);
}

.top-right { display: flex; align-items: center; gap: 10px; }

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}

.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { background: var(--lime); color: #0b1206; }

/* ── screens ─────────────────────────────────────────────────── */
.screen {
  display: none;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.screen.active { display: flex; flex-direction: column; animation: fade-in 0.28s ease both; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ── home ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 26px 72px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  width: 720px;
  height: 720px;
  top: -320px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(200, 244, 90, 0.10), transparent 65%);
  pointer-events: none;
}

.hero-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.75;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.55) 45%, transparent 88%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.55) 45%, transparent 88%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 790px;
  text-align: center;
}

.kicker {
  margin: 0;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 4.5px;
  text-transform: uppercase;
  color: var(--lime);
}

.hero-title {
  margin: 18px 0 20px;
  font-size: clamp(50px, 8.6vw, 104px);
  line-height: 0.93;
  letter-spacing: -0.045em;
  font-weight: 800;
  color: #f4f9ff;
  text-wrap: balance;
}

.hero-title .accent { color: var(--lime); }

.hero-lede {
  max-width: 600px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.62;
  color: var(--muted);
  text-wrap: balance;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rules-line {
  margin: 16px 0 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stats-row {
  margin: 40px auto 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat {
  min-width: 112px;
  padding: 13px 20px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(12, 22, 35, 0.62);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-num {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--muted-2);
}

.how {
  max-width: 760px;
  margin: 58px auto 0;
  text-align: left;
}

.how h2 {
  margin: 0 0 14px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted-2);
}

.how-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.how-list li {
  display: flex;
  gap: 11px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(12, 22, 35, 0.5);
}

.how-num {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lime);
  color: #0b1206;
  font-size: 12px;
  font-weight: 800;
}

.how-list strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.how-list p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted-2);
}

/* ── buttons ─────────────────────────────────────────────────── */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 14px 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: translateY(1px) scale(0.995); }
.btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

.btn-primary {
  background: var(--lime);
  color: #0b1206;
  box-shadow: 0 10px 34px rgba(200, 244, 90, 0.20);
}

.btn-primary:hover { background: var(--lime-bright); transform: translateY(-1px); }

.btn-primary:disabled {
  background: #23301f;
  color: #6b7d62;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.065); border-color: var(--line-strong); }
.btn-block { width: 100%; }
.btn-lg { padding: 18px 30px; font-size: 16px; border-radius: 16px; }
.btn .arrow { opacity: 0.85; }

/* ── game ────────────────────────────────────────────────────── */
#screen-game { padding: 4px 20px 14px; }

.game {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-height: 0;
}

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  flex: 0 0 auto;
}

.round-wrap { display: flex; align-items: center; gap: 11px; }

.round-dots { display: flex; align-items: center; gap: 5px; }

.round-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.2s, box-shadow 0.2s;
}

.round-dots .dot.done { background: var(--lime); }
.round-dots .dot.current { background: transparent; box-shadow: inset 0 0 0 1.5px var(--lime); }

.round-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.live-score {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted-2);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.live-score strong {
  font-size: 18px;
  letter-spacing: 0;
  color: var(--lime);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.question-card {
  flex: 0 0 auto;
  padding: 15px 20px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #122234 0%, #0e1b2a 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.q-meta { display: flex; align-items: center; gap: 10px; }

.year {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}

.tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
}

.q-text {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
  color: #e3edf9;
  text-wrap: pretty;
}

.map-shell {
  position: relative;
  flex: 1;
  min-height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 110% at 28% 0%, #10253c 0%, #0b1726 46%, #08111d 100%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.45), 0 18px 50px rgba(0, 0, 0, 0.3);
}

.map-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(rgba(150, 190, 235, 0.14) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(72% 68% at 50% 50%, #000 0%, transparent 82%);
  -webkit-mask-image: radial-gradient(72% 68% at 50% 50%, #000 0%, transparent 82%);
}

#gameMap {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.map-hint,
.map-zoom,
.result-sheet { z-index: 2; }

.map-hint {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 13, 22, 0.82);
  backdrop-filter: blur(9px);
  font-size: 11.5px;
  font-weight: 600;
  color: #c7d6e8;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  max-width: calc(100% - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-hint.gone { opacity: 0; transform: translate(-50%, -7px); }

.map-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-zoom button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 27, 0.86);
  backdrop-filter: blur(8px);
  color: #dce8f7;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s;
}

.map-zoom button:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-strong); }

.result-sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 13px 15px 14px;
  border-radius: 16px;
  border: 1px solid rgba(160, 195, 235, 0.20);
  background: rgba(8, 16, 27, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: sheet-up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.result-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.result-points {
  font-size: 21px;
  font-weight: 800;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.result-sheet[data-tier="3"] .result-points { color: #ffb066; }
.result-sheet[data-tier="4"] .result-points { color: #ff7a45; }

.result-body { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

.result-distance {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.result-place {
  font-size: 14.5px;
  font-weight: 700;
  color: #ecf4ff;
}

.result-sheet .btn { height: 43px; padding: 0 18px; font-size: 14px; }

.action-row { flex: 0 0 auto; }
.btn-lock { height: 54px; font-size: 15px; letter-spacing: 0.2px; }

/* ── end ─────────────────────────────────────────────────────── */
#screen-end { padding: 22px 20px 44px; overflow-y: auto; }

.end-wrap { width: 100%; max-width: 720px; margin: auto; }

.results-card {
  position: relative;
  overflow: hidden;
  padding: 34px 40px 30px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 34, 52, 0.96) 0%, rgba(10, 20, 32, 0.98) 100%);
  box-shadow: var(--shadow);
  text-align: center;
}

.results-card::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 50%;
  width: 560px;
  height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(200, 244, 90, 0.14), transparent);
  pointer-events: none;
}

.results-card > * { position: relative; z-index: 1; }

.end-title {
  margin: 5px 0 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.end-score-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 4px;
}

.end-score {
  font-size: clamp(62px, 12vw, 92px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}

.end-max {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted-2);
  letter-spacing: 0.5px;
}

.end-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.badges {
  min-height: 24px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(200, 244, 90, 0.13);
  border: 1px solid rgba(200, 244, 90, 0.35);
  color: var(--lime);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.streak-line { font-size: 12px; font-weight: 600; color: var(--muted); }

.grid {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 26px;
}

.grid-cell {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0b1206;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.tier-1 { background: var(--lime); }
.tier-2 { background: var(--yellow); }
.tier-3 { background: #ffb066; }
.tier-4 { background: #2b3d55; color: #b9cbe1; }

.share-row {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}

.share-row .btn { padding: 13px 18px; font-size: 14px; }

.next-round {
  margin: 20px 0 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted-2);
}

.next-round strong {
  color: var(--text);
  font-size: 12.5px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.practice-note { margin: 16px 0 0; font-size: 11.5px; color: var(--muted-2); }

.end-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}

.end-actions .btn { font-size: 13px; padding: 11px 16px; }

/* ── footer / misc ───────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: 14px 20px 16px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(110, 133, 158, 0.7);
}

body[data-screen="game"] .footer { display: none; }

.ad-slot { position: relative; z-index: 1; max-width: 980px; margin: 0 auto 20px; padding: 0 20px; }
body[data-screen="game"] .ad-slot { display: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(200, 244, 90, 0.45);
  background: rgba(9, 18, 29, 0.96);
  color: var(--lime);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── responsive ──────────────────────────────────────────────── */
@media (max-width: 820px) {
  .topbar { padding: 15px 16px; }
  .brand-sub { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  .hero { padding: 26px 16px 56px; }
  .hero-lede { font-size: 15.5px; }
  .stats-row { margin-top: 30px; }
  .stat { min-width: 0; flex: 1 1 0; padding: 11px 12px; }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 8.5px; letter-spacing: 0.9px; }
  .how { margin-top: 42px; }
  .how-list { grid-template-columns: 1fr; }
  .how-list li { padding: 14px; }

  #screen-game { padding: 2px 10px 10px; }
  .game { gap: 9px; }
  .question-card { padding: 13px 15px 14px; border-radius: 16px; }
  .q-text { font-size: 15px; }
  .map-shell { border-radius: 16px; min-height: 300px; }
  .result-sheet { left: 8px; right: 8px; bottom: 8px; padding: 12px 13px 13px; }
  .result-place { font-size: 13.5px; }
  .btn-lock { height: 50px; }

  #screen-end { padding: 16px 12px 32px; }
  .results-card { padding: 28px 18px 24px; border-radius: 22px; }
  .grid { gap: 7px; }
  .grid-cell { width: 52px; height: 52px; font-size: 14px; border-radius: 12px; }
  .share-row { gap: 7px; }
  .share-row .btn { flex: 1 1 auto; padding: 12px 14px; font-size: 13px; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 46px; }
  .grid-cell { width: 46px; height: 46px; font-size: 13px; }
  .brand-name { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* short landscape phones: keep the map usable */
@media (max-height: 620px) and (orientation: landscape) {
  .topbar { padding: 8px 16px; }
  .footer { display: none; }
  .hero { padding: 10px 16px 30px; }
  .hero-title { font-size: 44px; margin: 10px 0; }
  .hero-lede, .how, .rules-line { display: none; }
  .stats-row { margin-top: 16px; }
  .question-card { padding: 10px 14px; }
  .q-text { font-size: 14px; }
}
