/* Oddway Game (oddwaygame.com) — Synthwave Pixel Getaway UI + High-Contrast SEO Surface */

:root {
  --bg-obsidian: #10141c;
  --bg-void: #090b12;
  --bg-panel: #121626;
  --bg-card: #161b2e;
  --text-main: #eef2f7;
  --text-muted: #9aa7bd;
  --pink: #ff2e88;
  --cyan: #22e5ff;
  --gold: #ffd644;
  --emerald: #2df0a5;
  --orange: #f97316;
  --crimson: #ef4444;
  --border-subtle: rgba(238, 242, 247, 0.22);
  --font-display: "Pixelify Sans", system-ui, sans-serif;
  --font-pixel: "DotGothic16", ui-monospace, monospace;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-body);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-void);
  color: var(--text-main);
  overflow-x: clip;
  line-height: 1.55;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font-family: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   FULL-BLEED 100vw x 100dvh LIVE GAME STAGE (matching oddway.app)
   ============================================================ */
.game-hero {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-obsidian);
  isolation: isolate;
}

#cityCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 0;
  pointer-events: none;
}

/* Top Floating HUD (.topbar) — strictly single row, zero horizontal overflow */
.topbar {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 100vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px 6px;
  overflow: hidden;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  background: rgba(10, 12, 22, 0.85);
  color: var(--text-main);
  border: 1.5px solid rgba(238, 242, 247, 0.55);
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
}

.hud-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.hud-btn-menu {
  background: var(--pink);
  color: #090b12;
  border: 2px solid var(--pink);
  box-shadow: 3px 3px 0 var(--cyan);
  font-weight: 700;
}

.hud-btn-menu:hover {
  background: #ff4b9a;
  color: #090b12;
}

/* Active Play Telemetry HUD inside .topbar */
.play-telemetry {
  display: none;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.in-round .play-telemetry {
  display: flex;
  flex: 1;
  min-width: 0;
}

/* Keep Menu & Sound compact and accessible during active play, reveal & summary! */
body.in-round .hud-btn-label {
  display: none;
}

body.in-round .hud-btn {
  padding: 0 8px;
  min-width: 34px;
  height: 34px;
}

.hud-box {
  background: rgba(9, 11, 18, 0.9);
  border: 1.5px solid #eef2f7;
  padding: 4px 10px;
  min-width: 82px;
  text-align: left;
  flex-shrink: 0;
}

.hud-box-right {
  text-align: right;
}

.hud-km {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.05;
  color: #ffffff;
}

.hud-zone {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  color: var(--cyan);
  white-space: nowrap;
}

.hud-pts {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--gold);
}

