:root {
  --bg: #0b1020;
  --panel: #10182a;
  --accent: #38bdf8;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --outline: #1f2a44;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(1200px circle at 20% 10%, #1b2a4a, var(--bg));
  color: var(--text);
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

header p {
  margin: 0;
  color: var(--muted);
}

.toggles {
  display: flex;
  align-items: center;
  gap: 12px;
}

button {
  background: var(--accent);
  border: none;
  color: #0b1220;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

button.active {
  background: #f97316;
  color: #1f1305;
}

#status {
  color: var(--muted);
}

.live {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 16px;
  margin: 24px 0;
}

video {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--outline);
  background: #020617;
}

.stats {
  display: grid;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: 16px;
  padding: 14px;
  align-content: start;
}

.stats div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.stats strong {
  color: var(--text);
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

label {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--outline);
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="range"] {
  width: 100%;
}

.outputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--muted);
}

.pano-status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

canvas {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #0f172a;
  background: #020617;
}

.note {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

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