:root {
  --bg: #0b0b0f;
  --panel: #15151c;
  --line: #262632;
  --text: #ecebf3;
  --muted: #9a98ab;
  --accent: #8b5cf6;
  --live: #ef4444;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
code { background: var(--line); padding: 1px 6px; border-radius: 4px; font-size: 0.92em; }

.theater { max-width: 1280px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.now h1 { margin: 0; font-size: 1.15rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.live-dot.on { background: var(--live); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.bar-right { display: flex; align-items: center; gap: 12px; flex: none; }
.end-btn { height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid #7f1d1d; background: transparent; color: #fca5a5; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.end-btn:hover:not(:disabled) { background: rgba(185, 28, 28, 0.2); }
.end-btn.armed { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.end-btn:disabled { opacity: 0.5; cursor: default; }
.end-btn[hidden] { display: none; }
.viewers { margin: 0; color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

.screen { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--line); }
.screen video { width: 100%; height: 100%; display: block; background: #000; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at center, #1a1a24 0%, #050507 75%); padding: 16px; }
.overlay[hidden] { display: none; }
.card { max-width: 460px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.card p { margin: 0.4em 0; color: var(--muted); }
.card .big { color: var(--text); font-size: 1.2rem; font-weight: 650; }
.unmute { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); border: 0; border-radius: 999px; padding: 10px 18px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.unmute[hidden] { display: none; }
.player { display: flex; flex-direction: column; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.player .screen { border: 0; border-radius: 0; }
/* Full screen: the video fills the whole screen; the controls float over its bottom edge and fade out. */
.player.fs { position: relative; border-radius: 0; border: 0; width: 100vw; height: 100vh; background: #000; }
.player.fs .screen { position: absolute; inset: 0; aspect-ratio: auto; }
.player.fs .screen video { object-fit: contain; }
.player.fs .controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 24px 18px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.85)); transition: opacity 0.35s ease; }
.player.fs .hint { display: none; }
.player.fs .btn { background: rgba(29, 29, 39, 0.75); }
.player.fs .btn.primary { background: var(--accent); }
.player.fs:not(.idle) .skip-intro, .player.fs:not(.idle) .next-up { bottom: 130px; }
.player.fs:not(.idle) .unmute { bottom: 150px; }
.player.fs.idle { cursor: none; }
.player.fs.idle .controls { opacity: 0; pointer-events: none; }

.skip-intro { position: absolute; right: 16px; bottom: 16px; border: 1px solid rgba(255,255,255,0.35); border-radius: 8px; padding: 10px 16px; background: rgba(10,10,15,0.75); color: #fff; font: inherit; font-weight: 600; cursor: pointer; backdrop-filter: blur(4px); }
.skip-intro:hover { background: rgba(139, 92, 246, 0.85); }
.skip-intro[hidden] { display: none; }
.next-up { position: absolute; right: 16px; bottom: 16px; display: flex; align-items: stretch; gap: 0; max-width: min(380px, calc(100% - 32px)); padding: 0; border: 1px solid rgba(255,255,255,0.25); border-radius: 10px; overflow: hidden; background: rgba(10,10,15,0.85); color: #fff; font: inherit; text-align: left; cursor: pointer; backdrop-filter: blur(4px); transition: bottom 0.35s ease; }
.next-up:hover:not(:disabled) { border-color: var(--accent); }
.next-up[hidden] { display: none; }
.next-up img { width: 140px; height: 79px; object-fit: cover; display: block; flex: none; background: #222; }
.next-up img[hidden] { display: none; }
.next-up-text { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 14px; min-width: 0; }
.next-up-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.next-up-title { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-up-play { font-size: 0.82rem; color: #c4b5fd; }
.skip-intro { transition: bottom 0.35s ease; }
.toast { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(10,10,15,0.85); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 0.9rem; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.toast.error { border-color: #b91c1c; }
.toast[hidden] { display: none; }

.controls { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.seek { display: flex; align-items: center; gap: 10px; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; min-width: 3.6em; text-align: center; }
.track { position: relative; flex: 1; display: flex; align-items: center; }
.intro-mark { position: absolute; top: 50%; height: 6px; margin-top: -3px; background: rgba(245, 158, 11, 0.55); border-radius: 3px; pointer-events: none; }
.intro-mark[hidden] { display: none; }
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; width: 100%; height: 22px; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: var(--line); border-radius: 3px; }
input[type="range"]::-moz-range-track { height: 6px; background: var(--line); border-radius: 3px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: var(--accent); border: 0; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 0; }
input[type="range"]:disabled { cursor: default; opacity: 0.5; }
.buttons { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.group { display: flex; align-items: center; gap: 6px; }
.btn svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.btn span[hidden] { display: none; }
.btn.muted { color: var(--muted); opacity: 0.6; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: #1d1d27; color: var(--text); font: inherit; font-size: 0.95rem; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn[hidden] { display: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; min-width: 56px; font-size: 1.1rem; }
.btn.ghost { background: transparent; }
.mine input[type="range"] { width: 90px; }
.hint { margin: 0; color: var(--muted); font-size: 0.78rem; }

.foot { color: var(--muted); font-size: 0.85rem; text-align: center; padding-bottom: 8px; }

.landing { min-height: 100%; display: grid; place-items: center; padding: 16px; }

@media (max-width: 600px) {
  .theater { padding: 0 0 12px; gap: 8px; }
  .bar { padding: 10px 12px 0; }
  .player { border-radius: 0; border-left: 0; border-right: 0; }
  .buttons { justify-content: center; }
  .mine input[type="range"] { display: none; }
  .next-up img { width: 96px; height: 54px; }
  .next-up-text { padding: 6px 10px; }
  .foot { padding: 0 12px; }
}
