:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #05070f;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

/* Full-screen damage flash when a bolt connects with the player. */
#hitflash {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 45, 45, 0) 28%, rgba(255, 26, 26, 0.6) 100%);
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
#hitflash.on {
  opacity: 1;
  transition: opacity 0.04s linear;
}

/* Scene fills the window. */
a-scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Floating control guide (desktop only; hidden once in VR). */
#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;
  max-width: 320px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.72);
  border: 1px solid rgba(95, 168, 255, 0.35);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
#hud h1 {
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7fc0ff;
}
#hud ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #b9c6db;
}
#hud b { color: #eaf2ff; }
#hud .desktop-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #7f8ca3;
}

/* ------------------------------------------------------------ blaster HUD */
#blaster-ui {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 12;
  pointer-events: none;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.blaster-card {
  width: 300px;
  padding: 14px 16px 12px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(10, 18, 34, 0.88), rgba(6, 10, 20, 0.88));
  border: 1px solid rgba(95, 168, 255, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(7px);
  color: #eaf2ff;
}
.blaster-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.blaster-era { color: #6f8099; }
.blaster-mode-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  color: #ffd27f;
  background: rgba(255, 178, 64, 0.16);
  border: 1px solid rgba(255, 178, 64, 0.45);
}
.blaster-mode-badge.stun {
  color: #8fe0ff;
  background: rgba(56, 182, 255, 0.16);
  border-color: rgba(56, 182, 255, 0.5);
}
.blaster-title {
  margin: 8px 0 2px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.blaster-mfg { font-size: 11px; color: #8fa1bb; }
.blaster-stats-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0;
}
.blaster-stat { display: flex; flex-direction: column; gap: 3px; }
.stat-label { font-size: 9px; letter-spacing: 0.14em; color: #6f8099; }
.stat-val { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.bolt-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff2222;
}
.blaster-heat-wrap { margin-bottom: 10px; }
.heat-header {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #6f8099;
  margin-bottom: 4px;
}
.heat-track {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.heat-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #37d67a, #ffd23f);
  transition: width 0.12s linear;
}
.heat-fill.overheated { background: linear-gradient(90deg, #ff5a3c, #ff1e27); }
#blaster-heat-status.heat-warn { color: #ffd23f; }
#blaster-heat-status.heat-danger { color: #ff5a3c; }
.blaster-desc { font-size: 11px; line-height: 1.5; color: #9fb0c8; }
.blaster-controls-hint {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(95, 168, 255, 0.2);
  font-size: 10px;
  line-height: 1.5;
  color: #6f8099;
}
.blaster-controls-hint b { color: #b9c6db; }

/* ------------------------------------------------------ loader + menu */
.hidden { display: none !important; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(30, 70, 140, 0.28), rgba(4, 7, 15, 0.96) 62%),
    #05070f;
  backdrop-filter: blur(2px);
  transition: opacity 0.45s ease;
}
.overlay.fade { opacity: 0; pointer-events: none; }

.loader-inner,
.menu-inner {
  width: min(680px, 88vw);
  padding: 34px 40px 38px;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(165deg, rgba(12, 22, 42, 0.92), rgba(5, 9, 20, 0.94));
  border: 1px solid rgba(95, 168, 255, 0.32);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), inset 0 0 60px rgba(40, 90, 180, 0.12);
}

.brand-mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #eaf2ff;
  background: linear-gradient(145deg, #1d3a6e, #0d1c38);
  border: 1px solid rgba(127, 192, 255, 0.5);
  box-shadow: 0 0 30px rgba(95, 168, 255, 0.35);
}

.loader-title,
.menu-title {
  margin: 0 0 6px;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #eaf2ff;
  text-shadow: 0 0 24px rgba(95, 168, 255, 0.55);
}
.menu-sub {
  margin: 0 0 26px;
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #7f93b3;
}

.loader-bar {
  position: relative;
  height: 12px;
  margin: 26px 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(95, 168, 255, 0.22);
}
.loader-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f9bff, #7fe6ff 60%, #b06bff);
  box-shadow: 0 0 18px rgba(95, 168, 255, 0.7);
  transition: width 0.28s ease;
}
.loader-status {
  font-size: 13px;
  color: #9fb0c8;
  min-height: 18px;
}
.loader-pct {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #5f7799;
}

.menu-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.menu-btn {
  min-width: 168px;
  padding: 15px 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  color: #cfe0ff;
  background: rgba(20, 34, 62, 0.9);
  border: 1px solid rgba(95, 168, 255, 0.4);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.menu-btn:hover {
  transform: translateY(-2px);
  background: rgba(30, 52, 92, 0.95);
  box-shadow: 0 10px 26px rgba(95, 168, 255, 0.28);
}
.menu-btn.primary {
  color: #04101f;
  background: linear-gradient(180deg, #8fd4ff, #2f9bff);
  border-color: #bfe4ff;
  box-shadow: 0 0 30px rgba(95, 168, 255, 0.55);
}
.menu-btn.small {
  min-width: 120px;
  padding: 10px 18px;
  font-size: 12px;
}

.settings-panel {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(95, 168, 255, 0.22);
  display: flex;
  gap: 28px;
  text-align: left;
  flex-wrap: wrap;
  justify-content: center;
}
.settings-col { min-width: 220px; flex: 1; }
.settings-col h2 {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7fc0ff;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #b9c6db;
}
.setting select,
.setting input[type="range"] {
  flex: 1;
  max-width: 150px;
  accent-color: #2f9bff;
}
.setting select {
  background: #0d1728;
  color: #cfe0ff;
  border: 1px solid rgba(95, 168, 255, 0.35);
  border-radius: 8px;
  padding: 5px 8px;
}
.setting.toggle input { accent-color: #2f9bff; transform: scale(1.15); }
.settings-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 6px;
}
