:root {
  --bg-void: #03050a;
  --glass-bg: rgba(9, 14, 26, 0.76);
  --glass-border: rgba(255, 255, 255, 0.09);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --gold: #f5b942;
  --gold-bright: #ffe08a;
  --cyan: #00f0ff;
  --violet: #a855f7;
  --emerald: #10b981;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  background: var(--bg-void); color: var(--text-primary);
  font-family: var(--font-sans); overflow: hidden;
  user-select: none; -webkit-user-select: none;
}

#neuralCanvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  display: block; z-index: 1; cursor: crosshair;
}

.hidden { display: none !important; }
.gold-text { color: var(--gold-bright); }
.cyan-text { color: var(--cyan); }
.emerald-text { color: var(--emerald); }
.violet-text { color: var(--violet); }
.mono { font-family: var(--font-mono); }

/* LANDING */
.landing-overlay {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto;
  background: radial-gradient(circle at 50% 25%, rgba(16, 26, 52, 0.4), rgba(3, 5, 10, 0.9) 70%);
  transition: opacity 0.45s ease;
}
.landing-overlay.fade-out { opacity: 0; pointer-events: none; }

.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; background: rgba(3, 5, 10, 0.75);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--glass-border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 12px var(--gold);
}
.brand-name { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.12em; }
.brand-name strong { color: var(--gold-bright); }
.concept-pill {
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(168, 85, 247, 0.14); border: 1px solid rgba(168, 85, 247, 0.4); color: #d8b4fe;
}
.nav-links { display: flex; gap: 12px; }

.landing-main { max-width: 980px; margin: 0 auto; padding: 48px 24px; }
.hero-section {
  min-height: calc(100vh - 140px);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
  color: var(--gold-bright); background: rgba(245, 185, 66, 0.08);
  border: 1px solid rgba(245, 185, 66, 0.28); padding: 7px 14px; border-radius: 999px; margin-bottom: 22px;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan); animation: pulseAnim 2s infinite;
}
@keyframes pulseAnim { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.4); } }

.hero-title { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 12px; }
.title-sub { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.36em; color: var(--cyan); }
.title-main {
  font-family: var(--font-display); font-size: clamp(3rem, 8vw, 5.4rem); font-weight: 700;
  background: linear-gradient(180deg, #fff 0%, #ffe6a3 55%, #f5b942 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-tagline { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 18px; }
.hero-desc { max-width: 680px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 32px; }
.hero-desc strong { color: var(--gold-bright); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 42px; }
.hero-metrics { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.metric-chip {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 12px 18px; min-width: 190px; display: flex; flex-direction: column; gap: 4px;
}
.metric-label { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-muted); letter-spacing: 0.14em; }
.metric-val { font-family: var(--font-display); font-size: 0.9rem; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.04em;
  border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  transition: all 0.2s ease; padding: 11px 20px; font-size: 0.9rem;
}
.btn-sm { padding: 7px 12px; font-size: 0.78rem; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 0.96rem; }
.btn-primary {
  background: linear-gradient(135deg, #f5b942 0%, #ffdf7e 55%, #d97706 100%);
  color: #080c14; box-shadow: 0 0 26px rgba(245, 185, 66, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 38px rgba(245, 185, 66, 0.6); }
.btn-gold {
  background: rgba(245, 185, 66, 0.14); border-color: rgba(245, 185, 66, 0.45); color: var(--gold-bright);
}
.btn-gold:hover { background: rgba(245, 185, 66, 0.25); }

/* HUD */
.game-hud {
  position: fixed; inset: 0; z-index: 15; pointer-events: none;
  display: flex; flex-direction: column; justify-content: space-between; padding: 14px 18px;
}
.hud-top, .hud-bottom, .objective-banner { pointer-events: auto; }

.hud-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px); border-radius: 14px; padding: 9px 14px;
}
.hud-brand-group { display: flex; align-items: center; gap: 10px; }
.hud-title { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.08em; }
.hud-divider { color: var(--text-muted); margin: 0 3px; }
.hud-phase { font-family: var(--font-mono); font-size: 0.66rem; color: var(--cyan); letter-spacing: 0.08em; }

.hud-telemetry { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tele-item { display: flex; flex-direction: column; gap: 2px; min-width: 78px; }
.tele-label { font-family: var(--font-mono); font-size: 0.58rem; color: var(--text-muted); letter-spacing: 0.1em; }
.tele-val { font-family: var(--font-mono); font-size: 0.84rem; font-weight: 700; }
.tele-bar-wrap { width: 100px; height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; overflow: hidden; }
.tele-bar { height: 100%; transition: width 0.15s ease; }
.energy-fill { background: linear-gradient(90deg, var(--cyan), var(--gold-bright)); }

.hud-controls { display: flex; align-items: center; gap: 8px; }
.hud-icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05); color: var(--text-primary); cursor: pointer;
}
.hud-icon-btn.active { border-color: rgba(0, 240, 255, 0.45); color: var(--cyan); }

.objective-banner {
  align-self: center; margin-top: 8px; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; background: rgba(9, 14, 26, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.25); font-size: 0.82rem; max-width: 92vw;
}
.obj-icon { color: var(--gold-bright); }

.output-feed {
  position: fixed; right: 18px; top: 82px; z-index: 16;
  display: flex; flex-direction: column; gap: 6px; width: 250px; pointer-events: none;
}
.feed-item {
  background: rgba(9, 14, 26, 0.82); border-left: 3px solid var(--cyan);
  border-radius: 8px; padding: 7px 10px; font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--text-primary); backdrop-filter: blur(8px);
  animation: feedIn 0.25s ease;
}
.feed-item.gold { border-left-color: var(--gold-bright); }
.feed-item.violet { border-left-color: var(--violet); }
.feed-item.emerald { border-left-color: var(--emerald); }
@keyframes feedIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }

