.screen { padding: 18px 0 28px; display: flex; flex-direction: column; align-items: center; }
.hero-block { text-align: center; margin-bottom: 16px; }
.hero-block h1 { font-size: 2.1rem; margin: 0 0 8px; }
.hero-block p { color: var(--text-muted); max-width: 460px; margin: 0 auto; }
.title-block { padding-top: 18px; }
.title-icon { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
.title-credit { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 18px; }

.best-card {
  padding: 14px 22px; display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 22px; min-width: 220px;
}
.best-row { display: flex; justify-content: space-between; gap: 20px; font-size: 0.95rem; }
.best-name { color: var(--text-muted); font-weight: 600; }
.best-score { font-weight: 800; font-family: var(--mono); color: var(--accent); }

.btn-start { font-size: 1.05rem; padding: 14px 36px; }

.controls-hint {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin-top: 22px; color: var(--text-muted); font-size: 0.85rem; text-align: center;
}

/* --- Game screen: fills the viewport below the nav, no page scroll needed --- */
#game-screen {
  padding: 10px 0 0;
  width: 100%;
  align-items: stretch;
}

.hud {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  padding: 4px 12px 10px;
}
.hud-chip {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-weight: 800; font-size: 1.05rem;
  padding: 6px 16px; border-radius: 999px; background: var(--bg-elevated);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.fuel-chip { min-width: 130px; }
.fuel-icon { font-size: 0.95rem; }
.fuel-bar {
  width: 84px; height: 9px; border-radius: 999px; background: var(--border); overflow: hidden;
}
.fuel-fill {
  height: 100%; width: 100%; background: var(--accent-grad);
  transition: width 0.15s linear, background-color 0.2s ease;
}
.fuel-fill.low { background: #e5484d; }

.canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  touch-action: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  background: var(--bg-elevated);
}

.countdown-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 4rem; font-weight: 800; color: #fff;
  text-shadow: 0 4px 20px rgba(0,0,0,0.6);
  pointer-events: none;
  background: rgba(10, 10, 16, 0.25);
}

#final-score-line { font-size: 1.15rem; font-weight: 600; }

/* --- Touch controls: large, always-visible, thumb-reachable corners --- */
.ctrl-btn {
  position: absolute;
  bottom: clamp(12px, 3vh, 24px);
  width: clamp(76px, 16vw, 116px);
  height: clamp(76px, 16vw, 116px);
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  border: 2px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  backdrop-filter: blur(6px);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.08s ease, border-color 0.08s ease, background-color 0.08s ease;
  z-index: 5;
}
.ctrl-btn .ctrl-icon { font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1; }
.ctrl-btn .ctrl-label { font-size: clamp(0.62rem, 1.6vw, 0.78rem); font-weight: 700; }
.ctrl-btn.pressed {
  transform: scale(0.92);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-elevated));
}
.ctrl-brake { left: clamp(10px, 2.5vw, 28px); }
.ctrl-gas { right: clamp(10px, 2.5vw, 28px); }

@media (orientation: landscape) and (max-height: 520px) {
  .canvas-wrap { max-width: 100%; aspect-ratio: auto; height: calc(100dvh - 96px); }
  .hud { padding: 2px 12px 6px; }
  .hud-chip { font-size: 0.92rem; padding: 4px 12px; }
}

/* The accelerator owns the bottom-right corner during a run, so the shared
   fullscreen button moves to the top instead of being hidden — hidden meant
   it could not be found once you were actually playing. */
body:has(#game-screen:not([hidden])) .game-fs-btn {
  bottom: auto !important;
  top: max(66px, calc(env(safe-area-inset-top) + 66px)) !important;
}
