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

body {
  background: #000;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  color: #fff;
}

#webcam {
  display: none;
}

#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}

/* Loading screen */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(ellipse at center, #1a0a2e 0%, #0d0d0d 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}

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

.loader-content {
  text-align: center;
}

.loader-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ff6b35, #ff4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#loading-status {
  font-size: 1.1rem;
  color: #aaa;
  margin-bottom: 1.5rem;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1.5rem;
  border: 3px solid rgba(255, 107, 53, 0.3);
  border-top-color: #ff6b35;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#start-btn {
  padding: 12px 32px;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #ff6b35, #e63946);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

#start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

/* HUD */
#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.hud-line {
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
  display: inline-block;
}

.hud-line.calibrating { color: #00ffff; }
.hud-line.charging { color: #ffa500; }
.hud-line.sharingan { color: #ff3333; }
.hud-line.rasengan { color: #55aaff; }

/* Instructions toast */
#instructions {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.85rem;
  text-align: center;
  transition: opacity 2s;
  pointer-events: none;
}

#instructions p {
  margin: 4px 0;
  color: #ccc;
}

#instructions p strong {
  color: #fff;
}

#instructions.fade-out {
  opacity: 0;
}
