/* foyer — lecteur (maquettes 10, 11, 13, 22, 23). Base TV 960 × 540 ; marges = --safe-x / --safe-y. */
html[data-device] .screen.pl { display: block; padding: 0; overflow: hidden; background: var(--nuit); }
.pl-stage { position: absolute; inset: 0; background: var(--nuit); }
.pl-art { position: absolute; inset: 0; background: linear-gradient(135deg, #27324F, #141A2B); }
.pl-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; opacity: 0; transition: opacity var(--t-fondu); }
.pl.is-ready .pl-video { opacity: 1; }
.pl-video::cue { font-size: var(--cue, 100%); background: rgba(15, 17, 21, .85); }
/* Sous-titres maison (subs-overlay.js) : centrés, au-dessus des commandes quand elles sont visibles. */
/* Tiroir de chaînes sous les commandes : rangée fixe, ▼ pour y descendre, la chaîne en cours cerclée de braise. */
.pl-drawer { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); display: flex; gap: 8px; padding: 6px 4px; overflow-x: hidden; z-index: 3; } /* flotte au-dessus des commandes : rien ne se déplace à l'ouverture */
.pl-drawer[hidden] { display: none; }
.pl-drawer-ch { flex: none; width: 168px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 12px; border-radius: var(--r-galet-m); background: rgba(34, 38, 49, .92); color: var(--craie); text-align: left; min-width: 0; }
.pl-drawer-ch b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-drawer-ch small { font-size: 11px; color: var(--brume); max-width: 100%; }
.pl-drawer-ch.is-current { box-shadow: inset 0 0 0 2px var(--braise); }
html[data-device="phone"] .pl-drawer, html[data-device="pc"] .pl-drawer { overflow-x: auto; scrollbar-width: none; }
html[data-device="phone"] .pl-drawer-ch { min-height: 44px; }
.pl-subs { --sub-up: 250px; position: absolute; left: var(--safe-x); right: var(--safe-x); bottom: calc(var(--safe-y) + 12px); z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 22px; line-height: 1.25; text-align: center; pointer-events: none; transition: transform var(--t-fondu); }
.pl-subs span { font-size: var(--cue, 100%); padding: 1px 10px; border-radius: 6px; background: rgba(15, 17, 21, .85); color: var(--craie); max-width: 100%; text-wrap: balance; }
.pl:not(.is-idle) .pl-subs, .m3u-pl:not(.is-idle) .pl-subs { transform: translateY(calc(var(--sub-up) * -1)); }
html[data-device="phone"] .pl-subs { --sub-up: 210px; font-size: 15px; }
html[data-device="pc"] .pl-subs { --sub-up: 240px; font-size: 24px; }
.pl-shade { position: absolute; left: 0; right: 0; pointer-events: none; transition: opacity var(--t-fondu); }
.pl-shade--top { top: 0; height: 130px; background: linear-gradient(0deg, rgba(15, 17, 21, 0), rgba(15, 17, 21, .7)); }
.pl-shade--bottom { bottom: 0; height: 280px; background: linear-gradient(180deg, rgba(15, 17, 21, 0), rgba(15, 17, 21, .95) 60%); }
.pl.is-idle .pl-shade { opacity: 0; }
.pl-pausemark { position: absolute; left: 50%; top: 42%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: rgba(15, 17, 21, .75); display: flex; align-items: center; justify-content: center; }
.pl:not(.is-idle) .pl-pausemark { display: none; } /* commandes visibles : le gros bouton Lecture suffit, pas deux ronds empilés */
.pl-buffer { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); background: rgba(15, 17, 21, .8); color: var(--craie); }

