:root {
  --cyan: #3ad4f0;
  --cyan-hot: #6af0ff;
  --cyan-deep: #1aa8c8;
  --cyan-dim: #2a88a8;
  --gold: #f0a018;
  --gold-2: #ffc040;
  --orange: #f5a010;
  --green: #3cff7a;
  --green-dim: #2ad868;
  --red: #e04058;
  --pink: #ff4a78;
  --navy: #081428;
  --panel: rgba(8, 16, 36, 0.82);
  --panel-2: rgba(10, 18, 40, 0.88);
  --ink: #e8f4ff;
  --muted: #6aa8c0;
  --border: #2ec8e8;
}

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

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

#stage, #c {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#c { z-index: 0; }

#search-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(255, 230, 160, 0.16), transparent 42%);
  transition: opacity 0.25s;
}
#search-vignette.on { opacity: 1; }

#float-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.hidden { display: none !important; }

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

/* ========== WORLD TAGS ========== */
.wtag {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  font-family: "Share Tech Mono", "Orbitron", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 14px;
  pointer-events: none;
}
.wtag.dread {
  color: #ffd0d8;
  background: rgba(48, 8, 16, 0.88);
  border: 1px solid #e04058;
  box-shadow: 0 0 10px rgba(224, 64, 88, 0.35);
}
.wtag.inf {
  color: #8af0ff;
  background: rgba(8, 18, 36, 0.88);
  border: 1px solid #2ec8e8;
}
.wtag.ap {
  color: #b8ffd0;
  background: rgba(8, 28, 18, 0.88);
  border: 1px solid #3cff7a;
}
.wtag.ap.blocked {
  color: #ffd0d8;
  background: rgba(40, 8, 12, 0.88);
  border-color: #e04058;
}

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

#hud-tl {
  position: absolute;
  top: 18px;
  left: 22px;
}

