:root {
  --cyan: #3ec8eb;
  --cyan-hot: #5ce8ff;
  --cyan-bar: #20b8eb;
  --cyan-deep: #0a8cb8;
  --gold: #e8b020;
  --gold-2: #deb373;
  --gold-bar: #f0c040;
  --orange: #e89018;
  --warn: #c84a28;
  --warn-hot: #ff6a30;
  --blue-bar: #1e8adb;
  --navy: #071f29;
  --panel: rgba(7, 31, 41, 0.78);
  --panel-r: rgba(0, 30, 58, 0.82);
  --white: #e8f4f8;
  --score: #d8ecf4;
}

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

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

#stage {
  position: fixed;
  inset: 0;
  background: #070e18;
}

#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: 6;
  overflow: hidden;
}
.floater {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  pointer-events: none;
  font-family: "Share Tech Mono", "Orbitron", monospace;
  letter-spacing: 0.06em;
  font-size: 12px;
  font-weight: 700;
  color: #7af6ff;
  text-shadow: 0 0 8px #00d4ff;
}
.floater.score { color: #f0c040; text-shadow: 0 0 8px #e8b020; }
.floater.dmg { color: #ff6a40; text-shadow: 0 0 8px #c84a28; }
.floater.harvest { color: #ffb040; font-size: 14px; }

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

/* ----- RADAR (top-left) ----- */
#hud-radar {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 168px;
  height: 168px;
  background: rgba(7, 31, 41, 0.72);
  border: 2px solid #2aa8c8;
  box-shadow:
    0 0 0 1px rgba(10, 40, 55, 0.9),
    0 0 18px rgba(32, 180, 220, 0.25),
    inset 0 0 24px rgba(0, 20, 30, 0.55);
}
#hud-radar::before,
#hud-radar::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #3ec8eb;
  z-index: 2;
  pointer-events: none;
}
#hud-radar::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
#hud-radar::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
#radar { position: relative; }
#radar {
  display: block;
  width: 100%;
  height: 100%;
}

/* ----- TITLE BANNER ----- */
#hud-title {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}
.title-plate {
  position: relative;
  min-width: 420px;
  padding: 10px 56px 11px;
  text-align: center;
  background: linear-gradient(180deg, rgba(28, 62, 82, 0.88) 0%, rgba(12, 34, 50, 0.92) 100%);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%, 0 50%);
  box-shadow: 0 0 24px rgba(60, 200, 235, 0.18);
  border-top: 1px solid rgba(160, 220, 240, 0.35);
  border-bottom: 1px solid rgba(60, 180, 220, 0.45);
}
.title-plate span {
  font-family: "Orbitron", "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.28em;
  color: #f2f8fc;
  text-shadow: 0 0 16px rgba(90, 210, 240, 0.55);
  white-space: nowrap;
}
.title-plate.xl {
  min-width: 560px;
  padding: 14px 48px 15px;
}
.title-plate.xl span {
  font-size: 24px;
  letter-spacing: 0.24em;
}

/* ----- SCORE (top-right) ----- */
#hud-scorebox {
  position: absolute;
  top: 16px;
  right: 28px;
  text-align: right;
  color: var(--score);
}
.score-line {
  font-family: "Rajdhani", "Exo 2", sans-serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.04em;
  color: #e6f0f6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.score-line b { font-weight: 700; }
.mult-line {
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #c8d8e4;
  margin-top: -2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
#hud-mult { color: #d8e8f0; }

/* ----- LOCK-ON ----- */
#lockon {
  position: absolute;
  width: 128px;
  height: 128px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
#lock-reticle {
  width: 128px;
  height: 128px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px #ff3030);
  opacity: 0.95;
}
.lock-meta {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translate(6px, -50%);
  font-family: "Share Tech Mono", "Orbitron", monospace;
  color: #ff4a4a;
  text-shadow: 0 0 8px #ff2020;
  white-space: nowrap;
}
#lock-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
#lock-dist {
  font-size: 12px;
  color: #ff6a6a;
}

