/* foyer — « Ma playlist » : liste (maquette 16), fiches (17), gestion, lecteur de la playlist. Échelle TV 960 × 540. */

/* ---------- Liste ---------- */
.m3u { padding-bottom: 0; }
.m3u-head { height: 36px; margin-top: 12px; display: flex; align-items: center; gap: 14px; flex: none; position: relative; z-index: 2; }
.m3u-head h1 { font-size: 20px; font-weight: 600; white-space: nowrap; }
.m3u-flex { flex: 1; min-width: 0; }
.m3u-seg { display: flex; background: var(--ardoise); border-radius: 10px 3px 10px 3px; padding: 3px; flex: none; }
.m3u-seg-btn { height: 28px; padding: 0 12px; font-size: 13px; font-weight: 700; display: flex; align-items: center; color: var(--brume); border-radius: 8px 2px 8px 2px; white-space: nowrap; }
.m3u-seg-btn[aria-pressed="true"] { background: var(--craie); color: var(--nuit); }
html[data-input="key"] .m3u-seg-btn.is-focus { background: var(--lumen); color: var(--nuit); outline-offset: 2px; }
.m3u-filter { width: 120px; height: 32px; font-size: 13px; flex: none; }
.m3u-status { font-size: 12px; color: var(--brume); min-width: 0; flex: 0 1 auto; }
.m3u-manage { flex: none; }

.m3u-body { flex: 1; min-height: 0; display: flex; gap: 24px; margin-top: 14px; }
.m3u-cats { width: 170px; flex: none; display: flex; flex-direction: column; gap: 3px; overflow: hidden; padding: 8px; margin: -8px; width: 186px; }
.m3u-cat { height: 34px; padding: 0 12px; border-radius: 10px 3px 10px 3px; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--brume); flex: none; }
.m3u-cat[aria-pressed="true"] { background: var(--ardoise-2); box-shadow: inset 3px 0 0 var(--craie); color: var(--craie); }
html[data-input="key"] .m3u-cat.is-focus { background: var(--lumen); color: var(--nuit); box-shadow: none; outline-offset: 2px; }
.m3u-cat-n { font-size: 12px; font-weight: 400; flex: none; }
.m3u-cats { scroll-behavior: smooth; }

