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

:root {
  --cyan: #00e5ff;
  --cyan-glow: rgba(0, 229, 255, 0.55);
  --gold: #ffb84d;
  --red: #ff3b5c;
  --text: #c9f5ff;
  --text-dim: rgba(201, 245, 255, 0.6);
  --panel: rgba(0, 30, 60, 0.55);
  --border: rgba(0, 229, 255, 0.35);
  --border-dim: rgba(0, 229, 255, 0.15);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #000814;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }

#video {
  position: fixed; bottom: 90px; right: 20px;
  width: 200px; height: 150px;
  object-fit: cover; border-radius: 8px;
  border: 1.5px solid var(--border);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.25);
  transform: scaleX(-1);
  z-index: 8; opacity: 0; transition: opacity 0.6s ease;
  background: #000;
  filter: hue-rotate(160deg) saturate(0.8);
}
#video.on { opacity: 0.85; }

#hand-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; }

.reactor-wrap {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4; pointer-events: none;
  opacity: 0; animation: reactorIn 1.6s 0.6s forwards;
}
@keyframes reactorIn { to { opacity: 1; } }

.reactor {
  position: relative;
  width: clamp(220px, 30vw, 340px);
  height: clamp(220px, 30vw, 340px);
  display: flex; align-items: center; justify-content: center;
}

.reactor-ring {
  position: absolute; border-radius: 50%;
  border: 1.5px solid var(--border);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.ring-1 { width: 100%; height: 100%; border-style: dashed; animation: spin 24s linear infinite; }
.ring-2 { width: 78%; height: 78%; animation: spin 16s linear infinite reverse; }
.ring-3 { width: 56%; height: 56%; border-style: dotted; border-width: 2px; animation: spin 10s linear infinite; }
.ring-4 { width: 34%; height: 34%; box-shadow: 0 0 24px var(--cyan-glow); animation: spin 6s linear infinite reverse; }
@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.reactor-core {
  width: 20%; height: 20%; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--cyan) 40%, transparent 100%);
  box-shadow: 0 0 40px #fff, 0 0 80px var(--cyan), 0 0 120px var(--cyan-glow);
  animation: corePulse 2.4s ease-in-out infinite;
}
@keyframes corePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

.reactor-pulse {
  position: absolute; top: 50%; left: 50%;
  width: 100%; height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%; border: 2px solid var(--cyan);
  animation: pulseOut 3s ease-out infinite;
}
@keyframes pulseOut {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

.hud-top {
  position: fixed; top: 0; left: 0; right: 0;
  height: 70px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: linear-gradient(180deg, rgba(0, 20, 40, 0.9) 0%, transparent 100%);
  z-index: 10; pointer-events: none;
  border-bottom: 1px solid var(--border-dim);
}

.hud-left { display: flex; flex-direction: column; gap: 4px; }
.brand-name {
  font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 16px;
  letter-spacing: 3px; color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan-glow);
}
.brand-sub { font-size: 10px; color: var(--text-dim); letter-spacing: 2px; }
.clock {
  font-family: 'Orbitron', sans-serif; font-weight: 500; font-size: 20px;
  color: var(--cyan); letter-spacing: 4px;
  text-shadow: 0 0 12px var(--cyan-glow);
}

.status-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; font-size: 11px; letter-spacing: 1.5px;
  color: var(--text); backdrop-filter: blur(8px);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: statusPulse 1.6s ease-in-out infinite;
}
.status-dot.ready { background: #00ff88; box-shadow: 0 0 10px #00ff88; }
.status-dot.error { background: var(--red); box-shadow: 0 0 10px var(--red); }
@keyframes statusPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hud-left-panel, .hud-right-panel {
  position: fixed; top: 90px; bottom: 110px; width: 240px;
  z-index: 9; display: flex; flex-direction: column; gap: 12px;
  padding: 12px; pointer-events: none;
  opacity: 0; animation: panelIn 0.8s 1.2s forwards;
}
@keyframes panelIn { to { opacity: 1; } }
.hud-left-panel { left: 20px; }
.hud-right-panel { right: 20px; }

.panel {
  background: var(--panel); border: 1px solid var(--border-dim);
  border-left: 3px solid var(--cyan); border-radius: 6px;
  padding: 14px 16px; backdrop-filter: blur(10px);
}
.panel-title {
  font-family: 'Orbitron', sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 3px; color: var(--cyan);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-dim);
}
.stat-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 11.5px;
  color: var(--text-dim); letter-spacing: 1px;
}
.stat-val { color: var(--cyan); font-weight: 700; }
.stat-val.active { color: #00ff88; }
.stat-val.searching { color: var(--gold); }

.log {
  max-height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; line-height: 1.5;
}
.log-entry {
  color: var(--text-dim); padding-left: 10px;
  position: relative; word-break: break-word;
}
.log-entry::before { content: "▸"; position: absolute; left: 0; color: var(--cyan); }
.log-entry.source { color: var(--cyan); font-size: 10px; opacity: 0.75; }

.hud-bottom {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 14px 24px 18px;
  background: linear-gradient(0deg, rgba(0, 20, 40, 0.9) 0%, transparent 100%);
  z-index: 10; display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid var(--border-dim);
  pointer-events: none;
}

.voice-section { display: flex; align-items: center; gap: 14px; justify-content: center; }
.voice-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(0, 229, 255, 0.35), rgba(0, 40, 80, 0.7));
  border: 1.5px solid var(--cyan);
  color: var(--cyan); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px var(--cyan-glow);
  pointer-events: auto;
  transition: transform 0.2s ease;
}
.voice-btn:active { transform: scale(0.96); }
.voice-btn.listening {
  background: radial-gradient(circle at 35% 30%, rgba(255, 59, 92, 0.4), rgba(80, 0, 20, 0.7));
  border-color: var(--red); color: var(--red);
  box-shadow: 0 0 40px rgba(255, 59, 92, 0.6);
  animation: voicePulse 1.2s ease-in-out infinite;
}
@keyframes voicePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.mic-off { display: none; }
.voice-btn.listening .mic-on { display: none; }
.voice-btn.listening .mic-off { display: block; }

