/* Lecteur maison (gateway/web/player.js) : overlay plein écran dans la page, commandes propres. */
.tfp { position: fixed; inset: 0; z-index: 50; background: #000; overflow: hidden; }
.tfp video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.tfp .tfp-surface { position: absolute; inset: 0; z-index: 1; }

.tfp .tfp-top, .tfp .tfp-bottom, .tfp .tfp-next { transition: opacity 0.2s ease; }
.tfp.is-still .tfp-top, .tfp.is-still .tfp-bottom, .tfp.is-still .tfp-next, .tfp.is-still .tfp-flash { transition: none; }
.tfp.is-bare .tfp-top, .tfp.is-bare .tfp-bottom, .tfp.is-bare .tfp-next { opacity: 0; pointer-events: none; }

.tfp .tfp-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 6px;
  padding: calc(var(--sat) + 8px) calc(env(safe-area-inset-right, 0px) + 10px) 28px calc(env(safe-area-inset-left, 0px) + 10px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
}
.tfp .tfp-title { flex: 1; min-width: 0; }
.tfp .tfp-title b { display: block; font-size: 15px; font-weight: 700; }
.tfp .tfp-title span { display: block; font-size: 12px; color: var(--ink-2); }

.tfp .tfp-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 22px; background: rgba(22, 24, 31, 0.7); color: var(--ink);
}
.tfp .tfp-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tfp .tfp-icon.is-on { background: var(--ink); color: var(--bg); }
.tfp .tfp-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 14px; border-radius: 22px; background: rgba(22, 24, 31, 0.7);
  color: var(--ink); font-size: 14px; font-weight: 700; white-space: nowrap;
}
.tfp .tfp-btn.is-primary { background: var(--ink); color: var(--bg); }

.tfp .tfp-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; min-height: 64px; padding: 0 34px; font-size: 18px; }
.tfp .tfp-status {
  position: absolute; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.tfp .tfp-status:empty { display: none; }

/* Sous les barres (z-index 3) : la préparation d'un saut peut durer une minute, « Retour » et
   « Regarder sur la TV » doivent rester atteignables. */
.tfp .tfp-veil { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.72); padding: 0 24px; text-align: center; font-size: 14px; font-weight: 600; }
/* Reprise après une longue pause : l'image figée doit rester lisible sous le voile. */
.tfp .tfp-veil.is-resume { background: rgba(0, 0, 0, 0.45); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }

.tfp .tfp-flash {
  position: absolute; top: 0; bottom: 0; width: 33%; z-index: 2; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.tfp .tfp-flash.is-left { left: 0; }
.tfp .tfp-flash.is-right { right: 0; }
.tfp .tfp-flash.is-on { opacity: 1; }
.tfp .tfp-flash span { padding: 10px 16px; border-radius: 22px; background: rgba(0, 0, 0, 0.6); font-size: 15px; font-weight: 800; }

.tfp .tfp-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; flex-direction: column; gap: 10px;
  padding: 34px calc(env(safe-area-inset-right, 0px) + 14px) calc(var(--sab) + 14px) calc(env(safe-area-inset-left, 0px) + 14px);
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
}
.tfp .tfp-time { display: flex; flex-direction: column; }
.tfp .tfp-clock { font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* 44 px de hauteur saisissable pour une piste de 6 px : la marge de la piste porte la cible. */
.tfp .tfp-range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: none; outline: 0; margin: 0; }
.tfp .tfp-range::-webkit-slider-runnable-track { height: 6px; margin: 19px 0; border-radius: 3px; background: rgba(255, 255, 255, 0.28); }
.tfp .tfp-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 11px; background: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.tfp .tfp-range::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.28); }
.tfp .tfp-range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 11px; background: var(--ink); }

.tfp .tfp-transport { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tfp .tfp-transport .tfp-btn { min-width: 72px; }
.tfp .tfp-main { width: 56px; height: 56px; border-radius: 28px; background: var(--ink); color: var(--bg); }
.tfp .tfp-main svg { width: 26px; height: 26px; }

.tfp .tfp-next {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--sab) + 152px); z-index: 4;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 14px; background: var(--panel);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); font-size: 14px; font-weight: 600;
}
.tfp .tfp-next > span { flex: 1; min-width: 140px; }

/* Image dans l'image : la vidéo reste dans le DOM à 1 px, sinon WebKit en sort. */
.tfp.is-pip { inset: auto 0 calc(var(--tabs-h) + var(--sab)) 0; height: 56px; background: var(--panel); border-top: 1px solid var(--line); }
.tfp.is-pip video { width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tfp.is-pip .tfp-surface, .tfp.is-pip .tfp-bottom, .tfp.is-pip .tfp-status, .tfp.is-pip .tfp-big, .tfp.is-pip .tfp-veil, .tfp.is-pip .tfp-flash, .tfp.is-pip .tfp-next { display: none; }
.tfp.is-pip .tfp-top { position: static; height: 100%; padding: 6px 12px; background: none; }
.tfp.is-pip .tfp-top .tfp-btn { display: none; }

.tfp video::cue { font-family: Manrope, system-ui, sans-serif; font-size: 20px; background: rgba(0, 0, 0, 0.55); }

@media (orientation: landscape) {
  .tfp .tfp-top { padding-top: calc(var(--sat) + 6px); padding-bottom: 20px; }
  .tfp .tfp-bottom { padding-bottom: calc(var(--sab) + 10px); gap: 8px; }
  .tfp .tfp-next { bottom: calc(var(--sab) + 130px); }
}
@media (max-width: 380px) {
  .tfp .tfp-transport { gap: 6px; }
  .tfp .tfp-transport .tfp-btn { min-width: 0; padding: 0 10px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .tfp .tfp-top, .tfp .tfp-bottom, .tfp .tfp-next, .tfp .tfp-flash { transition: none; }
}
