:root {
  --cyan: #00e8f8;
  --cyan-hot: #5cfff8;
  --cyan-deep: #00c8d8;
  --magenta: #ff2ec8;
  --magenta-hot: #ff4ae0;
  --pink: #ff3d9b;
  --gold: #ffd020;
  --gold-hot: #ffe14a;
  --orange: #ff8a28;
  --navy: #050816;
  --panel: rgba(4, 10, 28, 0.82);
  --white: #f4fbff;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #020510;
  color: var(--white);
  font-family: "Exo 2", "Rajdhani", "Trebuchet MS", sans-serif;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  background: #020814;
}

#c {
  display: block;
  width: 100%;
  height: 100%;
}

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }

/* ========== FLOATING WORLD LABELS ========== */
#float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
.floater {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  pointer-events: none;
  font-family: "Orbitron", "Audiowide", sans-serif;
  letter-spacing: 0.06em;
}
.floater.plat-tag {
  background: rgba(40, 4, 28, 0.82);
  border: 1.5px solid #ff2ea8;
  padding: 8px 16px 7px;
  text-align: center;
  box-shadow: 0 0 16px rgba(255, 40, 160, 0.35);
}
.floater.plat-tag .t1 {
  display: block;
  color: #ff6ad0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.floater.plat-tag .t2 {
  display: block;
  color: #ff8ae0;
  font-size: 9px;
  letter-spacing: 0.14em;
  margin-top: 2px;
}
.floater.metro-tag {
  background: rgba(4, 28, 40, 0.82);
  border: 1.5px solid #00e8f8;
  padding: 8px 16px 7px;
  text-align: center;
  box-shadow: 0 0 16px rgba(0, 220, 240, 0.35);
}
.floater.metro-tag .t1 {
  display: block;
  color: #7ef8ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.floater.metro-tag .t2 {
  display: block;
  color: #b8f6ff;
  font-size: 9px;
  letter-spacing: 0.12em;
  margin-top: 2px;
}
.floater.bridge-tag {
  background: rgba(4, 30, 42, 0.78);
  border: 1px solid #2ad8e8;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 9px;
  color: #b8f8ff;
  letter-spacing: 0.12em;
}
.floater.crit {
  font-weight: 900;
  font-size: 22px;
  color: #ffe14a;
  text-shadow: 0 0 14px #ffb000, 0 2px 0 #201000;
  background: rgba(20, 12, 0, 0.72);
  border: 1.5px solid #ffe14a;
  padding: 6px 12px 5px;
}
.floater.crit .sub {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #ffc860;
  margin-top: 2px;
}
.floater.dmg {
  font-weight: 800;
  font-size: 16px;
  color: #7ef6ff;
  text-shadow: 0 0 10px #00e8f4, 0 2px 0 #001018;
}
.floater.lock {
  font-size: 11px;
  color: #ff4d6a;
  letter-spacing: 0.12em;
  font-weight: 700;
}
.floater.reticle {
  width: 72px;
  height: 72px;
  border: 2px dashed rgba(255, 50, 70, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(255, 40, 70, 0.4);
}
.floater.reticle::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #ffe14a;
  box-shadow: 0 0 8px #ffe14a;
}
.floater.hp-mini {
  width: 88px;
  height: 6px;
  background: rgba(20, 0, 8, 0.7);
  border: 1px solid rgba(255, 40, 80, 0.5);
  transform: translate(-50%, -140%);
  padding: 0;
}
.floater.hp-mini i {
  display: block;
  height: 100%;
  width: 70%;
  background: linear-gradient(90deg, #ff2a50, #ff6a30);
}

/* ========== HUD ========== */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

#hud-tl {
  position: absolute;
  top: 1.4%;
  left: 1.2%;
}
.conductor-panel {
  display: flex;
  gap: 12px;
  align-items: center;
  background: linear-gradient(180deg, rgba(6, 18, 36, 0.88), rgba(4, 10, 28, 0.84));
  border: 1.6px solid rgba(0, 224, 238, 0.8);
  border-radius: 14px;
  padding: 10px 16px 10px 10px;
  min-width: 430px;
  box-shadow: 0 0 22px rgba(0, 200, 230, 0.22), inset 0 0 18px rgba(0, 80, 120, 0.18);
}
.portrait-wrap {
  position: relative;
  flex-shrink: 0;
  width: 78px;
  height: 78px;
}
.portrait-ring {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2.5px solid var(--cyan);
  background: radial-gradient(circle at 40% 35%, #163048, #061018);
  overflow: hidden;
  box-shadow: 0 0 14px rgba(0, 232, 244, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.portrait-ring img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px #00e8f4);
}
.p1-badge {
  position: absolute;
  right: -6px;
  bottom: 4px;
  background: #ff2ea8;
  color: #fff;
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 7px 1px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(255, 46, 168, 0.7);
}
.conductor-body { flex: 1; min-width: 0; }
.name-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.name-stack { display: flex; flex-direction: column; line-height: 1.05; }
.name-ghost, .name-cond {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.16em;
  color: #e8fbff;
  text-shadow: 0 0 8px rgba(0, 220, 255, 0.45);
}
.lives-wrap {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.hearts {
  color: #ffc020;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-shadow: 0 0 8px #ffb000;
}
.lives-lab {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #9ab0c4;
  font-weight: 600;
}
.bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 4px 0;
}
.bar-track {
  height: 11px;
  border-radius: 6px;
  background: rgba(8, 16, 32, 0.9);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
}
.bar-track i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 6px;
  transform-origin: left center;
}
.hp-track i {
  background: linear-gradient(90deg, #00e0d4, #3cfff8);
  box-shadow: 0 0 8px #00e8f8;
}
.resin-track i {
  background: linear-gradient(90deg, #ff2ea8, #ff6a40, #ffaa30);
  box-shadow: 0 0 8px #ff4a80;
}
.bar-num {
  font-family: "Share Tech Mono", "Orbitron", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #c8f4ff;
  white-space: nowrap;
  min-width: 118px;
  text-align: right;
}
.resin-num { color: #ffb0e0; }

/* ----- title ----- */
#hud-title {
  position: absolute;
  top: 1.2%;
  left: 50%;
  transform: translateX(-50%);
}
.title-banner {
  background: linear-gradient(180deg, rgba(6, 16, 36, 0.86), rgba(4, 10, 28, 0.8));
  border: 1.6px solid rgba(0, 224, 238, 0.78);
  border-radius: 14px;
  padding: 8px 36px 8px;
  min-width: 560px;
  text-align: center;
  box-shadow: 0 0 22px rgba(0, 200, 230, 0.2);
}
.title-word {
  font-family: "Orbitron", "Audiowide", sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.28em;
  display: flex;
  justify-content: center;
  gap: 0.45em;
}
.title-word.big { font-size: 32px; letter-spacing: 0.22em; }
.t-cyan { color: #00e8f8; text-shadow: 0 0 12px #00e8f8; }
.t-white { color: #f4fbff; text-shadow: 0 0 10px rgba(200, 240, 255, 0.5); }
.t-mag { color: #ff4ad4; text-shadow: 0 0 12px #ff2ec8; }
.title-sub {
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: "Share Tech Mono", "Orbitron", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2dff8a;
  box-shadow: 0 0 8px #2dff8a;
  display: inline-block;
}
.sub-gold { color: #ffc020; }
.sub-wave { color: #ffe14a; }
.sub-clock { color: #00e8f8; }

/* ----- score + radar ----- */
#hud-tr {
  position: absolute;
  top: 1.3%;
  right: 1.3%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.score-panel {
  background: linear-gradient(180deg, rgba(10, 14, 28, 0.86), rgba(6, 8, 22, 0.82));
  border: 1.6px solid rgba(255, 200, 40, 0.45);
  border-radius: 12px;
  padding: 8px 18px 10px;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 0 18px rgba(255, 180, 20, 0.15);
}
.score-lab {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #c8d0dc;
  font-weight: 700;
}
.score-num {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: #ffd020;
  letter-spacing: 0.08em;
  text-shadow: 0 0 14px #ffb000;
  line-height: 1.15;
}
.combo-pill {
  margin-top: 4px;
  display: inline-block;
  background: linear-gradient(90deg, #c020ff, #ff40c0);
  color: #fff;
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 3px 12px 2px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255, 40, 180, 0.45);
}
.radar-wrap {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 2.5px solid #00e8f8;
  background: radial-gradient(circle, rgba(4, 20, 36, 0.7), rgba(2, 8, 18, 0.9));
  box-shadow: 0 0 16px rgba(0, 220, 240, 0.35);
  overflow: hidden;
}
.radar-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ----- objective ----- */
#hud-obj {
  position: absolute;
  top: 18%;
  right: 1.4%;
}
.obj-panel {
  background: rgba(4, 12, 28, 0.82);
  border: 1.5px solid rgba(0, 224, 238, 0.7);
  border-radius: 10px;
  padding: 10px 14px 12px;
  max-width: 280px;
  box-shadow: 0 0 16px rgba(0, 180, 220, 0.18);
}
.obj-head {
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #00e8f8;
  margin-bottom: 6px;
  font-weight: 700;
}
.obj-body {
  font-size: 12px;
  line-height: 1.4;
  color: #d8eef8;
  font-weight: 600;
}

/* ----- event log ----- */
#hud-log {
  position: absolute;
  left: 1.3%;
  bottom: 3.2%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 340px;
}
.log-line {
  display: flex;
  align-items: stretch;
  background: rgba(4, 10, 24, 0.82);
  border-radius: 4px;
  overflow: hidden;
  font-size: 12px;
  color: #d0e4f0;
  min-height: 22px;
  opacity: 0;
  transition: opacity 0.25s;
}
.log-line.on { opacity: 1; }
.log-line i.tick {
  width: 5px;
  flex-shrink: 0;
}
.log-line i.tick.cyan { background: #00e8f8; }
.log-line i.tick.mag { background: #ff2ea8; }
.log-line i.tick.gold { background: #ffd020; }
.log-line span {
  padding: 4px 10px;
  font-weight: 600;
}

/* ----- abilities ----- */
#hud-abil {
  position: absolute;
  left: 50%;
  bottom: 2.2%;
  transform: translateX(-50%);
  pointer-events: auto;
}
.abil-bar {
  display: flex;
  gap: 8px;
  background: linear-gradient(180deg, rgba(6, 12, 28, 0.9), rgba(4, 8, 22, 0.92));
  border: 1.6px solid rgba(0, 200, 220, 0.45);
  border-radius: 12px;
  padding: 8px 12px 8px;
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.45);
}
.abil-slot {
  pointer-events: auto;
  background: transparent;
  border: 0;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 78px;
  padding: 2px 4px;
  opacity: 1;
  transition: filter 0.15s, transform 0.1s;
}
.abil-slot:hover { filter: brightness(1.15); }
.abil-slot.cd { opacity: 0.45; }
.abil-slot.active .abil-ico {
  box-shadow: 0 0 14px #00e8f8;
}
.abil-key {
  font-family: "Orbitron", sans-serif;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #9ec8d8;
  font-weight: 700;
}
.abil-key.key-gold { color: #ffd020; }
.abil-ico {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 1.6px solid #00e8f8;
  background: rgba(4, 16, 32, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.abil-ico img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 0 4px #00e8f8);
}
.ico-pink {
  border-color: #ff2ea8;
  background: linear-gradient(180deg, #3a1030, #1a0818);
}
.ico-pink img { filter: drop-shadow(0 0 4px #ff4ad0); }
.ico-gold {
  border-color: #ffd020;
  background: linear-gradient(180deg, #2a2208, #141008);
}
.ico-gold img { filter: drop-shadow(0 0 4px #ffd020); }
.slot-gold .abil-ico {
  border-color: #ffd020;
  box-shadow: 0 0 10px rgba(255, 200, 30, 0.35);
}
.abil-name {
  font-family: "Orbitron", sans-serif;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: #c8e8f4;
  font-weight: 700;
  white-space: nowrap;
}
.slot-pink .abil-name { color: #ff6ad0; }
.slot-gold .abil-name { color: #ffd020; }

/* ========== MENU / RESULTS ========== */
#menu, #results {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(0, 30, 50, 0.45), rgba(0, 4, 12, 0.72));
}
.menu-card {
  text-align: center;
  background: linear-gradient(180deg, rgba(6, 16, 36, 0.92), rgba(4, 8, 22, 0.94));
  border: 1.8px solid rgba(0, 224, 238, 0.75);
  border-radius: 16px;
  padding: 28px 42px 32px;
  max-width: 640px;
  box-shadow: 0 0 40px rgba(0, 180, 220, 0.25);
}
.menu-hero {
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px #00e8f8);
  margin-bottom: 10px;
}
.menu-sub {
  margin-top: 8px;
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.16em;
  color: #ffc020;
  font-size: 12px;
}
.menu-blurb {
  margin: 16px auto 18px;
  max-width: 480px;
  color: #d0e4f0;
  font-size: 14px;
  line-height: 1.5;
}
.menu-blurb b { color: #00e8f8; }
#btn-play, #btn-again {
  pointer-events: auto;
  background: linear-gradient(90deg, #00c8e0, #00e8f8);
  color: #041018;
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 14px;
  border: 0;
  border-radius: 8px;
  padding: 12px 28px;
  box-shadow: 0 0 18px rgba(0, 232, 248, 0.45);
}
#btn-play:hover, #btn-again:hover { filter: brightness(1.1); }
.menu-controls {
  margin-top: 16px;
  font-size: 12px;
  color: #9ab0c0;
  line-height: 1.7;
}
.menu-controls kbd {
  display: inline-block;
  background: rgba(0, 40, 60, 0.7);
  border: 1px solid #00c8d8;
  border-radius: 3px;
  padding: 0 6px;
  color: #00e8f8;
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
}
.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin: 18px 0 20px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #b8c8d4;
}
.res-grid b {
  display: block;
  color: #00e8f8;
  font-family: "Orbitron", sans-serif;
  font-size: 18px;
  margin-top: 2px;
}

#toast, #wave-banner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  pointer-events: none;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.14em;
  text-align: center;
}
#toast {
  bottom: 22%;
  background: rgba(4, 10, 24, 0.85);
  border: 1px solid #00e8f8;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  color: #e8fbff;
}
#wave-banner {
  top: 28%;
  font-size: 36px;
  font-weight: 800;
  color: #00e8f8;
  text-shadow: 0 0 22px #00e8f8;
}

@media (max-width: 1200px) {
  .conductor-panel { min-width: 360px; transform: scale(0.9); transform-origin: top left; }
  .title-banner { min-width: 420px; transform: scale(0.88); }
  .abil-slot { min-width: 64px; }
  .abil-ico { width: 44px; height: 44px; }
}
