/* player.css — the one picture (player/manager.js) wherever it shows, and the full-screen player
 * (screens/player.js): PlayerOverlays.kt / PlayerPanels.kt in CSS pixels, always on dark. */

/* the picture and its aspect modes (AspectMode) */
.pm-holder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #000; }
.pm-video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.pm-holder[data-aspect="fill"] .pm-video { object-fit: cover; }
.pm-holder[data-aspect="zoom"] .pm-video { object-fit: cover; transform: scale(1.15); }
.pm-holder[data-aspect="stretch"] .pm-video { object-fit: fill; }
.pm-holder[data-aspect="16:9"] .pm-video { width: auto; height: 100%; max-width: 100%; aspect-ratio: 16 / 9; object-fit: fill; }
.pm-holder[data-aspect="4:3"] .pm-video { width: auto; height: 100%; max-width: 100%; aspect-ratio: 4 / 3; object-fit: fill; }
.pm-holder[data-aspect="original"] .pm-video { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: none; }
.pm-video::cue { background: transparent; color: transparent; text-shadow: none; }

/* the full-screen player */
.scr-player { background: #000; }
.player { position: absolute; inset: 0; background: #000; color: #fff; overflow: hidden; }
.pl-stage { position: absolute; inset: 0; }
.pl-touch { position: absolute; inset: 0; z-index: 1; touch-action: none; }
.pl-status { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.pl-spin { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff; text-align: center; }
.pl-spin .spokes { color: #fff; }
.pl-pill { position: absolute; top: calc(var(--safe-top) + 24px); left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 99px; background: rgba(28,28,32,0.9); font: 400 13px/18px var(--font); white-space: nowrap; pointer-events: none; }
.pl-tap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 8; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 28px; border-radius: 22px; background: rgba(28,28,32,0.92); color: #fff; font: 600 15px var(--font); }
.pl-tap .mi { color: var(--accent); }

/* subtitles, drawn by the player (Settings › Subtitles: size, colour, background) */
.pl-subs { position: absolute; left: 8%; right: 8%; bottom: 7%; z-index: 2; text-align: center; pointer-events: none; transition: bottom 180ms; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.player:has(.pl-osd.show) .pl-subs { bottom: 30%; }
.pl-subs .cue span { display: inline; font: 600 var(--sub-size, 22px)/1.35 var(--font); color: #fff; white-space: pre-line; padding: 2px 8px; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.pl-subs[data-bg="shadow"] .cue span { text-shadow: 0 0 4px #000, 0 1px 3px #000, 0 0 2px #000; }
.pl-subs[data-bg="box"] .cue span { background: rgba(0,0,0,0.66); }
.pl-subs[data-bg="outline"] .cue span { -webkit-text-stroke: 1px #000; paint-order: stroke fill; }
.pl-subs[data-color="yellow"] .cue span { color: #FFD60A; }
.pl-subs[data-color="cyan"] .cue span { color: #64D2FF; }
.pl-subs[data-color="green"] .cue span { color: #30D158; }

/* the OSD: glass buttons, scrims top and bottom */
.pl-osd { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 200ms; }
.pl-osd.show { opacity: 1; }
.pl-osd.show > * { pointer-events: auto; }
.osd-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 14px; padding: calc(var(--safe-top) + 18px) calc(var(--safe-right) + 28px) 40px calc(var(--safe-left) + 24px); }
.osd-top.vod { align-items: flex-start; background: linear-gradient(180deg, rgba(0,0,0,0.75), transparent); padding-bottom: 48px; }
.osd-back { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.osd-back.hot { background: var(--accent); color: var(--on-accent); }
.osd-titles { padding-top: 2px; }
.osd-title { font: 600 22px/28px var(--font); letter-spacing: -0.3px; }
.osd-sub { font: 400 14px/19px var(--font); color: rgba(255,255,255,0.72); }
.osd-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.72); font: 600 11px/14px var(--font); letter-spacing: 0.4px; white-space: nowrap; flex: none; }
.osd-clock { font: 600 18px/24px var(--font); color: #fff; flex: none; }
.osd-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px calc(var(--safe-right) + 36px) calc(var(--safe-bottom) + 24px) calc(var(--safe-left) + 36px);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.55) 35%, rgba(0,0,0,0.88)); }
.osd-bottom.vod { padding-top: 80px; }
.osd-live-row { display: flex; align-items: center; gap: 18px; }
.osd-logo { background: rgba(255,255,255,0.1) !important; }
.osd-live-info { flex: 1; min-width: 0; }
.osd-chline { display: flex; align-items: center; gap: 10px; min-width: 0; }
.osd-num { font: 600 18px/24px var(--font); color: rgba(255,255,255,0.72); flex: none; }
.osd-chname { font: 600 18px/24px var(--font); min-width: 0; }
.osd-chline .badge { flex: none; }
.badge.glass { background: rgba(255,255,255,0.18); color: #fff; }
.osd-fav { color: #FF375F; display: inline-flex; flex: none; }
.osd-prog { margin-top: 6px; font: 600 22px/28px var(--font); letter-spacing: -0.3px; }
.osd-timeline { display: flex; align-items: center; gap: 12px; margin-top: 6px; font: 400 13px/18px var(--font); color: rgba(255,255,255,0.72); white-space: nowrap; }
.osd-pline { width: 220px; max-width: 30%; flex: none; }
.osd-noinfo { margin-top: 6px; font: 600 18px/24px var(--font); color: rgba(255,255,255,0.72); }
.osd-next { margin-top: 6px; font: 400 13px/18px var(--font); color: rgba(255,255,255,0.5); white-space: pre; }
.osd-buttons { display: flex; gap: 10px; margin-top: 18px; padding-bottom: 2px; }
.osd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 44px; height: 44px; border-radius: 22px; background: rgba(255,255,255,0.14); color: #fff; flex: none;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: transform 140ms var(--ease), background-color 140ms; font: 600 13px var(--font); white-space: nowrap; }
.osd-btn.pill { width: auto; padding: 0 16px; }
.osd-btn.big { width: 58px; height: 58px; border-radius: 29px; }
.osd-btn.active { background: rgba(var(--accent-rgb),0.35); }
.osd-btn.hot { transform: scale(1.06); background: var(--accent); color: var(--on-accent); }
.osd-vod-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.osd-group { display: flex; align-items: center; gap: 10px; }

/* the seek bar: 30 tall to hit, a 4 line (7 while dragged) */
.seekbar { width: 100%; }
.sb-hit { position: relative; height: 30px; display: flex; align-items: center; touch-action: none; cursor: pointer; }
.sb-track, .sb-buf, .sb-fill { position: absolute; left: 0; height: 4px; border-radius: 99px; top: 50%; transform: translateY(-50%); transition: height 120ms; }
.sb-track { right: 0; background: rgba(255,255,255,0.22); }
.sb-buf { background: rgba(255,255,255,0.32); width: 0; }
.sb-fill { background: #fff; width: 0; }
.sb-knob { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; opacity: 0; transition: opacity 120ms; }
.sb-hit.dragging .sb-track, .sb-hit.dragging .sb-buf, .sb-hit.dragging .sb-fill { height: 7px; }
.sb-hit.dragging .sb-fill { background: var(--accent); }
.sb-hit.dragging .sb-knob { opacity: 1; }
.sb-times { display: flex; font: 600 12px/16px var(--font); font-variant-numeric: tabular-nums; }
.sb-left { font-weight: 400; color: rgba(255,255,255,0.72); }

/* side panels (SidePanel): 400 wide glass, inset 14 */
.pl-panel { position: absolute; top: 0; bottom: 0; z-index: 7; width: min(400px, 60%); padding: calc(var(--safe-top) + 14px) 14px calc(var(--safe-bottom) + 14px); display: flex; animation: pp-in-r 260ms var(--ease); }
.pl-panel.left { left: 0; padding-left: calc(var(--safe-left) + 14px); animation-name: pp-in-l; }
.pl-panel.right { right: 0; padding-right: calc(var(--safe-right) + 14px); }
@keyframes pp-in-r { from { transform: translateX(40px); opacity: 0; } } @keyframes pp-in-l { from { transform: translateX(-40px); opacity: 0; } }
.pp-box { flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: 20px; background: rgba(22,22,25,0.94); border: 0.6px solid rgba(255,255,255,0.10); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); overflow: hidden; }
.pp-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 12px 12px 16px; }
.pp-sub { color: rgba(255,255,255,0.72); }
.pp-body { flex: 1; min-height: 0; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.pp-loading { display: flex; justify-content: center; padding: 30px; }
.pp-empty, .pp-none { color: rgba(255,255,255,0.72); padding: 12px; }
.pp-header { font: 600 11px/14px var(--font); letter-spacing: 0.4px; color: rgba(255,255,255,0.72); padding: 12px 12px 4px; }
.pp-row { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 12px; border-radius: 11px; text-align: left; color: #fff; flex: none; transition: background-color 120ms; }
.pp-row.hl { background: rgba(var(--accent-rgb),0.28); }
.pp-row.dim { opacity: 0.55; }
.pp-row.hot { background: var(--accent); color: var(--on-accent); }
.pp-row.hot .pp-detail, .pp-row.hot .pp-trail { color: var(--on-accent); }
.pp-title { font: 500 14px/19px var(--font); }
.pp-detail { font: 400 12px/16px var(--font); color: rgba(255,255,255,0.72); }
.pp-trail { color: var(--accent); display: inline-flex; flex: none; }
.pp-row .chlogo { background: rgba(255,255,255,0.08); }
.pp-thumb { position: relative; width: 88px; height: 50px; border-radius: 8px; overflow: hidden; background: #000; flex: none; }
.pp-thumb > .rimg { position: absolute; inset: 0; }
.pp-chips { display: flex; gap: 8px; padding: 0 4px 10px; flex: none; }
.pp-eps { display: flex; flex-direction: column; gap: 4px; }

/* statistics, the number being typed, the error, Up Next */
.pl-stats { position: absolute; left: calc(var(--safe-left) + 24px); top: calc(var(--safe-top) + 80px); z-index: 5; padding: 14px; border-radius: 14px; background: rgba(16,16,18,0.85); pointer-events: none; font: 400 12px/16px ui-monospace, Menlo, monospace; }
.pl-stats-title { font: 600 11px/14px var(--font); color: rgba(255,255,255,0.5); margin-bottom: 6px; letter-spacing: 0.4px; }
.pl-stats-row { display: flex; padding: 1px 0; } .pl-stats-row span:first-child { width: 118px; color: rgba(255,255,255,0.5); flex: none; }
.pl-number { position: absolute; right: calc(var(--safe-right) + 28px); top: calc(var(--safe-top) + 28px); z-index: 6; padding: 12px 26px; border-radius: 18px; background: rgba(28,28,32,0.9); font: 700 34px/40px var(--font); }
.pl-error { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,0.35); }
.pl-errcard { width: 100%; max-width: 520px; padding: 26px; border-radius: 22px; background: rgba(28,28,32,0.92); border: 0.6px solid rgba(255,255,255,0.10); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.pl-erricon { width: 46px; height: 46px; border-radius: 12px; background: rgba(255,159,10,0.2); color: #FF9F0A; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.pl-errcard p { margin: 6px 0 20px; color: rgba(255,255,255,0.72); }
.pl-errbtns { display: flex; gap: 10px; flex-wrap: wrap; }
.pl-upnext { position: absolute; right: calc(var(--safe-right) + 36px); bottom: calc(var(--safe-bottom) + 36px); z-index: 7; }
.pl-upcard { width: min(420px, calc(var(--lw) * 0.8)); display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: rgba(28,28,32,0.92); border: 0.6px solid rgba(255,255,255,0.10); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.pl-upthumb { position: relative; width: 150px; height: 84px; border-radius: 10px; overflow: hidden; flex: none; }
.pl-upthumb > .rimg { position: absolute; inset: 0; }
.pl-uplabel { font: 600 11px/14px var(--font); letter-spacing: 0.4px; color: var(--accent); }
.pl-upsub { color: rgba(255,255,255,0.72); }
.pl-upbtns { display: flex; gap: 8px; margin-top: 8px; }

/* small phones on their side: a little tighter */
:root.lh-short {
  .osd-bottom { padding-top: 48px; padding-bottom: calc(var(--safe-bottom) + 14px); }
  .osd-buttons { margin-top: 12px; }
  .osd-prog { font-size: 19px; line-height: 24px; }
  .osd-live-row .chlogo { width: 56px !important; height: 56px !important; }
}
