/* style.css — dark neon look, responsive, mobile friendly */

:root {
  --neon-cyan: #39f0ff;
  --neon-pink: #ff2d6f;
  --neon-yellow: #ffd23f;
  --neon-text: #cfe9ff;
  --bg: #04050e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--neon-text);
  font-family: 'Orbitron', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* The play field fills the whole viewport; HUD/screens float on top. */
#stage {
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, #0a1030 0%, #04050e 60%, #000 100%);
}

#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;          /* keep swipes from scrolling/zooming */
}

/* ------------------------------- HUD ------------------------------------- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 92px 8px 12px;
  pointer-events: none;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(57, 240, 255, 0.7);
  flex-wrap: wrap;
  transition: opacity 0.2s;
}
#hud.hidden { display: none; }

.hud-item {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 44px;
}
.hud-label {
  font-size: 10px;
  color: rgba(207, 233, 255, 0.55);
  letter-spacing: 2px;
}
.hud-value {
  font-size: clamp(14px, 4.5vw, 22px);
  color: var(--neon-cyan);
}
.hud-lives .hud-value { color: var(--neon-pink); }
.hud-level .hud-value { color: var(--neon-yellow); }
.hud-score { margin-left: auto; text-align: right; }
.hud-best { text-align: right; }
.hud-best .hud-value { color: #9bf6ff; }

#powerups {
  position: absolute;
  top: 46px; left: 12px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--neon-yellow);
  text-shadow: 0 0 8px rgba(255, 210, 63, 0.8);
  pointer-events: none;
}

#pause-btn {
  position: absolute;
  top: 10px; right: 12px;
  z-index: 5;
  pointer-events: auto;
  background: rgba(57, 240, 255, 0.08);
  border: 1px solid rgba(57, 240, 255, 0.5);
  color: var(--neon-cyan);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
}
#pause-btn.hidden { display: none; }
#pause-btn:active { background: rgba(57, 240, 255, 0.25); }

/* ---------------------------- Overlay screens ---------------------------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 14px;
  background: rgba(2, 3, 12, 0.72);
  backdrop-filter: blur(3px);
  z-index: 10;
}
.screen.hidden { display: none; }

.title {
  font-size: clamp(34px, 11vw, 84px);
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
  text-shadow:
    0 0 6px var(--neon-cyan),
    0 0 18px var(--neon-cyan),
    0 0 38px var(--neon-pink);
}
.title .accent { color: var(--neon-pink); text-shadow: 0 0 10px var(--neon-pink), 0 0 30px var(--neon-pink); }

.tag {
  font-size: clamp(12px, 3.5vw, 16px);
  color: var(--neon-yellow);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 210, 63, 0.8);
}

.big-num {
  font-size: clamp(28px, 8vw, 52px);
  font-weight: 800;
  color: var(--neon-cyan);
  text-shadow: 0 0 14px var(--neon-cyan);
}
.big-num .label { display: block; font-size: 12px; color: rgba(207,233,255,.6); letter-spacing: 3px; }

.new-best {
  color: var(--neon-yellow);
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 0 12px var(--neon-yellow);
  animation: pulse 0.8s infinite alternate;
}
.new-best.hidden { display: none; }

.instructions {
  margin-top: 8px;
  font-size: clamp(11px, 3vw, 14px);
  line-height: 1.9;
  color: rgba(207, 233, 255, 0.8);
  max-width: 36ch;
}
.instructions b { color: var(--neon-cyan); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 4px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 8px currentColor; background: currentColor; }
.dot.a { color: #ff3ea5; } .dot.b { color: #ffd23f; } .dot.c { color: #b14bff; }

.btn {
  margin-top: 6px;
  padding: 14px 34px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #02030a;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(57, 240, 255, 0.6), 0 0 30px rgba(255, 45, 111, 0.4);
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.btn:hover { box-shadow: 0 0 26px rgba(57, 240, 255, 0.9), 0 0 46px rgba(255, 45, 111, 0.6); }
.btn:active { transform: scale(0.94); }

.hint { font-size: 11px; letter-spacing: 2px; color: rgba(207,233,255,.5); }

@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }

/* ------------------------------ small phones ----------------------------- */
@media (max-width: 480px) {
  #powerups { font-size: 10px; }
  #hud { padding: 6px 78px 6px 8px; gap: 6px; }
  .instructions { max-width: 30ch; }
}

/* Touch devices: hint that you drag to fly */
@media (hover: none) and (pointer: coarse) {
  .hint.touch { display: block; }
}
@media (hover: hover) {
  .hint.touch { display: none; }
}
