:root {
  --bg: #0f0518;
  --panel: #1a0b2e;
  --primary: #d946ef; /* Pink */
  --secondary: #8b5cf6; /* Purple */
  --accent: #22d3ee; /* Cyan */
  --text: #e9d5ff;
  --font-head: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 1000px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--secondary);
  padding-bottom: 10px;
}

h1 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 2rem;
  letter-spacing: 2px;
  text-shadow: 0 0 10px var(--primary);
}
.accent { color: var(--primary); }

.status-bar {
  font-size: 1rem;
  color: var(--accent);
  font-weight: bold;
}

/* Main Canvas Area */
main {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  border: 1px solid var(--secondary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

video {
  display: none;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Loading Screen */
.loading-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15, 5, 24, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  text-align: center;
}
.spinner {
  width: 50px; height: 50px;
  border: 4px solid var(--secondary);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer / Controls */
footer {
  margin-top: 15px;
  background: var(--panel);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

h3 { margin: 0 0 10px; font-size: 1rem; color: var(--accent); }

.style-selector {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.style-btn {
  width: 80px;
  height: 80px;
  border: 2px solid var(--secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.style-btn canvas {
  width: 100%; height: 100%;
}
.style-btn:hover { transform: translateY(-3px); border-color: var(--primary); }
.style-btn.active { border-color: var(--primary); box-shadow: 0 0 15px var(--primary); }

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 10px;
}

input[type=range] { accent-color: var(--primary); }

#start-btn {
  padding: 10px 30px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  border: none;
  color: white;
  font-family: var(--font-head);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
}
#start-btn:hover { filter: brightness(1.2); }