:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --panel: #15171c;
  --panel-2: #1c1f26;
  --line: #2c3039;
  --text: #f5f6f7;
  --muted: #9ba1ad;
  --accent: #d9ff4a;
  --accent-text: #111503;
  --danger: #ff7770;
  --success: #7ce0a4;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at 15% 0%, rgba(217, 255, 74, 0.07), transparent 32rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
[hidden] { display: none !important; }

.shell { width: min(1120px, calc(100% - 36px)); min-height: 100vh; margin: 0 auto; padding: 22px 0 26px; display: flex; flex-direction: column; }
.topbar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--text); font-weight: 750; text-decoration: none; }
.brand-mark { width: 15px; height: 15px; border: 5px solid var(--accent); border-radius: 50%; }
.status, .badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.status[data-tone="good"] { color: var(--success); }
.status[data-tone="warn"] { color: #ffd47d; }
.status[data-tone="bad"] { color: var(--danger); }

.landing {
  min-height: calc(100vh - 164px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(48px, 9vw, 120px);
  align-items: center;
  padding: 70px 0;
}
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(44px, 7.3vw, 88px); line-height: 0.96; letter-spacing: -0.065em; }
.lede { max-width: 650px; margin: 26px 0 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.card { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(150deg, var(--panel-2), var(--panel)); box-shadow: 0 26px 80px rgba(0,0,0,.35); }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { background: var(--accent); color: var(--accent-text); }
.button-secondary { border-color: var(--line); background: var(--panel-2); }
.button-ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.button-danger { border-color: rgba(255,119,112,.35); background: rgba(255,119,112,.1); color: #ffa19c; }
.button-wide { width: 100%; min-height: 52px; }
.button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(217,255,74,.38); outline-offset: 3px; }
.divider { display: flex; gap: 12px; align-items: center; margin: 22px 0; color: #717784; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.divider::before, .divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
label { display: block; margin-bottom: 8px; color: #c8cbd1; font-size: 12px; font-weight: 700; }
.join-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #0d0f12; color: var(--text); }
.error { margin: 14px 0 0; color: #ffa19c; font-size: 13px; line-height: 1.5; }
.error-banner { margin: 0 0 16px; padding: 12px 14px; border: 1px solid rgba(255,119,112,.3); border-radius: 11px; background: rgba(255,119,112,.08); }

.room { flex: 1; padding-top: 58px; }
.room-header { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.room-meta { display: flex; gap: 8px; margin-bottom: 12px; }
.badge[data-role="host"] { border-color: rgba(217,255,74,.25); background: rgba(217,255,74,.08); color: var(--accent); }
.room h1 { font-size: clamp(34px, 5vw, 56px); }
.message { margin: 11px 0 0; color: var(--muted); }
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stage {
  position: relative;
  min-height: min(64vh, 690px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #060708;
  box-shadow: 0 24px 72px rgba(0,0,0,.32);
}
.stage video { width: 100%; height: 100%; max-height: 76vh; object-fit: contain; background: #000; }
.empty-state { max-width: 480px; padding: 46px 24px; text-align: center; }
.empty-state h2 { margin: 18px 0 8px; font-size: 25px; }
.empty-state p { margin: 0; color: var(--muted); line-height: 1.55; }
.screen-icon { width: 58px; height: 40px; margin: 0 auto; border: 3px solid #505661; border-radius: 7px; position: relative; }
.screen-icon::after { position: absolute; left: 18px; right: 18px; bottom: -10px; height: 3px; background: #505661; content: ""; }
.live { position: absolute; top: 14px; left: 14px; padding: 6px 9px; border-radius: 999px; background: rgba(8,9,10,.75); color: var(--success); font-size: 12px; font-weight: 800; backdrop-filter: blur(8px); }
.controls { margin-top: 14px; display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.controls > div:first-child { display: grid; gap: 4px; }
.controls span { color: var(--muted); font-size: 13px; }
.control-buttons { display: flex !important; grid-auto-flow: column; gap: 8px !important; }
.site-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #717784;
  font-size: 12px;
}
.site-footer .version { color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 800px) {
  .landing { grid-template-columns: 1fr; min-height: auto; padding: 70px 0 40px; }
  .room-header { align-items: flex-start; flex-direction: column; }
  .room-actions { justify-content: flex-start; }
  .stage { min-height: 54vh; }
  .controls { align-items: flex-start; flex-direction: column; }
}
