:root {
  --primary: #38bdf8;
  --secondary: #818cf8;
  --accent: #f472b6;
  --bg: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: "Outfit", sans-serif;
  background-color: var(--bg);
  color: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
}

.container {
  width: 100%;
  max-width: 1200px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 1rem;
}

h1 {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

p.subtitle {
  color: #94a3b8;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.view-section {
  position: relative;
  background: var(--card-bg);
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

#video,
#canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}

#video {
  transform: scaleX(-1);
}

#canvas {
  transform: scaleX(-1);
  z-index: 2;
}

.info-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.result-card {
  text-align: center;
  border: 2px solid var(--primary);
}

.result-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

#text {
  font-family: "JetBrains Mono", monospace;
  font-size: 5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #94a3b8;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: pulse 2s infinite;
}

.status-dot.active {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.5s ease;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.guide-list {
  list-style: none;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.guide-list li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guide-list li::before {
  content: "→";
  color: var(--primary);
}

.hidden {
  display: none !important;
}
