/* A stable fullscreen host survives replacement of the media element. */
#content:fullscreen{display:block;width:100vw;height:100dvh;max-width:none;margin:0;padding:0;overflow:hidden;background:#000;color:#f4f6fb}
#content:fullscreen>:not(.watch-section){display:none!important}
#content:fullscreen .watch-section,#content:fullscreen .watch-main{display:block;width:100%;height:100%;margin:0;padding:0;max-width:none}
#content:fullscreen .watch-section>.episodes,#content:fullscreen .watch-main>:not(.video-frame){display:none!important}
#content:fullscreen .video-frame{width:100%;height:100%;max-height:none;aspect-ratio:auto;margin:0;border:0;border-radius:0;overflow:hidden}
#content:fullscreen .video-frame>video#video{width:100%;height:100%;max-height:none;object-fit:contain}
#content:fullscreen .watch-controls{padding:35px max(24px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left))}
#content:fullscreen .watch-preview{width:240px}
/* The title and episode list already exist on the page; only repeat them in fullscreen. */
.watch-topbar,.watch-buttons>.watch-episodes-toggle{display:none}
#content:fullscreen .watch-topbar{position:absolute;inset:0 0 auto;z-index:2;display:block;padding:20px 24px 32px;background:linear-gradient(#0008,transparent);transition:opacity .18s;pointer-events:none}
.watch-now{display:grid;gap:4px;text-shadow:0 1px 6px #000}.watch-now>span{font-size:12px;color:#c3c1be}.watch-now>b{font-size:16px;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#content:fullscreen .watch-buttons>.watch-episodes-toggle{display:grid;margin-left:auto}
#content:fullscreen .watch-buttons:has(.watch-episodes-toggle)>.watch-settings-toggle{margin-left:0}
.custom-player.controls-idle:not(.is-paused) .watch-topbar{opacity:0}
.custom-player.settings-open,.custom-player.episodes-open{overflow:hidden}
.watch-settings-panel{width:min(310px,calc(100% - 24px));max-height:calc(var(--player-height,500px) - 98px);padding:12px 14px;overscroll-behavior:contain;scrollbar-width:thin;background:#1e1c19fa;border:1px solid #ffffff26;border-radius:12px;box-shadow:0 8px 26px #0007}
.watch-settings-heading{gap:4px;margin-bottom:12px;font-size:14px}.watch-settings-heading>b{flex:1;font-weight:600}
.watch-settings-panel .watch-settings-heading>.watch-help{display:grid;place-items:center;width:30px;min-height:30px;height:30px;padding:0;border:0;font-size:16px;color:#bbb9b6}
.watch-settings-heading>.watch-settings-close,.watch-settings-heading>.watch-episodes-close{width:30px;height:30px;font-size:23px}
.watch-settings-panel .watch-quality,.watch-settings-panel .watch-speed,.watch-settings-panel .watch-subtitles-settings label,.watch-settings-panel #audio-tracks label{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;gap:10px;margin:0 0 10px;font-size:13px}
.watch-settings-panel select{min-height:36px;border:1px solid #ffffff1d;background:#2c2a27;padding:6px 8px;font-size:12px;border-radius:7px}
.watch-settings-panel #audio-tracks{margin:0}.watch-settings-panel #audio-tracks:empty{display:none}
.watch-settings-panel .watch-subtitles-status{font-size:11px;color:#a09e9b;line-height:1.4;margin:0 0 10px}

/* Compact playback-rate control with a neutral track and persistent current value. */
.watch-settings-panel .watch-speed{display:block;margin:4px 0 14px}
.watch-speed-heading{display:flex;align-items:center;gap:8px;margin-bottom:3px;font-size:13px}
.watch-speed-heading label{flex:1}.watch-speed-value{font-variant-numeric:tabular-nums;color:var(--text);font-size:13px;font-weight:600}
.watch-settings-panel .watch-speed-reset{width:auto;min-height:28px;padding:3px 6px;font-size:11px;color:var(--muted);border-radius:5px}
.watch-speed-reset:hover:not(:disabled){background:#ffffff0c;color:var(--text)}.watch-speed-reset:disabled{opacity:.35;cursor:default}
.watch-settings-panel .watch-rate{display:block;width:100%;height:30px;margin:0;padding:0;appearance:none;-webkit-appearance:none;background:transparent;border:0;border-radius:999px;cursor:pointer;touch-action:pan-y}
.watch-rate::-webkit-slider-runnable-track{height:5px;border:0;border-radius:999px;background:linear-gradient(to right,#e5e0d5 var(--rate),#ffffff35 var(--rate))}
.watch-rate::-moz-range-track{height:5px;border:0;border-radius:999px;background:#ffffff35}
.watch-rate::-moz-range-progress{height:5px;border-radius:999px;background:#e5e0d5}
.watch-rate::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:15px;height:15px;margin-top:-5px;border:0;border-radius:50%;background:#e5e0d5;box-shadow:0 1px 4px #0005}
.watch-rate::-moz-range-thumb{width:15px;height:15px;border:0;border-radius:50%;background:#e5e0d5;box-shadow:0 1px 4px #0005}
.watch-rate:focus-visible,.watch-speed-reset:focus-visible{outline:2px solid #e5e0d5;outline-offset:2px}
.watch-speed-marks{display:flex;justify-content:space-between;color:var(--muted);font-size:10px;font-variant-numeric:tabular-nums;line-height:1.4}
.watch-source-options>label{margin:8px 0 4px}.watch-source-options>label>span{font-size:12px}

.watch-source-options{margin-top:4px;border-top:1px solid #ffffff12;padding-top:3px}
.watch-source-options summary{display:flex;align-items:center;gap:12px;min-height:36px;font-size:12px;cursor:pointer;list-style:none}
.watch-source-options summary::-webkit-details-marker{display:none}.watch-source-options summary:after{content:'›';font-size:18px;color:#afadaa}.watch-source-options[open] summary:after{transform:rotate(90deg)}
.watch-source-name{margin-left:auto;min-width:0;max-width:150px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;color:#aeaca9}
.watch-source-options label{display:grid;gap:6px;font-size:11px;color:#b7b5b2;margin:8px 0}.watch-source-options select{width:100%;min-width:0}
.watch-source-refresh{min-height:32px;padding:4px 0;color:var(--accent);font-size:12px}.watch-source-status{font-size:11px;color:#b7b5b2;line-height:1.4;margin:4px 0}.watch-source-status:empty{display:none}
.watch-episodes-panel{position:absolute;z-index:6;right:12px;bottom:94px;width:min(310px,calc(100% - 24px));max-height:calc(var(--player-height,500px) - 112px);height:410px;display:flex;flex-direction:column;padding:12px 14px;border:1px solid #ffffff26;border-radius:12px;background:#1e1c19fa;color:#f4f6fb;box-shadow:0 8px 26px #0007}
.watch-episodes-panel[hidden]{display:none}.watch-episodes-panel .watch-settings-heading{flex-shrink:0;margin:0 0 8px}
.watch-season-label{display:flex;align-items:center;gap:12px;flex-shrink:0;margin-bottom:8px;font-size:12px;color:#c1bfbc}
.watch-season-label select{flex:1;min-width:0;min-height:34px;padding:5px 8px;border-radius:7px;border:1px solid #ffffff1d;background:#2c2a27;color:#fff}
.watch-episode-list{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
.watch-episode-pick{display:flex;align-items:center;gap:12px;width:100%;min-height:46px;text-align:left;padding:8px;border-radius:7px;color:#d0cecb}
.watch-episode-pick[aria-current]{background:#c2c0bd18;color:#d6d4d1}.watch-episode-pick:hover{background:#ffffff0b}
.watch-episode-pick>span:first-child{font-size:11px;color:#9b9996;font-variant-numeric:tabular-nums}.watch-episode-pick>span:last-child{min-width:0}.watch-episode-pick b{display:block;font-size:12px;font-weight:500}.watch-episode-pick small{display:block;font-size:10px;color:#a6a4a1}
.watch-notice{position:absolute;z-index:20;top:20px;left:50%;transform:translateX(-50%);max-width:80%;padding:10px 15px;background:#272522f5;border:1px solid #ffffff24;border-radius:9px;font-size:13px;color:#f1efec;pointer-events:none}.watch-notice[hidden]{display:none}
.watch-loading-note{position:absolute;z-index:2;left:50%;top:44%;transform:translate(-50%,-50%);width:min(450px,80%);margin:0;padding:12px 16px;border-radius:10px;background:#191714e8;color:#d6d4d1;font-size:13px;text-align:center;pointer-events:none}
.watch-loading-note[hidden],.awaiting-source>.player-start{display:none}
.room-mini .watch-topbar,.room-mini .watch-episodes-panel{display:none!important}
@media(max-width:620px){
 .watch-settings-panel{right:6px;bottom:46px;width:min(300px,calc(100% - 12px));max-height:calc(var(--player-height,400px) - 70px);padding:10px 12px}
 #content:not(:fullscreen) .custom-player.settings-open{overflow:visible;z-index:35}
 #content:not(:fullscreen) .watch-settings-panel{position:fixed;inset:auto 8px max(8px,env(safe-area-inset-bottom)) auto;width:min(300px,calc(100vw - 16px));max-height:60dvh}
 #content:fullscreen .watch-controls{padding:25px 8px max(6px,env(safe-area-inset-bottom))}
 #content:fullscreen .watch-topbar{padding:12px 14px 24px}.watch-now>b{font-size:13px}.watch-now>span{font-size:10px}
 #content:fullscreen .watch-preview{width:160px}.watch-buttons>.watch-next{width:28px;flex-basis:28px}
 .watch-buttons>.watch-pip:not([hidden]){display:none!important}
 .watch-episodes-panel{right:6px;bottom:72px;max-height:calc(var(--player-height,400px) - 84px);width:min(310px,calc(100% - 12px))}
 .watch-loading-note{font-size:11px;padding:6px 8px;max-height:45%;overflow:hidden}
}
@media(prefers-reduced-motion:reduce){.watch-topbar{transition:none}}
:root[data-motion=reduced] .watch-topbar,:root[data-motion=reduced] .watch-controls{transition:none}
/* The continuation surface is the same fullscreen host later occupied by the room. */
.continuation-stage .video-frame{position:relative;min-height:300px;background:#090a0a;display:grid;place-items:center}
.continuation-stage video{display:block;width:100%;height:100%;object-fit:contain}
.continuation-loading{color:#c6c7c2;font-size:16px}
.continuation-loading[hidden]{display:none}
.continuation-exit{position:absolute;z-index:5;top:14px;right:16px;width:42px;height:42px;border-radius:12px;border:1px solid #ffffff30;background:#151717cc;color:#eee;font-size:27px;cursor:pointer}
.continuation-stage~.stream-panel{display:none}
#content:fullscreen .continuation-stage .video-frame{height:100dvh}
