:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #111722;
  --line: #263044;
  --text: #f4f7ff;
  --muted: #9ca9bd;
  --accent: #6c7cff;
  --accent2: #8c5cff;
  --danger: #ff5470;
  --success: #35d49a;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 50% -20%, #20294a 0, var(--bg) 45%); color: var(--text); font: 16px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
button, input, select { font: inherit; }
button { border: 1px solid var(--line); border-radius: 10px; padding: .72rem 1rem; color: var(--text); background: #1a2231; cursor: pointer; transition: .15s ease; }
button:hover { border-color: #526078; transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: wait; transform: none; }
.primary { border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); font-weight: 700; }
.danger { border-color: #753747; color: #ffb2bf; background: #2c1720; }
.container { width: min(900px, calc(100% - 32px)); margin: 0 auto; padding: 70px 0; }
header { text-align: center; margin-bottom: 38px; }
.eyebrow { color: #aeb8ff; font-size: .75rem; font-weight: 800; letter-spacing: .18em; }
h1 { max-width: 720px; margin: 12px auto 8px; font-size: clamp(2.25rem, 7vw, 4.6rem); line-height: 1.03; letter-spacing: -.055em; }
.subtitle { margin: 0; color: var(--muted); font-size: 1.1rem; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: 0 24px 60px #0007; }
.controls { padding: 24px; }
.step { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.step div { display: flex; flex-direction: column; }
.step small { color: var(--muted); }
.number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #242d50; color: #bac2ff; font-weight: 800; }
.room-controls { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.link-row, .quality-row, .status-row { display: flex; align-items: center; gap: 10px; }
.link-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: .72rem; color: #d9deeb; background: #090d15; }
.quality-row { margin-top: 18px; flex-wrap: wrap; }
.quality-row select { min-width: 190px; border: 1px solid var(--line); border-radius: 10px; padding: .72rem; color: var(--text); background: #090d15; }
.status-row { justify-content: space-between; margin-top: 20px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 700; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #8994a7; }
.status.live::before { background: var(--success); box-shadow: 0 0 0 4px #35d49a22; }
.status.error::before { background: var(--danger); }
.status.connecting::before { background: #f3b84b; animation: pulse 1s infinite; }
.preview { margin-top: 20px; padding: 10px; overflow: hidden; }
.preview video { display: block; width: 100%; max-height: 520px; border-radius: 11px; background: #000; }
.hidden { display: none !important; }
.viewer-page { overflow: hidden; background: #05070a; }
.viewer-shell { height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.viewer-bar { display: flex; align-items: center; gap: 18px; padding: 12px 18px; background: #10151e; border-bottom: 1px solid var(--line); }
.viewer-bar .status { margin-left: auto; }
.brand { color: var(--text); font-weight: 800; text-decoration: none; }
.video-stage { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; overflow: hidden; background: #000; }
.video-stage video,
.video-stage iframe { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; border: 0; background: #000; }
.video-message { position: absolute; pointer-events: none; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #111722e8; }
.streams-page { min-height: 100vh; }
.streams-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0; }
.streams-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; text-align: left; }
.streams-header h1 { margin: 8px 0 4px; font-size: clamp(2rem, 6vw, 3.7rem); }
.stream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 18px; }
.stream-card { padding: 22px; }
.stream-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stream-viewers { color: var(--muted); font-size: .86rem; }
.stream-card h2 { margin: 18px 0; font-size: 1.25rem; letter-spacing: -.02em; }
.stream-preview-hint { color: var(--muted); font-size: .9rem; }
.stream-preview { position: relative; aspect-ratio: 16 / 9; margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #000; }
.stream-preview iframe { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; border: 0; pointer-events: none; }
.stream-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.thumbnail-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: linear-gradient(135deg, #172338, #253a52); }
.stream-preview button { position: absolute; z-index: 2; inset: auto 8px 8px auto; width: auto; padding: .35rem .6rem; background: #111722e8; }
.stream-preview button[aria-pressed="true"] { inset: auto 8px 8px auto; width: auto; padding: .35rem .6rem; font-size: .8rem; background: #111722e8; }
.stream-details { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; margin: 0; font-size: .9rem; }
.stream-details dt { color: var(--muted); }
.stream-details dd { min-width: 0; margin: 0; text-align: right; overflow-wrap: anywhere; }
.stream-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.stream-actions > * { flex: 1; }
.button-link { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; padding: .72rem 1rem; color: var(--text); text-decoration: none; }
.empty-state { padding: 50px 24px; text-align: center; }
.empty-state p { margin: 12px 0 0; color: var(--muted); }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 600px) {
  .container { padding: 36px 0; }
  .controls { padding: 18px; }
  .link-row { align-items: stretch; flex-direction: column; }
  .quality-row > * { width: 100%; }
  .viewer-bar { gap: 10px; }
  .brand { display: none; }
  .viewer-bar .status { margin-left: 0; margin-right: auto; }
  .streams-shell { padding: 30px 0; }
  .streams-header { align-items: stretch; flex-direction: column; }
  .streams-header button { width: 100%; }
}

/* Shared navigation stays in normal flow, including on the full-height viewer. */
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 12px max(16px, calc((100% - 1440px) / 2)); background: #10151e; border-bottom: 1px solid var(--line); }
.site-logo { color: var(--text); font-weight: 800; text-decoration: none; }
.site-nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.site-nav-links a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; }
.site-nav-links a:hover, .site-nav-links a[aria-current="page"] { color: var(--text); background: #242d50; }
.site-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.viewer-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.viewer-page > .site-nav { flex: 0 0 auto; }
.viewer-shell { height: auto; flex: 1 1 0; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
