:root {
  color-scheme: dark;
  --bg: #0a0d12;
  --surface: #111720;
  --surface-2: #18212d;
  --line: #283443;
  --text: #f2f5f8;
  --muted: #98a5b4;
  --accent: #7bd6b3;
  --accent-strong: #42bb8f;
  --danger: #ed8d8d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 143, 125, 0.14), transparent 32rem),
    radial-gradient(circle at 100% 100%, rgba(62, 90, 131, 0.14), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 58px 0 32px;
}
.shell.watching { width: min(1280px, calc(100% - 32px)); }

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid rgba(123, 214, 179, 0.42); border-radius: 13px;
  color: var(--accent); background: rgba(123, 214, 179, 0.08); font-size: 22px;
}
.eyebrow, .kicker { margin: 0; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 4vw, 31px); letter-spacing: -.04em; }
h2 { margin: 7px 0 10px; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.045em; line-height: 1.08; }

.card {
  border: 1px solid rgba(152, 165, 180, 0.16); border-radius: 24px;
  background: rgba(17, 23, 32, 0.88); box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.setup-card { padding: 10px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border-radius: 15px; background: var(--bg); }
.mode-button, .secondary-button, .primary-button, .danger-button {
  border: 1px solid transparent; border-radius: 11px; padding: 12px 15px; color: var(--muted);
  background: transparent; transition: .18s ease; font-weight: 700;
}
.mode-button:hover, .secondary-button:hover { color: var(--text); background: var(--surface-2); }
.mode-button.active { color: var(--text); border-color: var(--line); background: var(--surface-2); }
.intro { padding: 42px 26px 27px; }
.intro p:not(.kicker) { max-width: 560px; margin-bottom: 0; color: var(--muted); line-height: 1.6; }
em { color: var(--text); font-style: normal; }

form { padding: 0 26px 10px; }
label { display: block; margin: 18px 0 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
label span { color: #667384; font-weight: 500; }
input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; outline: none; padding: 13px 14px;
  color: var(--text); background: rgba(10, 13, 18, .72); transition: .18s ease;
}
input:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(66, 187, 143, .12); }
select { width: 100%; border: 1px solid var(--line); border-radius: 12px; outline: none; padding: 13px 14px; color: var(--text); background: rgba(10, 13, 18, .72); }
select:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(66, 187, 143, .12); }
.form-actions, .stage-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.primary-button { color: #07150f; background: var(--accent); }
.primary-button:hover { background: #9de5c8; transform: translateY(-1px); }
.secondary-button { border-color: var(--line); }
.danger-button { border-color: rgba(237, 141, 141, .3); color: var(--danger); background: rgba(237, 141, 141, .06); }
.danger-button:hover { background: rgba(237, 141, 141, .14); }
.notice { margin: 18px 26px 15px; color: #6f7c8b; font-size: 12px; line-height: 1.5; }
.notice.error { color: var(--danger); }

.stage-card { padding: 24px; }
.stage-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.stage-header h2 { margin-bottom: 0; font-size: 25px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 100px; padding: 7px 10px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #e3b878; box-shadow: 0 0 12px #e3b878; }
.status-pill.live { color: var(--accent); border-color: rgba(123, 214, 179, .3); }
.status-pill.live .status-dot { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.status-pill.error { color: var(--danger); border-color: rgba(237, 141, 141, .3); }
.status-pill.error .status-dot { background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.video-frame { position: relative; display: grid; place-items: center; overflow: hidden; min-height: 360px; border: 1px solid var(--line); border-radius: 17px; background: #05070a; }
.video { display: block; width: 100%; max-height: min(70vh, 620px); object-fit: contain; background: #05070a; }
.shell.watching .video { max-height: min(76vh, 820px); }
.video-frame:fullscreen { width: 100vw; height: 100vh; border: 0; border-radius: 0; }
.video-frame:fullscreen .video { width: 100vw; height: 100vh; max-height: 100vh; }
.video-frame:fullscreen .video-placeholder { min-height: 100vh; }
.video-placeholder { display: grid; place-items: center; gap: 8px; padding: 65px 20px; color: var(--muted); text-align: center; }
.video-placeholder p { margin: 0; font-size: 13px; }
.placeholder-icon { color: var(--accent); font-size: 45px; line-height: 1; }
.stage-actions { justify-content: flex-end; margin-top: 17px; }

footer { display: flex; justify-content: center; gap: 8px; margin-top: 21px; color: #627080; font-size: 11px; }
footer a { color: var(--muted); }
.hidden { display: none !important; }

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 720px); padding-top: 28px; }
  .intro { padding: 32px 17px 22px; }
  form { padding: 0 17px 10px; }
  .notice { margin-left: 17px; margin-right: 17px; }
  .stage-card { padding: 16px; }
  .shell.watching { width: min(100% - 20px, 1280px); }
  .stage-header { align-items: flex-start; flex-direction: column; }
  .form-actions > * { width: 100%; }
  footer { flex-wrap: wrap; text-align: center; }
}
