:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: #111318;
  --panel-2: #171a20;
  --line: rgba(255,255,255,.09);
  --text: #f7f8fa;
  --muted: #9298a5;
  --cyan: #25f4ee;
  --pink: #fe2c55;
  --radius: 20px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh; margin: 0; color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(37,244,238,.11), transparent 26rem),
    radial-gradient(circle at 91% 22%, rgba(254,44,85,.09), transparent 28rem),
    var(--bg);
}
button, input { font: inherit; }
button { color: inherit; }
.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 28px 0 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.045); }
.brand-mark svg { width: 28px; fill: var(--text); filter: drop-shadow(-2px 0 var(--cyan)) drop-shadow(2px 0 var(--pink)); }
.brand-mark .accent { fill: var(--text); }
.brand > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 16px; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: .18em; }
.live-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: #ccd1da; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); font-size: 13px; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #2ee58a; box-shadow: 0 0 10px #2ee58a; }
.player-card, .control-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17,19,24,.86); box-shadow: 0 22px 60px rgba(0,0,0,.3); overflow: hidden; backdrop-filter: blur(18px); }
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #050506; overflow: hidden; }
.stage::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.045), transparent 38%); pointer-events: none; }
video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
video:not([src]) { opacity: 0; pointer-events: none; }
.empty-state, .loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 24px; }
.empty-icon { width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 23px; background: linear-gradient(145deg, rgba(37,244,238,.09), rgba(254,44,85,.08)); }
.empty-icon svg { width: 39px; fill: none; stroke: #dfe3e9; stroke-width: 1.7; stroke-linejoin: round; }
.empty-icon svg path:last-child { fill: #dfe3e9; stroke: none; }
.empty-state h1 { margin: 0 0 9px; font-size: clamp(20px, 3vw, 30px); letter-spacing: -.035em; }
.empty-state p, .loading p { margin: 0; color: var(--muted); font-size: 14px; }
.loading { background: rgba(5,5,6,.8); backdrop-filter: blur(10px); z-index: 3; }
.spinner { width: 35px; height: 35px; margin-bottom: 13px; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--cyan); border-right-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.room-strip { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 16px; border-top: 1px solid var(--line); }
.room-copy { min-width: 0; display: flex; align-items: center; gap: 12px; }
.avatar { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; background: linear-gradient(135deg, #13c9c5, #ec2852); }
.room-copy div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.room-copy strong { max-width: 680px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.room-copy div span { color: var(--muted); font-size: 12px; }
.quality-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.quality-list button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.035); color: #b8bec8; cursor: pointer; font-size: 12px; transition: .18s ease; }
.quality-list button:hover { color: #fff; border-color: rgba(255,255,255,.22); }
.quality-list button.active { color: #06100f; border-color: var(--cyan); background: var(--cyan); font-weight: 700; }
.quality-list button.sync-action { border-style: dashed; color: #d7dbe2; }
.quality-list button:disabled { opacity: .38; cursor: not-allowed; }
.dvr-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(255,255,255,.018); }
.dvr-copy { min-width: 0; display: flex; align-items: center; gap: 10px; }
.dvr-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 5px rgba(254,44,85,.1); }
.dvr-copy div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dvr-copy strong { font-size: 13px; }
.dvr-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dvr-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.dvr-actions button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.04); color: #c6cbd3; cursor: pointer; font-size: 12px; }
.dvr-actions button:hover:not(:disabled) { color: #fff; border-color: rgba(255,255,255,.25); }
.dvr-actions button:disabled { opacity: .4; cursor: not-allowed; }
.dvr-actions #clearDvrButton { color: #ff9aae; }
.control-card { margin-top: 16px; padding: 20px; overflow: visible; }
label { display: block; margin: 0 0 9px 2px; color: #d8dce3; font-size: 13px; font-weight: 650; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.url-field { position: relative; min-width: 0; }
.url-field > svg { position: absolute; left: 15px; top: 50%; width: 19px; transform: translateY(-50%); fill: none; stroke: #777f8e; stroke-width: 1.7; stroke-linecap: round; pointer-events: none; }
input { width: 100%; height: 50px; padding: 0 42px; outline: 0; color: var(--text); border: 1px solid var(--line); border-radius: 13px; background: #0c0e12; transition: .18s ease; }
input::placeholder { color: #5f6672; }
input:focus { border-color: rgba(37,244,238,.6); box-shadow: 0 0 0 3px rgba(37,244,238,.08); }
.clear { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #747b87; cursor: pointer; font-size: 22px; }
.clear:hover { background: rgba(255,255,255,.05); color: #fff; }
.primary { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 21px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(105deg, #e9254d, #fe2c55); box-shadow: 0 8px 25px rgba(254,44,85,.22); cursor: pointer; font-weight: 700; white-space: nowrap; transition: transform .15s ease, filter .15s ease; }
.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary:disabled { opacity: .5; transform: none; cursor: wait; }
.primary svg { width: 19px; fill: currentColor; }
.message { display: flex; align-items: center; gap: 8px; min-height: 22px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.message-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #6d7480; }
.message[data-tone="good"] { color: #89dfb1; }.message[data-tone="good"] .message-dot { background: #2ee58a; }
.message[data-tone="bad"] { color: #ff879f; }.message[data-tone="bad"] .message-dot { background: var(--pink); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.features article { display: flex; gap: 14px; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.features article > span { color: #535a66; font: 700 11px/1 ui-monospace, monospace; }
.features strong { display: block; margin-bottom: 7px; font-size: 13px; }
.features p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
footer { padding: 24px 0 0; color: #535965; text-align: center; font-size: 11px; }
dialog { width: min(390px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: #121419; box-shadow: 0 28px 90px #000; }
dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(9px); }
.login-card { display: flex; flex-direction: column; align-items: stretch; padding: 30px; text-align: center; }
.login-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 18px; background: linear-gradient(135deg, var(--cyan), var(--pink)); font-size: 20px; font-weight: 900; }
.login-card h2 { margin: 0 0 7px; font-size: 21px; }.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.login-card input { margin-bottom: 10px; padding: 0 15px; }.login-error { min-height: 18px; padding-top: 9px; color: #ff879f; font-size: 12px; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 16px; }
  .topbar { margin-bottom: 14px; }
  .player-card, .control-card { border-radius: 16px; }
  .room-strip { align-items: flex-start; flex-direction: column; }
  .quality-list { width: 100%; justify-content: flex-start; }
  .dvr-bar { align-items: flex-start; flex-direction: column; }
  .dvr-actions { width: 100%; justify-content: flex-start; }
  .input-row { grid-template-columns: 1fr; }
  .primary { width: 100%; }
  .features { grid-template-columns: 1fr; }
  .stage { min-height: 250px; aspect-ratio: 16 / 10; }
  .empty-state p { max-width: 250px; line-height: 1.5; }
}