/* ----- BOTTOM LEFT ----- */
#hud-bl {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 340px;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(42, 28, 14, 0.55) 0%, rgba(18, 12, 8, 0.78) 100%);
  clip-path: polygon(0 14px, 14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  border: 1px solid rgba(200, 140, 40, 0.28);
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.4);
}
.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.stat-ico {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 28px;
  filter: drop-shadow(0 0 4px rgba(240, 180, 40, 0.45));
}
.stat-body { flex: 1; min-width: 0; }
.stat-lab {
  font-family: "Rajdhani", "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: #f0d8a0;
  margin-bottom: 3px;
}
.track {
  height: 10px;
  background: rgba(20, 12, 8, 0.7);
  border: 1px solid rgba(180, 120, 40, 0.35);
  overflow: hidden;
}
.track i {
  display: block;
  height: 100%;
  width: 74%;
  background: linear-gradient(90deg, #c88818, #f0c040 60%, #ffe070);
  box-shadow: 0 0 8px rgba(240, 180, 40, 0.55);
}
.track.gold i {
  background: linear-gradient(90deg, #c07010, #e8b020 50%, #f8d860);
}
.track.cyan {
  border-color: rgba(40, 160, 210, 0.45);
  background: rgba(4, 18, 32, 0.7);
}
.track.cyan i {
  background: linear-gradient(90deg, #0a88c0, #20c0eb 55%, #7af0ff);
  box-shadow: 0 0 8px rgba(60, 200, 235, 0.55);
}
.track.blue {
  border-color: rgba(30, 100, 180, 0.45);
  background: rgba(4, 14, 28, 0.7);
}
.track.blue i {
  background: linear-gradient(90deg, #1560b0, #1e8adb 55%, #5ab0f0);
  box-shadow: 0 0 8px rgba(30, 138, 219, 0.45);
}
.track.thin { height: 7px; }

.boost-ready, .boost-wait, .boost-hot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 4px 2px;
}
.warn-ico {
  width: 22px;
  height: 22px;
  object-fit: contain;
  margin-top: 1px;
  filter: drop-shadow(0 0 5px #ff6a30);
}
#boost-title {
  font-family: "Rajdhani", "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.16em;
  color: #ff5a28;
  text-shadow: 0 0 10px rgba(255, 80, 30, 0.45);
}
#boost-sub {
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #c04028;
  line-height: 1.15;
  max-width: 260px;
  margin-top: 1px;
}
.boost-wait #boost-title { color: #8a7060; text-shadow: none; }
.boost-wait #boost-sub { color: #6a5040; }
.boost-hot #boost-title { color: #ffe040; animation: pulse 0.45s ease-in-out infinite alternate; }

@keyframes pulse {
  from { opacity: 1; }
  to { opacity: 0.55; }
}

/* ----- BOTTOM RIGHT ----- */
#hud-br {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 340px;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(0, 40, 70, 0.62) 0%, rgba(0, 22, 44, 0.84) 100%);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  border: 1px solid rgba(40, 170, 210, 0.38);
  box-shadow: 0 0 22px rgba(0, 40, 70, 0.45);
}
.r-row { margin-bottom: 9px; }
.r-body { text-align: right; }
.r-lab {
  color: #b8e4f4;
  letter-spacing: 0.16em;
}
#hud-br .stat-ico {
  filter: drop-shadow(0 0 5px rgba(60, 200, 235, 0.55));
}

/* ========== MENU / PAUSE / RESULTS ========== */
#menu, #pause, #results {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(10, 24, 40, 0.35) 0%, rgba(4, 10, 18, 0.55) 100%);
  pointer-events: auto;
}
.menu-card {
  width: min(640px, 92vw);
  padding: 28px 32px 26px;
  text-align: center;
  background: linear-gradient(180deg, rgba(10, 28, 42, 0.92) 0%, rgba(6, 16, 28, 0.94) 100%);
  border: 1px solid rgba(60, 200, 235, 0.4);
  box-shadow: 0 0 40px rgba(20, 80, 120, 0.35), inset 0 0 40px rgba(0, 20, 40, 0.4);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
}
.menu-card.slim { width: min(420px, 88vw); padding: 28px; }
.menu-card .title-plate { margin: 0 auto 10px; display: inline-block; }
.menu-tag {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #6ec8e0;
  margin-bottom: 12px;
}
#menu-kite {
  display: block;
  width: min(380px, 70vw);
  height: auto;
  margin: 8px auto 12px;
  filter: drop-shadow(0 0 18px rgba(60, 220, 255, 0.45));
}
.menu-blurb {
  font-family: "Rajdhani", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: #c8dce8;
  margin: 0 auto 16px;
  max-width: 520px;
}
.menu-blurb b { color: #ff8a40; }
#btn-play, #btn-resume, #btn-again {
  display: inline-block;
  padding: 10px 36px;
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.22em;
  color: #071018;
  background: linear-gradient(180deg, #7aecff, #20b8d8);
  border: 0;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  box-shadow: 0 0 18px rgba(60, 220, 255, 0.45);
}
#btn-play:hover, #btn-resume:hover, #btn-again:hover {
  filter: brightness(1.12);
}
.menu-controls {
  margin-top: 16px;
  font-family: "Rajdhani", sans-serif;
  font-size: 14px;
  color: #8ab0c4;
  letter-spacing: 0.04em;
  line-height: 1.55;
}
kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid #3aa0c0;
  background: rgba(20, 50, 70, 0.7);
  color: #c8f0ff;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  border-radius: 2px;
}
.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 16px 0 18px;
  font-family: "Rajdhani", sans-serif;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: #8ab8cc;
}
.res-grid b {
  display: block;
  font-family: "Orbitron", sans-serif;
  font-size: 18px;
  color: #e8f4f8;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

@media (max-width: 900px) {
  #hud-radar { width: 128px; height: 128px; }
  .title-plate { min-width: 280px; padding: 8px 36px; }
  .title-plate span { font-size: 14px; letter-spacing: 0.16em; }
  #hud-bl, #hud-br { width: 260px; }
  .score-line { font-size: 18px; }
}

@media (max-width: 720px) {
  #hud-radar { width: 96px; height: 96px; top: 8px; left: 8px; }
  #hud-title { top: 6px; }
  .title-plate { min-width: 0; padding: 6px 22px; }
  .title-plate span { font-size: 11px; letter-spacing: 0.14em; }
  #hud-scorebox { top: 40px; right: 10px; }
  .score-line { font-size: 15px; }
  .mult-line { font-size: 12px; }
  #hud-bl, #hud-br {
    width: 48%;
    padding: 8px 8px 6px;
    bottom: 8px;
  }
  #hud-bl { left: 6px; }
  #hud-br { right: 6px; }
  .stat-lab { font-size: 11px; letter-spacing: 0.06em; }
  .stat-ico { width: 18px; height: 18px; flex-basis: 18px; }
  #boost-title { font-size: 12px; }
  #boost-sub { font-size: 8px; max-width: 140px; }
  .track { height: 7px; }
  #lockon, #lock-reticle { width: 72px; height: 72px; }
}
