/* Neon Drift — theme */
:root {
  --bg: #05060d;
  --cyan: #4de0ff;
  --green: #7dffc0;
  --pink: #ff5d9a;
  --orange: #ffb040;
  --purple: #c060ff;
  --gold: #ffe14d;
  --text: #e6ecff;
  --dim: #8a90b8;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#stage {
  position: relative;
  width: min(100vw - 20px, calc((100vh - 20px) * 8 / 5), 1000px);
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: #030409;
  box-shadow:
    0 0 0 1px rgba(77, 224, 255, 0.22),
    0 0 40px rgba(77, 224, 255, 0.08),
    0 24px 80px rgba(0, 0, 0, 0.7);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- HUD ---------- */

#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 18px;
  pointer-events: none;
  font-size: 13px;
  text-shadow: 0 0 8px rgba(77, 224, 255, 0.4);
}
#hud.hidden { display: none; }

.hud-left { text-align: left; }
.hud-mid { text-align: center; }
.hud-right { text-align: right; }
.hud-left > div, .hud-right > div { margin-bottom: 6px; }

.label {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 2px;
}
.val { font-size: 17px; font-weight: bold; color: var(--cyan); }

#wave {
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--orange);
  text-shadow: 0 0 10px rgba(255, 176, 64, 0.6);
}
#lives { font-size: 15px; color: var(--pink); letter-spacing: 3px; }
#bombs { font-size: 15px; letter-spacing: 2px; }
#shields { font-size: 13px; color: var(--green); margin-top: 4px; }

#buffs { margin-top: 6px; }
#buffs .buff {
  display: inline-block;
  margin: 0 3px;
  font-size: 11px;
  color: var(--gold);
  border: 1px solid rgba(255, 225, 77, 0.5);
  border-radius: 3px;
  padding: 1px 6px;
  background: rgba(255, 225, 77, 0.08);
}

/* ---------- Boss bar ---------- */

#boss-bar {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: 460px;
  max-width: 70vw;
  display: none;
  pointer-events: none;
  text-align: center;
}
#boss-name {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--purple);
  text-shadow: 0 0 10px rgba(192, 96, 255, 0.8);
  margin-bottom: 4px;
}
#boss-hp-container {
  height: 10px;
  border: 1px solid var(--purple);
  border-radius: 5px;
  background: rgba(192, 96, 255, 0.1);
  overflow: hidden;
}
#boss-hp-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  box-shadow: 0 0 12px var(--purple);
  transition: width 0.2s;
}

/* ---------- Mute ---------- */

#mute-btn {
  position: absolute;
  bottom: 10px; right: 12px;
  background: none;
  border: 1px solid var(--dim);
  color: var(--dim);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  z-index: 20;
}
#mute-btn:hover { color: var(--cyan); border-color: var(--cyan); }

/* ---------- Screens ---------- */

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 13, 0.88);
  z-index: 10;
  text-align: center;
  padding: 24px;
}

.screen h1 {
  font-size: 52px;
  letter-spacing: 8px;
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(77, 224, 255, 0.8), 0 0 60px rgba(77, 224, 255, 0.4);
  margin-bottom: 8px;
}
.screen h2 {
  font-size: 30px;
  letter-spacing: 5px;
  color: var(--orange);
  text-shadow: 0 0 16px rgba(255, 176, 64, 0.7);
  margin-bottom: 14px;
}
.screen h3 { font-size: 14px; color: var(--dim); font-weight: normal; letter-spacing: 2px; }
.screen p { margin-bottom: 10px; color: var(--dim); font-size: 14px; }
.screen p strong { color: var(--text); }
.controls { font-size: 12px; color: var(--dim); }

.btn {
  background: none;
  border: 2px solid var(--green);
  color: var(--green);
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 3px;
  padding: 10px 30px;
  border-radius: 4px;
  cursor: pointer;
  margin: 8px;
  text-shadow: 0 0 10px rgba(125, 255, 192, 0.6);
  transition: all 0.15s;
}
.btn:hover {
  background: rgba(125, 255, 192, 0.12);
  box-shadow: 0 0 20px rgba(125, 255, 192, 0.5);
}
.btn.pink {
  border-color: var(--pink);
  color: var(--pink);
  text-shadow: 0 0 10px rgba(255, 93, 154, 0.6);
}
.btn.pink:hover {
  background: rgba(255, 93, 154, 0.12);
  box-shadow: 0 0 20px rgba(255, 93, 154, 0.5);
}

/* ---------- Score entry & list ---------- */

.score-entry { display: none; gap: 8px; margin: 10px 0; }
.score-entry input {
  background: none;
  border: 1px solid var(--dim);
  color: var(--text);
  font-family: inherit;
  font-size: 18px;
  letter-spacing: 6px;
  width: 90px;
  text-align: center;
  text-transform: uppercase;
  padding: 6px;
  border-radius: 3px;
}
.score-entry input:focus { outline: none; border-color: var(--green); }

.score-list {
  list-style: none;
  margin: 10px 0;
  min-width: 240px;
  text-align: left;
}
.score-list li {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 14px;
  padding: 2px 8px;
}
.score-list li span:first-child { color: var(--pink); }
.score-list li span:last-child { color: var(--green); }

@media (max-width: 700px) {
  .screen h1 { font-size: 34px; }
  #hud { font-size: 11px; padding: 8px 10px; }
  .val { font-size: 14px; }
}

/* ---------- top bar (back to game menu) ---------- */
#topbar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 8;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(77, 224, 255, 0.3);
  background: rgba(5, 6, 13, 0.6);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
  line-height: 1;
}
.icon-btn:hover { background: rgba(77, 224, 255, 0.18); }

.back-link { color: var(--dim); font-size: 12px; text-decoration: none; }
.back-link:hover { color: var(--cyan); }