.hud-pts-lbl {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.round-tracker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

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

.round-dot {
  width: 13px;
  height: 13px;
  border: 1.5px solid rgba(238, 242, 247, 0.45);
  background: rgba(9, 11, 18, 0.75);
}

.round-dot.active {
  border-color: var(--pink);
  box-shadow: 0 0 0 1px var(--pink);
}

.round-dot.tier-small_time { background: #94a3b8; border-color: #cbd5e1; }
.round-dot.tier-hustle { background: #f97316; border-color: #fdba74; }
.round-dot.tier-heavy_hitter { background: #22e5ff; border-color: #a5f3fc; }
.round-dot.tier-kingpin { background: #ffd644; border-color: #fef08a; }
.round-dot.tier-one_of_one { background: #2df0a5; border-color: #a7f3d0; }
.round-dot.tier-miss { background: #ef4444; border-color: #fca5a5; }

.round-label {
  font-family: var(--font-pixel);
  font-size: 0.76rem;
  color: #eef2f7;
  text-shadow: 0 1px 3px #000;
}

/* Right-edge vertical escape route ruler (desktop only) */
.route-ruler {
  position: absolute;
  right: 14px;
  top: 72px;
  bottom: 72px;
  width: 44px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.in-round .route-ruler {
  opacity: 0.92;
}

.ruler-track {
  position: relative;
  width: 6px;
  flex: 1;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 3px;
}

.ruler-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(to top, var(--pink), var(--gold), var(--emerald));
  border-radius: 3px;
  transition: height 0.4s ease;
}

.ruler-gold-line {
  position: absolute;
  left: -10px;
  right: -10px;
  bottom: 48.6%;
  height: 2px;
  background: var(--gold);
}

.ruler-gold-tag {
  position: absolute;
  right: 14px;
  bottom: 48.6%;
  transform: translateY(50%);
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--gold);
  background: rgba(9, 11, 18, 0.85);
  padding: 1px 4px;
  white-space: nowrap;
}

.ruler-cap {
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  color: var(--cyan);
  text-shadow: 0 1px 2px #000;
}

/* ============================================================
   STAGE OVERLAY SCREENS (Start / Active Play / Reveal / Summary)
   ============================================================ */
.stage-overlay {
  position: relative;
  z-index: 4;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 16px 12px;
  pointer-events: none;
}

.stage-overlay > * {
  pointer-events: auto;
}

/* START SCREEN — strictly faithful to oddway.app layout */
.start-header {
  text-align: center;
  margin-top: 2px;
}

.brand-wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.1rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.65);
}

.brand-odd {
  color: #ffffff;
}

.brand-way {
  color: var(--pink);
  text-shadow: 3px 3px 0 var(--cyan);
}

.brand-subtitle {
  margin: 6px 0 0;
  font-family: var(--font-pixel);
  font-size: clamp(0.95rem, 0.8rem + 0.65vw, 1.25rem);
  color: var(--cyan);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.start-mode-pill {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  background: rgba(9, 11, 18, 0.72);
  border: 1px solid rgba(255, 214, 68, 0.45);
}

.start-bottom-dock {
  width: 100%;
  max-width: 470px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
}

.start-tagline {
  margin: 0;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: clamp(0.84rem, 0.76rem + 0.35vw, 0.96rem);
  color: #eef2f7;
  line-height: 1.35;
}

.btn-engine {
  width: 100%;
  min-height: 58px;
  padding: 12px 20px;
  background: #0a0b15;
  color: #ffffff;
  border: 2px solid var(--pink);
  box-shadow: 5px 5px 0 var(--cyan);
  font-family: var(--font-pixel);
  font-size: clamp(1.08rem, 0.95rem + 0.55vw, 1.32rem);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn-engine:hover {
  background: #17102a;
}

.btn-engine:active {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--cyan);
}

.run-meta-line {
  font-family: var(--font-pixel);
  font-size: 0.86rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.start-mini-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 40px;
  padding: 6px 8px;
  background: #0b0d17;
  color: #eef2f7;
  border: 1.5px solid rgba(238, 242, 247, 0.65);
  font-family: var(--font-pixel);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-mini:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  text-decoration: none;
}

.btn-wide-ghost {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0b0d17;
  color: #eef2f7;
  border: 1.5px solid rgba(238, 242, 247, 0.65);
  font-family: var(--font-pixel);
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-wide-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  text-decoration: none;
}

.start-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-pixel);
  font-size: 0.82rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--cyan);
  text-decoration: underline;
  font-family: var(--font-pixel);
  font-size: 0.84rem;
  cursor: pointer;
  padding: 2px 4px;
}

.scroll-cue {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font-pixel);
  text-decoration: none;
}

.scroll-cue:hover {
  color: var(--gold);
}

/* 1v1 Incoming Challenge Banner */
.challenge-banner {
  width: 100%;
  max-width: 470px;
  background: rgba(16, 12, 34, 0.94);
  border: 2px solid var(--gold);
  box-shadow: 4px 4px 0 var(--pink);
  padding: 10px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.challenge-banner-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
}

.challenge-banner-meta {
  font-family: var(--font-pixel);
  font-size: 0.82rem;
  color: #eef2f7;
}

.challenge-banner-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ============================================================
   ACTIVE PLAY SCREEN (Upper-half anchored for mobile keyboard safety!)
   ============================================================ */
.play-stage {
  width: 100%;
  max-width: 520px;
  margin: 4px auto auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.prompt-card {
  background: #090b12;
  border: 2px solid #ffffff;
  box-shadow: 5px 5px 0 var(--pink);
  padding: 14px 16px;
  text-align: left;
}

.prompt-cat-tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.prompt-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.22rem, 1.02rem + 1vw, 1.65rem);
  font-weight: 700;
  line-height: 1.18;
  color: #ffffff;
}

/* Timer Ring + Single-Line Input + Hot Pink Go Button */
.answer-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.timer-ring-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(9, 11, 18, 0.9);
  border-radius: 50%;
}

.timer-svg {
  position: absolute;
  inset: 0;
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 4;
}

.timer-arc {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
  stroke-linecap: butt;
  transition: stroke-dashoffset 0.2s linear, stroke 0.2s ease;
}

.timer-arc.warn { stroke: var(--gold); }
.timer-arc.danger { stroke: var(--crimson); }

