/* Page OST : combiné télé-magnétoscope + pile de VHS (assets/js/ost/view-ost.js).
   S'appuie sur photo.css (mur continu, en-tête, cadrage, fiche) ; les coordonnées sont en pixels de l'image. */

/* les deux photos sont déjà ramenées au blanc du mur en JS : pas de correction en CSS */
.page-ost .is-wall #frame-pile { filter: none; }
.page-ost #frame-player > canvas#v-photo { position: absolute; left: 0; top: 0; }

/* ======================= L'écran cathodique ======================= */
.tv {
  position: absolute; overflow: hidden; cursor: pointer;
  isolation: isolate;
  --tv-blue: #1a2fd0;
}
.tv > * { position: absolute; inset: 0; margin: 0; pointer-events: none; }
.tv.is-on { background: #050607; }
.tv > .tv-pic, .tv > .tv-blue, .tv > .tv-snow, .tv > .tv-osd, .tv > .tv-fx { opacity: 0; }
/* le reflet de la fenêtre est déjà sur la photo : on ne le rajoute que par-dessus une image allumée */
.tv-glare { width: 100%; height: 100%; opacity: 0; transition: opacity .3s; }
.tv.is-on .tv-glare { opacity: .55; }
.tv.is-on .tv-fx { opacity: 1; }

.tv[data-tv="pic"] .tv-pic { opacity: 1; }
.tv[data-tv="blue"] .tv-blue { opacity: 1; }
.tv[data-tv="snow"] .tv-snow { opacity: .85; }
.tv-osd.is-on { opacity: 1; }

/* image : affiche entière sur sa version floutée (format 4/3 de la télé), couleurs un peu baveuses */
.tv-pic { filter: saturate(1.25) contrast(1.06) blur(.5px); }
.tv-poster-bg {
  position: absolute; inset: -30px;
  background: center / cover no-repeat;
  filter: blur(22px) brightness(.55) saturate(1.2);
}
.tv-poster {
  position: absolute; left: 50%; top: 0; height: 100%; width: auto;
  translate: -50% 0;
  display: none;
}
.tv.has-poster .tv-poster { display: block; }
.tv.has-poster .tv-card { display: none; }
/* extraits vidéo : format du film dans la télé 4/3, bandes noires comme une VHS « letterbox » */
.tv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: none; }
.tv.has-video .tv-video { display: block; }
.tv.has-video .tv-poster, .tv.has-video .tv-poster-bg, .tv.has-video .tv-card { display: none; }
/* lecture : lent travelling sur l'affiche */
.pstage[data-status="playing"] .tv-poster { animation: tv-pan 26s ease-in-out infinite alternate; }
@keyframes tv-pan { from { scale: 1; translate: -50% 0; } to { scale: 1.14; translate: -50% 3%; } }

