:root {
  --navy: #1c2433;
  --navy2: #242b3b;
  --navy3: #151b26;
  --panel: rgba(28, 36, 51, 0.92);
  --panel-solid: #222a38;
  --cyan: #3ec8f0;
  --cyan-hot: #7ae7ff;
  --cyan-deep: #1aa4d4;
  --gold: #f0c24a;
  --gold2: #e8a318;
  --orange: #f48719;
  --orange2: #e07a14;
  --peach: #fce8cf;
  --green: #3dce6a;
  --green2: #2aa85a;
  --red: #ff4458;
  --pink: #ff8a9a;
  --white: #f4f7fb;
  --muted: #8ea0b4;
  --stroke: rgba(62, 200, 240, 0.55);
}

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

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

#stage { position: fixed; inset: 0; background: #1a120c; }
#c { display: block; width: 100%; height: 100%; }

.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid #3ec8f0;
  border-radius: 4px;
  background: rgba(20, 30, 44, 0.85);
  color: var(--cyan-hot);
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
}

#loading {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a120c;
  color: var(--orange);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.22em;
  font-size: 14px;
}

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

.floater {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  pointer-events: none;
  text-shadow: 0 2px 8px #000;
}
.floater.gold { color: var(--gold); font-size: 22px; }
.floater.red { color: var(--red); font-size: 13px; }
.floater.cyan { color: var(--cyan-hot); font-size: 14px; }

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}

/* ========== WORDMARK ========== */
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark.big { transform: scale(1.15); margin-bottom: 6px; }
.mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
}
.mark img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
}
.word-top {
  font-family: "Orbitron", "Audiowide", sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #fff4d2 0%, #f0c24a 42%, #c98418 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(80, 40, 0, 0.4));
  line-height: 1.05;
}
.word-arcade {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.28em;
  color: #f08a1a;
  margin-top: -1px;
  text-shadow: 0 1px 0 #7a3a00;
}
.word-sub {
  margin-top: 4px;
  margin-left: 48px;
  font-family: "Exo 2", sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #4ec8ee;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

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

/* ========== TOP CENTER ========== */
#hud-tc {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 52vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.tc-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  justify-content: center;
}
.pill {
  background: linear-gradient(180deg, rgba(38, 48, 64, 0.94), rgba(22, 28, 40, 0.94));
  border: 1px solid rgba(90, 160, 190, 0.35);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
  padding: 6px 16px 7px;
  text-align: center;
}
.score-pill { min-width: 168px; }
.score-pill .pill-lab {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #9eb0c2;
  font-weight: 700;
}
.score-pill .pill-num {
  font-family: "Orbitron", sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #f3f7fb;
  letter-spacing: 0.04em;
  line-height: 1.05;
}
.score-pill .pill-hi {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #7f93a8;
  font-weight: 700;
}
.od-pill {
  min-width: 92px;
  background: linear-gradient(180deg, #f0a020, #d07010);
  border-color: #ffc258;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.35;
  transition: opacity 0.2s;
}
.od-pill.on { opacity: 1; }
.od-mult {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: #fff8e8;
}
.od-lab {
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: #fff0c8;
}
.wave-pill { min-width: 132px; }
.wave-num {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--cyan-hot);
  letter-spacing: 0.12em;
}
.wave-lab {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #c5d4e2;
  font-weight: 700;
}

.fort-row {
  display: flex;
  justify-content: space-between;
  width: 92%;
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: #f3e0c0;
  margin-top: 2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
}
.fort-name span { color: #fff4d0; }
.fort-int { color: #f0c24a; }

.int-track {
  width: 92%;
  height: 7px;
  border-radius: 4px;
  background: rgba(20, 16, 18, 0.55);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.45);
}
.int-track i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #c06018, #f0b430 55%, #ffe08a);
}

.warn-bar {
  margin-top: 3px;
  width: 94%;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #fff0f0;
  background: linear-gradient(90deg, transparent, rgba(200, 40, 50, 0.82), transparent);
  padding: 3px 8px;
  border-radius: 10px;
  text-shadow: 0 0 8px #ff3040;
}

/* ========== TOP RIGHT ========== */
#hud-tr {
  position: absolute;
  top: 10px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.radar-wrap {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px #2a8fb8, 0 0 18px rgba(50, 180, 230, 0.45);
  background: #1a2830;
}
#radar { width: 118px; height: 118px; display: block; }

