/* =====================================================================
 * player.css — the stylesheet of the real NOVA player, reproduced.
 * =====================================================================
 *
 * Everything the real player ships is in two files:
 *
 *   assets/VideoPlayer-*.css   the player component sheet
 *   assets/index-*.css         the global sheet, minus the parts the player
 *                              reads: :root tokens, the base element rules,
 *                              .truncate, .spinner, .nv-orbit/.nv-bounce,
 *                              .player-toast, the menu / source-opt / flag
 *                              classes it renders, .still-watching
 *
 * Both were read off the live site on 2026-10-08. Every value below is the
 * original value. Nothing here is invented and nothing is left out that the
 * player's own stylesheet sets.
 *
 * THE FILE ORDER IS THE SITE'S LOAD ORDER, AND THAT IS LOAD-BEARING
 *
 *   Their page loads `index-*.css` first and the player chunk's own sheet
 *   (`VideoPlayer-*.css`) second, when the player component mounts. So the
 *   component sheet is later in the cascade and wins every property the two
 *   files both set — media queries do not add specificity, so index.css's
 *   `@media (width <= 768px)` block loses to it at every width.
 *
 *   On their site, at 390px wide, that is why `.player-topbar` still
 *   computes to `height: 90px; padding: 22px 28px` and `.chip-btn` to
 *   `padding: 9px 15px; font-size: .8rem`: index.css asks for the compact
 *   76px bar and the 7px/10px chip, and the component sheet, loaded later,
 *   overrides both. Only the properties the component sheet does not touch
 *   survive from the media block — the boxed `.source-menu` / `.settings-menu`
 *   bottom sheet, `width: 240px` on `.settings-menu`'s own rule, and
 *   `.player-volume input[type=range] { display: none }`.
 *
 *   This file therefore keeps their order, and the sections below run in it:
 *
 *     1. :root tokens and the base element rules   (index.css, top)
 *     2. the global rules the player reads         (index.css, rest)
 *     3. the `@media (width <= 768px)` block       (index.css, 59 044)
 *     4. .source-menu / .source-opt / flags        (index.css, 74 852+,
 *                                                   after the media block,
 *                                                   so these win over it)
 *     5. the player component sheet                (VideoPlayer-*.css, last)
 *
 *   Reordering these sections silently changes the mobile player: with the
 *   media block last, the phone gets a 76px topbar, 33px chips and the
 *   cramped chip padding the real player never shows.
 *
 * NO DEVIATION LIVES HERE
 *
 *   The real `.player` is `position: fixed; inset: 0` — opening a title
 *   replaces the whole page, and `html.player-open` locks scrolling. This
 *   file reproduces that exactly, so the player here is the same full
 *   viewport takeover the real one is.
 *
 *   The page itself is a full-viewport shell now: watch.php's own <style>
 *   block only gives the document a black, scrollbar-free box to hold the
 *   player in, and manages the `player-open` classes on `html` / `body`.
 *   Nothing in it restyles the player, so the pixels here are the real
 *   player's pixels.
 *
 * Two layouts, exactly like the real player:
 *
 *   desktop (viewport > 719px)   .player-topbar + .player-bottom
 *                                bottom row = .player-ctrls (transport left,
 *                                chips / settings / fullscreen right)
 *   mobile  (viewport <= 719px)  .player-topbar + .player-mobile
 *                                .pm-center (skip / play / skip) over
 *                                .pm-sheet (scrub, .pm-chips, .pm-actions)
 *
 * watch.php picks one and renders it, the same way the real player does with
 * matchMedia('(max-width: 719px)').
 *
 * The loader is the real `Loader` component: `.nv-orbit` (three rings, four
 * orbiting dots, a star core) and `.nv-bounce` (three bouncing stars), with
 * `nv-loader-sm` / `nv-loader-lg` size modifiers. `.player-spinner` is the
 * orbit variant at its default 84px, which is exactly what the real player
 * renders there.
 */

/* ------------------------------------------------------------------ *
 * Tokens — the site's :root, verbatim. The player reads --accent,
 * --accent-soft, --surface, --border, --text*, --font-display, --font-body.
 * ------------------------------------------------------------------ */

:root {
  --canvas: #080a10;
  --panel: #0b0e15;
  --surface: #0f131b;
  --surface-2: #161b25;
  --surface-3: #1d2331;
  --border: #202632;
  --border-soft: #12151d;
  --accent: #ff7a59;
  --accent-soft: #ff7a591f;
  --accent-ember: #e2be8d;
  --accent-mint: #9fe2bb;
  --accent-party: #ffc98f;
  --cta: #f0f2f7;
  --good: #5ad48a;
  --danger: #ff8d8d;
  --text: #f0f2f7;
  --text-dim: #c9c8d6;
  --text-mute: #a5a5b0;
  --text-faint: #8a8a98;
  --font-display: "Marcellus", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --radius: 6px;
  --radius-card: 4px;
  --tab-h: 70px;
  color-scheme: dark;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--canvas);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizelegibility;
}

/* The base element rules from the global sheet. `box-sizing` in particular
   is load-bearing: every padding in this file assumes border-box. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--canvas); min-height: 100vh; color: var(--text); }
button { font-family: var(--font-body); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ================================================================== *
 * Rules the player takes from the global sheet
 * ================================================================== */