.voice-info { display: flex; flex-direction: column; gap: 3px; min-width: 200px; }
.voice-label { font-family: 'Orbitron', sans-serif; font-size: 9px; letter-spacing: 3px; color: var(--cyan); }
.voice-text { font-size: 12px; color: var(--text); }

.command-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; pointer-events: auto;
}
.chip {
  padding: 7px 14px;
  background: rgba(0, 40, 80, 0.5);
  border: 1px solid var(--border-dim);
  border-radius: 999px;
  color: var(--text); font-family: inherit;
  font-size: 11px; letter-spacing: 1px;
  cursor: pointer;
}
.chip:active { background: rgba(0, 229, 255, 0.15); }

.intro {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(ellipse at center, #001226 0%, #000408 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  transition: opacity 0.9s ease;
}
.intro.hide { opacity: 0; pointer-events: none; }

.intro-inner {
  max-width: 500px; width: 100%; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.intro-reactor {
  position: relative; width: 140px; height: 140px;
  display: flex; align-items: center; justify-content: center;
}
.intro-ring {
  position: absolute; top: 50%; left: 50%;
  width: 100%; height: 100%; border-radius: 50%;
  border: 1.5px solid var(--cyan);
  transform: translate(-50%, -50%); opacity: 0;
  animation: introRing 2.4s ease-out infinite;
}
.intro-ring.delay-1 { animation-delay: 0.8s; }
.intro-ring.delay-2 { animation-delay: 1.6s; }
@keyframes introRing {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}
.intro-core {
  width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--cyan) 40%, transparent 100%);
  box-shadow: 0 0 40px #fff, 0 0 80px var(--cyan);
}
.intro-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900; font-size: clamp(32px, 7vw, 56px);
  letter-spacing: 8px; color: var(--cyan);
  text-shadow: 0 0 30px var(--cyan-glow);
}
.intro-sub { font-size: 13px; letter-spacing: 2px; color: var(--text-dim); }
.intro-note {
  font-size: 11.5px; color: var(--text-dim);
  line-height: 1.7; max-width: 360px;
  padding: 12px 16px;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
}
.intro-btn {
  padding: 16px 44px;
  background: transparent;
  border: 1.5px solid var(--cyan);
  border-radius: 4px;
  color: var(--cyan);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700; font-size: 14px;
  letter-spacing: 6px; cursor: pointer;
  box-shadow: 0 0 20px var(--cyan-glow);
}
.intro-btn:active { background: rgba(0, 229, 255, 0.15); }

.response {
  position: fixed; bottom: 200px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: 700px; width: calc(100% - 40px);
  padding: 16px 24px;
  background: rgba(0, 30, 60, 0.85);
  border: 1px solid var(--cyan);
  border-radius: 8px;
  box-shadow: 0 0 40px var(--cyan-glow);
  backdrop-filter: blur(14px);
  z-index: 20; opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.response.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.response-label {
  font-family: 'Orbitron', sans-serif; font-size: 9px;
  letter-spacing: 4px; color: var(--cyan); margin-bottom: 6px;
}
.response-text { font-size: 15px; line-height: 1.6; color: var(--text); }

.flash {
  position: fixed; inset: 0; background: #fff;
  z-index: 200; opacity: 0; pointer-events: none;
}
.flash.fire { animation: flashFire 0.4s ease-out; }
@keyframes flashFire { 0% { opacity: 0; } 20% { opacity: 0.85; } 100% { opacity: 0; } }

@media (max-width: 900px) {
  .hud-left-panel, .hud-right-panel { display: none; }
  #video { width: 140px; height: 105px; bottom: 130px; right: 12px; }
  .clock { font-size: 15px; }
  .brand-name { font-size: 13px; }
  .brand-sub { font-size: 9px; }
  .hud-top { height: 60px; padding: 0 16px; }
  .hud-bottom { padding: 12px 16px; }
  .chip { padding: 6px 11px; font-size: 10px; }
  .response { bottom: 190px; font-size: 13px; }
}