/* Bannière de zapping */
.pl-banner { position: absolute; left: var(--safe-x); top: var(--safe-y); width: 440px; max-width: calc(100% - 2 * var(--safe-x)); background: rgba(24, 27, 34, .96); border-radius: 18px 6px 18px 6px; padding: 14px 16px; display: flex; gap: 14px; align-items: center; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); z-index: 3; animation: tombe var(--t-glisse) var(--courbe); }
.pl-ban-num { width: 56px; height: 56px; border-radius: 50%; background: var(--craie); color: var(--nuit); display: flex; align-items: center; justify-content: center; flex: none; font-size: 22px; font-weight: 700; }
.pl-ban-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.pl-ban-line { font-size: 12px; font-weight: 700; color: var(--brume); letter-spacing: .08em; text-transform: uppercase; }
.pl-ban-txt strong { font-size: 17px; font-weight: 600; }
.pl-ban-bar { height: 4px; background: var(--trait); border-radius: 2px; margin-top: 4px; }
.pl-ban-bar i { display: block; height: 4px; border-radius: 2px; background: var(--braise); }
.pl-ban-next { font-size: 12px; color: var(--brume); }
.pl-ban-zap { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--brume); flex: none; font-size: 11px; font-weight: 700; }
html[data-device="phone"] .pl-banner { top: calc(var(--safe-y) + 56px); width: auto; right: var(--safe-x); padding: 10px 14px; }
html[data-device="phone"] .pl-ban-num { width: 44px; height: 44px; font-size: 18px; }
html[data-device="pc"] .pl-banner { left: calc(var(--safe-x) + 56px); }
.pl-badge { position: absolute; right: var(--safe-x); top: var(--safe-y); height: 28px; padding: 0 10px; border-radius: var(--r-galet-s); background: rgba(15, 17, 21, .8); font-size: 12px; font-weight: 700; display: flex; align-items: center; z-index: 2; transition: opacity var(--t-fondu); }
.pl.is-idle .pl-badge { opacity: 0; }
.pl-exit { position: absolute; left: var(--safe-x); top: var(--safe-y); z-index: 4; transition: opacity var(--t-fondu); }
html[data-device="tv"] .pl-exit { display: none; }
.pl.is-idle .pl-exit { opacity: 0; pointer-events: none; }

/* Commandes */
.pl-ui { position: absolute; left: var(--safe-x); right: var(--safe-x); bottom: var(--safe-y); display: flex; flex-direction: column; gap: 12px; z-index: 2; transition: opacity var(--t-fondu), transform var(--t-fondu); }
.pl.is-idle .pl-ui { opacity: 0; pointer-events: none; transform: translateY(8px); }
.pl-info { display: flex; align-items: center; gap: 10px; }
.pl-chip--delay { background: var(--ardoise-2); color: var(--craie); }
.pl-meta { font-size: 13px; color: var(--brume); font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-title { margin: 0; font-size: 26px; font-weight: 600; min-height: 1.2em; }
.pl-frisebox { display: flex; flex-direction: column; gap: 6px; }
.pl-labels { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; font-weight: 700; color: var(--brume); }
.pl-labels span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-row { display: flex; align-items: center; gap: 10px; }
.pl-transport { display: flex; align-items: center; gap: 10px; flex: none; }
.pl-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.pl-spacer { flex: 1; }
.pl-row .btn:not(.btn--primary):not(.btn--icon) { background: rgba(34, 38, 49, .92); border-color: transparent; height: 40px; border-radius: var(--r-galet-m); }
.pl-row .btn--icon { background: rgba(34, 38, 49, .92); }
.pl-play { width: 44px; height: 44px; background: var(--craie) !important; color: var(--nuit); }
.pl-golive { margin-left: 6px; height: 40px; }
.pl-golive-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--braise); box-shadow: 0 0 0 2px var(--nuit); }
.pl-skipad { background: var(--ambre) !important; color: var(--nuit); }
.pl-rec { color: var(--braise); }
.pl-cast.is-casting { background: var(--lumen) !important; color: var(--nuit); }
html[data-input="key"] .pl .btn.is-focus { background: var(--lumen) !important; color: var(--nuit); }
.pl-speed { min-width: 52px; justify-content: center; }

