:root {
  --cyan: #2ee8e0;
  --cyan-hot: #7af8f0;
  --cyan-dim: #1aa8a8;
  --yellow: #ffe83c;
  --gold: #e8c400;
  --orange: #ff8d00;
  --hot: #ff3507;
  --magenta: #c84aff;
  --pink: #c04880;
  --lane2: #b03a78;
  --lane3: #b89830;
  --lane4: #3cb060;
  --hull: #2ad4e8;
  --temp: #f0a020;
  --panel: rgba(8, 12, 20, 0.88);
  --panel-2: rgba(10, 14, 24, 0.92);
  --stroke: #2ee8e0;
  --white: #e8f0f8;
  --muted: #8da3c0;
  --bg: #080c14;
}

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

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

#stage {
  position: fixed;
  inset: 0;
  background: #080c14;
}

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

.hidden { display: none !important; }

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

#float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}
.floater {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  pointer-events: none;
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px currentColor, 0 2px 0 #000;
}
.floater.perf { color: #7af8f0; font-size: 18px; }
.floater.great { color: #7cff9a; font-size: 16px; }
.floater.good { color: #ffe83c; font-size: 15px; }
.floater.miss { color: #ff5a4a; font-size: 16px; }
.floater.relic { color: #ffe83c; font-size: 20px; }

/* ========== TOP BAR ========== */
#hud { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
#hud button, #hud .lane-btn { pointer-events: auto; }

#topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 12px 8px;
  background: linear-gradient(180deg, rgba(6,10,20,0.96) 0%, rgba(6,10,20,0.82) 70%, rgba(6,10,20,0) 100%);
  pointer-events: none;
}

#top-cyan-line {
  position: absolute;
  top: 60px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #2ee8e0 8%, #2ee8e0 92%, transparent 100%);
  box-shadow: 0 0 10px #2ee8e0;
  z-index: 9;
  pointer-events: none;
}

#title-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #e8c400;
  background: #05070e;
  padding: 4px 10px 4px 6px;
  min-width: 268px;
  height: 48px;
  box-shadow: 0 0 0 1px #000 inset;
}
#title-icon {
  width: 28px; height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}
.title-main {
  font-family: "Orbitron", "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1.1;
}
.title-sub {
  font-family: "Share Tech Mono", monospace;
  font-size: 8px;
  color: #8da3c0;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

#score-block { min-width: 120px; }
.score-lab {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #8da3c0;
  font-weight: 700;
}
.score-num {
  font-family: "Rajdhani", "Exo 2", "Arial Black", sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: #ffe83c;
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(255,232,60,0.45);
}

#combo-box {
  border: 2px solid #c84aff;
  background: #1a0830;
  padding: 3px 10px 4px;
  min-width: 148px;
  box-shadow: 0 0 12px rgba(200,74,255,0.25);
}
.combo-head {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #d8b0ff;
  font-weight: 700;
}
.combo-mult {
  background: #e060d0;
  color: #1a0820;
  font-weight: 800;
  padding: 0 5px;
  font-size: 9px;
}
.combo-val {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.04em;
}

#depth-block { flex: 1; min-width: 220px; max-width: 360px; }
.depth-lab {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #c8d8e8;
  font-weight: 700;
}
.zone-tag { color: #2ee8e0; margin-left: 6px; }
.depth-track {
  position: relative;
  height: 10px;
  background: #0a1018;
  border: 1px solid #1a2838;
  margin-top: 4px;
  overflow: visible;
}
.depth-track i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1aa8a0, #2ee8e0);
  box-shadow: 0 0 8px #2ee8e0;
}
#depth-notch {
  position: absolute;
  top: -4px;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid #ffe83c;
  transform: translateX(-5px);
  filter: drop-shadow(0 0 4px #ffe83c);
}

#relic-block { min-width: 220px; }
.relic-lab {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #ffe83c;
  font-weight: 700;
  text-align: center;
}
.relic-row {
  display: flex;
  gap: 4px;
  margin-top: 3px;
  justify-content: center;
}
.relic-row img {
  width: 24px; height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
  background: #0a1018;
  border: 1px solid #1a2434;
}

#bpm-box {
  border: 1px solid #3a4860;
  background: rgba(10,16,28,0.9);
  padding: 6px 12px;
  min-width: 150px;
  text-align: right;
}
.bpm-row {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #ff5a6a;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.bpm-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #ff3a4a;
  box-shadow: 0 0 8px #ff3a4a;
  display: inline-block;
}
.bpm-track {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #8da3c0;
  font-weight: 700;
}

