:root {
  --bg: #081217;
  --bg-soft: #122028;
  --card: rgba(7, 18, 23, 0.86);
  --line: rgba(126, 249, 160, 0.18);
  --text: #edf6f2;
  --muted: #97afa7;
  --accent: #46ff96;
  --danger: #ff5b5b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(70, 255, 150, 0.12), transparent 35%),
    linear-gradient(180deg, #071015 0%, #0e1b20 100%);
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.hero h1,
.hero p {
  margin: 0;
}

.badge {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--danger);
  color: white;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.video-panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  gap: 12px;
}

.camera-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.camera-picker select {
  min-width: 200px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(70, 255, 150, 0.16);
  background: rgba(18, 32, 40, 0.92);
  color: var(--text);
}

.video-shell {
  position: relative;
}

#video {
  width: 100%;
  border-radius: 18px;
  background: black;
  aspect-ratio: 16 / 9;
}

.line-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.line-overlay line {
  stroke: #39ff76;
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(57, 255, 118, 0.45));
}

.line-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.preview-block {
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(18, 32, 40, 0.78);
  border: 1px solid rgba(70, 255, 150, 0.12);
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
}

.line-preview {
  width: 100%;
  display: block;
  border-radius: 16px;
  background: black;
}

.stats-panel {
  padding: 18px;
}

.stats-panel h2 {
  margin-top: 0;
}

.stat-card {
  padding: 18px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid rgba(70, 255, 150, 0.12);
  margin-bottom: 14px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: 32px;
  color: var(--accent);
}

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