/* style.css — NEON AURA AR v3.0 (PRD v1.0 + v2.0) */

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0f;
  --hud-color: #00ffff;
  --font-head: 'Orbitron', monospace;
  --font-mono: 'Space Mono', monospace;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: #fff;
  font-family: var(--font-mono);
}

/* ── Loading Overlay ───────────────────────────────────────────────────────── */
#loading {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(10,10,15,0.92);
  gap: 20px;
}

.loading-spinner {
  width: 52px; height: 52px;
  border: 3px solid rgba(0,255,255,0.15);
  border-top-color: #00ffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 3px;
  color: #00ffff;
  text-transform: uppercase;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ── Splash Screen ─────────────────────────────────────────────────────────── */
#splash {
  position: fixed; inset: 0;
  display: flex;
  align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 100;
  overflow: hidden;
}

#splashCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.splash-content {
  position: relative;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,255,255,0.15);
  border-radius: 20px;
  padding: 50px 60px;
  max-width: 560px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(0,255,255,0.08), inset 0 0 40px rgba(0,255,255,0.03);
}

/* Corner accents */
.splash-corner {
  position: absolute;
  width: 20px; height: 20px;
  border-color: rgba(0,255,255,0.55);
  border-style: solid;
}
.corner-tl { top: 10px; left: 10px;  border-width: 2px 0 0 2px; }
.corner-tr { top: 10px; right: 10px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: 10px; left: 10px;  border-width: 0 0 2px 2px; }
.corner-br { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }

.splash-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.logo-icon {
  font-size: 48px;
  filter: drop-shadow(0 0 12px rgba(0,255,255,0.6));
}

.splash-title {
  font-family: var(--font-head);
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #00ffff, #ff00ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  text-align: left;
}

.splash-subtitle {
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(0,255,255,0.6);
  text-transform: uppercase;
  text-align: left;
  margin-top: 4px;
}

.splash-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,255,255,0.35), transparent);
  margin: 20px 0;
}

.splash-desc {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  margin-bottom: 24px;
}

.splash-features {
  display: flex; flex-wrap: wrap;
  gap: 8px; justify-content: center;
  margin-bottom: 30px;
}

.feature-tag {
  background: rgba(0,255,255,0.06);
  border: 1px solid rgba(0,255,255,0.25);
  border-radius: 50px;
  padding: 4px 14px;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(0,255,255,0.8);
  text-transform: uppercase;
}

/* CTA actions */
.splash-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-direction: column;
}
@media (min-width: 480px) { .splash-actions { flex-direction: row; } }

#enterBtn, #tutorialBtn {
  width: 100%;
  padding: 16px 30px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s;
  display: flex; align-items: center; justify-content: center;
}

#enterBtn {
  color: #0a0a0f;
  background: linear-gradient(135deg, #00ffff, #00aaff);
  border: none;
  box-shadow: 0 0 30px rgba(0,255,255,0.4);
}

#tutorialBtn {
  color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 0 20px rgba(255,255,255,0.05);
}

#enterBtn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 45px rgba(0,255,255,0.6);
}

#tutorialBtn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}

#enterBtn:active:not(:disabled) { transform: scale(0.97); }
#enterBtn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Error message */
#errorMsg {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  background: rgba(255,50,50,0.08);
  border: 1px solid rgba(255,100,100,0.3);
  border-radius: 12px;
  color: #ff6060;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

#retryBtn {
  padding: 8px 24px;
  background: rgba(255,100,100,0.15);
  border: 1px solid rgba(255,100,100,0.4);
  border-radius: 50px;
  color: #ff6060;
  font-family: var(--font-head);
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.2s;
}
#retryBtn:hover { background: rgba(255,100,100,0.25); }

/* ── AR Screen ─────────────────────────────────────────────────────────────── */
#arScreen {
  display: none;
  position: fixed; inset: 0;
}

/* Hidden video — used as source for MediaPipe and canvas drawImage */
#video {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Full-screen canvas overlay */
#canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

/* ── Top Nav ────────────────────────────────────────────────────────────────── */
#topBar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(10,10,15,0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,255,255,0.08);
  z-index: 50;
}

.top-logo {
  font-family: var(--font-head);
  font-size: clamp(10px, 2vw, 14px);
  font-weight: 700;
  letter-spacing: 4px;
  background: linear-gradient(90deg, #00ffff, #ff00ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

.top-right {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Theme Pills ───────────────────────────────────────────────────────────── */
#themeSwitcher {
  display: flex; gap: 6px; flex-wrap: wrap;
}

.theme-pill {
  padding: 5px 14px;
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}
.theme-pill:hover { border-color: rgba(0,255,255,0.5); color: #fff; }
.theme-pill.active {
  background: rgba(0,255,255,0.12);
  border-color: #00ffff;
  color: #00ffff;
  box-shadow: 0 0 12px rgba(0,255,255,0.35);
}

/* ── Left Action Buttons ────────────────────────────────────────────────────── */
#leftBar {
  position: fixed; top: 60px; left: 12px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 50;
}

.ctrl-btn {
  padding: 7px 14px;
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(20, 20, 30, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.ctrl-btn:hover { border-color: rgba(0,255,255,0.5); color: #fff; }
.ctrl-btn.active {
  background: rgba(0,255,255,0.1);
  border-color: #00ffff;
  color: #00ffff;
  box-shadow: 0 0 10px rgba(0,255,255,0.3);
}

/* ── Mute button ───────────────────────────────────────────────────────────── */
#muteBtn {
  padding: 6px 10px;
  font-size: 16px;
  background: rgba(10,10,15,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
#muteBtn:hover { border-color: rgba(0,255,255,0.5); }

/* ── Capture flash overlay ─────────────────────────────────────────────────── */
#capture-flash {
  position: fixed; inset: 0;
  background: #fff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 999;
}

/* ── Overlay Controls (Floating mode buttons) ──────────────────────────────── */
.overlay-controls {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.overlay-controls button {
  pointer-events: auto;
  padding: 12px 24px;
  background: rgba(0, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(0, 255, 255, 0.4);
  color: #00ffff;
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.overlay-controls button:hover {
  background: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* ── Gesture Badge ──────────────────────────────────────────────────────────── */
#gestureBadge {
  position: fixed;
  top: 70px; left: 50%; transform: translateX(-50%);
  padding: 8px 24px;
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 2px;
  background: rgba(10,10,15,0.85);
  border: 1px solid var(--hud-color);
  border-radius: 50px;
  color: var(--hud-color);
  box-shadow: 0 0 20px rgba(0,255,255,0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 60;
  white-space: nowrap;
}
#gestureBadge.visible { opacity: 1; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .splash-content { padding: 36px 24px; }
  .splash-title   { font-size: 22px; }
  .top-logo       { font-size: 10px; letter-spacing: 2px; }
  .theme-pill     { font-size: 8px; padding: 4px 9px; }
  .ctrl-btn       { font-size: 9px; padding: 6px 10px; }
  #leftBar        { top: 52px; }
}