.obj-panel {
  width: 210px;
  background: linear-gradient(180deg, rgba(36, 48, 64, 0.94), rgba(24, 32, 46, 0.94));
  border: 1px solid rgba(70, 150, 180, 0.4);
  border-radius: 12px;
  padding: 8px 12px 10px;
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
}
.obj-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  color: var(--cyan);
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.15;
  margin-bottom: 6px;
}
.obj-head .sec { color: var(--cyan-hot); font-size: 12px; }
.obj-line {
  font-size: 12px;
  font-weight: 700;
  color: #c8d4e0;
  margin: 3px 0;
  letter-spacing: 0.02em;
}
.obj-line.done { color: var(--green); }
.obj-line .tick { color: var(--green); margin-right: 4px; }
.obj-line .dot { margin-right: 6px; color: #7a8898; }
.obj-line .dot.orange { color: var(--orange); }

/* ========== LOCK / CRIT ========== */
#lock-card {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9;
  text-align: center;
}
.lock-lab {
  font-family: "Exo 2", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #ff6a5a;
  text-shadow: 0 1px 4px #000;
  margin-bottom: 4px;
}
.lock-box { position: relative; width: 78px; height: 78px; margin: 0 auto; }
.lock-sq {
  position: absolute; inset: 0;
  border: 2px dashed #e23a3a;
  border-radius: 2px;
}
.lock-plus {
  position: absolute;
  left: 50%; top: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border: 2px solid #e23a3a;
  border-radius: 50%;
}
.lock-pts {
  margin-top: 4px;
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: 28px;
  color: #f0c24a;
  text-shadow: 2px 3px 0 #7a4a00, 0 0 12px rgba(240, 180, 40, 0.55);
}
.lock-shield {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #f0c24a;
}
#crit-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #c01828;
  color: #fff;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  z-index: 9;
}

/* ========== BOTTOM LEFT ========== */
#hud-bl {
  position: absolute;
  left: 16px;
  bottom: 16px;
}
.corv-panel {
  width: 430px;
  background: linear-gradient(180deg, rgba(32, 44, 60, 0.94), rgba(22, 30, 42, 0.94));
  border: 1px solid rgba(62, 200, 240, 0.45);
  border-radius: 14px;
  padding: 10px 14px 10px;
  box-shadow: 0 10px 22px rgba(0,0,0,.32), inset 0 1px 0 rgba(120, 210, 255, 0.12);
}
.corv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.corv-name {
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--cyan);
  font-size: 14px;
}
.lives-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8aa0b4;
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
}
.life {
  width: 12px;
  height: 12px;
  display: inline-block;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  margin-left: 3px;
}
.life.off { background: #334050; box-shadow: none; }
.stat {
  display: grid;
  grid-template-columns: 56px 1fr 48px;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
}
.stat-lab {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #9aadc0;
  font-weight: 700;
}
.stat-track {
  height: 8px;
  border-radius: 4px;
  background: #0e1218;
  overflow: hidden;
}
.stat-track i { display: block; height: 100%; border-radius: 4px; }
.fill-shield { background: linear-gradient(90deg, #1280c0, #3ec8f0); }
.fill-hull { background: linear-gradient(90deg, #1e8a40, #3dce6a); }
.stat-num { font-size: 12px; font-weight: 800; text-align: right; }
.stat-num.cyan { color: var(--cyan-hot); }
.stat-num.green { color: var(--green); }
.wep-row {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0d1118;
  border-radius: 6px;
  padding: 5px 10px;
  border: 1px solid #1c2634;
}
.wep-name {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #e8f0f8;
}
.wep-rpm {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

/* ========== BOTTOM CENTER FUEL ========== */
#hud-bc {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(560px, 46vw);
}
.fuel-banner {
  margin: 0 auto 0;
  width: fit-content;
  background: linear-gradient(180deg, #f0a020, #d07012);
  color: #fff8e8;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 4px 16px 5px;
  border-radius: 8px 8px 0 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 -2px 10px rgba(240, 140, 20, 0.35);
}
.fuel-panel {
  background: linear-gradient(180deg, rgba(22, 28, 40, 0.96), rgba(12, 14, 20, 0.96));
  border: 1px solid rgba(240, 160, 40, 0.35);
  border-radius: 14px;
  padding: 10px 14px 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.4);
}
.fuel-top {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
}
.fuel-lab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 4px;
}
.fuel-ico { width: 14px; height: 14px; object-fit: contain; }
.fuel-row { display: flex; align-items: center; gap: 8px; }
.fuel-track {
  flex: 1;
  height: 10px;
  border-radius: 3px;
  background: #0a0c10;
  overflow: hidden;
  border: 1px solid #1a1e28;
}
.fuel-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #c05010, #f48719 60%, #ffc040);
}
.fuel-pct {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  color: var(--orange);
  font-size: 16px;
  min-width: 48px;
}
.fuel-low {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--orange);
}
.fuel-low.ok { color: #6a7a88; }
.od-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--cyan);
}
.od-ready {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--cyan-hot);
  letter-spacing: 0.16em;
  text-align: right;
  margin-top: -16px;
}
.od-ready.hot { color: #ff8a40; }
.od-track {
  margin-top: 6px;
  height: 10px;
  border-radius: 6px;
  background: #10141c;
  overflow: hidden;
}
.od-track i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7a4cff, #4ec8f0 55%, #b8f0ff);
}
.od-bonus {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #d0d8e0;
  letter-spacing: 0.04em;
}
.fuel-bot {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(240, 170, 50, 0.45);
  border-radius: 8px;
  padding: 5px 8px;
  background: rgba(20, 16, 10, 0.45);
}
.key-chip {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #e8e0d0;
}
.risk-chip {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
}