.timer-num {
  position: relative;
  font-family: var(--font-pixel);
  font-size: 1.02rem;
  color: #ffffff;
}

.answer-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  background: #ffffff;
  color: #090b12;
  border: 2.5px solid var(--gold);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0;
}

.answer-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

.btn-go {
  height: 48px;
  min-width: 64px;
  padding: 0 18px;
  background: var(--pink);
  color: #ffffff;
  border: 2px solid var(--pink);
  box-shadow: 4px 4px 0 var(--cyan);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-go:hover {
  background: #ff4495;
}

.btn-go:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--cyan);
}

.play-assist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.assist-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-assist {
  height: 30px;
  padding: 0 10px;
  background: rgba(9, 11, 18, 0.88);
  color: #eef2f7;
  border: 1px solid rgba(238, 242, 247, 0.45);
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-assist:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-assist:disabled {
  opacity: 0.48;
  cursor: default;
}

.feedback-strip {
  min-height: 24px;
  font-family: var(--font-pixel);
  font-size: 0.84rem;
  color: #ff8a3d;
  background: rgba(9, 11, 18, 0.88);
  padding: 3px 8px;
  display: none;
}

.feedback-strip.visible {
  display: inline-block;
}

.hint-box {
  background: rgba(16, 20, 34, 0.94);
  border-left: 3px solid var(--gold);
  padding: 6px 10px;
  font-size: 0.86rem;
  color: #fef08a;
  display: none;
}

.hint-box.visible {
  display: block;
}

.dym-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dym-chip {
  background: #171d33;
  color: var(--cyan);
  border: 1.5px solid var(--cyan);
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.dym-chip:hover {
  background: var(--cyan);
  color: #090b12;
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.shake-error {
  animation: inputShake 0.22s ease;
}

/* ============================================================
   REVEAL OVERLAY (Splash above car + Clean card below road!)
   ============================================================ */
.reveal-splash {
  margin-top: 12vh;
  text-align: center;
  transform: rotate(-3deg);
  pointer-events: none;
}

.reveal-tier-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  text-shadow: 4px 4px 0 #090b12, -2px -2px 0 #090b12;
}

.reveal-tier-pts {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1rem + 1.5vw, 1.9rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 3px 3px 0 #090b12;
}

.reveal-bottom-card {
  width: 100%;
  max-width: 440px;
  margin-top: auto;
  padding: 12px 14px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.reveal-answer-quoted {
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
}

.reveal-sub-stats {
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  color: var(--gold);
}

.reveal-quip {
  font-size: 0.92rem;
  color: #eef2f7;
}

.reveal-fact {
  font-size: 0.84rem;
  color: var(--cyan);
  background: rgba(18, 22, 38, 0.86);
  border: 1px solid rgba(34, 229, 255, 0.3);
  padding: 6px 10px;
  max-width: 420px;
}

.zone-progress-bar {
  width: 100%;
  max-width: 340px;
  height: 7px;
  background: rgba(255, 255, 255, 0.16);
}

.zone-progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width 0.35s ease;
}

.zone-progress-lbl {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-keep-driving {
  width: 100%;
  max-width: 320px;
  min-height: 50px;
  background: #0a0b15;
  color: #ffffff;
  border: 2px solid var(--pink);
  box-shadow: 0 0 0 2px var(--gold), 5px 5px 0 var(--cyan);
  font-family: var(--font-pixel);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.btn-keep-driving:hover {
  background: #17102a;
}

/* ============================================================
   SUMMARY OVERLAY (Scroll-safe inside 100dvh!)
   ============================================================ */
.summary-card {
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 82px);
  overflow-y: auto;
  margin: auto;
  background: rgba(10, 12, 22, 0.96);
  border: 2px solid var(--pink);
  box-shadow: 6px 6px 0 var(--cyan);
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-top {
  text-align: center;
}

.summary-score-big {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3rem);
  color: var(--gold);
  line-height: 1;
}

.summary-persona {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #ffffff;
}

.summary-tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.integrity-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  border: 1px solid var(--emerald);
  color: var(--emerald);
  background: rgba(45, 240, 165, 0.1);
}

.integrity-pill.assisted {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(255, 214, 68, 0.1);
}

.duel-scorecard {
  background: #171230;
  border: 1.5px solid var(--gold);
  padding: 10px 12px;
  text-align: center;
}

.duel-verdict {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold);
}

.duel-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--font-pixel);
  font-size: 0.84rem;
  white-space: pre-line;
}

