:root {
  --bg: #04050c;
  --cyan: #00f0ff;
  --magenta: #ff2e93;
  --gold: #ffd13b;
  --green: #19ff8c;
  --red: #ff3b5c;
  --text: #f3f6ff;
  --dim: #8a97bf;
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Cascadia Mono', 'Consolas', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

#arena {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.hidden {
  display: none !important;
}

/* FLOATING HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 18px;
  pointer-events: none;
  z-index: 10;
}

.hud-left, .hud-center, .hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-block {
  display: flex;
  flex-direction: column;
  padding: 7px 14px;
  border-radius: 12px;
  background: rgba(6, 9, 22, 0.72);
  border: 1px solid rgba(0, 240, 255, 0.25);
  backdrop-filter: blur(6px);
  min-width: 165px;
}

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

.lbl {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--dim);
}

.combo-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
  color: #04050c;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
  box-shadow: 0 0 12px rgba(255, 46, 147, 0.6);
}

.score-val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.55);
}

.best-val {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan);
  margin-top: 2px;
}

/* CENTER OVERDRIVE + BOSS */
.hud-center {
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
}

.overdrive-wrap, .boss-wrap {
  width: 280px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(6, 9, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}

.boss-wrap {
  border-color: rgba(255, 59, 92, 0.55);
  box-shadow: 0 0 18px rgba(255, 59, 92, 0.25);
}

.od-header, .boss-header {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.4px;
  margin-bottom: 4px;
}

.od-lbl { color: var(--gold); }
.od-pct { font-family: var(--font-mono); color: #fff; }
.boss-header { color: var(--red); }

.od-bar-bg, .boss-bar-bg {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.od-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--gold), var(--magenta));
  box-shadow: 0 0 12px rgba(255, 209, 59, 0.7);
  transition: width 0.08s linear;
}

.boss-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff3b5c, #ff8a3b);
  box-shadow: 0 0 12px rgba(255, 59, 92, 0.75);
}

/* HUD RIGHT */
.weapon-badge {
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(6, 9, 22, 0.76);
  border: 1px solid rgba(0, 240, 255, 0.45);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
}

.hp-pips {
  display: flex;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(6, 9, 22, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hp-pip {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--green);
  box-shadow: 0 0 10px rgba(25, 255, 140, 0.7);
  transition: all 0.15s ease;
}

.hp-pip.lost {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.hud-btn {
  pointer-events: auto;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 12, 28, 0.85);
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hud-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.hud-btn.active {
  color: var(--cyan);
  border-color: rgba(0, 240, 255, 0.55);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

/* OVERLAY */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 14, 0.72);
  backdrop-filter: blur(6px);
  z-index: 25;
  padding: 20px;
}

.overlay-card {
  width: 100%;
  max-width: 560px;
  padding: 30px 28px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(16, 22, 48, 0.96), rgba(7, 10, 24, 0.98));
  border: 1px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.22), 0 24px 60px rgba(0, 0, 0, 0.75);
  text-align: center;
}

.ov-eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2.5px;
  color: var(--magenta);
  margin-bottom: 6px;
}

.ov-title {
  margin: 0;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1;
  background: linear-gradient(90deg, #fff 0%, var(--cyan) 45%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(0, 240, 255, 0.4));
}

.ov-sub {
  margin: 12px 0 20px;
  font-size: 14px;
  color: var(--dim);
  line-height: 1.45;
}

.ov-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--dim);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 900;
  margin-top: 2px;
}

.stat-num.gold { color: var(--gold); }
.stat-num.cyan { color: var(--cyan); }
.stat-num.magenta { color: var(--magenta); }

.controls-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-bottom: 22px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
}

.controls-strip b {
  color: var(--cyan);
}

.play-btn {
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffe259 0%, #ffa751 45%, #ff2e93 100%);
  color: #050611;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(255, 46, 147, 0.5);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 38px rgba(255, 209, 59, 0.7);
}

.play-btn:active {
  transform: scale(0.98);
}
