@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;800;900&family=Rajdhani:wght@500;600;700&family=Share+Tech+Mono&display=swap');

:root {
  --primary-cyan: #00e5ff;
  --primary-cyan-glow: rgba(0, 229, 255, 0.4);
  --warning-amber: #ffaa00;
  --warning-red: #ff3344;
  --warning-red-glow: rgba(255, 51, 68, 0.5);
  --cozy-gold: #ffc266;
  --cozy-gold-glow: rgba(255, 194, 102, 0.35);
  --hud-bg: rgba(6, 12, 20, 0.78);
  --hud-border: rgba(0, 229, 255, 0.3);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #020408;
  color: #e0f2fe;
  font-family: var(--font-body);
  font-size: 16px;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#three-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================================================
   CINEMATIC EYELIDS & WAKEUP EFFECT
   ========================================================= */
#cinematic-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.eyelid {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background: #000;
  transition: transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.eyelid-top {
  top: 0;
  transform-origin: top;
}

.eyelid-bottom {
  bottom: 0;
  transform-origin: bottom;
}

.eyelid-open .eyelid-top {
  transform: translateY(-100%);
}

.eyelid-open .eyelid-bottom {
  transform: translateY(100%);
}

#flash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 55;
  transition: opacity 0.15s ease-out;
}

/* =========================================================
   HUD & RETICLE
   ========================================================= */
#hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

#reticle-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#reticle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#reticle.active {
  width: 24px;
  height: 24px;
  background: transparent;
  border: 2px solid var(--primary-cyan);
  box-shadow: 0 0 16px var(--primary-cyan-glow);
  transform: rotate(45deg);
}

#interaction-prompt {
  margin-top: 18px;
  padding: 6px 14px;
  background: var(--hud-bg);
  border: 1px solid var(--primary-cyan);
  border-radius: 4px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.2s ease-out;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

#interaction-prompt.visible {
  opacity: 1;
  transform: translateY(0);
}

#interaction-prompt .key {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 6px;
  background: var(--primary-cyan);
  color: #030a14;
  font-weight: 800;
  border-radius: 3px;
}

/* =========================================================
   TOP STATUS & NAVIGATION BAR
   ========================================================= */
#top-bar {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
  z-index: 30;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 6px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--primary-cyan);
  text-shadow: 0 0 10px var(--primary-cyan-glow);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 10px;
}

.deck-selector {
  display: flex;
  gap: 8px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  backdrop-filter: blur(8px);
  padding: 4px;
  border-radius: 6px;
}

.hud-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.hud-btn.active {
  color: #030a14;
  background: var(--primary-cyan);
  border-color: var(--primary-cyan);
  box-shadow: 0 0 12px var(--primary-cyan-glow);
  font-weight: 700;
}

.hud-btn.danger {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

.hud-btn.danger:hover {
  background: rgba(255, 107, 107, 0.2);
  color: #fff;
}

/* =========================================================
   H.O.M.E. AI SUBTITLE BANNER
   ========================================================= */
#ai-banner {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 820px;
  background: rgba(4, 10, 18, 0.88);
  border: 1px solid var(--primary-cyan);
  border-radius: 8px;
  padding: 14px 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 20px var(--primary-cyan-glow);
  pointer-events: auto;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 40;
}

#ai-banner.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--primary-cyan);
}

.ai-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 12px;
}

.ai-wave-bar {
  width: 3px;
  height: 4px;
  background: var(--primary-cyan);
  border-radius: 1px;
  animation: wave 1.2s ease-in-out infinite alternate;
}

.ai-wave-bar:nth-child(2) { animation-delay: 0.2s; height: 10px; }
.ai-wave-bar:nth-child(3) { animation-delay: 0.4s; height: 14px; }
.ai-wave-bar:nth-child(4) { animation-delay: 0.1s; height: 8px; }
.ai-wave-bar:nth-child(5) { animation-delay: 0.5s; height: 6px; }

@keyframes wave {
  0% { transform: scaleY(0.3); opacity: 0.5; }
  100% { transform: scaleY(1.2); opacity: 1; }
}

.ai-text {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: #f1f5f9;
}

/* =========================================================
   SMARTWATCH (BIO-SYNC PULSE) OVERLAY
   ========================================================= */
#smartwatch-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 640px;
  background: rgba(3, 8, 16, 0.94);
  border: 1px solid var(--primary-cyan);
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.25), inset 0 0 20px rgba(0, 229, 255, 0.1);
  backdrop-filter: blur(16px);
  padding: 24px;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
}

#smartwatch-modal.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.watch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 229, 255, 0.3);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.watch-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--primary-cyan);
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.vital-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.vital-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.vital-val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #38bdf8;
}

.vital-val.warn {
  color: var(--warning-amber);
}

/* =========================================================
   START SCREEN & OVERLAYS
   ========================================================= */
#start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #0a1424 0%, #020509 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: opacity 1.2s ease;
  pointer-events: auto;
}

#start-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-container {
  max-width: 680px;
  text-align: center;
  padding: 40px;
}

.intro-logo {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 0 0 25px var(--primary-cyan-glow);
  margin-bottom: 6px;
}

.intro-subtitle {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--primary-cyan);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.intro-story {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 32px;
}

.start-btn {
  background: linear-gradient(135deg, #00e5ff 0%, #0077b6 100%);
  color: #020617;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  border: none;
  padding: 16px 36px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 25px var(--primary-cyan-glow);
  transition: all 0.25s ease;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.8);
}

.intro-hints {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #64748b;
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* =========================================================
   BOTTOM CONTROLS HELP BAR
   ========================================================= */
#controls-helper {
  position: absolute;
  bottom: 8px;
  left: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(148, 163, 184, 0.6);
  pointer-events: none;
  z-index: 25;
}
