/* The video player in Kixi's look (John, 7 November 2026), over Plyr's own plyr.css. See public/js/player.js */
/* No overflow: hidden here: the speed menu rises above the player on a phone, and clipping it hid the speeds (tested 7 November 2026).
   Never taller than the screen, less the site's header, so it fits sideways on a phone. */
.kx-player { max-width: min(960px, calc((100vh - 96px) * 16 / 9)); max-width: min(960px, calc((100svh - 96px) * 16 / 9)); border-radius: 16px; box-shadow: 0 0 0 1px rgba(36,20,70,.06), 0 30px 60px -28px rgba(36,20,70,.45); }
.kx-player video { display: block; width: 100%; aspect-ratio: 16/9; }
.kx-player > video { border-radius: inherit; }   /* before Plyr starts, or with no script */
.kx-player .plyr { border-radius: inherit; }
.kx-player .plyr__video-wrapper { border-radius: inherit; overflow: hidden; }
/* Clean corners (John, 8 November 2026): nothing dark under the picture. A dark ground clipped to the same rounding as the poster or video
   shows through at the curve's soft edge, as thin black slivers at the four corners (seen on the MCP video, 8 November 2026). The picture
   is 16:9 in a 16:9 box, so there is nothing to fill; full screen keeps Plyr's black, for the bars round a picture of another shape. */
.kx-player .plyr:not(.plyr--fullscreen-active):not(.plyr--fullscreen-fallback) { --plyr-video-background: transparent; }
.plyr { --plyr-color-main: var(--primary, #8a2be2); --plyr-font-family: var(--font-sans, Inter, ui-sans-serif, system-ui, sans-serif); --plyr-control-icon-size: 18px; --plyr-menu-radius: 12px; --plyr-control-radius: 8px; --plyr-captions-background: rgba(26,16,48,.86); --plyr-font-size-base: 15px; --plyr-font-size-large: 18px; --plyr-menu-background: #fff; }
.plyr__control--overlaid { padding: 26px; box-shadow: 0 0 0 7px rgba(255,255,255,.8), 0 14px 34px rgba(36,20,70,.35); }
.plyr__control--overlaid svg { width: 26px; height: 26px; left: 0; }
.plyr:not(.plyr--fullscreen-active):not(.plyr--fullscreen-fallback) .plyr__poster { background-size: cover; }   /* (no dark sliver at its edge; whole in full screen) */
/* Before the first play, the thumbnail and the big play button alone: the bar would sit on the thumbnail's own words */
.plyr--stopped.plyr__poster-enabled .plyr__controls:not(:focus-within) { opacity: 0; pointer-events: none; }
/* The gear goes straight to the speeds (player.js), so no way back to a menu of one. It scrolls if there's no room above it: --kx-menu-max is set when it opens */
.plyr__menu__container { max-height: var(--kx-menu-max, none); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; z-index: 5; }
.plyr__menu__container .plyr__control--back { display: none; }
.plyr__menu__container .plyr__control--back + div { padding-top: 4px; }
/* Anything with a thumb: bigger buttons, a bigger strip to catch the progress bar, and no volume slider, as phones have volume buttons */
@media (pointer: coarse) {
  .plyr__volume { display: none; }
  .plyr__controls { padding-left: 6px !important; padding-right: 6px !important; }
  .plyr__controls .plyr__control { padding: 11px; }
  .plyr__controls .plyr__controls__item { margin-left: 0; }
  .plyr__progress__container { flex: 1; min-width: 0; padding-left: 8px !important; margin-left: 0 !important; }
  .plyr__progress input[type=range] { height: 40px; margin-top: -20px; margin-bottom: -20px; position: relative; }
  .plyr__progress { display: flex; align-items: center; min-height: 40px; }
  .plyr__menu__container [role=menuitemradio] { min-height: 42px; }
}
@media (max-width: 640px) {
  .plyr__volume, .plyr__time--duration { display: none; }   /* the progress bar needs the room */
  .plyr__progress__container { flex: 1; min-width: 0; }
  .plyr__control--overlaid { padding: 16px; box-shadow: 0 0 0 5px rgba(255,255,255,.8), 0 10px 24px rgba(36,20,70,.35); }
  .plyr__control--overlaid svg { width: 20px; height: 20px; }
  .kx-player { border-radius: 12px; }
}
@media (max-width: 379px) { .plyr__time--current { display: none; } }   /* the smallest phones: the bar over the time */

/* R1: the Watch button opens a pop-out over the dimmed page (public/js/watch.js): a blog post's Watch, and How it works' hero (moved from blog.css, 9 November 2026). The dialog fills the screen, so a press on it, and not the player, is a press outside */
.kp-close { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 0; padding: 6px 12px 6px 10px; border-radius: 999px; font: 600 14px/21px var(--font-sans); cursor: pointer; }
.kp-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.kp-title { margin: 0; min-width: 0; font: 600 17px/28px var(--font-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-host .kx-player { max-width: none; }
.kp-pop { position: fixed; inset: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; overflow: visible; }
.kp-pop[open] { display: grid; place-items: center; animation: kpFade .18s ease-out; }
.kp-pop::backdrop { background: rgba(20, 17, 28, .86); animation: kpFade .18s ease-out; }
@keyframes kpFade { from { opacity: 0; } to { opacity: 1; } }
.kp-in { width: min(1120px, calc(100vw - 64px), calc((100vh - 120px) * 16 / 9)); width: min(1120px, calc(100vw - 64px), calc((100dvh - 120px) * 16 / 9)); }
.kp-pop .kp-close { color: #fff; background: rgba(255, 255, 255, .14); }
.kp-pop .kp-close .ph { color: #fff; }
.kp-pop .kp-close:hover { background: rgba(255, 255, 255, .24); }
.kp-pop .kp-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.kp-pop .kx-player { box-shadow: none; }
@media (max-width: 640px) {
  .kp-in { width: 100vw; }
  .kp-pop .kp-top { padding: 0 16px; }
  .kp-pop .kx-player { border-radius: 0; }
}
@media (max-height: 480px) {
  .kp-in { width: min(100vw, calc(100vh * 16 / 9)); width: min(100vw, calc(100dvh * 16 / 9)); }
  .kp-pop .kp-top { position: fixed; top: 8px; right: 8px; margin: 0; padding: 0; z-index: 3; }
  .kp-pop .kp-title { display: none; }
  .kp-pop .kx-player { border-radius: 0; }
  .kp-pop .kp-close { background: rgba(20, 17, 28, .72); }
}
@media (prefers-reduced-motion: reduce) { .kp-pop[open], .kp-pop::backdrop { animation: none; } }