.m3u-area { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.m3u-none { color: var(--brume); font-size: 14px; padding: 24px 4px; }
.m3u-grid { flex: 1; min-height: 0; overflow: hidden; padding: 16px 12px; margin: -16px -12px; scroll-behavior: smooth; position: relative; }
.m3u-sizer { position: relative; }
.m3u-grow { position: absolute; left: 0; right: 0; display: grid; grid-template-columns: repeat(var(--m3u-cols, 6), minmax(0, 1fr)); gap: 0 14px; }
.m3u-grow:focus-within { z-index: 2; }
.m3u-state { flex: 1; display: flex; align-items: center; justify-content: center; }
.m3u-skel { align-items: flex-start; }

.m3u-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; text-align: left; }
.m3u-art { width: 100%; height: var(--m3u-art-h, 150px); border-radius: 14px 4px 14px 4px; transition: transform var(--t-eclair) var(--courbe), box-shadow var(--t-eclair); }
.m3u-art-title { position: absolute; left: 8px; right: 8px; bottom: 8px; font-family: var(--f-titre); font-size: 11px; font-weight: 600; line-height: 1.15; z-index: 1; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m3u-card .media-bar { z-index: 1; }
.m3u-fav, .m3u-seen { position: absolute; top: 6px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 1; }
.m3u-fav { right: 6px; background: var(--nuit); color: var(--braise); }
.m3u-seen { left: 6px; background: var(--craie); color: var(--nuit); }
.m3u-meta { font-size: 12px; color: var(--brume); display: block; }
html[data-input="key"] .m3u-card.is-focus { outline: none; box-shadow: none; transform: none; }
html[data-input="key"] .m3u-card.is-focus .m3u-art { outline: 3px solid var(--lumen); outline-offset: 3px; box-shadow: 0 0 0 10px rgba(216, 255, 62, .16), var(--ombre); transform: scale(1.06); }
html[data-motion="reduced"][data-input="key"] .m3u-card.is-focus .m3u-art { transform: none; }
@media (prefers-reduced-motion: reduce) { html[data-input="key"] .m3u-card.is-focus .m3u-art { transform: none; } .m3u-grid, .m3u-cats { scroll-behavior: auto; } }
html[data-motion="reduced"] .m3u-grid, html[data-motion="reduced"] .m3u-cats { scroll-behavior: auto; }

/* Gérer la playlist */
.panel--manage { width: 460px; max-width: 92vw; padding: 24px; gap: 10px; }
.m3u-man-status { font-size: 14px; color: var(--craie-2); }
.m3u-man-label { font-size: 13px; font-weight: 700; color: var(--brume); margin-top: 8px; }
.m3u-man-error { color: var(--braise); font-size: 14px; font-weight: 700; }
.m3u-man-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.panel--manage .panel-hint { margin-top: 10px; }

/* Téléphone : type et filtre sur deux lignes, catégories en puces, grille à défilement natif */
html[data-device="phone"] .m3u { overflow: hidden; padding-bottom: 64px; }
html[data-device="phone"] .m3u-head { height: auto; flex-wrap: wrap; gap: 8px 10px; margin-top: 8px; }
html[data-device="phone"] .m3u-head h1 { display: none; }
html[data-device="phone"] .m3u-seg { overflow-x: auto; max-width: 100%; }
html[data-device="phone"] .m3u-seg-btn { height: 40px; }
html[data-device="phone"] .m3u-flex { display: none; }
html[data-device="phone"] .m3u-filter { flex: 1; width: auto; height: 44px; font-size: 16px; }
html[data-device="phone"] .m3u-status { order: 9; flex: 1 0 100%; }
html[data-device="phone"] .m3u-manage { width: 44px; height: 44px; }
html[data-device="phone"] .m3u-body { flex-direction: column; gap: 6px; margin-top: 6px; }
html[data-device="phone"] .m3u-cats { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; margin: 0 -16px; padding: 4px 16px; scrollbar-width: none; flex: none; }
html[data-device="phone"] .m3u-cat { min-height: 44px; border-radius: 12px; white-space: nowrap; flex: none; }
html[data-device="phone"] .m3u-grid { overflow-y: auto; scrollbar-width: none; margin: 0 -16px; padding: 12px 16px; }
html[data-device="phone"] .m3u-fav, html[data-device="phone"] .m3u-seen { width: 24px; height: 24px; }
html[data-device="pc"] .m3u-filter { width: 220px; }

/* ---------- Fiche film / série (maquette 17) ---------- */
.m3u-fiche { position: absolute; }
.m3u-glow { position: absolute; right: -140px; top: -220px; width: 560px; height: 560px; border-radius: 50%; background: var(--lumen); opacity: .08; pointer-events: none; }
.m3u-back { height: 24px; align-self: flex-start; display: flex; align-items: center; gap: 8px; color: var(--brume); font-size: 13px; font-weight: 700; position: relative; flex: none; margin-bottom: 13px; }
.m3u-fiche-head { display: flex; gap: 24px; position: relative; flex: none; }
.m3u-fiche-art { width: 150px; height: 225px; border-radius: 18px 6px 18px 6px; flex: none; }
.m3u-fiche-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.m3u-fiche-title { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.m3u-fiche-meta { font-size: 14px; color: var(--brume); font-weight: 700; }
.m3u-fiche-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; flex-wrap: wrap; padding: 6px 0; }
.btn--lg { height: 42px; padding: 0 16px; font-size: 15px; }
.btn--lumen { background: var(--lumen); color: var(--nuit); border-color: transparent; padding: 0 18px; }
.m3u-lang .m3u-seg-btn { height: 34px; }
.m3u-favbtn { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--trait-2); display: flex; align-items: center; justify-content: center; color: var(--braise); flex: none; }
.m3u-favbtn:not(.is-on) { color: var(--brume); }
html[data-input="key"] .m3u-favbtn.is-focus { background: var(--lumen); color: var(--nuit); border-color: transparent; }
.m3u-seasons { margin-top: 23px; display: flex; flex-direction: column; gap: 12px; position: relative; min-height: 0; }
.m3u-season-tabs { display: flex; gap: 20px; align-items: baseline; }
.m3u-season { font-family: var(--f-titre); font-size: 15px; font-weight: 500; color: var(--brume); padding-bottom: 4px; border-bottom: 3px solid transparent; }
.m3u-season[aria-selected="true"] { color: var(--craie); font-weight: 600; border-bottom-color: var(--craie); }
.m3u-eps { display: flex; gap: 16px; margin: -16px calc(var(--safe-x) * -1); padding: 16px var(--safe-x); overflow-x: hidden; scroll-behavior: smooth; }
.m3u-ep { width: 196px; flex: none; display: flex; flex-direction: column; gap: 6px; text-align: left; min-width: 0; }
.m3u-ep strong { font-size: 14px; display: block; }
.m3u-ep-art { height: 110px; border-radius: 14px 4px 14px 4px; transition: transform var(--t-eclair) var(--courbe), box-shadow var(--t-eclair); }
.m3u-ep.is-seen .m3u-ep-art > :not(.m3u-seen):not(.media-tag) { opacity: .6; }
.m3u-seen--r { left: auto; right: 8px; top: 8px; }
html[data-input="key"] .m3u-ep.is-focus { outline: none; box-shadow: none; transform: none; }
html[data-input="key"] .m3u-ep.is-focus .m3u-ep-art { outline: 3px solid var(--lumen); outline-offset: 3px; box-shadow: 0 0 0 10px rgba(216, 255, 62, .16), var(--ombre); transform: scale(1.06); }
html[data-motion="reduced"][data-input="key"] .m3u-ep.is-focus .m3u-ep-art { transform: none; }
html[data-motion="reduced"] .m3u-eps { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) { html[data-input="key"] .m3u-ep.is-focus .m3u-ep-art { transform: none; } .m3u-eps { scroll-behavior: auto; } }
html[data-device="phone"] .m3u-fiche { overflow-y: auto; }
html[data-device="phone"] .m3u-fiche-head { flex-direction: column; gap: 14px; }
html[data-device="phone"] .m3u-fiche-art { width: 110px; height: 165px; }
html[data-device="phone"] .m3u-fiche-title { font-size: 24px; }
html[data-device="phone"] .m3u-fiche-actions .btn, html[data-device="phone"] .m3u-seg-btn { min-height: 44px; }
html[data-device="phone"] .m3u-back { height: 44px; }
html[data-device="phone"] .m3u-eps { overflow-x: auto; scrollbar-width: none; }
html[data-device="phone"] .m3u-favbtn { width: 44px; height: 44px; }
/* Saisons : une grille fixe qui retourne à la ligne, jamais une rangée qui glisse. */
html[data-device="phone"] .m3u-season-tabs { flex-wrap: wrap; gap: 8px; }
html[data-device="phone"] .m3u-season { min-height: 40px; padding: 0 14px; border: 1px solid var(--trait); border-radius: 999px; display: inline-flex; align-items: center; }
html[data-device="phone"] .m3u-season[aria-selected="true"] { background: var(--craie); color: var(--nuit); border-color: var(--craie); }
html[data-device="pc"] .m3u-eps { overflow-x: auto; scrollbar-width: none; }