/* ========== LEFT PANEL ========== */
#left-panel {
  position: absolute;
  top: 72px;
  left: 10px;
  width: 292px;
  background: var(--panel);
  border: 2px solid #2ee8e0;
  box-shadow: 0 0 0 1px #041018, 0 12px 40px rgba(0,0,0,0.55);
  padding: 8px 10px 10px;
  pointer-events: none;
}
.lp-head {
  display: inline-block;
  background: #0a1820;
  border: 1px solid #2ee8e0;
  color: #2ee8e0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  margin: -16px 0 8px 6px;
  position: relative;
  top: -2px;
}
.sec-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}
.fuel-warn {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ff4a3a;
  margin: 2px 0 6px;
}
.fuel-warn.ok { color: #7cff9a; }
.fuel-warn.warn { color: #ff8d00; }
.fuel-cells {
  display: flex;
  gap: 3px;
  height: 16px;
  background: #0a1018;
  border: 1px solid #2a3848;
  padding: 2px;
}
.fuel-cells i {
  flex: 1;
  background: #1a2430;
}
.fuel-cells i.on.red { background: #ff3507; box-shadow: 0 0 6px #ff3507; }
.fuel-cells i.on.yellow { background: #ffbb00; box-shadow: 0 0 6px #ffbb00; }
.fuel-cells i.on.green { background: #3cb060; }
.fuel-cons {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #8da3c0;
  margin: 4px 0 10px;
  font-weight: 700;
}

.overdrive {
  border: 2px solid #e8a010;
  background: #120c08;
  padding: 6px 8px 8px;
  margin-bottom: 10px;
}
.overdrive.active {
  border-color: #ff8d00;
  box-shadow: 0 0 16px rgba(255,141,0,0.35);
  background: #1a1008;
}
.od-title {
  background: #ff8d00;
  color: #1a0a00;
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 12px;
  text-align: center;
  padding: 3px 4px;
  margin: -6px -8px 8px;
}
.overdrive:not(.active) .od-title {
  background: #3a3018;
  color: #c8b070;
}
.od-keyrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.od-key {
  border: 1px solid #e8c400;
  color: #e8c400;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  letter-spacing: 0.06em;
}
.od-state {
  color: #c8b070;
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 12px;
}
.overdrive.active .od-state { color: #ffe83c; }
.od-h {
  color: #7cff9a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.od-h.risk { color: #ff8d00; }
.overdrive ul {
  list-style: none;
  font-size: 11px;
  color: #d0c8b0;
  line-height: 1.35;
  margin: 0 0 6px 2px;
  font-weight: 600;
}
.overdrive:not(.active) .od-col { opacity: 0.45; }

.bar-block { margin-bottom: 6px; }
.bar-lab {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  display: flex;
  justify-content: space-between;
  color: #d0dce8;
}
.bar-lab .hot, #hud-temp.hot { color: #ff8d00; }
.bar-track {
  height: 8px;
  background: #0a1018;
  border: 1px solid #1a2838;
  margin-top: 3px;
}
.bar-track i { display: block; height: 100%; width: 100%; }
.bar-track.hull i { background: #2ad4e8; box-shadow: 0 0 8px #2ad4e8; }
.bar-track.temp i { background: #f0a020; box-shadow: 0 0 8px #f0a020; }

.chisel-box {
  border: 1px solid #2ee8e0;
  background: #0a121c;
  padding: 6px 8px;
  margin-top: 8px;
}
.chisel-lab {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #8da3c0;
  font-weight: 700;
}
.chisel-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}
.chisel-perk {
  font-size: 11px;
  color: #7cff9a;
  font-weight: 700;
}

/* ========== GOLEM / JUDGE / SLAM ========== */
#golem-plate {
  position: absolute;
  top: 24%;
  right: 16%;
  width: 220px;
  pointer-events: none;
}
.golem-name {
  background: #2a0808;
  border: 1px solid #e04030;
  color: #ffe8a0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 3px 6px;
}
.golem-track {
  height: 7px;
  background: #180808;
  border: 1px solid #e04030;
  border-top: none;
}
.golem-track i {
  display: block;
  height: 100%;
  width: 100%;
  background: #e04030;
  box-shadow: 0 0 8px #e04030;
}

#judge-pop {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  border: 2px solid #2ee8e0;
  background: rgba(8, 16, 24, 0.92);
  padding: 6px 22px 8px;
  text-align: center;
  pointer-events: none;
  z-index: 12;
  box-shadow: 0 0 20px rgba(46,232,224,0.35);
}
.jp-main {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #2ee8e0;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px #2ee8e0;
}
.jp-sub {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.08em;
}
#judge-pop.great .jp-main { color: #7cff9a; }
#judge-pop.good .jp-main { color: #ffe83c; }
#judge-pop.miss .jp-main { color: #ff5a4a; border-color: #ff5a4a; }

#slam-box {
  position: absolute;
  right: 28%;
  bottom: 28%;
  width: 170px;
  border: 2px solid #e04030;
  background: rgba(40, 8, 8, 0.78);
  color: #ffd0a0;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 12px;
  text-align: center;
  padding: 18px 8px;
  pointer-events: none;
}

/* ========== BOTTOM LANE HUD ========== */
#lane-hud {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(860px, 62vw);
  background: var(--panel-2);
  border: 2px solid #2ee8e0;
  padding: 10px 12px 8px;
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.lh-head {
  position: absolute;
  top: -11px;
  left: 14px;
  background: #0a1820;
  border: 1px solid #2ee8e0;
  color: #2ee8e0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 1px 8px;
}
.lh-body {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.lane-btn {
  flex: 1;
  background: #0c1018;
  border: 2px solid #2ee8e0;
  color: #fff;
  padding: 8px 6px;
  text-align: left;
  pointer-events: auto;
  min-height: 56px;
}
.lane-btn.l2 { border-color: #c04880; }
.lane-btn.l3 { border-color: #b89830; }
.lane-btn.l4 { border-color: #3cb060; }
.lane-btn.hit {
  filter: brightness(1.5);
  box-shadow: 0 0 16px currentColor;
}
.lane-btn.l1.hit { background: #083038; }
.lane-btn.l2.hit { background: #3a1830; }
.lane-btn.l3.hit { background: #3a3010; }
.lane-btn.l4.hit { background: #0c2818; }
.lane-btn.active-hit {
  background: #3a1830;
}
.lane-btn.l2.active-hit { background: #6a2850; }
.lane-btn.l3.active-hit { background: #6a5818; color: #fff; }
.lb-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.lb-sub {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #8da3c0;
  font-weight: 700;
  margin-top: 2px;
}
.lane-btn.active-hit .lb-sub { color: #fff; }

.timing-box {
  width: 168px;
  border: 2px solid #2ee8e0;
  padding: 6px 8px;
  background: #0c1018;
}
.tb-lab {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #c8d8e8;
  margin-bottom: 4px;
}
.tb-bar {
  position: relative;
  display: flex;
  height: 12px;
  overflow: hidden;
  border: 1px solid #1a2434;
}
.tb-bar .seg { flex: 1; display: block; }
.seg.miss-l, .seg.miss-r { background: #a02020; }
.seg.good-l, .seg.good-r { background: #e8c400; }
.seg.great-l, .seg.great-r { background: #40c0e0; }
.seg.perf { background: #2ee8e0; flex: 0.7; }
#tb-needle {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 3px;
  background: #fff;
  left: 50%;
  box-shadow: 0 0 6px #fff;
}
.tb-dev {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-top: 4px;
  color: #c8d8e8;
}
.lh-foot {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #8da3c0;
  font-weight: 700;
}

/* ========== RADAR ========== */
#radar-panel {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 292px;
  background: var(--panel);
  border: 2px solid #2ee8e0;
  padding: 12px 10px 8px;
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.rp-head {
  position: absolute;
  top: -11px;
  left: 12px;
  background: #0a1820;
  border: 1px solid #2ee8e0;
  color: #2ee8e0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 1px 8px;
}
.rp-body { display: flex; gap: 8px; align-items: center; }
#radar {
  width: 118px; height: 118px;
  background: #080c14;
}
.rp-legend { flex: 1; }
.leg-title {
  color: #2ee8e0;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 12px;
  margin-bottom: 4px;
}
.leg { font-size: 11px; font-weight: 700; line-height: 1.45; }
.leg.gold { color: #e8c400; }
.leg.teal { color: #2ee8e0; }
.leg.red { color: #e04030; }
.rp-haz {
  margin-top: 8px;
  border: 2px solid #e04030;
  background: #180808;
  color: #e8c400;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 6px 6px;
  opacity: 0.25;
}
.rp-haz.on {
  opacity: 1;
  animation: hazblink 0.4s steps(2) infinite;
}
@keyframes hazblink {
  50% { background: #3a1010; }
}

/* ========== MENU / PAUSE / RESULTS ========== */
#menu, #pause, #results {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 14, 0.72);
  pointer-events: auto;
}
.menu-card {
  width: min(640px, 92vw);
  background: rgba(8, 12, 20, 0.94);
  border: 2px solid #2ee8e0;
  box-shadow: 0 0 0 1px #041018, 0 20px 60px rgba(0,0,0,0.6);
  padding: 22px 26px 20px;
  text-align: center;
}
.menu-card.slim { width: min(420px, 90vw); }
.menu-title-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px solid #e8c400;
  background: #05070e;
  padding: 8px 14px;
  margin-bottom: 14px;
}
.menu-title-box img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.mt-main {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.1em;
}
.mt-sub {
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  color: #8da3c0;
  letter-spacing: 0.08em;
  margin-top: 4px;
}
.menu-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  height: 150px;
  margin: 8px 0 12px;
}
.menu-art img {
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.6));
}
#menu-ex { height: 130px; }
#menu-go { height: 150px; }
.menu-blurb {
  font-size: 14px;
  line-height: 1.45;
  color: #c8d4e0;
  margin-bottom: 16px;
  font-weight: 600;
}
#btn-play, #btn-again, #btn-resume, #btn-quit {
  display: inline-block;
  background: #ff8d00;
  color: #1a0a00;
  border: none;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 14px;
  padding: 10px 22px;
  margin: 4px;
}
#btn-play:hover, #btn-again:hover, #btn-resume:hover { filter: brightness(1.15); }
#btn-quit.ghost {
  background: transparent;
  color: #8da3c0;
  border: 1px solid #3a4860;
}
.menu-keys {
  margin-top: 14px;
  font-size: 12px;
  color: #8da3c0;
  font-weight: 700;
  line-height: 1.6;
}
kbd {
  display: inline-block;
  border: 1px solid #2ee8e0;
  color: #2ee8e0;
  padding: 0 5px;
  margin: 0 2px;
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
}

.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #8da3c0;
  font-weight: 700;
}
.res-grid b {
  display: block;
  color: #ffe83c;
  font-family: "Orbitron", sans-serif;
  font-size: 18px;
  margin-top: 2px;
}

@media (max-width: 1280px) {
  #left-panel { width: 250px; transform: scale(0.9); transform-origin: top left; }
  #lane-hud { width: min(760px, 70vw); }
  .title-main { font-size: 11px; }
  .score-num { font-size: 20px; }
}
@media (max-width: 900px) {
  #left-panel { display: none; }
  #radar-panel { transform: scale(0.8); transform-origin: bottom right; }
  #lane-hud { width: 96vw; }
}
