/* One control surface, with the film as the primary visual layer. */
.watch-page .stage { border-radius: 20px; outline-color: rgba(232, 241, 255, .12); box-shadow: 0 28px 80px rgba(0, 0, 0, .38); }
.watch-page .stage-wm { opacity: .05; }
.watch-page .pc { padding: 42px 18px 14px; font-family: var(--ui-font); background: linear-gradient(transparent, rgba(3, 7, 11, .7)); }
.watch-page .pc-timeline { padding-inline: 9px; }
.watch-page .pc-seek { width: 100%; height: 28px; }
.watch-page .pc-seek::before,
.watch-page .pc-buf,
.watch-page .pc-played { top: 12px; height: 3px; }
.watch-page .pc-seek:hover::before,
.watch-page .pc-seek:hover .pc-buf,
.watch-page .pc-seek:hover .pc-played,
.watch-page .pc-seek:focus-visible::before,
.watch-page .pc-seek:focus-visible .pc-buf,
.watch-page .pc-seek:focus-visible .pc-played { top: 11px; height: 5px; }
.watch-page .pc-played { background: #b6def4; }
.watch-page .pc-played::after { width: 10px; height: 10px; right: -5px; background: #f4f7fa; }
.watch-page .pc-seek:focus-visible { outline: 2px solid #b6def4; outline-offset: 2px; border-radius: 4px; }
.watch-page .pc-bar {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 4px 8px;
  border: 1px solid rgba(232, 241, 255, .1); border-radius: 12px;
  background: rgba(14, 22, 30, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 8px 24px rgba(0, 0, 0, .16);
  backdrop-filter: blur(20px) saturate(1.15); -webkit-backdrop-filter: blur(20px) saturate(1.15);
}
.watch-page .pc-spacer { flex: 1 1 auto; min-width: 0; }
.watch-page .pc-btn,
.watch-page .pc-text { border-radius: 10px; transition: background 180ms, color 180ms; }
.watch-page .pc-btn svg { width: 21px; height: 21px; }
.watch-page .pc-btn svg, .watch-page .pc-settings-icon, .watch-page .set-close svg { display: block; flex: none; transition: transform 160ms var(--ease); }
.watch-page .pc-btn:active svg, .watch-page .pc-text:active svg, .watch-page .set-close:active svg { transform: scale(.9); }
.watch-page .pc-btn:focus-visible, .watch-page .pc-text:focus-visible, .watch-page .set-close:focus-visible, .watch-page .set-control select:focus-visible, .watch-page .set-toggle:focus-visible, .watch-page #pc-pip:focus-visible { outline: 2px solid #b6def4; outline-offset: -2px; }
.watch-page .pc-btn:disabled, .watch-page .pc-text:disabled { opacity: .4; }
.watch-page .pc-btn:hover,
.watch-page .pc-text:hover { opacity: 1; background: rgba(232, 241, 255, .085); }
.watch-page .pc-btn:disabled:hover, .watch-page .pc-text:disabled:hover { opacity: .4; background: transparent; }
.watch-page #pc-play { background: transparent; color: #fff; }
.watch-page #pc-play:hover { background: rgba(232, 241, 255, .085); }
.watch-page #pc-play svg { width: 23px; height: 23px; stroke-width: 1.85; }
.watch-page #set-btn[aria-expanded="true"], .watch-page #pc-cast[aria-pressed="true"] { color: #b6def4; }
.watch-page .pc-time { font-size: 13px; letter-spacing: 0; }
.watch-page .pc-settings-label { display: none; }
.watch-page .pc-settings-icon { display: block; width: 21px; height: 21px; }
.watch-page #set-btn { min-width: 44px; padding: 0; }
.watch-page .pc-text { font-size: 13px; letter-spacing: 0; }
.watch-page .pc-vol { gap: 4px; }
.watch-page .pc-center {
  width: 72px; height: 72px; border-radius: 24px;
  background: rgba(20, 28, 38, .72); border-color: rgba(232, 241, 255, .23);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 12px 40px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.watch-page .pc-center svg { width: 29px; height: 29px; margin-left: 0; stroke-width: 1.85; }
.watch-page .pc-skip, .watch-page .pc-boost { border-radius: 12px; }
.watch-page .stage-toast { bottom: 108px; border-radius: 14px; }
.watch-page .stage-toast button { min-height: 36px; border-radius: 9px; }
.watch-page .player-set-panel {
  inset: auto 0 calc(100% + 14px) auto; margin: 0;
  width: min(328px, var(--player-menu-width, 82vw));
  max-height: min(480px, var(--player-menu-height, calc(100dvh - 110px)));
  padding: 0 20px 16px; border-radius: 20px;
  color: #f4f7fa; background: rgba(20, 26, 34, .98);
  border-color: rgba(232, 241, 255, .16); font-family: var(--ui-font);
}
.watch-page .set-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; border-bottom: 1px solid rgba(232, 241, 255, .1); margin-bottom: 4px; background: #141a22; }
.watch-page .set-header h2 { margin: 0; font-family: var(--ui-font); font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
.watch-page .set-close { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #a6b2bf; }
.watch-page .set-close:hover { color: #fff; background: rgba(232, 241, 255, .07); }
.watch-page .set-close svg { width: 18px; height: 18px; }
.watch-page .set-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; min-height: 52px; margin: 0; border-bottom: 1px solid rgba(232, 241, 255, .065); }
.watch-page .set-row[hidden] { display: none !important; }
.watch-page .set-row > span { display: flex; align-items: center; gap: 10px; color: #c7d0db; font-size: 13px; text-transform: none; letter-spacing: 0; line-height: 1.4; }
.watch-page .set-label svg { width: 17px; height: 17px; flex: none; color: #8fa6b7; }
.watch-page .set-control { display: flex; align-items: center; justify-content: flex-end; }
.watch-page .set-control select { max-width: 150px; min-height: 44px; border: 0; border-radius: 8px; padding: 8px 4px; background: transparent; color: #f4f7fa; font-size: 13px; text-align: right; }
.watch-page .set-control select:disabled { opacity: .45; }
.watch-page .set-control option { background: #141a22; color: #f4f7fa; }
.watch-page .set-toggle {
  position: relative; width: 48px; min-height: 44px; border: 0; padding: 0;
  background: transparent; color: #f4f7fa;
}
.watch-page .set-toggle::before { content: ""; position: absolute; inset: 8px 0; border-radius: 20px; background: #3b4652; transition: background 180ms; }
.watch-page .set-toggle::after { content: ""; position: absolute; left: 3px; top: 11px; width: 22px; height: 22px; border-radius: 50%; background: #f4f7fa; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); transition: transform 180ms var(--ease); }
.watch-page .set-toggle[aria-checked="true"]::before { background: #447e99; }
.watch-page .set-toggle[aria-checked="true"]::after { transform: translateX(20px); }
.watch-page .set-control #pc-pip { min-height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #b6def4; font-size: 13px; }
.watch-page .set-control #pc-pip[aria-pressed="true"] { color: #fff; }
.watch-page .set-range { max-width: 140px; accent-color: #b6def4; }
.watch-page .set-keys { padding-top: 14px; color: #8f9aa7; font-size: 10px; line-height: 1.75; }
.watch-page .quality-menu { border-radius: 16px; background: rgba(20, 26, 34, .98); }
.watch-page .gate-bar, .watch-page .gate-bar.is-stack { border-radius: 20px; padding: 14px 16px; }
.watch-page .gate-actions .btn.ghost { color: #c7d0db; }
.watch-page .stage-end-actions #end-replay { background: transparent; color: #f4f7fa; padding-inline: 0; }
.watch-page .danmaku-bar { min-height: 54px; padding: 5px 7px 5px 16px; border-radius: 14px; background: var(--ui-soft); border-color: var(--ui-hairline); }
.watch-page .danmaku-bar .btn { min-height: 40px; padding: 8px 16px; border-radius: 10px; }
.watch-page .youtube-tools-bar { gap: 2px 8px; padding: 4px 8px; border-radius: 14px; background: var(--ui-soft); }
.watch-page .youtube-tools-bar button,
.watch-page .youtube-tools-bar a { border: 0; border-radius: 8px; background: transparent; padding: 8px 10px; font-family: var(--ui-font); font-size: 13px; }
.watch-page .youtube-tools-bar button:hover, .watch-page .youtube-tools-bar a:hover { background: var(--ui-soft); }
.watch-page .youtube-tools-bar #yt-danmaku::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.watch-page .youtube-tools-bar #yt-danmaku[aria-pressed="true"]::before { background: var(--ui-highlight); }
.watch-page .related-rail .related-card .thumb { border-radius: 12px; outline: none; }
.watch-page .column-rec-card .thumb { border-radius: 16px; outline: none; }
.watch-page .stage:fullscreen,
.watch-page .stage:-webkit-full-screen { border-radius: 0; }
.watch-page .stage:fullscreen .player-set-panel,
.watch-page .stage:-webkit-full-screen .player-set-panel { width: min(328px, var(--player-menu-width, 82vw)); }
@media (max-width: 719px) {
  /* Floating controls: time above the seek rail, actions directly on the film. */
  .watch-page .stage { border-radius: 12px; outline-color: rgba(232, 241, 255, .06); box-shadow: none; }
  .watch-page .pc {
    --mobile-pc-bottom: 4px;
    padding: 12px 12px var(--mobile-pc-bottom);
    background: linear-gradient(180deg, transparent, rgba(3, 7, 11, .38) 38%, rgba(3, 7, 11, .88));
  }
  .watch-page .pc-bar {
    display: flex; gap: 2px; min-height: 44px; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .watch-page .pc-timeline { padding-inline: 0; }
  .watch-page .pc-seek { height: 44px; }
  .watch-page .pc-seek::before, .watch-page .pc-buf, .watch-page .pc-played { top: 31px; height: 2px; }
  .watch-page .pc-seek:hover::before, .watch-page .pc-seek:hover .pc-buf, .watch-page .pc-seek:hover .pc-played, .watch-page .pc-seek:focus-visible::before, .watch-page .pc-seek:focus-visible .pc-buf, .watch-page .pc-seek:focus-visible .pc-played { top: 30px; height: 4px; }
  .watch-page .pc-played::after { width: 8px; height: 8px; right: -4px; opacity: 1; }
  .watch-page .pc-time {
    position: absolute; bottom: calc(72px + var(--mobile-pc-bottom)); left: 12px;
    font-size: 12px; line-height: 16px; color: #f4f7fa;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8); pointer-events: none;
  }
  .watch-page .pc-dur { display: block; left: auto; right: 12px; font-size: 0; color: #c7d0db; }
  .watch-page #pc-dur { font-size: 12px; }
  .watch-page .pc-btn, .watch-page .pc-text {
    width: 44px; height: 44px; border-radius: 8px; color: #e8eef4;
  }
  .watch-page .pc-btn svg, .watch-page .pc-settings-icon { width: 21px; height: 21px; }
  .watch-page #pc-play { background: transparent; color: #fff; }
  .watch-page #pc-play svg { width: 24px; height: 24px; }
  .watch-page .pc-btn:hover, .watch-page .pc-text:hover, .watch-page #pc-play:hover { background: transparent; }
  .watch-page .pc-btn:active, .watch-page .pc-text:active, .watch-page #pc-play:active { background: rgba(232, 241, 255, .085); }
  .watch-page .pc-btn[aria-pressed="true"] { color: #b6def4; }
  .watch-page .pc-btn:focus-visible, .watch-page .pc-text:focus-visible { outline: 2px solid #b6def4; outline-offset: -2px; }
  .watch-page .pc-vol { gap: 0; }
  .watch-page .pc-center { width: 56px; height: 56px; border-radius: 50%; background: rgba(14, 22, 30, .6); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .watch-page .pc-center svg { width: 24px; height: 24px; }
  .watch-page .stage-toast { left: 12px; top: 4px; bottom: auto; padding: 4px 4px 4px 10px; gap: 8px; font-size: 12px; }
  .watch-page .quality { display: none; }
  .watch-page .stage:fullscreen, .watch-page .stage:-webkit-full-screen { border-radius: 0; }
  .watch-page .stage:fullscreen .pc, .watch-page .stage:-webkit-full-screen .pc { --mobile-pc-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .watch-page #danmaku-form { min-height: 48px; gap: 8px; padding: 1px 8px 1px 14px; border-radius: 12px; border-color: transparent; }
  .watch-page #danmaku-form:focus-within { border-color: var(--ui-highlight); }
  .watch-page #danmaku-input { min-width: 0; width: 0; min-height: 44px; padding: 0; font-size: 16px; line-height: 24px; }
  .watch-page #danmaku-input::placeholder { font-size: 14px; color: var(--muted); }
  .watch-page #danmaku-form .btn {
    min-width: 56px; min-height: 44px; padding: 0 12px;
    border: 0; border-left: 1px solid var(--ui-hairline); border-radius: 0;
    background: transparent; color: var(--ui-highlight); box-shadow: none;
    font-size: 13px; line-height: 20px;
  }
  .watch-page dialog.player-set-panel,
  .watch-page .stage:fullscreen dialog.player-set-panel,
  .watch-page .stage:-webkit-full-screen dialog.player-set-panel {
    position: fixed; inset: auto 12px calc(12px + env(safe-area-inset-bottom, 0px));
    margin: 0; width: auto; max-width: none; max-height: 76dvh;
    padding: 0 18px 16px; border-radius: 22px; background: #141a22;
    transform-origin: bottom center; backdrop-filter: none;
  }
  .watch-page dialog.player-set-panel::backdrop { background: rgba(3, 7, 11, .65); }
  .watch-page .set-row { min-height: 56px; }
  .watch-page .set-control select { font-size: 16px; }
  .watch-page .set-row > span { font-size: 14px; }
  .watch-page .set-label svg { width: 18px; height: 18px; }
  .watch-page .set-keys { display: none; }
  .watch-page .gate-bar { flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .watch-page .gate-copy { flex-basis: 100%; }
  .watch-page .youtube-tools-bar a { margin-left: 0; }
  .watch-page .youtube-tools-bar button, .watch-page .youtube-tools-bar a { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .watch-page .set-toggle::before, .watch-page .set-toggle::after,
  .watch-page .pc-btn, .watch-page .pc-text,
  .watch-page .pc-btn svg, .watch-page .pc-settings-icon, .watch-page .set-close svg { transition: none; }
}