.title-bar {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 22px 10px 18px;
  min-width: 470px;
  box-shadow: 0 0 18px rgba(46, 200, 232, 0.18), inset 0 0 18px rgba(20, 60, 90, 0.25);
}
.title-bar.big {
  min-width: 0;
  padding: 12px 28px;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.05;
}
.title-diamond {
  color: var(--cyan);
  font-size: 16px;
  filter: drop-shadow(0 0 6px #3ad4f0);
}
.word-cyan, .word-gold {
  font-family: "Orbitron", "Exo 2", sans-serif;
  font-weight: 800;
  font-size: clamp(18px, 1.7vw, 24px);
  letter-spacing: 0.08em;
}
.word-cyan { color: #7ee8ff; text-shadow: 0 0 10px rgba(58, 212, 240, 0.45); }
.word-gold { color: #f0a018; text-shadow: 0 0 10px rgba(240, 160, 24, 0.35); }
.title-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.act-badge {
  display: inline-block;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 2px 8px;
  border-radius: 3px;
}
.sector {
  font-family: "Share Tech Mono", "Rajdhani", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #3ad4f0;
}

/* top center detection */
#hud-tc {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}
.detect-panel {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 18px 8px;
  min-width: min(540px, 42vw);
  box-shadow: 0 0 16px rgba(46, 200, 232, 0.16);
}
.detect-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.detect-lab {
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #5ad8f0;
}
.detect-track {
  height: 8px;
  background: #0c1828;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
  width: 160px;
}
.detect-track i {
  display: block;
  height: 100%;
  width: 18%;
  background: linear-gradient(90deg, #2ad868, #6aff90);
  box-shadow: 0 0 8px #3cff7a;
  border-radius: 4px;
}
.shadow-box {
  border: 1.5px solid #3cff7a;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #3cff7a;
  background: rgba(8, 28, 18, 0.45);
  white-space: nowrap;
}
.shadow-box.alert {
  border-color: #e04058;
  color: #ff8aa0;
  background: rgba(40, 8, 12, 0.5);
}
.detect-bot {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #5aa8c0;
}
.baffle { color: #7ad0e0; }

/* top right score / altitude */
#hud-tr {
  position: absolute;
  top: 16px;
  right: 18px;
  display: flex;
  gap: 10px;
}
.stat-card {
  background: var(--panel);
  border-radius: 10px;
  padding: 8px 18px 8px 16px;
  min-width: 138px;
  text-align: center;
}
.gold-card {
  border: 1.5px solid #c89028;
  box-shadow: 0 0 12px rgba(200, 144, 40, 0.22);
}
.stat-k {
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #d8c8a0;
}
.stat-v {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.stat-v.orange { color: #f5a010; text-shadow: 0 0 10px rgba(245, 160, 16, 0.35); }
.stat-s {
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-top: 1px;
}
.stat-s.green { color: #3cff7a; }
.stat-s.cyan { color: #3ad4f0; }

/* left resonance */
#hud-size {
  position: absolute;
  top: 38%;
  left: 18px;
  transform: translateY(-40%);
  width: 248px;
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 0 16px rgba(46, 200, 232, 0.14);
}
.size-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.size-title {
  font-family: "Orbitron", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #5ad8f0;
  line-height: 1.2;
}
.size-hook {
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #f0a018;
  text-align: right;
  line-height: 1.2;
}
.size-body {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}
.size-slider {
  width: 10px;
  flex: 0 0 10px;
  position: relative;
  height: 92px;
}
.size-track {
  position: absolute;
  inset: 0;
  width: 4px;
  left: 3px;
  background: #123044;
  border-radius: 2px;
  overflow: hidden;
}
.size-track i {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 35%;
  background: linear-gradient(180deg, #6af0ff, #1aa8c8);
  box-shadow: 0 0 8px #3ad4f0;
}
.size-knob {
  position: absolute;
  left: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6af0ff;
  box-shadow: 0 0 8px #3ad4f0;
  bottom: calc(35% - 6px);
}
.size-pct {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: #6af0ff;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 0 10px rgba(58, 212, 240, 0.4);
}
.size-name {
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #3ad4f0;
  margin-top: 4px;
}
.size-desc {
  font-family: "Rajdhani", sans-serif;
  font-size: 12px;
  color: #8ab0c4;
  line-height: 1.25;
  margin-top: 4px;
  max-width: 180px;
}
.aperture-box {
  margin-top: 12px;
  border: 1.5px solid #c04050;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(32, 8, 14, 0.35);
}
.ap-k {
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #e06070;
}
.ap-v {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  color: #3cff7a;
  margin-top: 2px;
}
.aperture-box.blocked .ap-v { color: #ff8aa0; }

/* bottom left vitals */
#hud-bl {
  position: absolute;
  left: 18px;
  bottom: 18px;
}
.vitals {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px 12px;
  min-width: 320px;
  box-shadow: 0 0 14px rgba(46, 200, 232, 0.14);
}
.vit-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.vit-k { color: #8ab8c8; }
.vit-n.cyan { color: #6af0ff; }
.vit-n.gold { color: #f0a018; }
.vit-bar {
  height: 8px;
  background: #101828;
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0 8px;
}
.vit-bar i {
  display: block;
  height: 100%;
  width: 95%;
  background: linear-gradient(90deg, #2a88d8, #6ab8ff);
  border-radius: 4px;
  box-shadow: 0 0 8px #4aa8f0;
}
.vit-bar.gold i {
  width: 92%;
  background: linear-gradient(90deg, #c87810, #f0a018);
  box-shadow: 0 0 8px #f0a018;
}

/* abilities */
#hud-ab {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  pointer-events: auto;
  box-shadow: 0 0 16px rgba(46, 200, 232, 0.16);
}
.ab-btn {
  width: 86px;
  height: 86px;
  background: rgba(8, 16, 32, 0.55);
  border: 1.5px solid #2a5068;
  border-radius: 10px;
  color: #8ab8c8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: auto;
}
.ab-btn.cyan-on, .ab-btn.active {
  border-color: #3ad4f0;
  box-shadow: 0 0 12px rgba(58, 212, 240, 0.28) inset, 0 0 10px rgba(58, 212, 240, 0.2);
  color: #6af0ff;
}
.ab-btn.cd { opacity: 0.45; }
.ab-key {
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #6aa8c0;
}
.ab-btn.cyan-on .ab-key, .ab-btn.active .ab-key { color: #6af0ff; }
.ab-ico {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(58, 212, 240, 0.4));
}
.ab-name {
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 700;
}

/* radar */
#hud-br {
  position: absolute;
  right: 16px;
  bottom: 16px;
}
.radar-panel {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px 12px;
  box-shadow: 0 0 14px rgba(46, 200, 232, 0.14);
}
.radar-head {
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #6ad0e8;
  text-align: center;
  margin-bottom: 6px;
}
.radar-head span { color: #8ab8c8; }
#radar {
  display: block;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: #081018;
}

/* ========== MENU / RESULTS ========== */
#menu, #results, #pause {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 70% 35%, rgba(40, 70, 120, 0.28), transparent 50%),
              radial-gradient(ellipse at 20% 30%, rgba(20, 40, 80, 0.35), transparent 50%),
              rgba(6, 12, 24, 0.55);
}
.menu-card {
  background: rgba(8, 16, 36, 0.92);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 28px 36px 24px;
  max-width: 640px;
  width: min(640px, 92vw);
  text-align: center;
  box-shadow: 0 0 40px rgba(46, 200, 232, 0.18);
}
.menu-card.slim { max-width: 360px; padding: 28px; }
.menu-card .title-bar { display: inline-block; text-align: left; margin-bottom: 12px; }
.menu-art {
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0 12px;
}
.menu-art img {
  height: 110px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(58, 212, 240, 0.4));
}
.menu-blurb {
  font-size: 16px;
  color: #c8dce8;
  line-height: 1.45;
  margin: 0 0 18px;
}
.menu-blurb b { color: #6af0ff; }
#btn-play, #btn-again, #btn-resume {
  background: #3ad4f0;
  color: #081428;
  border: none;
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: 8px;
}
#btn-play:hover, #btn-again:hover, #btn-resume:hover { background: #6af0ff; }
.menu-controls {
  margin-top: 16px;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  color: #8aa0b8;
  line-height: 1.7;
}
kbd {
  display: inline-block;
  border: 1px solid #1aa8c8;
  padding: 0 5px;
  color: #6af0ff;
  font-family: inherit;
  border-radius: 3px;
}
.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 18px 0;
  font-family: "Share Tech Mono", monospace;
  color: #9ad0e0;
}
.res-grid b {
  display: block;
  font-family: "Orbitron", sans-serif;
  color: #f5a010;
  font-size: 20px;
}

@media (max-width: 1100px) {
  .title-bar { min-width: 360px; }
  .word-cyan, .word-gold { font-size: 16px; }
  #hud-size { width: 210px; }
  .stat-v { font-size: 20px; }
  .ab-btn { width: 72px; height: 72px; }
}
