/* The player (docs/designs/lyra-web-screens.md, 3.12). */
body.playing { overflow: hidden; }
.player { position: fixed; inset: 0; z-index: 1500; background: #000; color: #fff; overflow: hidden; outline: none; user-select: none; -webkit-user-select: none; cursor: none; transition: opacity .25s ease-out; }
.player.controls, .player.launching, .player.scrubbing { cursor: default; }
.player.closing { opacity: 0; }
.p-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.p-video.fill { object-fit: cover; }
.spinner.big { width: 31px; height: 31px; border-width: 3px; }

/* opening: black, a spinner and the title */
.p-launch { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; pointer-events: none; }
.p-launch p { font-size: 15px; font-weight: 600; color: rgba(255,255,255,.7); max-width: 80%; text-align: center; }
.p-wait { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }

/* the controls, over a darkening at the top and the bottom */
.p-controls { position: absolute; inset: 0; opacity: 0; transition: opacity .2s ease-in-out; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.6), transparent 26%, transparent 66%, rgba(0,0,0,.75)); }
.player.controls .p-controls, .player.scrubbing .p-controls { opacity: 1; pointer-events: auto; }
.player.launching .p-controls { opacity: 1; pointer-events: auto; background: none; }
.player.launching .p-centre, .player.launching .p-bottom, .player.launching .p-top-right, .player.launching .p-heading { visibility: hidden; }
.p-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; transition: background .12s ease-out, transform .12s ease-out; }
.p-btn:hover { background: rgba(255,255,255,.12); }
.p-btn:active { transform: scale(.94); }
.p-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 14px; padding: 18px 24px; }
.p-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-heading strong { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-heading span { font-size: 15px; color: rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-heading span:empty { display: none; }
.p-top-right { display: flex; align-items: center; gap: 4px; }
.p-centre { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 56px; }
.p-centre .p-btn { width: 60px; height: 60px; }
.p-centre .p-play { width: 84px; height: 84px; }
.p-bottom { position: absolute; left: 32px; right: 32px; bottom: 16px; }

/* the scrubber */
.p-track { position: relative; height: 26px; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.p-track-line { position: relative; width: 100%; height: 6px; border-radius: 3px; background: rgba(255,255,255,.3); overflow: hidden; }
.p-track-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #fff; }
.p-knob { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); transition: width .1s, height .1s, margin .1s; }
.player.scrubbing .p-knob, .p-track:hover .p-knob { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.p-track:focus-visible .p-knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.p-times { display: flex; justify-content: space-between; margin-top: 2px; font-size: 12px; color: rgba(255,255,255,.85); }
.p-preview { position: absolute; bottom: 30px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.p-preview-pic { border-radius: 6px; border: 1.5px solid #fff; background-color: #000; background-repeat: no-repeat; box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.p-preview-time { font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.8); }

/* double-click skip badges */
.p-badge { position: absolute; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(0,0,0,.35); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .25s ease-out; pointer-events: none; }
.p-badge.left { left: 20%; } .p-badge.right { left: 80%; }
.p-badge.in { opacity: 1; transition: none; }

/* subtitles, drawn by the player */
.p-subs { position: absolute; left: 6%; right: 6%; bottom: 40px; display: flex; justify-content: center; text-align: center; pointer-events: none; transition: bottom .2s ease-in-out; }
.player.controls .p-subs { bottom: 110px; }
.p-subs span { white-space: pre-line; font-size: clamp(18px, 2.4vw, 34px); font-weight: 600; line-height: 1.25; text-shadow: 0 0 2px #000, 0 1px 3px #000, 0 0 6px rgba(0,0,0,.6); }

/* Skip Intro, Next Episode */
.p-skip { position: absolute; right: 48px; bottom: 36px; transition: bottom .2s ease-in-out; }
.player.controls .p-skip { bottom: 96px; }
.p-capsule { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; background: #fff; color: #000; font-size: 16px; font-weight: 600; transition: transform .12s ease-out, opacity .12s; }
.p-capsule:hover { transform: scale(1.03); }
.p-capsule:active { transform: scale(.97); opacity: .85; }
.p-capsule.dim { background: rgba(255,255,255,.18); color: #fff; }

/* Up Next */
.p-upnext { position: absolute; right: 48px; bottom: 36px; display: flex; gap: 14px; padding: 14px; border-radius: 16px; background: rgba(0,0,0,.72); max-width: min(560px, calc(100% - 64px)); transition: bottom .2s ease-in-out; }
.player.controls .p-upnext { bottom: 96px; }
.p-next-still { position: relative; width: 168px; height: 94px; flex: none; border-radius: 10px; overflow: hidden; background: var(--plum-gradient); }
.p-count { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.45); font-size: 20px; font-weight: 700; }
.p-next-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.p-next-label { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.7); }
.p-next-text strong { font-size: 17px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-next-btns { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.p-next-btns .p-capsule { height: 36px; padding: 0 14px; font-size: 14px; }

/* the connection notice */
.p-notice { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: rgba(0,0,0,.62); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12); font-size: 14px; font-weight: 500; white-space: nowrap; transition: top .2s ease-in-out; pointer-events: none; }
.player.controls .p-notice { top: 64px; }

/* errors */
.p-error { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: min(460px, calc(100% - 48px)); padding: 24px 26px; border-radius: 12px; background: rgba(0,0,0,.7); text-align: center; font-size: 16px; }

/* panels: Audio and Subtitles, Playback Settings */
.p-panel { position: absolute; inset: 0; z-index: 5; background: rgba(0,0,0,.94); padding: 36px 72px; overflow: auto; cursor: default; animation: p-fade .2s ease-out; }
@keyframes p-fade { from { opacity: 0; } }
.p-panel-close { position: absolute; top: 18px; right: 22px; }
.p-panel-top { position: absolute; top: 18px; right: 22px; display: flex; align-items: center; gap: 10px; }
.p-debug { height: 30px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 13px; font-weight: 600; }
.p-debug.on { background: #fff; color: #000; }
.p-cols { display: flex; gap: 48px; flex-wrap: wrap; margin-top: 8px; }
.p-col { min-width: 160px; display: flex; flex-direction: column; }
.p-col.wide { flex: 1 1 280px; max-width: 460px; }
.p-col.q { width: 132px; min-width: 132px; } .p-col.s { width: 116px; min-width: 100px; }
.p-col h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.p-rows { display: flex; flex-direction: column; }
.p-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; font-size: 17px; color: rgba(255,255,255,.62); text-align: left; }
.p-row:hover { color: #fff; }
.p-row.on { color: #fff; font-weight: 600; }
.p-row small { display: block; font-size: 12px; font-weight: 400; color: rgba(255,255,255,.5); margin-top: 2px; }
.p-check { width: 16px; flex: none; padding-top: 3px; }
.p-check .icon { stroke-width: 2.6; }
.p-none { font-size: 16px; color: rgba(255,255,255,.5); }
.p-table { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; align-items: baseline; }
.p-k { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.5); }
.p-v { font-size: 14px; }

@media (max-width: 599px) {
  .p-top { padding: 12px 10px; gap: 6px; }
  .p-centre { gap: 30px; }
  .p-bottom { left: 16px; right: 16px; }
  .p-panel { padding: 70px 22px 30px; }
  .p-cols { gap: 28px; }
  .p-skip, .p-upnext { right: 16px; }
  .p-upnext { flex-direction: column; }
}
