/* 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:#b8c2cf}.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:#171c25fa;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:#aebacf}
.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:#222b38;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:#929fb2;line-height:1.4;margin:0 0 10px}
.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:#a2aec0}.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:#9fadc2}
.watch-source-options label{display:grid;gap:6px;font-size:11px;color:#a9b6c8;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:#a9b6c8;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:#171c25fa;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:#b4c0d2}
.watch-season-label select{flex:1;min-width:0;min-height:34px;padding:5px 8px;border-radius:7px;border:1px solid #ffffff1d;background:#222b38;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:#c5cfdf}
.watch-episode-pick[aria-current]{background:#a3c2ff18;color:#c1d6ff}.watch-episode-pick:hover{background:#ffffff0b}
.watch-episode-pick>span:first-child{font-size:11px;color:#899bb7;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:#94a6c0}
.watch-notice{position:absolute;z-index:20;top:20px;left:50%;transform:translateX(-50%);max-width:80%;padding:10px 15px;background:#1c2636f5;border:1px solid #ffffff24;border-radius:9px;font-size:13px;color:#e7f0ff;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:#111824e8;color:#c9d5e5;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}