.summary-crate-btn {
  width: 100%;
  min-height: 48px;
  background: var(--gold);
  color: #090b12;
  border: 2px solid #ffffff;
  box-shadow: 4px 4px 0 var(--pink);
  font-family: var(--font-pixel);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
}

.summary-crate-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.summary-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: #14192b;
  border-left: 4px solid var(--cyan);
  font-size: 0.86rem;
}

.summary-row-main {
  min-width: 0;
  flex: 1;
}

.summary-row-q {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-row-a {
  color: #ffffff;
  font-weight: 600;
}

.summary-row-link {
  font-family: var(--font-pixel);
  font-size: 0.74rem;
  color: var(--cyan);
  white-space: nowrap;
}

/* ============================================================
   NATIVE <dialog> MODALS (modern-web-guidance compliant!)
   ============================================================ */
dialog.ow-dialog {
  width: min(94vw, 620px);
  max-height: 86dvh;
  padding: 0;
  border: 2px solid var(--pink);
  box-shadow: 6px 6px 0 var(--cyan);
  background: #0d101c;
  color: var(--text-main);
  overflow: auto;
}

dialog.ow-dialog:modal {
  overscroll-behavior: contain;
}

dialog.ow-dialog::backdrop {
  background: rgba(5, 7, 14, 0.78);
  backdrop-filter: blur(3px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: #0d101c;
  border-bottom: 1px solid var(--border-subtle);
}

.dialog-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #ffffff;
}

.dialog-body {
  padding: 16px;
}

.drawer-dialog {
  margin: 0 auto 0 0;
  width: min(86vw, 320px);
  height: 100dvh;
  max-height: 100dvh;
  border: none;
  border-right: 2px solid var(--pink);
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.7);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #14192b;
  border: 1px solid rgba(238, 242, 247, 0.16);
  color: #eef2f7;
  font-family: var(--font-pixel);
  font-size: 0.92rem;
}

.drawer-nav a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  text-decoration: none;
}

.drawer-section-lbl {
  margin: 12px 0 4px;
  font-family: var(--font-pixel);
  font-size: 0.74rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Vault & Crate Grid */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.vault-card {
  background: #14192b;
  border: 1.5px solid rgba(238, 242, 247, 0.2);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vault-card.locked {
  opacity: 0.45;
}

.vault-card.equipped {
  border-color: var(--emerald);
  box-shadow: 0 0 0 1px var(--emerald);
}

.vault-swatch {
  height: 42px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #090b12;
  background: #22e5ff;
}

.png-preview-img {
  width: 100%;
  max-width: 380px;
  height: auto;
  aspect-ratio: 4 / 5;
  display: block;
  margin: 0 auto 12px;
  border: 1.5px solid var(--border-subtle);
}

/* ============================================================
   SEO CONTENT SECTIONS (Cleanly below 100dvh!)
   ============================================================ */
.site-topbar-static {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 12, 22, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid rgba(255, 46, 136, 0.5);
}

.site-topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.static-brand {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-decoration: none;
}

.static-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-pixel);
  font-size: 0.88rem;
}

.seo-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 18px 64px;
}

.seo-section {
  margin-bottom: 42px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 46, 136, 0.28);
}

.seo-section:first-child {
  border-top: none;
  padding-top: 0;
}

.seo-wrap h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 1.3rem + 2.2vw, 2.7rem);
  line-height: 1.1;
  margin: 0 0 12px;
  color: #ffffff;
}

.seo-wrap h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
  margin: 0 0 12px;
  color: #ffffff;
}

.seo-wrap h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  margin: 16px 0 6px;
  color: var(--cyan);
}

.seo-wrap p {
  margin: 0 0 12px;
  color: #d6deeb;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-family: var(--font-pixel);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.tier-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.tier-tile {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  padding: 12px;
}

.tier-tile-pts {
  font-family: var(--font-display);
  font-size: 1.65rem;
  line-height: 1;
  color: var(--gold);
}

.tier-tile-name {
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  margin-top: 4px;
  color: #ffffff;
}

.tier-tile-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.route-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.9rem;
}

.route-table th,
.route-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(238, 242, 247, 0.14);
}

.route-table th {
  font-family: var(--font-pixel);
  color: var(--cyan);
  background: #131829;
}

.cat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.cat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--bg-card);
  border: 1.5px solid rgba(238, 242, 247, 0.2);
  color: var(--text-main);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.cat-card:hover {
  border-color: var(--pink);
  transform: translateY(-2px);
  text-decoration: none;
}

