@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&family=Barlow:wght@300;400;600&display=swap');

/* ── Root & reset ───────────────────────────────────────── */
#dr-root *, #dr-root *::before, #dr-root *::after { box-sizing: border-box; margin: 0; padding: 0; }

#dr-root {
  --bg:       #08090f;
  --city:     #0e1020;
  --road:     #151826;
  --lane:     #1e2235;
  --neon-y:   #ffe93d;
  --neon-o:   #ff6b1a;
  --neon-c:   #00e5ff;
  --neon-g:   #39ff7a;
  --neon-r:   #ff3a5c;
  --text:     #e8edf5;
  --muted:    #5a6080;
  --font-h:   'Orbitron', sans-serif;
  --font-b:   'Barlow', sans-serif;
  --r:        10px;

  font-family: var(--font-b);
  background:  var(--bg);
  color:       var(--text);
  border-radius: var(--r);
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ── Screens ────────────────────────────────────────────── */
.dr-screen { display: none; flex-direction: column; animation: drFade .3s ease; }
.dr-screen.active { display: flex; }
@keyframes drFade { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* ══ SPLASH ══════════════════════════════════════════════ */
#dr-splash {
  min-height: 480px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 24px;
  text-align: center;
  background:
    radial-gradient(ellipse 100% 60% at 50% 100%, #1a0a00 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 80%, #001a2a 0%, transparent 60%),
    var(--bg);
}

.dr-logo {
  font-family: var(--font-h);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 900;
  color: var(--neon-y);
  text-shadow: 0 0 20px var(--neon-y), 0 0 60px #ff6b1a88;
  line-height: 1;
  letter-spacing: 2px;
}
.dr-logo-sub {
  font-family: var(--font-h);
  font-size: clamp(.9rem, 3vw, 1.1rem);
  font-weight: 700;
  color: var(--neon-c);
  letter-spacing: 6px;
  text-shadow: 0 0 12px var(--neon-c);
  margin-top: 4px;
}
.dr-van-anim {
  font-size: 3.5rem;
  animation: drDrive 1.8s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 12px var(--neon-y));
}
@keyframes drDrive {
  from { transform: translateX(-16px) rotate(-2deg); }
  to   { transform: translateX(16px)  rotate(2deg);  }
}
.dr-tagline { color: var(--muted); font-size: .9rem; max-width: 320px; line-height: 1.65; }

.dr-howto {
  background: var(--city);
  border: 1px solid #ffffff11;
  border-radius: var(--r);
  padding: 14px 18px;
  font-size: .82rem;
  text-align: left;
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dr-howto b { color: var(--neon-y); }

/* ══ BUTTONS ══════════════════════════════════════════════ */
.dr-btn {
  font-family: var(--font-h);
  font-size: .82rem;
  font-weight: 700;
  border: none;
  border-radius: 7px;
  padding: 11px 26px;
  cursor: pointer;
  transition: transform .12s, filter .12s, box-shadow .12s;
  letter-spacing: 1px;
}
.dr-btn:hover  { transform: translateY(-2px); filter: brightness(1.15); }
.dr-btn:active { transform: translateY(0); }
.dr-btn-primary  { background: var(--neon-y);  color: #0a0800; box-shadow: 0 0 18px #ffe93d66; }
.dr-btn-danger   { background: var(--neon-r);  color: #fff;    box-shadow: 0 0 14px #ff3a5c55; }
.dr-btn-outline  { background: transparent; border: 2px solid var(--neon-c); color: var(--neon-c); }

/* ══ HUD ══════════════════════════════════════════════════ */
#dr-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--city);
  border-bottom: 1px solid #ffffff0d;
  flex-wrap: wrap;
}
.dr-hud-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-h);
  font-size: .72rem;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 5px;
  border: 1px solid #ffffff0f;
}
.dr-hud-item .lbl { color: var(--muted); font-size: .62rem; margin-right: 2px; }
.dr-hud-item.score .val { color: var(--neon-y); }
.dr-hud-item.lives .val { color: var(--neon-r); }
.dr-hud-item.level .val { color: var(--neon-c); }
.dr-hud-item.streak .val { color: var(--neon-g); }
.dr-hud-item.timer .val { color: var(--neon-o); }

/* ══ CANVAS AREA ══════════════════════════════════════════ */
#dr-game {
  position: relative;
  background: var(--bg);
}
#dr-canvas {
  display: block;
  width: 100%;
  touch-action: none;
}

/* ── Overlay messages ───────────────────────────────────── */
#dr-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #08090fcc;
  backdrop-filter: blur(3px);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
}
#dr-overlay.show { opacity: 1; pointer-events: auto; }
.dr-overlay-title {
  font-family: var(--font-h);
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 900;
  color: var(--neon-y);
  text-shadow: 0 0 20px var(--neon-y);
  letter-spacing: 2px;
}
.dr-overlay-sub { color: var(--muted); font-size: .88rem; }

/* ── Float labels ───────────────────────────────────────── */
.dr-float {
  position: absolute;
  font-family: var(--font-h);
  font-size: .85rem;
  font-weight: 700;
  pointer-events: none;
  animation: drFloat 1s ease forwards;
  z-index: 20;
}
@keyframes drFloat {
  from { opacity:1; transform: translateY(0) scale(1); }
  to   { opacity:0; transform: translateY(-50px) scale(1.3); }
}

/* ── Controls strip ─────────────────────────────────────── */
#dr-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--city);
  border-top: 1px solid #ffffff0d;
  gap: 10px;
}
.dr-ctrl-hint { font-size: .75rem; color: var(--muted); }
.dr-ctrl-hint kbd {
  background: var(--lane);
  border: 1px solid #ffffff15;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-h);
  font-size: .65rem;
  color: var(--neon-c);
}

/* Mobile arrow buttons */
#dr-arrow-btns {
  display: none;
  gap: 6px;
}
@media (max-width: 520px) { #dr-arrow-btns { display: flex; } }
.dr-arrow {
  width: 44px; height: 44px;
  background: var(--lane);
  border: 1px solid #ffffff15;
  border-radius: 8px;
  color: var(--neon-y);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s;
  -webkit-tap-highlight-color: transparent;
}
.dr-arrow:active { background: #2a3050; }

/* ══ END SCREEN ══════════════════════════════════════════ */
#dr-end {
  min-height: 480px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 24px;
  text-align: center;
  background: radial-gradient(ellipse 70% 50% at 50% 50%, #1a0f00, var(--bg));
}
.dr-end-icon { font-size: 3rem; animation: drDrive 1.5s ease-in-out infinite alternate; }
.dr-end-title {
  font-family: var(--font-h);
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  color: var(--neon-y);
  text-shadow: 0 0 20px var(--neon-y);
}
.dr-end-scores {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.dr-end-box {
  background: var(--city);
  border: 1px solid #ffffff0f;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.dr-end-val {
  font-family: var(--font-h);
  font-size: 1.4rem;
  color: var(--neon-c);
}
.dr-end-lbl { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.dr-end-grade {
  font-family: var(--font-h);
  font-size: 3.5rem;
  color: var(--neon-g);
  text-shadow: 0 0 24px var(--neon-g);
}
