:root {
  --cyan: #00e7f5;
  --cyan-hot: #7af6ff;
  --cyan-deep: #00b8d4;
  --teal: #3ee8c8;
  --magenta: #ff2ea8;
  --magenta-hot: #ff5ad8;
  --pink: #ff4aa8;
  --gold: #f0c430;
  --gold-hot: #ffe05a;
  --orange: #ff9a28;
  --green: #3ee070;
  --green-bar: #2ad060;
  --purple: #c44cff;
  --navy: #040b18;
  --panel: rgba(4, 12, 28, 0.78);
  --panel-2: rgba(6, 16, 36, 0.86);
  --ink: #e8f6ff;
  --muted: #6aa8c8;
  --sub: #7ab0d8;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #040b18;
  color: var(--ink);
  font-family: "Rajdhani", "Exo 2", "Segoe UI", sans-serif;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  background: #040b18;
}

#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: 7;
  overflow: hidden;
}

.floater {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  pointer-events: none;
  font-family: "Orbitron", "Share Tech Mono", sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  filter: drop-shadow(0 0 10px currentColor);
}
.floater .amt {
  font-size: 22px;
  line-height: 1;
}
.floater .tag {
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  margin-top: 4px;
  font-weight: 700;
}
.floater.mag {
  color: #ffe8ff;
}
.floater.mag .box {
  background: linear-gradient(180deg, rgba(90, 10, 70, 0.92), rgba(40, 4, 36, 0.92));
  border: 2px solid #ff4ad4;
  box-shadow: 0 0 18px #ff2ea8aa, inset 0 0 12px #ff4ad444;
  border-radius: 10px;
  padding: 8px 16px 8px;
}
.floater.sol {
  color: #fff6c8;
}
.floater.sol .box {
  background: linear-gradient(180deg, rgba(50, 44, 8, 0.92), rgba(20, 18, 4, 0.92));
  border: 2px solid #f0c430;
  box-shadow: 0 0 18px #f0c430aa;
  border-radius: 10px;
  padding: 8px 16px;
}
.floater.cyn {
  color: #e8ffff;
}
.floater.cyn .box {
  background: linear-gradient(180deg, rgba(8, 36, 48, 0.92), rgba(4, 16, 24, 0.92));
  border: 2px solid #3ee8f0;
  box-shadow: 0 0 18px #3ee8f0aa;
  border-radius: 10px;
  padding: 8px 16px;
}
.floater.aby {
  color: #f4e0ff;
}
.floater.aby .box {
  background: linear-gradient(180deg, rgba(40, 8, 56, 0.92), rgba(16, 4, 28, 0.92));
  border: 2px solid #c44cff;
  box-shadow: 0 0 18px #c44cffaa;
  border-radius: 10px;
  padding: 8px 16px;
}

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

#hud button { pointer-events: auto; }