.cat-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #ffffff;
}

.cat-card-meta {
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  color: var(--cyan);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid rgba(238, 242, 247, 0.18);
  padding: 12px 14px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--cyan);
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 8px 0 0;
  color: #d6deeb;
}

/* ============================================================
   ANSWERS / RARITY CHECKER & ARCHIVE PAGES (390px overflow-safe!)
   ============================================================ */
.explorer-shell {
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.explorer-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  background: var(--bg-card);
  border: 1.5px solid rgba(255, 46, 136, 0.45);
  padding: 16px;
  margin-bottom: 20px;
}

.explorer-input,
.explorer-select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  background: #090b12;
  color: #ffffff;
  border: 1.5px solid rgba(238, 242, 247, 0.45);
  font-size: 0.96rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  padding: 5px 10px;
  background: #0b0e19;
  color: #cbd5e1;
  border: 1px solid rgba(238, 242, 247, 0.26);
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--pink);
  color: #ffffff;
  border-color: var(--pink);
}

.spectrum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.spectrum-card {
  background: var(--bg-card);
  border: 1px solid rgba(238, 242, 247, 0.18);
  border-left: 4px solid var(--cyan);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.spectrum-name {
  font-weight: 700;
  color: #ffffff;
}

.spectrum-pts {
  font-family: var(--font-pixel);
  font-size: 0.82rem;
  color: var(--gold);
  white-space: nowrap;
}

.spectrum-fact {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.archive-card {
  background: var(--bg-card);
  border: 1.5px solid rgba(238, 242, 247, 0.22);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-card.done {
  border-color: var(--emerald);
}

.site-footer {
  border-top: 1px solid rgba(238, 242, 247, 0.16);
  background: #07090f;
  padding: 28px 18px 40px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  font-family: var(--font-pixel);
}

/* ============================================================
   RESPONSIVE MEDIA QUERIES (Broad first, narrow/short AFTER!)
   ============================================================ */
@media (max-width: 720px) {
  .route-ruler {
    display: none;
  }

  .topbar {
    padding: 8px 10px 4px;
    gap: 6px;
  }

  .hud-btn {
    height: 34px;
    padding: 0 9px;
    font-size: 0.82rem;
  }

  .hud-box {
    min-width: 62px;
    padding: 3px 6px;
  }

  .hud-km,
  .hud-pts {
    font-size: 0.92rem;
  }

  .hud-zone,
  .hud-pts-lbl {
    font-size: 0.66rem;
  }

  .round-dot {
    width: 9px;
    height: 9px;
  }

  .round-dots {
    gap: 3px;
  }

  .play-stage {
    gap: 8px;
  }

  .prompt-card {
    padding: 10px 12px;
  }

  .answer-input,
  .btn-go {
    height: 44px;
  }

  .timer-ring-wrap,
  .timer-svg {
    width: 44px;
    height: 44px;
  }

  .start-bottom-dock {
    gap: 8px;
  }

  .btn-engine {
    min-height: 50px;
  }
}

/* Short-screen mobile safety (375x667 and 375x600) — placed AFTER broader rules! */
@media (max-height: 680px) {
  .brand-wordmark {
    font-size: 2.15rem;
  }

  .brand-subtitle {
    font-size: 0.86rem;
    margin-top: 2px;
  }

  .start-bottom-dock {
    gap: 6px;
  }

  .btn-engine {
    min-height: 46px;
    padding: 8px 14px;
    font-size: 1rem;
  }

  .btn-mini,
  .btn-wide-ghost {
    min-height: 34px;
    font-size: 0.76rem;
  }

  .reveal-splash {
    margin-top: 6vh;
  }

  .reveal-bottom-card {
    gap: 5px;
    padding: 8px 10px 4px;
  }

  .btn-keep-driving {
    min-height: 44px;
  }
}

@media (max-height: 610px) {
  .brand-wordmark {
    font-size: 1.9rem;
  }

  .start-tagline {
    font-size: 0.78rem;
  }

  .btn-engine {
    min-height: 42px;
  }

  .start-mini-grid {
    gap: 5px;
  }

  .btn-mini,
  .btn-wide-ghost {
    min-height: 30px;
    padding: 4px 6px;
  }

  .prompt-card {
    padding: 8px 10px;
  }

  .prompt-text {
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .shake-error {
    animation: none;
  }
}