/* ========== TELEMETRY ========== */
#hud-br {
  position: absolute;
  right: 16px;
  bottom: 16px;
}
.tele-panel {
  width: 230px;
  background: linear-gradient(180deg, rgba(36, 46, 62, 0.94), rgba(24, 32, 44, 0.94));
  border: 1px solid rgba(62, 200, 240, 0.4);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 10px 22px rgba(0,0,0,.32);
}
.tele-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #8aa0b4;
  margin: 3px 0;
}
.tele-row b { font-family: "Share Tech Mono", "Orbitron", monospace; font-size: 13px; }
.tele-row b.cyan { color: var(--cyan-hot); }
.tele-row b.orange { color: var(--orange); }
.tele-row b.green { color: var(--green); }

#crosshair {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(255, 80, 70, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 60, 50, 0.4);
  pointer-events: none;
}
#hit-flash {
  position: absolute;
  inset: 0;
  background: rgba(180, 20, 30, 0);
  pointer-events: none;
  z-index: 7;
}

/* ========== MENUS ========== */
#menu, #results, #pause {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(40, 24, 10, 0.35), rgba(10, 8, 8, 0.55));
}
.menu-card {
  width: min(560px, 92vw);
  background: linear-gradient(180deg, rgba(28, 36, 52, 0.94), rgba(14, 16, 24, 0.96));
  border: 1px solid rgba(62, 200, 240, 0.4);
  border-radius: 18px;
  padding: 28px 32px 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: auto;
}
.menu-card.slim { width: min(360px, 86vw); padding: 28px; }
.menu-art {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  margin: 14px 0 8px;
}
.menu-art img {
  height: 88px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.4));
}
.menu-blurb {
  font-size: 14px;
  line-height: 1.45;
  color: #c8d4e0;
  margin: 8px 0 16px;
}
.menu-blurb b { color: var(--gold); }
#btn-play, #btn-again, #btn-resume {
  pointer-events: auto;
  background: linear-gradient(180deg, #f0a020, #c06010);
  color: #fff8e8;
  border: 1px solid #ffd070;
  border-radius: 10px;
  padding: 10px 28px;
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(200, 100, 10, 0.4);
}
#btn-play:hover, #btn-again:hover, #btn-resume:hover {
  filter: brightness(1.08);
}
.menu-controls {
  margin-top: 14px;
  font-size: 12px;
  color: #9aadc0;
  line-height: 1.6;
}
.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin: 16px 0;
  width: 100%;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #9aadc0;
}
.res-grid b {
  display: block;
  font-family: "Orbitron", sans-serif;
  color: var(--cyan-hot);
  font-size: 18px;
  margin-top: 2px;
}

@media (max-width: 1100px) {
  .corv-panel { width: 340px; }
  #hud-bc { width: min(480px, 50vw); }
  .word-top { font-size: 15px; }
}