/* ---------- Lecture de la playlist ---------- */
.m3u-pl { padding: 0; display: block; background: #000; overflow: hidden; }
.m3u-pl-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.m3u-pl.is-idle { cursor: none; }
.m3u-pl.is-casting .m3u-pl-video { visibility: hidden; }
.m3u-pl-top { position: absolute; left: 0; right: 0; top: 0; padding: var(--safe-y) var(--safe-x) 36px; display: flex; align-items: center; gap: 14px; background: linear-gradient(rgba(15, 17, 21, .85), transparent); transition: opacity var(--t-glisse), visibility 0s; }
.m3u-pl-titles { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m3u-pl-title { font-size: 18px; font-weight: 600; }
.m3u-pl-sub { font-size: 13px; color: var(--craie-2); }
.m3u-pl-ui { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px var(--safe-x) var(--safe-y); display: flex; flex-direction: column; gap: 14px; background: linear-gradient(transparent, rgba(15, 17, 21, .92)); transition: opacity var(--t-glisse), visibility 0s; }
.m3u-pl-top.is-hidden, .m3u-pl-ui.is-hidden { opacity: 0; visibility: hidden; transition: opacity var(--t-glisse), visibility 0s var(--t-glisse); }
.m3u-pl-barrow { display: flex; align-items: center; gap: 14px; }
.m3u-pl-time { font-family: var(--f-titre); font-size: 12px; font-weight: 500; color: var(--craie-2); min-width: 44px; text-align: center; }
.m3u-pl-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(243, 241, 234, .22); position: relative; }
.m3u-pl-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--lumen); }
.m3u-pl-btns { display: flex; align-items: center; gap: 12px; }
.m3u-pl-btn { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(34, 38, 49, .9); color: var(--craie); flex: none; }
.m3u-pl-play { width: 52px; height: 52px; background: var(--craie); color: var(--nuit); }
.m3u-pl-prev svg { transform: scaleX(-1); }
.m3u-pl-fav.is-on { color: var(--braise); }
.m3u-pl-fav.is-on svg { fill: currentColor; }
html[data-input="key"] .m3u-pl-btn.is-focus { background: var(--lumen); color: var(--nuit); }
html[data-input="key"] .m3u-pl-bar.is-focus { height: 10px; }
.m3u-pl-msg { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); background: rgba(15, 17, 21, .9); padding: 14px 20px; border-radius: 14px 4px 14px 4px; font-size: 15px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: min(560px, 86vw); white-space: pre-line; z-index: 3; }
.m3u-pl-msg.is-error { border: 1.5px solid var(--braise); }
.m3u-pl-nextup { position: absolute; right: var(--safe-x); bottom: 120px; z-index: 4; gap: 12px; padding: 16px 18px; }
.m3u-pl-next-text { font-size: 15px; font-weight: 700; }
.m3u-pl-next-actions { display: flex; gap: 10px; }
.m3u-pl-track { justify-content: flex-start; }
.m3u-pl-track-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.m3u-pl-track[aria-pressed="true"] .m3u-pl-track-dot { background: currentColor; }
.m3u-pl-track-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.m3u-pl-track-name small { font-size: 11px; font-weight: 400; opacity: .7; }
.m3u-pl-tracks { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; max-height: 340px; }
.m3u-pl--error { display: flex; align-items: center; justify-content: center; }
html[data-device="phone"] .m3u-pl-btns { gap: 8px; flex-wrap: wrap; }
html[data-device="phone"] .m3u-pl-btn { width: 44px; height: 44px; }
html[data-device="phone"] .m3u-pl-ui { padding-bottom: 16px; }
html[data-device="phone"] .m3u-pl-nextup { bottom: 150px; right: 16px; left: 16px; }
