/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
body {
  background: #2d2d2d;
  color: #f0f0f0;
  font-family: sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Screens ────────────────────────────────────────────────────────────────── */
.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 100%;
  min-height: 100vh;
  padding: 16px;
}

.hidden {
  display: none !important;
}

/* ── Typography ─────────────────────────────────────────────────────────────── */
.title {
  font-size: clamp(1.6rem, 6vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: clamp(1rem, 4vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  min-height: 56px;
  padding: 0 32px;
  transition: filter 0.1s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active {
  filter: brightness(0.85);
  transform: scale(0.97);
}

/* Start / Restart */
.btn-start {
  background: #f0c040;
  color: #1a1a1a;
  min-width: 180px;
}

/* Answer buttons container */
#answer-btns {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 500px;
}

.btn-left,
.btn-right {
  flex: 1;
  min-height: 64px;
  font-size: clamp(1.1rem, 5vw, 1.4rem);
}

.btn-left  { background: #1565c0; color: #fff; }   /* blue */
.btn-right { background: #1565c0; color: #fff; }   /* green */

/* ── HUD (top status bar) ───────────────────────────────────────────────────── */
#hud {
  display: flex;
  align-items: center;
  gap: 0;
}

.hud-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  padding: 10px 22px;
  background: #1a1a1a;
  border-radius: 14px;
  border-top: 3px solid transparent;
}

.hud-timer-card   { border-top-color: #f0c040; }
.hud-correct-card { border-top-color: #66bb6a; }
.hud-errors-card  { border-top-color: #ef5350; }

.hud-divider {
  width: 1px;
  height: 36px;
  background: #3a3a3a;
  margin: 0 6px;
  flex-shrink: 0;
}

.hud-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  opacity: 0.55;
  text-transform: uppercase;
}

.hud-value {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
}

/* In-game restart button */
.btn-restart-game {
  background: transparent;
  color: rgba(240, 240, 240, 0.45);
  border: 1px solid rgba(240, 240, 240, 0.15);
  border-radius: 10px;
  font-size: 0.82rem;
  min-height: 38px;
  padding: 0 18px;
  letter-spacing: 0.06em;
  transition: color 0.15s, border-color 0.15s;
}

.btn-restart-game:active {
  color: rgba(240, 240, 240, 0.9);
  border-color: rgba(240, 240, 240, 0.4);
}

/* ── Intersection SVG ───────────────────────────────────────────────────────── */
#intersection-svg {
  width: 70vmin;
  height: 70vmin;
  display: block;
}

/* ── Results screen ─────────────────────────────────────────────────────────── */
#results-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #1a1a1a;
  border-radius: 14px;
  padding: 20px 36px;
  width: 100%;
  max-width: 320px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.result-label {
  font-size: 1rem;
  opacity: 0.7;
}

.result-value {
  font-size: 2rem;
  font-weight: 700;
}

.result-value.correct { color: #66bb6a; }
.result-value.errors  { color: #ef5350; }

/* ── How to play ────────────────────────────────────────────────────────────── */
#how-to-play {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #1a1a1a;
  border-radius: 14px;
  padding: 20px 24px;
  max-width: 380px;
  width: 100%;
}

.htp-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.9;
}

.htp-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Round feedback flash ───────────────────────────────────────────────────── */
@keyframes flash-correct {
  0%   { background-color: #1b5e20; }
  100% { background-color: #2d2d2d; }
}

@keyframes flash-error {
  0%   { background-color: #b71c1c; }
  100% { background-color: #2d2d2d; }
}

.flash-correct { animation: flash-correct 0.38s ease-out forwards; }
.flash-error   { animation: flash-error   0.38s ease-out forwards; }