/* Frise */
.frise { position: relative; height: 22px; touch-action: none; cursor: pointer; }
.frise > div, .fr-marks i { position: absolute; }
.fr-track { left: 0; right: 0; top: 9px; height: 5px; border-radius: 3px; background: repeating-linear-gradient(90deg, #2E3340 0 6px, #262A35 6px 12px); }
.fr-avail { left: 0; top: 9px; height: 5px; border-radius: 3px; background: #4A5060; }
.fr-seen { left: 0; top: 9px; height: 5px; border-radius: 3px; background: var(--craie); }
.fr-marks { inset: 0; pointer-events: none; }
.fr-marks i { top: 6px; height: 11px; border-radius: 2px; background: var(--ambre); }
.fr-marks .fr-tick { top: 4px; height: 15px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--craie); opacity: .6; }
.fr-thumb { top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--lumen); box-shadow: 0 0 0 5px rgba(216, 255, 62, .22); }
.fr-live { right: -4px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--braise); border: 3px solid var(--nuit); }
.frise .fr-live[hidden] { display: none; }

/* États (ouverture, chaîne hors ligne, erreur) */
.pl-state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1; background: rgba(15, 17, 21, .55); }
.pl-state .state { background: rgba(24, 27, 34, .94); border-radius: var(--r-feuille); padding: 28px 36px; max-width: 460px; box-shadow: var(--ombre); }
.pl-pulse { color: var(--craie); animation: pl-pulse 1.6s ease-in-out infinite; }
@keyframes pl-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .pl-pulse { animation: none; } }
html[data-motion="reduced"] .pl-pulse { animation: none; }

/* Saut de pub (maquette 11) */
.pl-adtoast { position: absolute; right: var(--safe-x); bottom: var(--safe-y); width: 380px; max-width: calc(100% - 2 * var(--safe-x)); background: rgba(24, 27, 34, .97); border-radius: 18px 6px 18px 6px; padding: 14px 14px 14px 18px; display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--ambre); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); z-index: 6; }
.pl-adtoast[hidden] { display: none; }
.pl-adtoast-ic { color: var(--ambre); display: inline-flex; }
.pl-adtoast-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-adtoast-txt strong { font-size: 15px; }
.pl-adtoast-txt span { font-size: 13px; color: var(--brume); }
.pl-undo { height: 36px; }