#title-block {
  position: absolute;
  top: 16px;
  left: 22px;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.title-diamond {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px #00e7f5);
}
.title-word {
  font-family: "Orbitron", "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.14em;
  color: #7af6ff;
  text-shadow:
    0 0 8px #00e7f5,
    0 0 22px #00b8d4,
    0 0 40px #006888;
  line-height: 1;
}
.title-row.big .title-word { font-size: 28px; }
.title-sub {
  margin-top: 8px;
  font-family: "Share Tech Mono", "Rajdhani", monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #8ec4e8;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hadal-badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #3aa0d8;
  color: #9ad8ff;
  background: rgba(8, 28, 48, 0.55);
  font-size: 11px;
  letter-spacing: 0.16em;
}
.sub-sep { color: #3a88b8; }

#vitals {
  position: absolute;
  top: 78px;
  left: 22px;
  width: 360px;
  padding: 10px 14px 10px 12px;
  background: linear-gradient(180deg, rgba(4, 14, 32, 0.82), rgba(2, 8, 20, 0.78));
  border: 1px solid rgba(0, 200, 230, 0.28);
  border-radius: 6px;
  box-shadow: 0 0 24px rgba(0, 80, 120, 0.35);
}
.vital-row {
  display: grid;
  grid-template-columns: 132px 1fr 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.vital-lab {
  font-family: "Share Tech Mono", "Rajdhani", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #8ec8e8;
}
.vital-lab.dim { color: #5a90b0; font-size: 10px; }
.vital-pct {
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  color: #c8f0ff;
  text-align: right;
}
.vital-track {
  height: 8px;
  background: rgba(4, 20, 36, 0.9);
  border: 1px solid rgba(0, 180, 210, 0.25);
  position: relative;
  overflow: hidden;
}
.vital-track i {
  display: block;
  height: 100%;
  width: 94%;
  box-shadow: 0 0 8px currentColor;
}
.vital-track.cyan i {
  background: linear-gradient(90deg, #00b8d4, #5af0ff);
  color: #3ee8f0;
}
.vital-track.green i {
  background: linear-gradient(90deg, #1aa050, #3ee070);
  color: #3ee070;
}
.vessels-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
#vessel-pips { display: flex; gap: 6px; }
.vessel {
  width: 22px;
  height: 14px;
  object-fit: contain;
  opacity: 0.25;
  filter: grayscale(1);
}
.vessel.on {
  opacity: 1;
  filter: drop-shadow(0 0 6px #00e7f5);
}

#ascent-chip {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.ascent-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px 6px 16px;
  background: linear-gradient(180deg, rgba(6, 22, 40, 0.88), rgba(4, 14, 28, 0.88));
  border: 1px solid #1aa8d0;
  border-radius: 22px;
  box-shadow: 0 0 16px rgba(0, 180, 220, 0.35);
  font-family: "Orbitron", "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: #d8f8ff;
}
.ascent-tri { color: #3ee8f0; font-size: 14px; }
.vel-pill {
  font-size: 12px;
  color: #3ee8c8;
  background: rgba(0, 60, 70, 0.55);
  border: 1px solid #1aa888;
  border-radius: 12px;
  padding: 2px 8px;
  letter-spacing: 0.04em;
}
.ascent-sub {
  margin-top: 6px;
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #6aa8c8;
}
.ascent-sub b { color: #3ee8f0; font-weight: 700; }
.ascent-sub b.over { color: #7af6ff; text-shadow: 0 0 8px #00e7f5; }
.ascent-sub b.cruise { color: #8ec8e8; }

#score-box {
  position: absolute;
  top: 14px;
  right: 22px;
  min-width: 280px;
  padding: 8px 22px 10px;
  text-align: center;
  background: linear-gradient(180deg, rgba(28, 6, 32, 0.9), rgba(12, 4, 20, 0.9));
  border: 2px solid #ff3eb8;
  border-radius: 8px;
  box-shadow: 0 0 22px rgba(255, 46, 168, 0.45), inset 0 0 18px rgba(255, 46, 168, 0.12);
}
.score-lab {
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #ff8ad0;
}
#hud-score {
  font-family: "Exo 2", "Orbitron", "Rajdhani", sans-serif;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-shadow: 0 0 14px #ff4ad4, 0 0 28px #ff2ea8;
  line-height: 1.15;
  min-height: 38px;
  font-variant-numeric: tabular-nums;
}

#chain-box {
  position: absolute;
  top: 92px;
  right: 22px;
  width: 320px;
  padding: 10px 14px 10px 16px;
  background: linear-gradient(90deg, rgba(90, 8, 50, 0.92), rgba(40, 10, 20, 0.88));
  border: 2px solid #ff4aa8;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(255, 74, 168, 0.4);
}
.chain-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.chain-title {
  font-family: "Orbitron", "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: #fff0c8;
  line-height: 1.1;
  text-shadow: 0 0 10px #ff9a40;
}
.chain-timer {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  color: #ffe9a0;
  background: rgba(20, 10, 4, 0.65);
  border: 1px solid #c89030;
  border-radius: 6px;
  padding: 3px 8px;
}
.chain-track {
  margin-top: 8px;
  height: 6px;
  background: rgba(20, 8, 8, 0.8);
  border-radius: 4px;
  overflow: hidden;
}
.chain-track i {
  display: block;
  height: 100%;
  width: 70%;
  background: linear-gradient(90deg, #ff7a18, #ffe05a);
  box-shadow: 0 0 8px #ff9a28;
}
.chain-foot {
  margin-top: 6px;
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #e8c090;
}
.chain-foot b { color: #ffe9a0; }

#sonar-wrap {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 180px;
  text-align: center;
}
#sonar {
  width: 168px;
  height: 168px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 10px #00c8e0);
}
.sonar-lab {
  margin-top: 2px;
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #3aa8c8;
}

#ability-bar {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, rgba(6, 16, 32, 0.9), rgba(4, 10, 22, 0.92));
  border: 1px solid rgba(40, 120, 160, 0.45);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.abil {
  width: 118px;
  text-align: center;
  position: relative;
}
.abil-key { display: none; }
.abil-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 6px;
  display: grid;
  place-items: center;
  background: transparent;
}
.abil-icon-wrap img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0, 220, 200, 0.35));
}
#abil-shift .abil-icon-wrap img {
  filter: drop-shadow(0 0 8px rgba(26, 200, 232, 0.45));
}
.abil-icon-wrap.gold img,
#abil-e .abil-icon-wrap img {
  filter: drop-shadow(0 0 8px rgba(240, 196, 48, 0.45));
}
.abil-name {
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #d8f0ff;
  line-height: 1.15;
  min-height: 26px;
}
.abil-state {
  margin-top: 4px;
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.abil-state.ready { color: #3ee8c8; }
.abil-state.burst { color: #3ee8f0; }
.abil-state.crit { color: #ffc430; }
.abil-state.cd { color: #6a88a0; }

#matrix {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 360px;
  padding: 12px 16px 12px;
  background: linear-gradient(180deg, rgba(18, 8, 28, 0.9), rgba(8, 4, 18, 0.9));
  border: 2px solid #ff3eb8;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255, 46, 168, 0.35);
}
.mx-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #ff6ad0;
  margin-bottom: 10px;
}
.mx-tier {
  font-size: 10px;
  color: #1a1020;
  background: #f0c430;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.mx-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mx-node {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #061018;
  box-shadow: 0 0 12px currentColor;
  opacity: 0.38;
  transition: opacity 0.15s, transform 0.15s;
}
.mx-node.on {
  opacity: 1;
  transform: scale(1.06);
}
.mx-node.cyn { background: #3ee8f0; color: #042028; box-shadow: 0 0 14px #3ee8f0; }
.mx-node.mag { background: #ff4ad4; color: #200418; box-shadow: 0 0 14px #ff4ad4; }
.mx-node.sol { background: #f0c430; color: #201804; box-shadow: 0 0 14px #f0c430; }
.mx-node.aby { background: #c44cff; color: #180420; box-shadow: 0 0 14px #c44cff; }
.mx-arrow { color: #c8d0d8; font-size: 16px; opacity: 0.7; }
.mx-foot {
  font-family: "Rajdhani", sans-serif;
  font-size: 12px;
  line-height: 1.3;
  color: #c8a0d8;
  text-align: center;
}

/* menu / results */
#menu, #results {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(0, 40, 60, 0.35), rgba(2, 6, 16, 0.72));
}
.menu-card {
  width: min(720px, 92vw);
  padding: 28px 36px 30px;
  background: linear-gradient(180deg, rgba(6, 18, 36, 0.94), rgba(4, 10, 22, 0.96));
  border: 1px solid rgba(0, 220, 240, 0.45);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(0, 180, 220, 0.25), 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.menu-sub {
  margin-top: 10px;
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.18em;
  color: #7ab0d8;
  font-size: 13px;
}
.menu-blurb {
  margin: 16px auto 18px;
  max-width: 580px;
  font-size: 16px;
  line-height: 1.45;
  color: #c8e4f4;
}
.menu-blurb b.cyn { color: #3ee8f0; }
.menu-blurb b.mag { color: #ff4ad4; }
.menu-blurb b.sol { color: #f0c430; }
.menu-blurb b.aby { color: #c44cff; }
.menu-art {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 28px;
  margin: 8px 0 18px;
  height: 140px;
}
.menu-art img {
  height: 130px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px #00e7f5);
}
.menu-card button {
  pointer-events: auto;
  border: 0;
  padding: 12px 36px;
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 14px;
  color: #041820;
  background: linear-gradient(180deg, #7af6ff, #00c8e0);
  border-radius: 6px;
  box-shadow: 0 0 18px rgba(0, 231, 245, 0.55);
}
.menu-card button:disabled {
  opacity: 0.45;
  cursor: wait;
}
.menu-card button:hover:not(:disabled) {
  filter: brightness(1.08);
}
.menu-controls {
  margin-top: 16px;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  color: #7aa8c0;
  letter-spacing: 0.04em;
  line-height: 1.6;
}
kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid #2a7088;
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #c8f0ff;
  background: rgba(8, 24, 40, 0.8);
  font-family: inherit;
  font-size: 11px;
}
.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin: 22px 0 20px;
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.12em;
  color: #7ab0d8;
  font-size: 13px;
}
.res-grid b {
  display: block;
  margin-top: 4px;
  font-family: "Orbitron", sans-serif;
  font-size: 20px;
  color: #e8f8ff;
  letter-spacing: 0.06em;
}

@media (max-width: 1100px) {
  .title-word { font-size: 16px; }
  #vitals { width: 280px; }
  #score-box { min-width: 220px; }
  #hud-score { font-size: 22px; }
  #chain-box { width: 250px; }
  #matrix { width: 280px; }
  .mx-node { width: 40px; height: 40px; font-size: 9px; }
}