.cinematic-banner {
  position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; padding: 22px 36px; border-radius: 16px;
  background: rgba(3, 5, 10, 0.88); border: 1px solid rgba(245, 185, 66, 0.55);
  box-shadow: 0 0 60px rgba(245, 185, 66, 0.28); z-index: 30; pointer-events: none;
}
.cin-kicker { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.22em; color: var(--cyan); }
.cin-title { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--gold-bright); margin: 4px 0; }
.cin-sub { color: var(--text-secondary); font-size: 0.9rem; }

/* BOTTOM DOCK */
.hud-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pulse-glow { animation: glowPulse 1.8s infinite; }
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(245, 185, 66, 0.45); }
  50% { box-shadow: 0 0 46px rgba(245, 185, 66, 0.85), 0 0 68px rgba(0, 240, 255, 0.35); }
}

.impulse-panel {
  display: flex; align-items: center; gap: 14px;
  background: var(--glass-bg); border: 1px solid rgba(245, 185, 66, 0.35);
  backdrop-filter: blur(14px); border-radius: 14px; padding: 10px 16px;
}
.impulse-meter-wrap { width: 220px; display: flex; flex-direction: column; gap: 5px; }
.impulse-meter-label { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-secondary); }
.resonance-track { position: relative; height: 13px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.resonance-sweet-spot {
  position: absolute; top: 0; bottom: 0; left: 38%; width: 24%;
  background: linear-gradient(90deg, rgba(245, 185, 66, 0.25), rgba(255, 224, 138, 0.72), rgba(245, 185, 66, 0.25));
  border-left: 1px solid var(--gold-bright); border-right: 1px solid var(--gold-bright);
}
.resonance-cursor {
  position: absolute; top: -2px; bottom: -2px; width: 6px; border-radius: 3px;
  background: var(--cyan); box-shadow: 0 0 12px var(--cyan); left: 50%; transform: translateX(-50%);
}
.btn-impulse {
  display: flex; flex-direction: column; align-items: center; padding: 9px 18px; border-radius: 11px;
  border: 1px solid rgba(255, 224, 138, 0.65);
  background: linear-gradient(135deg, #f5b942 0%, #ffdf7e 55%, #d97706 100%);
  color: #060911; cursor: pointer; box-shadow: 0 0 22px rgba(245, 185, 66, 0.4);
}
.impulse-btn-main { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; }
.impulse-btn-sub { font-family: var(--font-mono); font-size: 0.58rem; opacity: 0.82; }

.bottom-docks-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 98vw;
}
.limbs-dock, .upgrades-dock { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.limb-chip, .upgrade-chip {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px); border-radius: 11px; padding: 8px 12px;
  min-width: 158px; text-align: left; color: var(--text-primary); cursor: pointer;
  transition: all 0.2s ease;
}
.limb-chip.unlocked {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(168, 85, 247, 0.12);
}
.limb-chip.affordable, .upgrade-chip.affordable {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.18);
}
.limb-chip.disabled, .upgrade-chip.disabled { opacity: 0.45; cursor: not-allowed; }
.limb-chip:hover:not(.disabled), .upgrade-chip:hover:not(.disabled) { transform: translateY(-2px); }

.upg-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; gap: 6px; }
.upg-name { font-family: var(--font-display); font-size: 0.8rem; font-weight: 600; }
.upg-lvl { font-family: var(--font-mono); font-size: 0.65rem; color: var(--cyan); }
.upg-desc { font-size: 0.68rem; color: var(--text-secondary); margin-bottom: 4px; }
.upg-cost { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; color: var(--emerald); }
