:root {
  color-scheme: dark;
  --bg: #0b0d0f;
  --surface: #1b2024;
  --text: #f1f3f1;
  --muted: #a6afb4;
  --border: #343d43;
  --accent: #c3e8ce;
  --accent-text: #172b1e;
  --error: #ffc4b6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.4; }
button, input { font: inherit; }
button { min-height: 2.75rem; padding: .55rem .85rem; border: 1px solid var(--border); border-radius: .4rem; background: var(--surface); color: var(--text); font-weight: 550; cursor: pointer; }
button.primary { background: var(--accent); border-color: transparent; color: var(--accent-text); }
button.quiet { background: var(--surface); color: var(--text); }
button:hover { filter: brightness(1.1); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, video:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.login-shell { min-height: 100svh; display: grid; place-items: center; padding: 1.25rem; }
.login-card { width: min(100%, 21rem); }
.login-card h1 { font-size: 1.4rem; font-weight: 600; letter-spacing: -.03em; margin-bottom: 1.5rem; }
.login-form { display: grid; gap: .8rem; }
.login-form input { width: 100%; min-height: 3rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: .4rem; background: var(--surface); color: var(--text); font-size: 1rem; }
.login-form input::placeholder { color: var(--muted); }
.form-error { color: var(--error); font-size: .85rem; }
.form-error:empty { display: none; }
.watch-shell { height: 100svh; height: 100dvh; min-height: 15rem; display: flex; flex-direction: column; padding: .5rem max(.5rem, env(safe-area-inset-right)) max(.5rem, env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left)); }
.watch-header { display: flex; align-items: center; gap: 1rem; min-height: 2rem; padding: 0 .25rem .5rem; }
.watch-header h1 { font-size: .9rem; font-weight: 600; white-space: nowrap; }
.status-line { min-width: 0; display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--muted); }
.status-line p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: .35rem; height: .35rem; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.status-line[data-state="live"] { color: var(--accent); }
.watch-player { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.player-frame { position: relative; flex: 1; min-height: 0; width: 100%; overflow: hidden; background: #000; border-radius: .3rem; }
video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.waiting-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; background: #0009; text-align: center; pointer-events: none; }
.waiting-overlay h2 { font-size: 1rem; font-weight: 500; color: var(--muted); }
.player-actions { display: flex; align-items: center; gap: .5rem; padding-top: .5rem; }
.player-actions button { font-size: .8rem; }
#retry { margin-left: auto; }
#fullscreen, #sound-hint, #waiting-detail, [hidden] { display: none !important; }
.player-frame:fullscreen { border-radius: 0; width: 100%; height: 100%; }
@media (orientation: landscape) and (max-height: 36rem) {
  .watch-shell { padding: 0; min-height: 0; position: relative; }
  .watch-header { position: absolute; z-index: 2; top: env(safe-area-inset-top); left: max(.6rem, env(safe-area-inset-left)); right: 15rem; height: 2.75rem; padding: 0; gap: .7rem; pointer-events: none; text-shadow: 0 1px 4px #000; }
  .watch-header h1 { font-size: .75rem; }
  .status-line { font-size: .7rem; }
  .player-frame { border-radius: 0; }
  .player-actions { position: absolute; z-index: 3; top: calc(env(safe-area-inset-top) + .2rem); right: max(.4rem, env(safe-area-inset-right)); padding: 0; }
  .player-actions button { min-height: 2.5rem; padding: .4rem .65rem; }
}
