:root {
  color-scheme: dark;
  --bg: #081217;
  --bg-accent: #11242b;
  --panel: rgba(7, 22, 30, 0.82);
  --panel-strong: rgba(9, 32, 44, 0.95);
  --line: rgba(138, 221, 255, 0.18);
  --text: #effbf8;
  --muted: #98b5bd;
  --accent: #7df9c7;
  --accent-strong: #d6ff72;
  --danger: #ff8170;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(125, 249, 199, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(214, 255, 114, 0.12), transparent 24%),
    linear-gradient(180deg, #081217 0%, #09161c 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.35rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #071217;
  font-weight: 700;
}

button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

input {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0.95rem 1rem;
}

.shell,
.tv-shell {
  min-height: 100vh;
  padding: 1.5rem;
}

.landing-shell,
.phone-shell {
  display: grid;
  gap: 1.5rem;
}

.landing-shell {
  place-items: center;
}

.hero-card,
.panel,
.tv-sidebar {
  width: min(960px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card h1,
.panel h1,
.tv-sidebar h1 {
  margin: 0.35rem 0 0.8rem;
  font-size: clamp(2rem, 4vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--accent);
  font-size: 0.72rem;
}

.lede,
.hint,
.scoreline,
.status-stack p,
.notes-grid p {
  color: var(--muted);
}

.room-form,
.status-stack {
  display: grid;
  gap: 0.8rem;
}

.pairing-card,
.tv-pairing {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pairing-card h2 {
  margin: 0.25rem 0 0.6rem;
  font-size: 1.4rem;
}

.pairing-layout {
  display: grid;
  grid-template-columns: minmax(140px, 240px) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.pairing-details {
  display: grid;
  gap: 0.85rem;
}

.pairing-link {
  color: var(--text);
  word-break: break-all;
}

.qr-image {
  display: block;
  width: min(100%, 240px);
  aspect-ratio: 1;
  border-radius: 18px;
  background: white;
  padding: 0.65rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.notes-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.notes-grid article {
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.sticky-panel {
  position: sticky;
  top: 1rem;
  z-index: 2;
}

.camera-stage,
.tv-stage {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 56vh;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.camera-stage video,
.camera-stage canvas,
.tv-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.camera-stage video,
.camera-stage canvas {
  position: absolute;
  inset: 0;
  object-fit: cover;
}

.tv-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 1.25rem;
}

.tv-sidebar {
  width: 100%;
}

.tv-body {
  overflow: hidden;
}

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

  .pairing-layout {
    grid-template-columns: 1fr;
  }

  .camera-stage,
  .tv-stage {
    min-height: 48vh;
  }
}