/* sans affiche : carton de générique blanc sur noir */
.tv-card {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 10px;
  padding: 88px 40px 34px; text-align: center;   /* en haut : place pour l'incrustation */
  background: radial-gradient(ellipse at 50% 55%, #1b1d22, #050506 70%);
  color: #f1efe6; font-family: "Josefin Sans", sans-serif;
  text-shadow: 1.5px 0 rgba(255, 40, 40, .45), -1.5px 0 rgba(40, 140, 255, .45);
}
.tv-card p { margin: 0; }
.tv-card-kind { font-size: 18px; letter-spacing: .3em; text-transform: uppercase; opacity: .7; }
.tv-card-title { font-size: 44px; line-height: 1.05; font-weight: 300; letter-spacing: .04em; text-transform: uppercase; max-width: 560px; }
.tv-card-by { font-size: 22px; font-style: italic; opacity: .85; }
.tv-card-music { margin-top: 26px !important; font-size: 16px; letter-spacing: .18em; text-transform: uppercase; opacity: .75; line-height: 1.6; }
.tv-card-music strong { font-size: 22px; font-weight: 600; letter-spacing: .12em; }

/* écran bleu du magnétoscope */
.tv-blue {
  background: var(--tv-blue);
  padding: 34px 40px !important;
  font: 46px/1 "VT323", ui-monospace, monospace; color: #f4f6ff; letter-spacing: .04em;
  text-shadow: 2px 0 rgba(255, 90, 90, .35), -2px 0 rgba(90, 200, 255, .35);
}

/* neige */
.tv-snow { width: 100%; height: 100%; image-rendering: pixelated; mix-blend-mode: screen; }
.tv.is-glitch .tv-snow { opacity: .55; -webkit-mask: linear-gradient(transparent 30%, #000 42%, #000 58%, transparent 70%); mask: linear-gradient(transparent 30%, #000 42%, #000 58%, transparent 70%); }
.tv.is-glitch .tv-pic { translate: 6px 0; filter: saturate(1.6) contrast(1.2) blur(1px); }

/* incrustations (OSD) : texte vert-blanc en gros pixels, en haut à gauche */
.tv-osd {
  inset: auto !important; left: 38px !important; top: 30px !important;
  font: 44px/1 "VT323", ui-monospace, monospace; color: #e9ffe9; letter-spacing: .05em;
  text-shadow: 0 0 6px rgba(120, 255, 140, .7), 2px 2px 0 rgba(0, 0, 0, .6);
  transition: opacity .1s;
}

/* lignes de balayage, bombé du tube, bande de défilement qui passe de temps en temps */
.tv-fx {
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}
.tv-fx::after {
  content: ""; position: absolute; left: 0; right: 0; height: 18%; top: -20%;
  background: linear-gradient(transparent, rgba(255, 255, 255, .05) 40%, rgba(255, 255, 255, .09) 50%, rgba(255, 255, 255, .05) 60%, transparent);
  animation: tv-roll 9s linear infinite;
}
@keyframes tv-roll { 0%, 70% { top: -20%; } 100% { top: 105%; } }
/* pause : image qui tremble, bande de bruit fixe */
.pstage[data-status="paused"] .tv-pic { animation: tv-jitter .18s steps(2) infinite; }
@keyframes tv-jitter { 50% { translate: 0 1.5px; } }

/* allumage : un trait lumineux qui s'ouvre ; extinction : le trait se referme en un point */
.tv.is-on-anim > :not(.tv-glare) { animation: crt-on .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes crt-on {
  0% { transform: scale(1, .004); filter: brightness(8); }
  35% { transform: scale(1, .004); filter: brightness(6); }
  70% { transform: scale(1, 1); filter: brightness(1.8); }
  100% { transform: none; filter: none; }
}
.tv::after {
  content: ""; position: absolute; inset: 0; z-index: 9; pointer-events: none;
  background: #f8fbff; opacity: 0; border-radius: inherit;
}
.tv.is-off-anim::after { animation: crt-off .55s ease-in forwards; }
@keyframes crt-off {
  0% { opacity: .9; transform: scale(1, 1); }
  35% { opacity: .9; transform: scale(1, .006); }
  75% { opacity: .9; transform: scale(.004, .006); }
  100% { opacity: 0; transform: scale(0, 0); }
}

/* ======================= Le magnétoscope ======================= */
/* volet : quand il s'ouvre, on voit l'intérieur sombre */
.v-flap {
  position: absolute; pointer-events: none; border-radius: 2px;
  background: linear-gradient(#000 0, rgba(0, 0, 0, 0) 100%);
  opacity: 0; transition: opacity .25s;
}
.v-flap.is-open { opacity: .9; box-shadow: inset 0 6px 10px rgba(0, 0, 0, .9); }

/* la cassette : arrive de la pile, se présente devant le volet, puis entre */
.v-tape {
  position: absolute; z-index: 2; pointer-events: none;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .45));
  transition: translate .42s cubic-bezier(.3, .7, .2, 1), scale .42s cubic-bezier(.3, .7, .2, 1), opacity .42s;
  scale: 1.04;
}
.v-tape canvas { display: block; width: 100%; height: 100%; }
.v-tape.no-anim { transition: none; }
.v-tape.is-out { translate: 40% 160%; scale: 1.35; opacity: 0; }
.v-tape.is-in { translate: 0 -10%; scale: .9; opacity: 0; transition-duration: .34s; }
.v-tape.is-gone { visibility: hidden; }

/* afficheur fluorescent : il luit */
.v-display { position: absolute; pointer-events: none; filter: drop-shadow(0 0 2px rgba(110, 255, 230, .75)) drop-shadow(0 0 6px rgba(110, 255, 230, .3)); }

/* voyant rouge */
.v-led { background: #3a0806; }
[data-status="playing"] .v-led, [data-status="loading"] .v-led {
  background: #ff3b24;
  box-shadow: 0 0 5px 2px rgba(255, 50, 30, .8), 0 0 14px 5px rgba(255, 40, 20, .3);
}
[data-status="paused"] .v-led { background: #e0301e; }

/* touches rectangulaires, pictogrammes gris clair */
.v-btn { border-radius: 3px; }
.v-btn svg { width: auto; height: 52%; }
.v-btn--play .i-pause { opacity: 0; }
[data-status="playing"] .v-btn--play .i-play,
[data-status="loading"] .v-btn--play .i-play { opacity: 0; }
[data-status="playing"] .v-btn--play .i-pause,
[data-status="loading"] .v-btn--play .i-pause { opacity: 1; }

/* ======================= La pile ======================= */
/* la cassette qui est dans le magnétoscope dépasse de la pile, comme tirée vers soi */
.v-case.is-loaded { z-index: 60 !important; translate: 0 0; scale: 1.06; box-shadow: 0 14px 22px -8px rgba(0, 0, 0, .55); }

@media (prefers-reduced-motion: reduce) {
  .v-tape, .tv-fx::after, .tv-poster { transition-duration: .01s; animation: none !important; }
}

/* Téléphone en portrait : hauteur du panneau = largeur utile × proportions du cadrage focusMobile (layout.js) */
@media (max-width: 760px) and (orientation: portrait) {
  .page-ost .is-wall .panel--player { height: calc((100vw - 60px) * 1.0041 + 44px); }
  .tv-osd { font-size: 54px; }
}

/* ======================= Fiche du film ======================= */
.info--film .info-body { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.info--film .info-visual { position: sticky; top: 0; align-self: start; }

/* boîtier VHS en plastique noir, affiche glissée sous la pochette transparente */
.vhs-box {
  position: relative; width: min(100%, 320px); aspect-ratio: 0.6;
  border-radius: 6px; padding: 4.5%;
  background: linear-gradient(135deg, #24262a, #0b0b0c 60%, #1a1b1d);
  box-shadow: 0 22px 46px -14px rgba(0, 0, 0, .55), 0 4px 10px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.vhs-box-poster, .vhs-box-card { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 2px; }
.vhs-box-card {
  display: grid; align-content: center; justify-items: center; gap: 12px; text-align: center; padding: 18px;
  background: radial-gradient(ellipse at 50% 40%, #23252b, #08090a 75%); color: #efece2;
  font-family: "Josefin Sans", sans-serif;
}
.vhs-box-card[hidden], .vhs-box-poster[hidden] { display: none; }
.vhs-box-card .c-kind { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; opacity: .7; }
.vhs-box-card .c-title { font-size: 26px; font-weight: 300; line-height: 1.1; text-transform: uppercase; letter-spacing: .05em; }
.vhs-box-card .c-by { font-size: 14px; font-style: italic; opacity: .85; }
.vhs-box-card .c-music { margin-top: 18px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.vhs-box-sleeve {
  position: absolute; inset: 4.5%; pointer-events: none; border-radius: 2px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .28) 0, rgba(255, 255, 255, .05) 25%, transparent 42%),
    linear-gradient(115deg, transparent 60%, rgba(255, 255, 255, .1) 64%, transparent 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
/* pastille de vidéoclub */
.vhs-box-sticker {
  position: absolute; right: -10px; top: 18px;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; rotate: 12deg;
  background: #ff5b1f; color: #fff;
  font: 700 12px/1 "Josefin Sans", sans-serif; letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
}

.vi-kind { margin: 4px 0 0; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: #8a8e93; font-family: "Josefin Sans", sans-serif; }
/* résumé du film (26/11/2026) */
.vi-synopsis { margin: 0 0 18px; font-size: 15px; line-height: 1.55; color: #2b2e31; }
.vi-synopsis[hidden] { display: none; }
.vi-credits { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 20px; font-size: 14px; }
.vi-credits dt { color: #8a8e93; }
.vi-credits dd { margin: 0; }
.vi-block { margin: 0 0 22px; }
.vi-block h3 { margin: 0 0 8px; font: 600 12px/1.2 "Josefin Sans", sans-serif; letter-spacing: .2em; text-transform: uppercase; color: #6a6e73; }
.vi-block[hidden] { display: none; }
/* feuille de minutage : M1, M2… comme une cue sheet de compositeur */
.vi-cues .n { font-family: "Special Elite", ui-monospace, monospace; }
.vi-empty { margin: 0; color: #6a6e73; font-size: 14px; }
.vi-fest { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 24px; font-size: 14px; }
.vi-fest li { break-inside: avoid; padding: 3px 0; }
.vi-fest .is-prize { font-weight: 600; }
.vi-fest .f-prize { display: block; font-weight: 400; color: #c4470e; font-size: 13px; }
.vi-fest .is-prize .f-name::before { content: "✦ "; color: #e0590f; }
.vi-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.vi-links[hidden] { display: none; }
.vi-link {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .16); color: inherit; text-decoration: none; font-size: 13px;
}
.vi-link:hover { background: rgba(0, 0, 0, .05); }
.vi-link.is-main { background: #1d1f22; color: #fff; border-color: #1d1f22; }
.vi-news { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.vi-news li { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(0, 0, 0, .07); }
.vi-news .n-date { color: #8a8e93; font-variant-numeric: tabular-nums; flex: none; }
.vi-news a { color: inherit; }

@media (max-width: 760px) {
  .info--film .info-body { grid-template-columns: 1fr; }
  .info--film .info-visual { position: static; }
  .vhs-box { width: min(64vw, 260px); }
}

/* Légendes sous les panneaux retirées (demande de Maxime, 22/11/2026) :
   l'afficheur du magnétoscope dit déjà ce qui joue. La place gagnée en bas va aux photos. */
.panel .caption { display: none; }
@media (min-width: 761px) and (min-height: 521px) {
  .is-wall .pstage { --reserve-bottom: 24px; }
}

/* ======================= Plein écran (22/11/2026) ======================= */
/* bouton dans le coin de l'écran (pixels de l'image : ~35 px à l'écran) ; visible au survol, toujours au doigt */
.tv > .tv-full-btn {
  inset: auto; right: 16px; bottom: 14px; width: 62px; height: 62px; z-index: 5;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px;
  background: rgba(10, 12, 14, .55); color: #f4f6f2; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .25s, background .2s;
}
.tv-full-btn svg, .tv-full-b svg { width: 62%; height: 62%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tv.is-on > .tv-full-btn { pointer-events: auto; }
.tv.is-on:hover > .tv-full-btn, .tv.is-on > .tv-full-btn:focus-visible { opacity: 1; }
.tv > .tv-full-btn:hover { background: rgba(10, 12, 14, .8); }
@media (hover: none) { .tv.is-on > .tv-full-btn { opacity: .8; } }
@media (max-width: 760px) { .tv > .tv-full-btn { width: 96px; height: 96px; right: 12px; bottom: 10px; border-radius: 14px; } }   /* ~40 px au doigt */

/* le calque : la télé prend toute la fenêtre, sans le reflet de la fenêtre de la photo */
.tv-full { position: fixed; inset: 0; z-index: 1000; background: #000; }
.tv-full[hidden] { display: none; }
.has-tv-full, .has-tv-full body { overflow: hidden; }
.tv-full > .tv { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0 !important; }
.tv-full > .tv > .tv-glare, .tv-full > .tv > .tv-full-btn { display: none; }
.tv-full[data-status="playing"] .tv-poster { animation: tv-pan 26s ease-in-out infinite alternate; }
.tv-full[data-status="paused"] .tv-pic { animation: tv-jitter .18s steps(2) infinite; }

/* commandes en bas, qui s'effacent (avec le curseur) quand on ne bouge plus */
.tv-full-bar {
  position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 10;
  display: flex; gap: 10px; padding: 8px; border-radius: 999px;
  background: rgba(12, 13, 15, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: opacity .35s;
}
.tv-full-b {
  position: relative; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: #f4f6f2; cursor: pointer;
}
.tv-full-b:hover, .tv-full-b:focus-visible { background: rgba(255, 255, 255, .14); }
.tv-full-b > svg { grid-area: 1 / 1; width: 46%; height: 46%; fill: currentColor; stroke: none; }
.tv-full-b > svg.i-exit { fill: none; stroke: currentColor; }
.tv-full-b.v-btn--play { background: #e8742a; color: #2a1608; }
.tv-full.is-idle { cursor: none; }
.tv-full.is-idle .tv-full-bar { opacity: 0; pointer-events: none; }

/* Touche (i) jaune du magnétoscope (photo.css) : la forme de la touche de la photo, un rectangle aux coins à
   peine arrondis (≈ 40 × 19 px de photo dans une zone de clic de 46 × 28, décalé vers le bas), au lieu du rond
   du lecteur CD (Maxime, 26/11/2026 : « la forme ne correspond pas au lecteur VHS ») ; halo en ellipse. */
#stage-player .p-btn[data-action="info"]:not(.cf-btn)::before {
  inset: 19.6% 6.5% 11.8%;
  border-radius: 7.5% / 16%;
  background: radial-gradient(ellipse at 46% 40%,
    rgb(255, 246, 170) 0, rgb(255, 214, 40) 38%, rgb(236, 172, 0) 72%, rgb(170, 112, 0) 100%);
}
#stage-player .p-btn[data-action="info"]:not(.cf-btn)::after {
  inset: -45% -25% -55%;
  background: radial-gradient(ellipse closest-side,
    rgba(255, 220, 40, .6) 0, rgba(255, 200, 20, .32) 45%, rgba(255, 190, 10, .1) 72%, rgba(255, 180, 0, 0) 100%);
}
#stage-player .p-btn[data-action="info"]:not(.cf-btn) svg { translate: 0 8%; }   /* le « i » au centre de la touche */

