:root {
  --bg: #07111f;
  --panel: #0c1b2d;
  --panel2: #0f2439;
  --text: #edf5ff;
  --muted: #9eb2c7;
  --line: #1f4565;
  --accent: #48a7ff;
  --danger: #e45858;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, Segoe UI, sans-serif; }
button, input, select { font: inherit; }

.shell { width: min(1120px, calc(100vw - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.shell.wide { width: min(1480px, calc(100vw - 32px)); }
header { margin-bottom: 20px; }
h1 { margin: 0 0 6px; font-size: 28px; }
p { color: var(--muted); }

.grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.operator-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.card, .video-wrap { background: linear-gradient(180deg, var(--panel), #081522); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
h2 { margin: 0 0 12px; font-size: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
button { cursor: pointer; border: 0; color: #04111f; background: var(--accent); padding: 10px 14px; border-radius: 10px; font-weight: 700; }
button.secondary { background: #d5e7f7; }
button.danger { background: var(--danger); color: white; }
input, select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #071827; color: var(--text); margin-bottom: 10px; }
label { display: block; color: var(--muted); margin-bottom: 6px; }

video { width: 100%; background: #000; border-radius: 10px; display: block; }
#preview { aspect-ratio: 16 / 9; margin-top: 12px; }
.video-wrap { padding: 8px; }
#remoteVideo { width: 100%; max-height: calc(100vh - 150px); object-fit: contain; }

.session-code { font-size: 42px; letter-spacing: 4px; font-weight: 800; color: var(--accent); margin: 16px 0; }
.muted { color: var(--muted); font-size: 14px; }
pre { white-space: pre-wrap; word-break: break-word; color: #d8eaff; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.07); border-radius: 10px; padding: 12px; min-height: 130px; max-height: 280px; overflow: auto; }

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