.truncate { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

/* The transient status message — "Audio: Auto", "Source: Vidzee". */
.player-toast {
  color: #fff;
  z-index: 1005;
  pointer-events: none;
  background: #080a10eb;
  border: 1px solid #ffffff26;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: .9rem;
  font-weight: 600;
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translate(-50%);
}

/* ---- the loader component ---------------------------------------- */

@keyframes nv-orbit-spin { to { transform: rotate(360deg); } }
@keyframes nv-bounce { 0%, 75%, to { opacity: .5; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-12px); } }
@keyframes nv-dot-pulse { 0% { opacity: .35; transform: scale(.45); } to { opacity: 1; transform: scale(1.15); } }
@keyframes nv-core-glow {
  0% { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--nv-loader) 45%, transparent)) brightness(1); }
  to { filter: drop-shadow(0 0 22px var(--nv-loader)) brightness(1.18); }
}
@keyframes nv-bounce-up { 0% { transform: translateY(0) rotate(0); } to { transform: translateY(-20px) rotate(8deg) scale(.95); } }
@keyframes nv-bounce-up-sm { 0% { transform: translateY(0); } to { transform: translateY(-9px) scale(.95); } }
@keyframes nv-toast-in { 0% { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.nv-orbit, .nv-bounce, .nv-star { --nv-loader: var(--accent, #8ab4ff); }
.nv-star {
  background: var(--nv-loader);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--nv-loader) 65%, transparent));
  display: block;
}
.nv-orbit { place-items: center; width: 84px; height: 84px; display: grid; position: relative; }
.nv-orbit .nv-ring { border: 2px solid #0000; border-radius: 50%; animation: linear infinite nv-orbit-spin; position: absolute; }
.nv-orbit .nv-ring:first-child { border-top-color: var(--nv-loader); width: 100%; height: 100%; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--nv-loader) 40%, transparent)); animation-duration: 3.6s; }
.nv-orbit .nv-ring:nth-child(2) { border-top-color: color-mix(in srgb, var(--nv-loader) 55%, #fff); opacity: .85; width: 74%; height: 74%; animation-duration: 4.8s; animation-direction: reverse; }
.nv-orbit .nv-ring:nth-child(3) { border-top-color: color-mix(in srgb, var(--nv-loader) 60%, transparent); opacity: .8; width: 52%; height: 52%; animation-duration: 3s; }
.nv-orbit .nv-dots { animation: 6.5s linear infinite nv-orbit-spin; position: absolute; inset: 0; }
.nv-orbit .nv-dots b { background: var(--nv-loader); width: 6px; height: 6px; box-shadow: 0 0 9px var(--nv-loader); border-radius: 50%; margin: -3px; animation: 1.4s ease-in-out infinite alternate nv-dot-pulse; position: absolute; }
.nv-orbit .nv-dots b:first-child { top: 0; left: 50%; }
.nv-orbit .nv-dots b:nth-child(2) { animation-delay: .35s; bottom: 0; left: 50%; }
.nv-orbit .nv-dots b:nth-child(3) { animation-delay: .7s; top: 50%; left: 0; }
.nv-orbit .nv-dots b:nth-child(4) { animation-delay: 1.05s; top: 50%; right: 0; }
.nv-orbit .nv-core { width: 34%; height: 34%; animation: 3s linear infinite nv-orbit-spin, 2s ease-in-out infinite alternate nv-core-glow; }
.nv-orbit.nv-loader-sm { width: 46px; height: 46px; }
.nv-orbit.nv-loader-lg { width: 104px; height: 104px; }

.nv-bounce { align-items: flex-end; gap: 12px; height: 44px; display: inline-flex; }
.nv-bounce .nv-star { animation: .85s ease-in-out infinite alternate nv-bounce-up; }
.nv-bounce .nv-star:first-child { width: 26px; height: 26px; }
.nv-bounce .nv-star:nth-child(2) { width: 21px; height: 21px; animation-delay: .15s; }
.nv-bounce .nv-star:nth-child(3) { width: 17px; height: 17px; animation-delay: .3s; }
.nv-bounce.nv-loader-sm { gap: 6px; height: 18px; }
.nv-bounce.nv-loader-sm .nv-star { animation-name: nv-bounce-up-sm; }
.nv-bounce.nv-loader-sm .nv-star:first-child { width: 13px; height: 13px; }
.nv-bounce.nv-loader-sm .nv-star:nth-child(2) { width: 11px; height: 11px; }
.nv-bounce.nv-loader-sm .nv-star:nth-child(3) { width: 9px; height: 9px; }

/* The older single-ring spinner, still used by the party-ad wait box. */
.spinner { width: 46px; height: 46px; margin: 0 auto; position: relative; }
.spinner:before { content: ""; border: 2px solid #ffffff1a; border-radius: 50%; position: absolute; inset: 0; }
.spinner:after { content: ""; background: radial-gradient(circle 5px at 50% 8%, var(--accent) 94%, transparent 100%) no-repeat; filter: drop-shadow(0 0 7px var(--accent)); border-radius: 50%; animation: .9s linear infinite nv-orbit-spin; position: absolute; inset: 0; }
.spinner.sm { width: 28px; height: 28px; }

@media (prefers-reduced-motion: reduce) {
  .nv-orbit .nv-ring, .nv-orbit .nv-dots, .nv-orbit .nv-core, .nv-bounce .nv-star, .spinner:after { animation-duration: 3.2s !important; }
}

/* ---- "more sources are still resolving" pill ---------------------- */

.resolving-more {
  left: 50%;
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 88px));
  z-index: 1050;
  border: 1px solid var(--border);
  max-width: calc(100vw - 24px);
  color: var(--text, #e7ebf2);
  pointer-events: auto;
  background: #12141aeb;
  border-radius: 999px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 14px;
  font-size: 13px;
  line-height: 1;
  animation: .25s both nv-toast-in;
  display: flex;
  position: absolute;
  top: auto;
  transform: translate(-50%);
  box-shadow: 0 8px 24px #00000073;
}
.rm-text { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.rm-dismiss { width: 22px; height: 22px; color: var(--text, #e7ebf2); cursor: pointer; background: #ffffff14; border: none; border-radius: 50%; flex: none; place-items: center; font-size: 12px; line-height: 1; display: grid; }
.rm-dismiss:hover { background: #ffffff29; }

/* ---- "are you still watching?" ----------------------------------- */

.still-watching { z-index: 1006; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); background: #06080cd1; place-items: center; animation: .2s both nv-toast-in; display: grid; position: absolute; inset: 0; }
.still-watching-box { text-align: center; flex-direction: column; align-items: center; gap: 10px; max-width: 420px; padding: 0 24px; display: flex; }
.still-watching-title { color: #fff; font-size: clamp(20px, 3.4vw, 30px); font-weight: 700; }
.still-watching-sub { color: #f0f2f7b3; max-width: 100%; font-size: 14px; }
.still-watching-btn { color: #0a0d14; cursor: pointer; background: #fff; border: none; border-radius: 999px; align-items: center; gap: 9px; margin-top: 10px; padding: 12px 26px; font-size: 15px; font-weight: 600; display: inline-flex; }
.still-watching-btn:hover { background: #ffffffe0; }


/* ---- the compact layout the sheet switches to at 768px ------------
 *
 * Their global sheet's own block (index.css, offset 59 044). It sits here,
 * before the .source-menu rules that follow and before the component sheet,
 * because that is where it sits in their file — and because the component
 * sheet, loaded last on their site, overrides the topbar, the transport row
 * and .chip-btn values it repeats. What survives from this block is below:
 * the boxed menus, the hidden volume slider, the safe-area paddings.
 */

@media (width <= 768px) {
  .player-bottom { padding: 20px 16px calc(26px + env(safe-area-inset-bottom)); }
  .player-ctrls { flex-wrap: wrap; gap: 10px; }
  .player-ctrls-left, .player-ctrls-right { gap: 12px; }
  .player-ctrls-left { flex: auto; }
  .chip-btn { max-width: 118px; padding: 7px 10px; font-size: .78rem; }
  .player-volume input[type=range] { display: none; }
  .source-menu, .settings-menu {
    width: auto;
    max-width: none;
    max-height: 62vh;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    position: fixed;
    inset: auto 0 0;
    box-shadow: 0 -12px 40px #0009;
  }
  .player-topbar { padding: calc(18px + env(safe-area-inset-top)) 16px 18px; height: 76px; }
}
/* ---- source menu internals --------------------------------------- */

.source-menu-backdrop { z-index: 1010; position: fixed; inset: 0; }
.source-menu {
  z-index: 1011;
  background: #0a0d14f7;
  border: 1px solid #f0f2f71f;
  border-radius: 10px;
  width: min(300px, 100vw - 24px);
  max-width: calc(100vw - 24px);
  max-height: 62vh;
  padding: 10px 0;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  overflow-y: auto;
  box-shadow: 0 24px 70px #0009;
}
.source-menu-title { letter-spacing: .26em; text-transform: uppercase; color: #f0f2f773; border-bottom: 1px solid #f0f2f714; margin-bottom: 4px; padding: 4px 20px 12px; font-size: 10.5px; font-weight: 600; }
.provider-heading { text-transform: uppercase; letter-spacing: .16em; color: #f0f2f766; padding: 12px 20px 4px; font-size: 11px; font-weight: 600; }
.source-opts { flex-direction: column; display: flex; }
.source-opt {
  color: #f0f2f7b3;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  background: 0 0;
  border: none;
  border-left: 2px solid #0000;
  border-radius: 0;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  transition: background .12s, color .12s;
  display: flex;
}
.source-opt:hover { color: #fff; background: #f0f2f70d; }
.source-opt.active { border-left-color: var(--accent); color: #fff; background: #ff7a591a; }
.source-opt-main { flex: 1; align-items: center; gap: 9px; min-width: 0; font-size: .84rem; display: flex; }
.source-opt-q { white-space: nowrap; color: #f0f2f773; flex-shrink: 0; font-size: .72rem; }
.source-opt.active .source-opt-q { color: var(--accent); }

.flag-icon { object-fit: cover; border-radius: 2px; flex-shrink: 0; width: 20px; height: 14px; }
.flag-fallback { background: #ffffff26; border-radius: 2px; flex-shrink: 0; width: 20px; height: 14px; display: inline-block; }

/* ------------------------------------------------------------------ *
 * One addition to the real sheet
 *
 * The real source menu groups with `.provider-heading` and never draws a
 * separator between groups. The clone's menu — which groups by provider and
 * then by language inside it — needs a hairline between those groups, so
 * this one class is ours. It changes nothing the real player renders.
 * ------------------------------------------------------------------ */

.source-group-divided { border-top: 1px solid #f0f2f714; margin-top: 4px; padding-top: 4px; }

/* ================================================================== *
 * The player component sheet
 * ================================================================== */

/* Scroll lock while a title is open. Toggled with the classes themselves. */
html.player-open, body.player-open {
  overscroll-behavior: none;
  height: 100%;
  overflow: hidden;
}

.player {
  z-index: 1000;
  overscroll-behavior: contain;
  touch-action: manipulation;
  background: #000;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100dvh;
  display: flex;
  position: fixed;
  inset: 0;
  overflow: hidden;
}
.player-video { object-fit: contain; background: #000; width: 100%; height: 100%; }
.player-spinner { pointer-events: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Shown when playback never started, or died. Three states: `slow` (still
   buffering past the grace period), `exhausted` (retrying, countdown live),
   and gave-up. */
.pb-recover {
  z-index: 1006;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  background: #06080cdb;
  place-items: center;
  padding: 24px;
  display: grid;
  position: absolute;
  inset: 0;
}
.pb-recover-box { text-align: center; flex-direction: column; align-items: center; gap: 10px; max-width: 460px; display: flex; }
.pb-recover-title { color: #fff; font-size: clamp(18px, 3vw, 26px); font-weight: 700; }
.pb-recover-sub { color: #f0f2f7b8; font-size: 14px; line-height: 1.45; }
.pb-recover-actions { flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; display: flex; }
.pb-recover-btn {
  color: #0a0d14;
  cursor: pointer;
  background: #fff;
  border: none;
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
}
.pb-recover-btn:hover { background: #ffffffe0; }
.pb-recover-btn.ghost { color: #fff; background: #ffffff1f; }
.pb-recover-btn.ghost:hover { background: #fff3; }

.player-nocursor { cursor: none; }

/* ---- the centre play button, and the pulse it breathes while paused ----
 *
 * One of the two additions to the harvested stylesheet — `.player-art` below is
 * the other one, and it makes the same argument from the other side. The button
 * itself is the real one — the player adds `button.player-center-play` as the
 * <video>'s next sibling the moment the picture is paused and takes it off the
 * screen again the instant playback starts, so the CSS below has one job: make
 * "nothing is happening — press this" visible from across the room.
 *
 * The two halos travel between the real stylesheet's own two values (48px/24px at rest, 60px at
 * hover), so the pulse reads as the button breathing rather than as a second, foreign glow. */
@keyframes nv-center-play-glow {
  0%, 100% { box-shadow: 0 0 44px #ff7a5959, inset 0 0 24px #ff7a5924; }
  50%      { box-shadow: 0 0 78px #ff7a599e, 0 0 26px #ff7a5961, inset 0 0 30px #ff7a593d; }
}
.player-center-play {
  color: #fff;
  cursor: pointer;
  z-index: 4;
  background: #f0f2f714;
  border: 1px solid #ff7a59bf;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  width: 86px;
  height: 86px;
  transition: background .15s, transform .15s, box-shadow .2s;
  display: flex;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 48px #ff7a5959, inset 0 0 24px #ff7a5924;
  animation: nv-center-play-glow 2.2s ease-in-out infinite;
}
/* A hand on the button should feel like a press, not fight the pulse: hovering stops the animation
   so the hover halo is the one in force. The scale still transitions as the real player's does. */
.player-center-play:hover {
  background: #ff7a5929;
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 0 60px #ff7a5980, inset 0 0 24px #ff7a5933;
  animation: none;
}
/* The same courtesy the rest of the player pays a viewer who has asked their system for less
   motion: the halo stays, it just stops moving. */
@media (prefers-reduced-motion: reduce) {
  .player-center-play { animation: none; }
}

/* ---- the title's own artwork, while there is no picture ------------
 *
 * The second addition to the harvested stylesheet, and the same argument as the
 * centre play button above: a player that has been asked for "Puss in Boots" and
 * answers with a black rectangle is not answering. So the backdrop the host's
 * metadata route already carries is drawn inside `.player` — under the chrome,
 * under the centre play button — from the moment the title is known until the
 * moment there is a picture, and `paintArt()` in watch-catalog.js adds and
 * removes it.
 *
 * `z-index: 0` rather than `auto`: the layer is inserted as the <video>'s next
 * sibling, which puts it before the topbar and the bottom transport in the tree,
 * and a browser that orders positioned boxes by z-index alone would otherwise
 * paint those two underneath it. `pointer-events: none` keeps the click, the
 * double-click and the press that the player binds to the <video> this layer
 * covers — the picture is covered, the picture is not taken away. */
.player-art {
  z-index: 0;
  pointer-events: none;
  background: #000 center / cover no-repeat;
  transition: opacity .5s ease;
  position: absolute;
  inset: 0;
}

.player-art.is-off { opacity: 0; }
.player-flash {
  color: #fff;
  pointer-events: none;
  z-index: 4;
  background: #080a108c;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  width: 84px;
  height: 84px;
  animation: .55s ease-out forwards nvflash;
  display: flex;
  position: absolute;
  top: 50%;
  left: 50%;
}
@keyframes nvflash {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(.8); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}

.player-topbar {
  background: linear-gradient(#000000bf, #0000);
  justify-content: space-between;
  align-items: center;
  height: 90px;
  padding: 22px 28px;
  transition: opacity .3s;
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}
.player-topback {
  color: #fff;
  cursor: pointer;
  background: #00000059;
  border: 1.5px solid #fff6;
  border-radius: 50%;
  flex: none;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  display: flex;
}
.player-topback:hover { border-color: #fff; }
.player-titlebox { text-align: center; color: #fff; }
.player-titlebox .pt { font-size: .95rem; font-weight: 700; }
.player-titlebox .ps { color: var(--text-dim); margin-top: 2px; font-size: .78rem; }

.player-bottom {
  background: linear-gradient(#0000, #000000e6);
  padding: 28px;
  transition: opacity .3s;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.player { --nv-transport: 136px; }
@media (width <= 720px), (pointer: coarse) { .player { --nv-transport: 210px; } }

.player-fade-out { opacity: 0; pointer-events: none; }

/* ---- mobile transport ------------------------------------------- */

.player-mobile { z-index: 1004; pointer-events: none; transition: opacity .3s; position: absolute; inset: 0; }
.player-mobile .pm-center, .player-mobile .pm-sheet { pointer-events: auto; }
.pm-center {
  justify-content: center;
  align-items: center;
  gap: 34px;
  transition: top .22s;
  display: flex;
  position: absolute;
  top: 46%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
}
.player.player-promo-sheet .pm-center { top: 30%; }
.pm-skip {
  color: #fff;
  cursor: pointer;
  background: #0a0d148c;
  border: 1px solid #f0f2f740;
  border-radius: 50%;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  display: inline-flex;
}
.pm-skip span { margin-top: -2px; font-size: 9px; font-weight: 700; }
.pm-play {
  color: #fff;
  cursor: pointer;
  background: #f0f2f714;
  border: 1px solid #ff7a59bf;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  width: 72px;
  height: 72px;
  display: inline-flex;
  box-shadow: 0 0 38px #ff7a5966, inset 0 0 18px #ff7a5924;
}
.pm-sheet {
  background: linear-gradient(#0000, #000000b8 42%);
  padding: 16px 16px 22px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.pm-scrub-wrap { margin-bottom: 14px; }
.pm-scrub-wrap .scrub { margin: 0; }
.pm-times {
  color: #f0f2f799;
  font-variant-numeric: tabular-nums;
  justify-content: space-between;
  margin-top: 9px;
  font-size: .72rem;
  display: flex;
}
.pm-chips { gap: 9px; margin-bottom: 16px; display: flex; }
.pm-chips .source-control { flex: 1; min-width: 0; }
.pm-chips .chip-btn { justify-content: center; width: 100%; max-width: none; }
.pm-actions { justify-content: center; gap: 40px; display: flex; }
.pm-act {
  color: #f0f2f7b3;
  cursor: pointer;
  background: 0 0;
  border: none;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  display: inline-flex;
}
.pm-act:disabled { opacity: .35; cursor: not-allowed; }
.pm-act.active { color: var(--accent); }
.pm-act-ico { align-items: center; height: 20px; font-size: .9rem; font-weight: 700; display: inline-flex; }
.pm-act-lbl { letter-spacing: .08em; text-transform: uppercase; color: #f0f2f773; font-size: .58rem; }
.pm-act.active .pm-act-lbl { color: var(--accent); }
.pm-act-wrap { position: relative; }
.pm-sheet .source-menu {
  width: min(340px, 100vw - 24px);
  max-height: 50vh;
  position: fixed;
  bottom: 104px;
  left: 50%;
  right: auto;
  transform: translate(-50%);
}
@media (width <= 719px) { .player-center-play { display: none; } }

/* ---- seek bar ---------------------------------------------------- */

.scrub-row { align-items: center; gap: 14px; margin-bottom: 18px; display: flex; }
.scrub-time { font-family: var(--font-display); color: var(--text-dim); text-align: center; min-width: 44px; font-size: .82rem; font-weight: 600; }
.scrub {
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  background: #fff3;
  border-radius: 3px;
  flex: 1;
  height: 6px;
  transition: height .12s;
  position: relative;
}
.scrub:before { content: ""; position: absolute; inset: -9px 0; }
.scrub:hover, .scrub.scrubbing { height: 8px; }
.scrub.scrubbing { cursor: grabbing; }
.scrub:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.scrub-buffered, .scrub-current { border-radius: 3px; position: absolute; top: 0; bottom: 0; left: 0; }
.scrub-buffered { background: #ffffff59; }
.scrub-current { background: linear-gradient(90deg, #ff7a59d9, var(--accent)); box-shadow: 0 0 10px #ff7a5999, 0 0 2px #ff7a59e6; }
.scrub-handle {
  pointer-events: none;
  background: #f0f2f7;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  transition: width .12s, height .12s, box-shadow .12s;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 14px #ff7a59e6, 0 0 0 3px #ff7a5940;
}
.scrub:hover .scrub-handle, .scrub.scrubbing .scrub-handle { width: 18px; height: 18px; box-shadow: 0 0 18px #ff7a59, 0 0 0 5px #ff7a594d; }
.scrub-tooltip {
  color: #fff;
  font-family: var(--font-display);
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
  background: #080a10e6;
  border: 1px solid #ffffff26;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: .78rem;
  font-weight: 600;
  position: absolute;
  bottom: calc(100% + 12px);
  transform: translate(-50%);
}

/* ---- desktop controls -------------------------------------------- */

.player-ctrls { justify-content: space-between; align-items: center; gap: 16px; display: flex; }
.player-ctrls-left, .player-ctrls-right { color: #fff; flex-wrap: wrap; align-items: center; gap: 22px; min-width: 0; display: flex; }
.player-ctrls-right { justify-content: flex-end; }
.ctrl-btn { color: #fff; cursor: pointer; background: 0 0; border: none; justify-content: center; align-items: center; padding: 2px; display: inline-flex; }
.ctrl-btn:hover { color: var(--accent); }
.ctrl-btn-play { border: 1px solid #f0f2f759; border-radius: 50%; width: 44px; height: 44px; transition: border-color .15s, background .15s, color .15s; }
.ctrl-btn-play:hover { border-color: var(--accent); background: var(--accent-soft); }
.player-volume { align-items: center; gap: 10px; margin-left: 6px; display: flex; }
.player-volume input[type=range] { accent-color: #fff; cursor: pointer; width: 80px; }
@media (hover: hover) {
  .player-volume input[type=range] { opacity: 0; width: 0; transition: width .18s, opacity .18s; }
  .player-volume:hover input[type=range], .player-volume:focus-within input[type=range] { opacity: 1; width: 80px; }
}

/* ---- menus ------------------------------------------------------- */

.settings-menu { width: 240px; }
.settings-report {
  color: #f0f2f7b8;
  width: 100%;
  font-size: .85rem;
  font-family: var(--font-body, inherit);
  cursor: pointer;
  text-align: left;
  background: 0 0;
  border: none;
  border-top: 1px solid #f0f2f714;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 11px 20px;
  display: flex;
}
.settings-report:hover { color: #fff; background: #ffffff0d; }

/* A native <select> chip, used where a menu would be overkill. */
.chip-select { align-items: center; display: inline-flex; position: relative; }
.chip-select select {
  appearance: none;
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  background: #ffffff1a;
  border: 1px solid #ffffff2e;
  border-radius: 6px;
  outline: none;
  padding: 8px 26px 8px 13px;
}
.chip-select svg { pointer-events: none; position: absolute; right: 8px; }
.chip-select select option { background: var(--surface); color: #fff; }

.source-control { position: relative; }
.chip-btn {
  color: #f0f2f7d9;
  max-width: 200px;
  font-size: .8rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  background: #f0f2f70d;
  border: 1px solid #f0f2f733;
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  transition: border-color .15s, color .15s, background .15s;
  display: inline-flex;
}
.chip-btn:hover { color: #fff; background: #ff7a591a; border-color: #ff7a5980; }

.episode-menu { width: min(320px, 100vw - 24px); overflow: visible; }
.episode-season-select select {
  color: #fff;
  border: 1px solid var(--border);
  width: 100%;
  font-family: var(--font-body);
  cursor: pointer;
  background: #ffffff0f;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .9rem;
}
.episode-season-select select option { color: #fff; background-color: #12151d; }
.episode-opts { max-height: min(50vh, 360px); overflow-y: auto; }
.episode-opt { justify-content: flex-start; }
.episode-opt .truncate { flex: auto; min-width: 0; }
.episode-num { text-align: center; opacity: .6; font-variant-numeric: tabular-nums; flex: none; min-width: 1.7em; }
.episode-opt.active .episode-num { opacity: .95; }
.episode-now { letter-spacing: .04em; text-transform: uppercase; opacity: .85; white-space: nowrap; margin-left: auto; padding-left: 8px; font-size: .68rem; }

/* ---- sponsor ad layer (not used by the clone; kept so this file is the
       whole player sheet and not a subset) --------------------------- */

.ad-player { z-index: 1010; background: #000; justify-content: center; align-items: center; display: flex; position: absolute; inset: 0; }
.ad-player-loading { flex-direction: column; gap: 18px; }
.ad-player .player-video { cursor: default; }
.ad-badge { color: #fff; letter-spacing: .02em; pointer-events: none; background: #0009; border: 1px solid #ffffff40; border-radius: 6px; padding: 6px 12px; font-size: .78rem; font-weight: 600; position: absolute; top: 20px; left: 20px; }
.ad-skip-btn { color: #fff; cursor: pointer; background: #141418d9; border: 1.5px solid #ffffff80; border-radius: 6px; padding: 10px 18px; font-size: .88rem; font-weight: 700; position: absolute; bottom: 24px; right: 24px; }
.ad-skip-btn:hover { background: #28282ee6; border-color: #fff; }
.ad-center-play { color: #fff; cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); background: #0c0c10d1; border: 1.5px solid #ffffff8c; border-radius: 8px; justify-content: center; align-items: center; gap: 10px; min-width: 180px; min-height: 54px; font-weight: 800; display: inline-flex; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.ad-center-play:hover { background: #1c1c22e6; border-color: #fff; }
.ad-play-toggle { color: #fff; cursor: pointer; background: #141418c7; border: 1.5px solid #ffffff73; border-radius: 50%; justify-content: center; align-items: center; width: 44px; height: 44px; display: inline-flex; position: absolute; bottom: 24px; left: 24px; }
.ad-play-toggle:hover { background: #28282ee6; border-color: #fff; }
.ad-unmute-btn { color: #fff; height: 44px; font: inherit; cursor: pointer; background: #141418c7; border: 1.5px solid #ffffff73; border-radius: 22px; align-items: center; gap: 6px; padding: 0 14px; font-size: .85rem; display: inline-flex; position: absolute; bottom: 24px; left: 80px; }
.ad-unmute-btn:hover { background: #28282ee6; border-color: #fff; }
.ad-skip-countdown { color: var(--text-dim); pointer-events: none; background: #141418b3; border: 1px solid #ffffff40; border-radius: 6px; padding: 10px 18px; font-size: .85rem; position: absolute; bottom: 24px; right: 24px; }

/* ---- captions drawn by the player -------------------------------- */

.cc-overlay {
  pointer-events: none;
  z-index: 6;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: min(92%, 1100px);
  transition: bottom .18s;
  display: flex;
  position: absolute;
  left: 50%;
  transform: translate(-50%);
}
@media (prefers-reduced-motion: reduce) { .cc-overlay { transition: none; } }
.cc-line { white-space: pre-line; -webkit-box-decoration-break: clone; box-decoration-break: clone; border-radius: 4px; max-width: 100%; font-weight: 600; line-height: 1.32; }

.subs-menu { width: min(340px, 100vw - 24px); }
.chip-btn-on { color: #fff; border-color: #f0f2f773; }
.chip-pulse { background: var(--accent, #6ea8fe); border-radius: 50%; flex: none; width: 6px; height: 6px; animation: 1.1s ease-in-out infinite cc-pulse; }
@keyframes cc-pulse { 0%, to { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chip-pulse { opacity: .8; animation: none; } }

.subs-pending, .subs-empty { color: var(--text-dim, #f0f2f799); align-items: center; gap: 10px; padding: 9px 20px; font-size: .82rem; display: flex; }
.subs-pending-spin { flex: none; width: 16px; height: 16px; }
.subs-sync { align-items: center; gap: 8px; padding: 4px 20px 0; display: flex; }
.subs-step, .subs-reset { color: #f0f2f7e6; cursor: pointer; background: #f0f2f70d; border: 1px solid #f0f2f733; border-radius: 8px; flex: none; justify-content: center; align-items: center; width: 30px; height: 30px; display: inline-flex; }
.subs-step:hover, .subs-reset:hover:not(:disabled) { background: #f0f2f71f; }
.subs-reset:disabled { opacity: .35; cursor: default; }
.subs-offset-val { text-align: center; font-variant-numeric: tabular-nums; color: #fff; min-width: 58px; font-size: .85rem; font-weight: 600; }
.subs-reset { margin-left: auto; }
.subs-hint { color: var(--text-dim, #f0f2f78c); padding: 8px 20px 2px; font-size: .72rem; line-height: 1.4; }
.subs-row { align-items: center; gap: 10px; padding: 6px 20px; display: flex; }
.subs-label { width: 72px; color: var(--text-dim, #f0f2f799); flex: none; font-size: .76rem; }
.subs-chips { flex-wrap: wrap; gap: 5px; display: flex; }
.subs-chip { color: #f0f2f7cc; font-size: .72rem; font-weight: 600; font-family: var(--font-body); cursor: pointer; background: 0 0; border: 1px solid #f0f2f72e; border-radius: 999px; padding: 4px 9px; }
.subs-chip:hover { background: #f0f2f71a; }
.subs-chip.active { color: #10131a; background: #f0f2f7eb; border-color: #0000; }
.subs-swatch { cursor: pointer; border: 2px solid #f0f2f740; border-radius: 50%; width: 22px; height: 22px; padding: 0; }
.subs-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px #0009; }
.subs-slider { min-width: 0; accent-color: var(--accent, #6ea8fe); flex: 1; }
.subs-restore { color: #f0f2f7bf; font-size: .76rem; font-family: var(--font-body); cursor: pointer; background: 0 0; border: 1px solid #f0f2f72e; border-radius: 8px; align-items: center; gap: 7px; margin: 6px 20px 2px; padding: 6px 12px; display: inline-flex; }
.subs-restore:hover { color: #fff; background: #f0f2f71a; }
.subs-preview {
  text-align: center;
  background-color: #3a3f4b;
  background-image:
    linear-gradient(45deg, #ffffff0f 25%, #0000 25% 75%, #ffffff0f 75%),
    linear-gradient(45deg, #ffffff0f 25%, #0000 25% 75%, #ffffff0f 75%);
  background-position: 0 0, 7px 7px;
  background-size: 14px 14px;
  border: 1px solid #f0f2f71f;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  min-height: 54px;
  margin: 2px 20px 8px;
  padding: 8px 10px;
  display: flex;
  overflow: hidden;
}
.subs-preview > span { -webkit-box-decoration-break: clone; box-decoration-break: clone; border-radius: 4px; max-width: 100%; font-weight: 600; line-height: 1.3; display: inline-block; }

/* ================================================================== *
 * The one deviation in this file
 *
 * The reference sheet is reproduced above byte for byte. This rule is the
 * exception, and it exists because of an interaction between two of the
 * reference's own blocks rather than because of anything this page does.
 *
 * The phone sheet is declared in the `@media (width <= 768px)` block as
 * `position: fixed; inset: auto 0 0` - a full-width bottom sheet. The desktop
 * `.source-menu` rule comes later in the sheet, so it takes back `position`,
 * `bottom` and `right`, but nothing in it mentions `left`, and the media block's
 * `left: 0` therefore survives. An absolutely positioned box with both `left: 0`
 * and `right: 0` is over-constrained: the width is used and `left` wins, so
 * between 720px and 768px - where the desktop transport is in use and the media
 * block still applies - every menu is drawn from the chip's left edge and runs
 * off the right of the screen.
 *
 * `left: auto` asks for the anchoring the desktop rule already declares. Above
 * 768px it is the value `left` already has, so nothing changes there, and the
 * phone's own `.pm-sheet .source-menu` sets `left: 50%` at a higher specificity,
 * so nothing changes there either.
 * ================================================================== */

.source-menu,
.settings-menu {
  left: auto;
}

/* ==================================================================
 * The two things the host's admin panel adds to the reference player.
 *
 * Everything above this line is the reference player's own stylesheet
 * with its real values, and it stays that way: with no logo uploaded and
 * no second accent colour chosen — which is how a fresh install starts —
 * not one of these rules has anything to draw.
 *
 *   .player-brand   the operator's logo in the topbar. A flex item at the
 *                   head of the row the reference player already has, so
 *                   it cannot disturb the title box under it.
 *   --accent-grad   a gradient built from --accent and --accent-2. It is
 *                   `none` unless a second colour was picked, which is why
 *                   the rules below are harmless in the default case.
 * ================================================================== */

.player-brand {
  width: 26px;
  height: 26px;
  margin-right: 10px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px #ffffff26, 0 2px 10px #00000059;
}

html[data-site-logo] .player-topbar {
  column-gap: 2px;
}

/* The accent, when there is a second colour: the spinner's core, the progress
   fill, and the row the viewer has selected.

   `background-image: var(--accent-grad, none)` is deliberately a *layer* rather
   than a replacement. With a second colour chosen the gradient sits over the
   rule above it; with none — the default — the token resolves to `none` and the
   declaration does nothing at all, so the reference player's own flat styling is
   still exactly what renders. */
.nv-core {
  background-image: var(--accent-grad, none);
}

.nv-progress-fill {
  background-image: var(--accent-grad, none);
}

.source-opt.active,
.episode-opt.active {
  background-image: var(--accent-grad, none);
}

/* ======================================================================
   The host's Telegram button.

   One anchor, drawn in both control rows the player builds: beside the
   settings gear on a desktop, and as a fourth quick action on the phone
   sheet. It is the same button in the two places, so it is one block of
   rules with the two rows' own classes.

   Its colour is Telegram's own blue rather than --accent, and that is the
   one deliberate deviation from the site's palette in this file. The button
   belongs to the channel, not to the host: a viewer recognises the mark by
   its colour, and colouring it with an accent that may be anything at all
   would make it read as one more of the player's own controls.

   With no address stored — the ordinary case — nothing is drawn at all, so
   none of these rules has anything to style.
   ====================================================================== */

.tg-btn,
.tg-act {
  color: #2aabee;
  /* This button is an anchor, not a `<button>`, so the browser would rule a
     line under it. The reference has no underline, and no other control in
     either row carries one, so it is taken off here rather than at each use. */
  text-decoration: none;
}

/* Both rows lay their items out with `display: flex`, which outranks the
   `[hidden]` attribute's own `display: none`; without this a host with no
   channel would be handed an empty button at the end of the row. */
.tg-btn[hidden],
.tg-act[hidden] {
  display: none;
}

.tg-btn {
  gap: 7px;
  padding: 2px 4px;
  border-radius: 8px;
}

/* After `.ctrl-btn:hover`, which paints every control with the accent. */
.tg-btn:hover {
  color: #62c3f2;
  background: #2aabee1a;
}

.tg-btn:focus-visible,
.tg-act:focus-visible {
  outline: 2px solid #2aabee;
  outline-offset: 3px;
}

.tg-label {
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}

/* The mark leaves and comes back, about once every four seconds.

   The plane flies up and to the right, which is the heading it is drawn
   pointing at, and the glow arrives with it and is gone before it lands. The
   distance is deliberately about a stroke's width: this control sits in a row
   of otherwise perfectly still icons, and a mark that travelled far enough to
   notice at a glance would read as a spinner rather than as an invitation.

   The long tail of the cycle — from 30% to the end — is one value repeated, so
   the button is at rest most of the time and the movement reads as an event
   rather than as a loop. */
@keyframes nv-tg-send {
  0%, 62%, 100% { transform: translate(0, 0) scale(1); filter: drop-shadow(0 0 0 #2aabee00); }
  14% { transform: translate(2.5px, -2.5px) scale(1.08); filter: drop-shadow(0 0 7px #2aabeecc); }
  30% { transform: translate(0, 0) scale(1); filter: drop-shadow(0 0 0 #2aabee00); }
}

.tg-btn svg,
.tg-act svg {
  animation: 4s ease-in-out infinite nv-tg-send;
}

/* Which is the one thing a reader who has asked for less motion must not be
   given, since the mark draws attention to itself on its own. */
@media (prefers-reduced-motion: reduce) {
  .tg-btn svg,
  .tg-act svg {
    animation: none;
  }
}

/* The phone's fourth quick action. Its label carries the class the other three
   use, so the only thing to say here is the colour: the icon and the word are
   the channel's blue rather than the sheet's grey. */
.tg-act .pm-act-lbl {
  color: #2aabee;
}

/* Four actions where the sheet was drawn for three. The row is centred and
   flex, so it shrinks before it overflows — this only takes back the room a
   narrow phone would otherwise have to steal from the labels. */
@media (width <= 420px) {
  .pm-actions {
    gap: 20px;
  }
}


/* ======================================================================
   Advertising.

   Two placements, both handed over as an operator's own ad tag: a bar above
   the picture, and a pre-roll curtain that holds the first frame.

   Nothing here is ever rendered for a subscriber, and that is not a rule of
   this stylesheet - server.js simply does not send the tags to a viewer with
   an active subscription, so there is nothing for these rules to style. A host
   with advertising switched off takes the same path, which is why the default
   costs a viewer nothing at all.

   Both slots are sized in ordinary CSS with no fixed heights, because the tag
   inside them is whatever the network returns: a 300x250 rectangle, a 728x90
   leaderboard, an iframe, or a script that draws its own box.
   ====================================================================== */

/* --- the bar above the picture ---------------------------------------- */

.ad-bar {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px 8px;
  background: var(--panel);
  border-bottom: 1px solid var(--border-soft);
  /* A network that returns something enormous must not eat the picture. */
  max-height: 34vh;
  overflow: hidden;
}

.ad-bar > * {
  max-width: 100%;
}

/* The markup ships the bar `hidden` so it takes no space before a tag lands,
   and the `display: flex` above would otherwise win over the attribute's own
   `display: none` — an attribute selector outranks a class. This is the rule
   that keeps an empty bar out of the picture. */
.ad-bar[hidden] {
  display: none;
}

/* The word "Advertisement" is required in a lot of markets and is good manners
   everywhere, so it is part of the bar rather than something an operator has to
   remember to paste into their tag. */
.ad-bar-tag {
  position: absolute;
  top: 2px;
  left: 10px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  pointer-events: none;
}

/* --- the pre-roll curtain -------------------------------------------- */

.ad-curtain {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 6vh 20px;
  background: radial-gradient(120% 90% at 50% 0%, #10141d 0%, #05070c 70%);
  color: var(--text);
  font-family: var(--font-body);
  animation: adFade 240ms ease both;
}

@keyframes adFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ad-curtain-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ad-tag {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.ad-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-mute);
}

/* The tag's own box. Centred and generous, because a video ad tag usually
   wants a 16:9 area and a display tag usually wants a rectangle; both look
   right in a box that simply takes the room it is given. */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(880px, 100%);
  min-height: min(52vh, 420px);
  padding: 10px;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border-soft);
  background: #0a0d14;
  overflow: hidden;
}

.ad-slot > * {
  max-width: 100%;
}

.ad-curtain-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.ad-skip {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid #ffffff26;
  background: #ffffff14;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.ad-skip:hover {
  background: #ffffff2a;
  border-color: #ffffff42;
}

.ad-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.ad-note a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.ad-note a:hover {
  border-bottom-color: currentColor;
}

/* A phone in a hand: the bar becomes a strip, the curtain breathing room. */
@media (max-width: 719px) {
  .ad-bar {
    padding: 4px 6px;
    max-height: 26vh;
  }

  .ad-curtain {
    gap: 12px;
    padding: 4vh 12px;
  }

  .ad-slot {
    min-height: 0;
    width: 100%;
  }
}

/* ======================================================================
   The design section — an account's own player.

   A frame addressed with `?p=pl-ab12cd34` is everything above this line with
   one account's design laid over it. `applyDesign()` in public/watch-catalog.js
   writes that design onto the document, and every rule below reads it. The
   whole section is behind `html[data-design]`, the marker that function sets
   and that nothing else in the project sets: a frame served to this host's own
   pages, or to anybody who pasted the plain address, matches none of it and
   renders the reference player exactly as it always did. That is why a variant
   can be written here without a second thought for the frames that never asked
   for one, and why the marker, rather than each attribute, is what these rules
   are scoped behind.

   Nothing arrives as a rule per element. Everything is one attribute or one
   custom property on `html`, written once, read by the selectors below:

     data-frame 1..3             the frame's own type
     data-loader 1..12           the loading mark
     data-welcome 1..3           how much of the welcome page is drawn
     data-play 1..9              the welcome's play button
     data-title logo|text        the title as artwork or as words
     data-posters 0|1            the poster behind the welcome
     data-info 0|1               the line of information above the button
     data-art 0|1                the title's artwork behind the picture
     data-menu 1..4              the panel a menu is drawn in
     data-menu-pos 1..3          where a menu is anchored
     data-menu-show 0|1          whether the chip row is drawn at all
     data-servers bar|list       how the providers are presented
     data-sources simple|detailed  how much a source row says
     data-episodes 0|1           the episodes chip (markup, in watch.js)

     and as tokens: --frame-scale, --font-scale, --chrome-scale,
     --loader-color, --welcome-blur, --welcome-overlay, --play-color.

   The caption size (`skin.subSize`) is a token too, but not one this sheet
   reads: a line of dialogue is sized line by line from watch.js, which is where
   the viewer's own choice already lives, so the design's multiplier is folded in
   there rather than fought over here with an `!important`.

   THREE SIZES, AND WHAT EACH ONE GROWS

     --font-scale    the type. `general.fontSize` against the reference's own
                     14px, written on the root's font size, so every `rem` in
                     this file follows it — which is most of the chrome's text.
     --chrome-scale  the controls. The frame's size and the type size together,
                     applied to the boxes the type sits in, so a design that is
                     30% larger is 30% larger in both.
     --frame-scale   the picture's own furniture: the loading mark and the
                     welcome page. Never the picture itself — a frame is as
                     large as the page it was pasted into, and a setting that
                     letterboxed somebody's film would be a setting no site
                     owner would thank us for.

   At the defaults — 100% and 14px, which is where every fresh player starts —
   all three are exactly 1, and every declaration below computes to the value
   the rule above it already had.
   ====================================================================== */

/* --- 1. the frame's three sizes ------------------------------------- */

html[data-design] {
  font-size: calc(16px * var(--font-scale, 1));
}

html[data-design] .player-spinner {
  width: calc(84px * var(--frame-scale, 1));
  height: calc(84px * var(--frame-scale, 1));
}

html[data-design] .player-topback {
  width: calc(42px * var(--chrome-scale, 1));
  height: calc(42px * var(--chrome-scale, 1));
}

html[data-design] .ctrl-btn-play {
  width: calc(44px * var(--chrome-scale, 1));
  height: calc(44px * var(--chrome-scale, 1));
}

html[data-design] .player-center-play {
  width: calc(86px * var(--chrome-scale, 1));
  height: calc(86px * var(--chrome-scale, 1));
}

html[data-design] .player-center-play svg {
  width: calc(40px * var(--chrome-scale, 1));
  height: calc(40px * var(--chrome-scale, 1));
}

html[data-design] .pm-play {
  width: calc(72px * var(--chrome-scale, 1));
  height: calc(72px * var(--chrome-scale, 1));
}

html[data-design] .pm-play svg {
  width: calc(26px * var(--chrome-scale, 1));
  height: calc(26px * var(--chrome-scale, 1));
}

html[data-design] .pm-skip {
  width: calc(48px * var(--chrome-scale, 1));
  height: calc(48px * var(--chrome-scale, 1));
}

html[data-design] .scrub {
  height: calc(6px * var(--frame-scale, 1));
}

html[data-design] .scrub:hover,
html[data-design] .scrub.scrubbing {
  height: calc(8px * var(--frame-scale, 1));
}

/* The bar, the sheet and the chips are the three things the reference sheet's
   own compact block also sizes, and its block comes earlier in this file with
   a class less specific than these rules. A design would therefore take the
   phone's small bar away from it. They are asked for at the widths where that
   block does not apply, and the phone keeps its own compact bar at its own
   size, scaled. */
@media (min-width: 769px) {
  html[data-design] .player-topbar {
    height: calc(90px * var(--chrome-scale, 1));
    padding: calc(22px * var(--chrome-scale, 1)) calc(28px * var(--chrome-scale, 1));
  }

  html[data-design] .player-bottom {
    padding: calc(28px * var(--chrome-scale, 1));
  }

  html[data-design] .chip-btn {
    padding: calc(9px * var(--chrome-scale, 1)) calc(15px * var(--chrome-scale, 1));
  }
}

@media (max-width: 768px) {
  html[data-design] .player-topbar {
    height: calc(76px * var(--chrome-scale, 1));
    padding: calc((18px * var(--chrome-scale, 1)) + env(safe-area-inset-top, 0px))
             calc(16px * var(--chrome-scale, 1))
             calc(18px * var(--chrome-scale, 1));
  }

  html[data-design] .player-bottom {
    padding: calc(20px * var(--chrome-scale, 1)) calc(16px * var(--chrome-scale, 1))
             calc((26px * var(--chrome-scale, 1)) + env(safe-area-inset-bottom, 0px));
  }

  html[data-design] .chip-btn {
    padding: calc(7px * var(--chrome-scale, 1)) calc(10px * var(--chrome-scale, 1));
  }
}

/* --- 2. the centre play button, and the welcome that replaces it ----

   The reference player's way in is the pulsing centre play button it adds to
   `.player` the moment there is a picture to press. An account's own player is
   asked for a welcome page instead — a screen with its title, its poster and
   its own button — and watch.js moves the two together: `welcomeSet()` is
   called from the same place `showCenterPlay()` is, so the two are never in
   two minds about whether the film is waiting for a press. What is left for
   this sheet is which one is drawn, and the answer is the reference's own
   button when there is no design and the welcome when there is.

   The phone is the one case where the reference button is not a layer of its
   own: its transport row carries the play button, and that button is also the
   only pause in the row. So it is not removed, it is stood down — and only
   while the welcome is actually up, which is a question the welcome can answer
   about itself. */
html[data-design] .player-center-play {
  display: none;
}

html[data-design] .player:has(.frame-welcome:not([hidden])) .pm-play {
  visibility: hidden;
}

/* --- 3. the welcome page ------------------------------------------- */

@keyframes fw-in {
  from { opacity: 0; transform: scale(1.015); }
  to { opacity: 1; transform: none; }
}

.frame-welcome {
  z-index: 3;
  background: var(--canvas);
  justify-content: center;
  align-items: center;
  animation: .34s ease both fw-in;
  display: flex;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* The markup ships the layer `hidden` and the two pieces of artwork toggle
   their own `hidden` from the catalogue, and `display: flex` above would
   outrank the attribute's own `display: none` — an attribute selector is
   written into the class here rather than left to the browser. */
.frame-welcome[hidden],
.frame-welcome *[hidden] {
  display: none;
}

/* The poster the title came with, blurred by the design and dimmed by the scrim
   over it. `scale` gives the blur something to work with: an unblurred copy is
   the picture itself, and a blurred one would otherwise show its own soft edge
   at the frame's border. */
.fw-art {
  background: #000 center / cover no-repeat;
  filter: blur(var(--welcome-blur, 0));
  transform: scale(1.06);
  position: absolute;
  inset: 0;
}

.fw-scrim {
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--canvas) 84%, transparent),
      color-mix(in srgb, var(--canvas) 58%, transparent) 46%,
      color-mix(in srgb, var(--canvas) 94%, transparent));
  opacity: var(--welcome-overlay, .7);
  position: absolute;
  inset: 0;
}

.fw-body {
  z-index: 1;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: calc(18px * var(--frame-scale, 1));
  width: min(92%, 780px);
  padding: 0 24px;
  display: flex;
  position: relative;
}

.fw-mark {
  aspect-ratio: 16 / 9;
  background: center / contain no-repeat;
  width: min(52vw, 360px);
}

.fw-title {
  font-family: var(--font-display);
  color: var(--text);
  font-size: clamp(26px, 4.6vw, 52px);
  font-weight: 600;
  line-height: 1.1;
  text-shadow: 0 6px 30px #000000b3;
}

.fw-info {
  color: var(--text-dim);
  max-width: 46ch;
  font-size: .92rem;
  line-height: 1.5;
}

/* The button. One base, then the nine the design can pick from.

   `--fw-play` is the design's own colour when it named one and the accent when
   it did not, and every variant below paints itself from that one token: a
   play colour set on the builder has to reach whichever of the nine was
   chosen, and a variant that read `--accent` directly would ignore it. */
.fw-play {
  --fw-play: var(--play-color, var(--accent));
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: calc(4px * var(--frame-scale, 1));
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
  display: inline-flex;
}

.fw-play:hover {
  transform: translateY(-2px);
}

.fw-play-ico {
  flex: none;
  justify-content: center;
  align-items: center;
  width: calc(30px * var(--frame-scale, 1));
  height: calc(30px * var(--frame-scale, 1));
  display: inline-flex;
}

.fw-play-ico svg {
  width: 100%;
  height: 100%;
}

/* The label is the design's own wording and only two of the nine buttons show
   it — a circle with a word under the triangle is not a shape the reference's
   own player has anywhere. */
.fw-play-label {
  letter-spacing: .01em;
  font-size: .95rem;
  display: none;
}

/* 1 — the reference's own centre play, translated: a glass disc in a ring. */
html[data-design][data-play="1"] .fw-play {
  border-color: var(--fw-play);
  border-radius: 50%;
  width: calc(96px * var(--frame-scale, 1));
  height: calc(96px * var(--frame-scale, 1));
  background: #f0f2f714;
  box-shadow: 0 18px 50px #000000a6, inset 0 0 0 1px #ffffff0f;
}

html[data-design][data-play="1"] .fw-play:hover {
  background: color-mix(in srgb, var(--fw-play) 22%, transparent);
  box-shadow: 0 22px 60px #000000b3, 0 0 34px color-mix(in srgb, var(--fw-play) 45%, transparent);
}

/* 2 — a solid disc in the design's own colour. */
html[data-design][data-play="2"] .fw-play {
  color: #07090f;
  border-radius: 50%;
  width: calc(96px * var(--frame-scale, 1));
  height: calc(96px * var(--frame-scale, 1));
  background: var(--fw-play);
  box-shadow: 0 18px 46px color-mix(in srgb, var(--fw-play) 42%, transparent);
}

/* 3 — a rounded square, which is the shape the reference uses for nothing. */
html[data-design][data-play="3"] .fw-play {
  border-color: #ffffff2e;
  border-radius: 24px;
  width: calc(96px * var(--frame-scale, 1));
  height: calc(96px * var(--frame-scale, 1));
  background: #101623d9;
  box-shadow: 0 18px 50px #000000a6;
}

html[data-design][data-play="3"] .fw-play:hover {
  border-color: var(--fw-play);
}

/* 4 — the label in a pill, with the triangle beside it. */
html[data-design][data-play="4"] .fw-play {
  border-color: var(--fw-play);
  padding: calc(10px * var(--frame-scale, 1)) calc(24px * var(--frame-scale, 1));
  background: #f0f2f714;
}

html[data-design][data-play="4"] .fw-play-label {
  display: inline;
}

html[data-design][data-play="4"] .fw-play:hover {
  background: color-mix(in srgb, var(--fw-play) 20%, transparent);
}

/* 5 — the outline alone: nothing behind it, so the poster does the work. */
html[data-design][data-play="5"] .fw-play {
  border-color: #ffffff59;
  padding: calc(10px * var(--frame-scale, 1)) calc(24px * var(--frame-scale, 1));
  color: var(--text);
}

html[data-design][data-play="5"] .fw-play-label {
  display: inline;
}

html[data-design][data-play="5"] .fw-play:hover {
  border-color: var(--fw-play);
  background: color-mix(in srgb, var(--fw-play) 16%, transparent);
}

/* 6 — the site's own gradient, when it has one, and the accent when it does
   not: `--accent-grad` is `none` unless a second colour was chosen. */
html[data-design][data-play="6"] .fw-play {
  padding: calc(10px * var(--frame-scale, 1)) calc(24px * var(--frame-scale, 1));
  color: #080a10;
  background: var(--accent-grad, linear-gradient(120deg, var(--fw-play), var(--accent-2, var(--fw-play))));
  box-shadow: 0 16px 40px color-mix(in srgb, var(--fw-play) 38%, transparent);
}

html[data-design][data-play="6"] .fw-play-label {
  display: inline;
}

/* 7 — a white pill: the loudest of the nine and the one that reads at a
   glance from across a room. */
html[data-design][data-play="7"] .fw-play {
  color: #0a0d14;
  padding: calc(10px * var(--frame-scale, 1)) calc(26px * var(--frame-scale, 1));
  background: #f0f2f7;
  box-shadow: 0 18px 50px #000000a6;
}

html[data-design][data-play="7"] .fw-play-label {
  display: inline;
}

html[data-design][data-play="7"] .fw-play:hover {
  background: #fff;
}

/* 8 — the disc again, breathing a halo in the design's colour. */
@keyframes fw-halo {
  0% { box-shadow: 0 18px 50px #000000a6, 0 0 0 0 color-mix(in srgb, var(--fw-play) 55%, transparent); }
  70% { box-shadow: 0 18px 50px #000000a6, 0 0 0 calc(26px * var(--frame-scale, 1)) transparent; }
  100% { box-shadow: 0 18px 50px #000000a6, 0 0 0 0 transparent; }
}

html[data-design][data-play="8"] .fw-play {
  border-color: var(--fw-play);
  border-radius: 50%;
  width: calc(96px * var(--frame-scale, 1));
  height: calc(96px * var(--frame-scale, 1));
  background: color-mix(in srgb, var(--fw-play) 16%, transparent);
  animation: 2.4s ease-out infinite fw-halo;
}

html[data-design][data-play="8"] .fw-play:hover {
  animation-play-state: paused;
  background: color-mix(in srgb, var(--fw-play) 26%, transparent);
}

/* 9 — the triangle on its own: no disc, no ring, no words. */
html[data-design][data-play="9"] .fw-play {
  color: var(--fw-play);
  border: none;
  background: none;
  box-shadow: none;
  margin-top: 0;
}

html[data-design][data-play="9"] .fw-play-ico {
  width: calc(56px * var(--frame-scale, 1));
  height: calc(56px * var(--frame-scale, 1));
}

html[data-design][data-play="9"] .fw-play:hover {
  transform: translateY(-2px) scale(1.06);
}

/* --- 4. how much of the welcome is drawn ---------------------------

   Three styles, and the three are the reference builder's: the button alone,
   the button with the title, and the button with the title over the title's own
   poster. Every one of them only ever takes something away, which is why the
   order of these rules does not matter and why the switches below them can be
   read in any order. */
html[data-design][data-welcome="1"] .fw-art,
html[data-design][data-welcome="1"] .fw-mark,
html[data-design][data-welcome="1"] .fw-title,
html[data-design][data-welcome="1"] .fw-info {
  display: none;
}

html[data-design][data-welcome="2"] .fw-art {
  display: none;
}

/* The four switches inside those styles: the poster, the artwork-as-title, the
   title-as-words, and the line of information. `logo` is the default and means
   the title's own artwork, which only exists for a title that has some — a frame
   whose catalogue carries no artwork is left with nothing above the button,
   which is what `hidden` on the mark is for in watch.js. */
html[data-design][data-posters="0"] .fw-art {
  display: none;
}

html[data-design][data-title="logo"] .fw-title {
  display: none;
}

html[data-design][data-title="text"] .fw-mark {
  display: none;
}

html[data-design][data-info="0"] .fw-info {
  display: none;
}

/* The title's artwork behind the *picture* — the other place it is drawn, and
   the one a design can ask to be without. */
html[data-design][data-art="0"] .player-art {
  display: none;
}

/* --- 5. the twelve loading marks -----------------------------------

   One component, twelve looks. The markup carries seven parts — three rings,
   four orbiting dots and a star core — and every mark below is those parts
   arranged, because a design that asks for the fourth loader must not be a
   design that makes the player download a second component to draw it. The
   colour is the design's own when it named one and the accent when it did not;
   it reaches the star as well as the box, because the reference sheet declares
   the token on the star itself and a declaration on an element outranks the
   one it would have inherited. */
html[data-design] .player-spinner,
html[data-design] .player-spinner .nv-star {
  --nv-loader: var(--loader-color, var(--accent));
}

/* 1 — the reference's own orbit. Nothing to write. */

/* 2 — two rings, no dots, no core. */
html[data-design][data-loader="2"] .player-spinner .nv-ring:nth-child(3),
html[data-design][data-loader="2"] .player-spinner .nv-dots,
html[data-design][data-loader="2"] .player-spinner .nv-core {
  display: none;
}

/* 3 — one ring, turning. */
html[data-design][data-loader="3"] .player-spinner .nv-ring:nth-child(2),
html[data-design][data-loader="3"] .player-spinner .nv-ring:nth-child(3),
html[data-design][data-loader="3"] .player-spinner .nv-dots,
html[data-design][data-loader="3"] .player-spinner .nv-core {
  display: none;
}

/* 4 — the four dots on their own, orbiting the empty middle. */
html[data-design][data-loader="4"] .player-spinner .nv-ring,
html[data-design][data-loader="4"] .player-spinner .nv-core {
  display: none;
}

html[data-design][data-loader="4"] .player-spinner .nv-dots b {
  width: 9px;
  height: 9px;
  margin: -4.5px;
}

/* 5 — the star alone, breathing. */
html[data-design][data-loader="5"] .player-spinner .nv-ring,
html[data-design][data-loader="5"] .player-spinner .nv-dots {
  display: none;
}

html[data-design][data-loader="5"] .player-spinner .nv-core {
  width: 46%;
  height: 46%;
  animation: 3s linear infinite nv-orbit-spin, 1.8s ease-in-out infinite alternate nv-core-glow;
}

/* 6 — the star alone, hopping. */
@keyframes nv-loader-hop {
  0% { opacity: .5; transform: translateY(7px) scale(.94); }
  100% { opacity: 1; transform: translateY(-9px) scale(1.05); }
}

html[data-design][data-loader="6"] .player-spinner .nv-ring,
html[data-design][data-loader="6"] .player-spinner .nv-dots {
  display: none;
}

html[data-design][data-loader="6"] .player-spinner .nv-core {
  width: 34%;
  height: 34%;
  animation: .85s ease-in-out infinite alternate nv-loader-hop;
}

/* 7 — a comet: one open arc with a bright head, turning quickly. */
html[data-design][data-loader="7"] .player-spinner .nv-ring:nth-child(2),
html[data-design][data-loader="7"] .player-spinner .nv-ring:nth-child(3),
html[data-design][data-loader="7"] .player-spinner .nv-dots,
html[data-design][data-loader="7"] .player-spinner .nv-core {
  display: none;
}

html[data-design][data-loader="7"] .player-spinner .nv-ring:first-child {
  border-width: 4px;
  border-top-color: var(--nv-loader);
  border-right-color: color-mix(in srgb, var(--nv-loader) 30%, transparent);
  animation-duration: 1.5s;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--nv-loader) 50%, transparent));
}

/* 8 — the same three rings as squares, which is mostly a different player. */
html[data-design][data-loader="8"] .player-spinner .nv-ring {
  border-radius: 16%;
}

html[data-design][data-loader="8"] .player-spinner .nv-dots,
html[data-design][data-loader="8"] .player-spinner .nv-core {
  display: none;
}

/* 9 — three bars, rising out of step. */
@keyframes nv-bar-rise {
  0% { opacity: .5; transform: scaleY(.4); }
  100% { opacity: 1; transform: scaleY(1); }
}

html[data-design][data-loader="9"] .player-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

html[data-design][data-loader="9"] .player-spinner .nv-ring {
  position: static;
  width: 7px;
  height: 100%;
  border: none;
  border-radius: 4px;
  background: var(--nv-loader);
  animation: .9s ease-in-out infinite alternate nv-bar-rise;
}

html[data-design][data-loader="9"] .player-spinner .nv-ring:first-child {
  height: 100%;
}

html[data-design][data-loader="9"] .player-spinner .nv-ring:nth-child(2) {
  height: 72%;
  animation-delay: .16s;
}

html[data-design][data-loader="9"] .player-spinner .nv-ring:nth-child(3) {
  height: 48%;
  animation-delay: .32s;
}

html[data-design][data-loader="9"] .player-spinner .nv-dots,
html[data-design][data-loader="9"] .player-spinner .nv-core {
  display: none;
}

/* 10 — three dots on a line, hopping in turn. */
html[data-design][data-loader="10"] .player-spinner .nv-ring,
html[data-design][data-loader="10"] .player-spinner .nv-core {
  display: none;
}

html[data-design][data-loader="10"] .player-spinner .nv-dots {
  animation: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  position: static;
  inset: auto;
}

html[data-design][data-loader="10"] .player-spinner .nv-dots b {
  position: static;
  width: 11px;
  height: 11px;
  margin: 0;
  box-shadow: none;
  animation: .8s ease-in-out infinite alternate nv-loader-hop;
}

html[data-design][data-loader="10"] .player-spinner .nv-dots b:nth-child(2) {
  animation-delay: .18s;
}

html[data-design][data-loader="10"] .player-spinner .nv-dots b:nth-child(3) {
  animation-delay: .36s;
}

html[data-design][data-loader="10"] .player-spinner .nv-dots b:nth-child(4) {
  display: none;
}

/* 11 — the inner ring and the dots: the reference's orbit with the outer ring
   taken off, which is the same mark reading as a smaller, calmer one. */
html[data-design][data-loader="11"] .player-spinner .nv-ring:first-child {
  display: none;
}

html[data-design][data-loader="11"] .player-spinner .nv-core {
  width: 26%;
  height: 26%;
}

/* 12 — three stars, hopping in turn, which is the reference's `.nv-bounce`
   drawn from the parts this component ships. */
html[data-design][data-loader="12"] .player-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

html[data-design][data-loader="12"] .player-spinner .nv-ring {
  position: static;
  border: none;
  border-radius: 0;
  background: var(--nv-loader);
  width: 24%;
  height: auto;
  aspect-ratio: 1;
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--nv-loader) 60%, transparent));
  animation: .85s ease-in-out infinite alternate nv-loader-hop;
}

html[data-design][data-loader="12"] .player-spinner .nv-ring:nth-child(2) {
  animation-delay: .18s;
}

html[data-design][data-loader="12"] .player-spinner .nv-ring:nth-child(3) {
  animation-delay: .36s;
}

html[data-design][data-loader="12"] .player-spinner .nv-dots,
html[data-design][data-loader="12"] .player-spinner .nv-core {
  display: none;
}

/* One mark out of the twelve turns continuously and two of them breathe, so the
   same courtesy the reference sheet pays a reader who asked for less motion is
   paid here: the marks stay, they stop. */
@media (prefers-reduced-motion: reduce) {
  html[data-design] .fw-play,
  html[data-design] .player-spinner .nv-core,
  html[data-design] .player-spinner .nv-dots b,
  html[data-design] .player-spinner .nv-ring {
    animation-duration: 3.2s !important;
  }
}

/* --- 6. the frame's own type ---------------------------------------

   1 is the frame the reference draws, and there is nothing to write for it.

   2 is the chrome taken off the picture: no bars, no gradients, no pill around
   a chip — the controls are drawn where they lie and the film is left alone.

   3 is the picture set inside the frame, the way a cinema screen sits in a
   room: the room's floor shows, the screen has corners, and the transport still
   belongs to the picture rather than to the wall. */
html[data-design][data-frame="2"] .player-topbar,
html[data-design][data-frame="2"] .player-bottom {
  background: none;
}

html[data-design][data-frame="2"] .player-topbar {
  height: calc(64px * var(--chrome-scale, 1));
  padding: calc((12px * var(--chrome-scale, 1)) + env(safe-area-inset-top, 0px))
           calc(20px * var(--chrome-scale, 1))
           calc(12px * var(--chrome-scale, 1));
}

html[data-design][data-frame="2"] .player-bottom {
  padding: calc(18px * var(--chrome-scale, 1)) calc(20px * var(--chrome-scale, 1))
           calc((20px * var(--chrome-scale, 1)) + env(safe-area-inset-bottom, 0px));
}

html[data-design][data-frame="2"] .chip-btn {
  background: none;
  border-color: transparent;
}

html[data-design][data-frame="2"] .chip-btn:hover {
  color: var(--accent);
  background: none;
  border-color: transparent;
}

html[data-design][data-frame="2"] .ctrl-btn-play {
  border-color: transparent;
  background: #ffffff14;
}

html[data-design][data-frame="3"] .player {
  padding: clamp(0px, 1.8vw, 24px);
  background: var(--canvas);
}

html[data-design][data-frame="3"] .player-video {
  border-radius: 16px;
  box-shadow: 0 0 0 1px #ffffff1a;
}

html[data-design][data-frame="3"] .player-bottom {
  background: linear-gradient(#0000, color-mix(in srgb, var(--canvas) 88%, transparent));
}

/* --- 7. the menus --------------------------------------------------

   Four panels. 1 is the reference's own frosted box and has nothing to write.
   2 is a solid card, 3 is the frosted one taken further, and 4 is a flat sheet
   with the accent down its side — the one that reads as a list rather than as a
   panel, which is what a site owner picks when the menu is long.

   Where a menu is anchored is a separate question and only one of the three
   answers is the reference's: a menu opens from a chip in the bottom row, so
   "above the chip" is the only place it can go and the question is which edge
   of it is squared up with the chip. */
html[data-design][data-menu="2"] .source-menu {
  background: var(--surface);
  border-color: var(--border);
  border-radius: 14px;
  box-shadow: 0 22px 60px #000000b8;
}

html[data-design][data-menu="2"] .source-menu-title {
  border-bottom-color: var(--border-soft);
}

html[data-design][data-menu="3"] .source-menu {
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  border-color: #ffffff26;
  border-radius: 20px;
}

html[data-design][data-menu="4"] .source-menu {
  background: var(--canvas);
  border-color: #ffffff1a;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

html[data-design][data-menu="4"] .source-opt.active {
  border-left-color: transparent;
}

/* The three positions, and only where a menu is anchored to a chip at all: on a
   phone the transport is the bottom sheet and every menu is centred over it, so
   the question of which edge of the panel lines up does not arise. 720px is
   where watch.js builds the other transport. */
@media (min-width: 720px) {
  html[data-design][data-menu-pos="2"] .source-control > .source-menu {
    right: auto;
    left: 0;
  }

  html[data-design][data-menu-pos="3"] .source-control > .source-menu {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* The chip row, when the design asks for it not to be drawn. The row is where a
   viewer changes the language, the captions and the source, so a design that
   removes it is a design for a frame somebody else drives — and it is taken off
   rather than hidden, because an empty pill row is worse than no row. */
html[data-design][data-menu-show="0"] .source-control:has(> .chip-btn),
html[data-design][data-menu-show="0"] .pm-chips {
  display: none;
}

/* --- 8. the source list --------------------------------------------

   `simple` is one line per source: no provider, no flag, no quality column and
   no hairline between the groups, which is what a host with one provider per
   title wants and what a long list needs. The Source menu is the only one this
   reaches — the others have no sources in them. */
html[data-design][data-sources="simple"] #menuSource .provider-heading,
html[data-design][data-sources="simple"] #menuSource .source-opt-q,
html[data-design][data-sources="simple"] #menuSource .flag-icon,
html[data-design][data-sources="simple"] #menuSource .flag-fallback,
html[data-design][data-sources="simple"] #menuSource .source-group-divided > .provider-heading {
  display: none;
}

html[data-design][data-sources="simple"] #menuSource .source-opt {
  padding-top: 8px;
  padding-bottom: 8px;
}

html[data-design][data-sources="simple"] #menuSource .source-group-divided {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* The providers as a bar: the same headings, drawn as the pills a viewer reads
   as tabs, and without the hairlines that are there to separate lists. */
html[data-design][data-servers="bar"] #menuSource .provider-heading {
  color: var(--text-dim);
  letter-spacing: .06em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  margin: 10px 16px 2px;
  padding: 5px 12px;
  display: inline-flex;
}

html[data-design][data-servers="bar"] #menuSource .source-group-divided {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* --- 9. a locked player --------------------------------------------

   The one screen this section draws for a viewer who has no design to look at:
   an account can lock its player to one of its own proved domains, and the host
   refuses a frame claiming another one — see playerDesign() in server.js. The
   alternative on the other builder is a black rectangle, so the refusal is
   drawn as a sentence rather than left as an absence. */
.frame-locked {
  z-index: 1006;
  text-align: center;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  grid-template-columns: minmax(0, 460px);
  justify-content: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  font-size: .9rem;
  line-height: 1.6;
  display: grid;
  position: absolute;
  inset: 0;
}

.frame-locked strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.frame-locked span {
  color: var(--text-dim);
}