/* Langue & sous-titres (maquette 13) */
.panel--side.pl-tracks { width: 400px; max-width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 22px; box-shadow: -12px 0 40px rgba(0, 0, 0, .45); align-content: start; }
.pl-tracks-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pl-tracks-head h2 { font-size: 17px; font-weight: 600; }
.pl-tracks-head span { font-size: 12px; color: var(--brume); font-weight: 700; min-width: 0; }
.pl-col { display: flex; flex-direction: column; gap: 6px; }
.pl-col .meta { margin-bottom: 4px; }
.pl-opt { height: 42px; border-radius: var(--r-galet-m); padding: 0 12px; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--brume); }
.pl-opt.is-on { background: var(--nuit); color: var(--craie); }
.pl-opt.is-on svg { color: var(--lumen); }
html[data-input="key"] .pl-opt.is-focus { background: var(--lumen); color: var(--nuit); }
html[data-input="key"] .pl-opt.is-focus svg { color: inherit; }
.pl-none { font-size: 13px; color: var(--brume); padding: 0 12px; }
.pl-tracks-foot { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; align-self: end; }
.pl-sizes { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-tracks-foot p { font-size: 13px; color: var(--brume); line-height: 1.4; }

/* Liste rapide des chaînes (maquette 11) */
.sheet.sheet--chaines { justify-content: flex-start; }
.sheet--chaines .scrim { background: linear-gradient(90deg, rgba(15, 17, 21, .92) 0, rgba(15, 17, 21, .6) 380px, rgba(15, 17, 21, 0) 560px); }
.pl-chpanel { position: relative; align-self: stretch; margin: var(--safe-y) var(--safe-x); width: 340px; max-width: calc(100% - 2 * var(--safe-x)); display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.pl-chhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pl-chhead h2 { font-size: 17px; font-weight: 600; }
.pl-chlist { flex: 1; min-height: 0; margin: 0 -16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.pl-ch { height: 56px; flex: none; border-radius: 14px 4px 14px 4px; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: rgba(24, 27, 34, .85); width: 100%; }
.pl-ch.is-playing { background: rgba(34, 38, 49, .95); }
.pl-ch-num { width: 36px; height: 36px; border-radius: 50%; background: var(--craie); color: var(--nuit); font-family: var(--f-titre); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.pl-ch-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; font-size: 14px; font-weight: 700; }
.pl-ch-bar { height: 3px; border-radius: 2px; background: var(--trait); }
.pl-ch-bar i { display: block; height: 3px; border-radius: 2px; background: var(--braise); }
.pl-ch-now { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--braise); text-transform: uppercase; flex: none; }
.pl-ch-sub { font-size: 12px; color: var(--brume); }
html[data-input="key"] .pl-ch.is-focus { background: var(--lumen); color: var(--nuit); }
html[data-input="key"] .pl-ch.is-focus .pl-ch-num { background: var(--nuit); color: var(--lumen); }
html[data-input="key"] .pl-ch.is-focus .pl-ch-bar { background: rgba(15, 17, 21, .25); }
html[data-input="key"] .pl-ch.is-focus .pl-ch-bar i { background: var(--nuit); }
html[data-input="key"] .pl-ch.is-focus .pl-ch-now { color: var(--nuit); }

/* Incrustation réduite (maquette 23) */
.pl-pipbar, .pl-pip-top { display: none; }
html[data-device] .screen.pl.is-pip { inset: auto; right: clamp(16px, 3vw, 32px); bottom: 24px; width: min(320px, calc(100% - 32px)); height: auto; z-index: 40; background: var(--ardoise-2); border-radius: 20px 6px 20px 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); }
html[data-device="phone"] .screen.pl.is-pip { bottom: 76px; }
.pl.is-pip .pl-stage { position: relative; inset: auto; aspect-ratio: 16 / 9; }
.pl.is-pip .pl-ui, .pl.is-pip .pl-banner, .pl.is-pip .pl-badge, .pl.is-pip .pl-exit, .pl.is-pip .pl-shade, .pl.is-pip .pl-pausemark, .pl.is-pip .pl-buffer, .pl.is-pip .pl-adtoast { display: none; }
.pl.is-pip .pl-state { position: absolute; inset: 0 0 auto 0; aspect-ratio: 16 / 9; }
.pl.is-pip .pl-state .state { padding: 8px; transform: scale(.6); }
.pl.is-pip .pl-pip-top { display: flex; position: absolute; left: 8px; right: 8px; top: 8px; justify-content: space-between; align-items: flex-start; z-index: 1; }
.pl.is-pip .pl-pip-chip { height: 22px; }
.pl-pip-expand { width: 32px; height: 32px; border-radius: 50%; background: rgba(15, 17, 21, .75); display: flex; align-items: center; justify-content: center; color: var(--craie); margin-left: auto; }
.pl.is-pip .pl-pipbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.pl-pip-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-pip-txt strong { font-size: 14px; }
.pl-pip-txt span { font-size: 12px; color: var(--brume); }
.pl-pip-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; color: var(--brume); }
.pl-pip-pause { background: var(--craie); color: var(--nuit); }

/* Téléphone (maquette 22) : cibles ≥ 44 px, grands boutons au centre, outils en haut à droite */
html[data-device="phone"] .pl-title { font-size: 18px; }
html[data-device="phone"] .pl-row .btn { min-height: 44px; }
html[data-device="phone"] .pl-row .btn--icon, html[data-device="phone"] .pl-exit { width: 44px; height: 44px; }
html[data-device="phone"] .pl-row { flex-wrap: wrap; }
html[data-device="phone"] .pl-transport { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); gap: 40px; z-index: 2; transition: opacity var(--t-fondu); }
html[data-device="phone"] .pl.is-idle .pl-transport { opacity: 0; pointer-events: none; }
html[data-device="phone"] .pl-transport .btn--icon { width: 56px; height: 56px; background: rgba(15, 17, 21, .6); }
html[data-device="phone"] .pl-transport .pl-play { width: 72px; height: 72px; }
html[data-device="phone"] .pl-tools { position: fixed; top: var(--safe-y); right: var(--safe-x); z-index: 2; gap: 8px; transition: opacity var(--t-fondu); }
html[data-device="phone"] .pl.is-idle .pl-tools { opacity: 0; pointer-events: none; }
html[data-device="phone"] .pl.is-pip .pl-tools, html[data-device="phone"] .pl.is-pip .pl-transport { display: none; }
html[data-device="phone"] .pl-badge { top: calc(var(--safe-y) + 52px); }
