/* ═══════════════════════════════════════════════════════
   INTERFILM — TV EN DIRECT  |  tv.css
   Thème : noir/orange (#f5a623) / blanc
   Parcours : grille de sélection des chaînes -> lecteur plein écran
   ══════════════════════════════════════════════════════ */

/* ── CONTAINER PRINCIPAL ── */
#tvView {
  display: none;
  min-height: 100vh;
  background: var(--bg);
}

/* ── ACCÈS REFUSÉ ── */
.tv-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 20px;
  gap: 16px;
}
.tv-locked-icon {
  width: 72px; height: 72px;
  background: rgba(245,166,35,.1);
  border: 2px solid rgba(245,166,35,.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.tv-locked h2 {
  font-family: var(--ff-head);
  font-size: 24px; font-weight: 800;
  color: var(--text);
}
.tv-locked p { color: var(--text2); font-size: 15px; max-width: 420px; }

/* ══════════════════════════════════════════════════════
   ÉTAPE 1 — SÉLECTION DE LA CHAÎNE
══════════════════════════════════════════════════════ */
.tv-select-step {
  padding: 0 clamp(20px, 4vw, 44px) 64px;
  max-width: 1480px;
  margin: 0 auto;
}

/* ── EN-TÊTE ── */
.tv-select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 0 22px;
}
.tv-select-header-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.tv-header-back {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text2);
  font-size: 13px; font-weight: 700;
  padding: 8px 16px; border-radius: 10px;
  cursor: pointer; transition: all .2s;
}
.tv-header-back:hover { background: rgba(255,255,255,.1); color: var(--text); }

.tv-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,48,74,.15);
  border: 1px solid rgba(232,48,74,.4);
  color: var(--red2);
  font-size: 11px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tv-live-dot {
  width: 7px; height: 7px;
  background: var(--red2);
  border-radius: 50%;
  animation: tv-pulse 1.2s infinite;
  flex-shrink: 0;
}
@keyframes tv-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.75); }
}
.tv-title {
  font-family: var(--ff-head);
  font-size: 28px; font-weight: 800;
  letter-spacing: .01em;
  color: var(--text);
}

/* ── RECHERCHE ── */
.tv-select-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--s1);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 10px 16px;
  min-width: 260px;
  color: var(--muted);
  transition: border-color .2s;
}
.tv-select-search:focus-within { border-color: rgba(245,166,35,.4); color: var(--text2); }
.tv-select-search input {
  flex: 1;
  background: none; border: none; outline: none;
  font-size: 13.5px; color: var(--text);
  font-family: var(--ff-body);
}
.tv-select-search input::placeholder { color: var(--muted); }

/* ── BANNIÈRE DE RACCOURCIS (TV / Sport) ── */
.tv-shortcuts-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 20px;
}
.tv-shortcut-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--s1);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all .2s ease;
  text-align: left;
  font-family: var(--ff-body);
}
.tv-shortcut-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0,0,0,.3); }

.tv-shortcut-icon {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 12px;
}
.tv-shortcut-tv {
  border-color: rgba(232,48,74,.35);
  background: linear-gradient(135deg, rgba(232,48,74,.1), rgba(232,48,74,.02));
}
.tv-shortcut-tv:hover { border-color: rgba(232,48,74,.6); }
.tv-shortcut-tv .tv-shortcut-icon { background: rgba(232,48,74,.15); color: var(--red2); }
.tv-shortcut-tv .tv-shortcut-arrow { color: var(--red2); }

.tv-shortcut-sport {
  border-color: rgba(245,166,35,.3);
  background: linear-gradient(135deg, rgba(245,166,35,.08), rgba(245,166,35,.02));
}
.tv-shortcut-sport:hover { border-color: rgba(245,166,35,.55); }
.tv-shortcut-sport .tv-shortcut-icon { background: rgba(245,166,35,.15); color: var(--gold); }
.tv-shortcut-sport .tv-shortcut-arrow { color: var(--gold); }

.tv-shortcut-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tv-shortcut-text strong { font-size: 15px; font-weight: 800; color: var(--text); }
.tv-shortcut-text span { font-size: 12px; color: var(--text2); }
.tv-shortcut-arrow { flex-shrink: 0; opacity: .8; }

/* ── SÉLECTEUR DE PAYS ── */
.tv-country-selector {
  position: relative;
  display: inline-block;
  margin-bottom: 18px;
}
.tv-country-trigger {
  display: flex; align-items: center; gap: 10px;
  background: var(--s1);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13.5px; font-weight: 700;
  color: var(--text);
  transition: border-color .2s;
}
.tv-country-trigger:hover { border-color: rgba(245,166,35,.35); }
.tv-country-trigger svg { color: var(--muted); flex-shrink: 0; }

.tv-country-flag {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.tv-country-code {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
  padding: 3px 6px; border-radius: 5px;
  background: rgba(245,166,35,.15);
  color: var(--gold);
  letter-spacing: .03em;
}

.tv-country-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 220px;
  max-height: 320px; overflow-y: auto;
  background: var(--s1);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}
.tv-country-menu.open { display: flex; }
.tv-country-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  background: none; border: none;
  text-align: left; cursor: pointer;
  font-size: 13.5px; color: var(--text2);
  transition: all .15s;
}
.tv-country-option:hover { background: rgba(255,255,255,.06); color: var(--text); }
.tv-country-option.active { background: rgba(245,166,35,.12); color: var(--gold); }
.tv-country-option-label { flex: 1; min-width: 0; }
.tv-country-option-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255,255,255,.05);
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.tv-country-option.active .tv-country-option-count {
  color: var(--gold);
  background: rgba(245,166,35,.12);
}

/* ── FILTRES CATÉGORIES ── */
.tv-channels-filter {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  padding: 4px 0 22px;
}
.tv-chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tv-channels-count {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text2);
  white-space: nowrap; flex-shrink: 0;
}
.tv-channels-count strong { color: var(--text); font-weight: 800; }
.tv-channels-count .tv-live-dot { background: var(--gold); animation: none; }

.tv-chip {
  font-size: 12px; font-weight: 700;
  padding: 7px 16px; border-radius: 20px;
  cursor: pointer; transition: all .2s;
  background: var(--s1);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text2);
  letter-spacing: .02em;
}
.tv-chip:hover { background: rgba(255,255,255,.08); color: var(--text); }
.tv-chip.active {
  background: linear-gradient(135deg, rgba(245,166,35,.18), rgba(245,166,35,.08));
  border-color: rgba(245,166,35,.5);
  color: var(--gold);
}

/* ── GRILLE DE CHAÎNES ── */
.tv-channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.tv-channel-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  background: var(--s1);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 26px 16px 20px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
  text-align: center;
  font-family: var(--ff-body);
}
.tv-channel-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245,166,35,.4);
  background: var(--s2);
  box-shadow: 0 16px 36px rgba(0,0,0,.35);
}
.tv-channel-card:active { transform: translateY(-1px); }
.tv-channel-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.tv-channel-card-live {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 800;
  letter-spacing: .06em;
  color: var(--red2);
  background: rgba(232,48,74,.12);
  border: 1px solid rgba(232,48,74,.3);
  padding: 3px 8px; border-radius: 20px;
}

.tv-fav-star {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  transition: all .2s; flex-shrink: 0;
}
.tv-fav-star:hover, .tv-fav-star.active { color: var(--gold); border-color: rgba(245,166,35,.4); }
.tv-fav-star.active svg { fill: var(--gold); }

.tv-channel-card-logo {
  width: 72px; height: 72px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  margin-top: 6px;
}
.tv-channel-card-logo img { width: 100%; height: 100%; object-fit: contain; padding: 9px; }
.tv-channel-card-logo .tv-logo-fallback {
  font-weight: 900; font-size: 13px; color: var(--text2);
  text-align: center; line-height: 1.2; padding: 6px;
}

.tv-channel-card-name {
  font-weight: 800; font-size: 13px; color: var(--text);
  line-height: 1.25;
  max-width: 100%;
  padding: 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.tv-channel-card-cat {
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}

/* Générique pour le logo dans le lecteur (réutilisé en step 2) */
.tv-channel-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.tv-channel-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.tv-channel-logo .tv-logo-fallback {
  font-weight: 900; font-size: 11px; color: var(--text2);
  text-align: center; line-height: 1.2; padding: 4px;
}

/* ── SKELETON LOADER (grille) ── */
.tv-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  grid-column: 1 / -1;
}
.tv-sk-card {
  background: var(--s1);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 26px 16px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.tv-sk-logo {
  width: 72px; height: 72px; border-radius: 14px;
  background: linear-gradient(90deg,
    rgba(255,255,255,.05) 25%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.05) 75%);
  background-size: 200% 100%;
  animation: tv-shimmer 1.4s infinite linear;
}
.tv-sk-line {
  width: 70%; height: 11px; border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(255,255,255,.05) 25%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.05) 75%);
  background-size: 200% 100%;
  animation: tv-shimmer 1.4s infinite linear;
}
@keyframes tv-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── EMPTY STATE ── */
.tv-empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════
   ÉTAPE 2 — LECTEUR
══════════════════════════════════════════════════════ */
.tv-player-step {
  position: fixed;
  inset: 0;
  z-index: 100000005;
  background: #000;
}

.tv-player-fs-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}
.tv-player-fs-wrap:fullscreen,
.tv-player-fs-wrap:-webkit-full-screen {
  width: 100%; height: 100%;
  max-width: none; max-height: none;
}

/* Fermer le lecteur — visible sur mobile, toujours au-dessus de la vidéo */
.tv-player-mobile-close {
  display: none;
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: max(12px, env(safe-area-inset-right, 12px));
  z-index: 30;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 18px rgba(0,0,0,.5);
  transition: background .2s, transform .15s, border-color .2s;
}
.tv-player-mobile-close:hover {
  background: rgba(247,127,0,.28);
  border-color: rgba(247,127,0,.45);
}
.tv-player-mobile-close:active {
  transform: scale(0.94);
}
.tv-player-fs-wrap.tv-controls-hidden .tv-player-mobile-close {
  opacity: 1;
  pointer-events: auto;
}

/* ── BARRE INTERFILM (haut) — le lecteur northlive garde ses contrôles en bas ── */
.tv-player-bottombar {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: auto;
  z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(to bottom, rgba(7,7,15,.94) 0%, rgba(7,7,15,.75) 55%, rgba(7,7,15,0) 100%);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  transition: opacity .25s ease, transform .25s ease;
  opacity: 1;
  transform: translateY(0);
}
.tv-player-fs-wrap.tv-controls-hidden .tv-player-bottombar {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}
.tv-player-back {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text2);
  font-size: 12.5px; font-weight: 700;
  padding: 8px 14px; border-radius: 10px;
  cursor: pointer; transition: all .2s;
  flex-shrink: 0;
}
.tv-player-back:hover { background: rgba(255,255,255,.1); color: var(--text); }

.tv-player-bottombar-meta {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; flex: 1;
}
.tv-channel-logo-sm {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.tv-channel-logo-sm img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.tv-channel-name-live {
  font-weight: 800; font-size: 15px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-channel-program {
  font-size: 12px; color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tv-channel-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.tv-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  cursor: pointer; transition: all .2s;
  color: var(--text2);
}
.tv-action-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }
.tv-action-btn.active { background: rgba(245,166,35,.15); border-color: rgba(245,166,35,.4); color: var(--gold); }
.tv-action-btn.report-btn:hover { background: rgba(232,48,74,.15); border-color: rgba(232,48,74,.3); color: var(--red2); }

/* ── ÉCRAN DU LECTEUR ── */
.tv-player-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
}
.tv-player-screen iframe,
.tv-player-screen video {
  width: 100%; height: 100%;
  border: none; display: block;
}
.tv-player-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; color: var(--text2);
}
.tv-player-placeholder svg { opacity: .3; }
.tv-player-placeholder span { font-size: 14px; opacity: .6; }

.tv-player-placeholder-logo {
  display: flex; align-items: center; justify-content: center;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: rgba(245,166,35,.08);
  border: 2px solid rgba(245,166,35,.2);
}
.tv-player-placeholder-name {
  font-size: 19px; font-weight: 800; color: var(--text);
  margin-top: 4px;
}
.tv-player-placeholder-program { font-size: 13px; color: var(--text2); }
.tv-player-placeholder-live {
  display: flex; align-items: center; gap: 7px;
  margin-top: 4px;
}
.tv-player-placeholder-live span {
  font-size: 12px; color: var(--red2); font-weight: 700; opacity: 1;
}
.tv-player-placeholder-text {
  margin-top: 18px; max-width: 340px; text-align: center;
  color: var(--muted); font-size: 12.5px; line-height: 1.7;
}
.tv-player-placeholder-text strong { color: var(--text2); }
.tv-player-placeholder-text a {
  color: var(--gold); text-decoration: none; font-weight: 700;
  margin-top: 10px; display: inline-block;
}
.tv-player-placeholder-text a:hover { color: var(--gold2); }

/* En plein écran natif, la barre de contrôles (overlay) suit le même comportement */

/* ── MODAL SIGNALEMENT ── */
.tv-report-modal {
  position: fixed; inset: 0;
  z-index: 100000020;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
}
.tv-report-modal.open { display: flex; }
.tv-report-box {
  background: var(--s1);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 28px;
  width: 380px; max-width: calc(100vw - 32px);
  box-shadow: 0 24px 80px rgba(0,0,0,.8);
  animation: tv-modal-in .25s cubic-bezier(.34,1.4,.64,1);
}
@keyframes tv-modal-in {
  from { opacity: 0; transform: scale(.9) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.tv-report-box h3 {
  font-family: var(--ff-head); font-size: 18px; font-weight: 800;
  color: var(--text); margin-bottom: 8px;
}
.tv-report-box p { font-size: 13.5px; color: var(--text2); margin-bottom: 16px; }
.tv-report-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.tv-report-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; cursor: pointer; transition: all .2s;
}
.tv-report-option:hover, .tv-report-option.selected {
  background: rgba(232,48,74,.1);
  border-color: rgba(232,48,74,.3);
}
.tv-report-option input[type=radio] { accent-color: var(--red2); }
.tv-report-option span { font-size: 14px; color: var(--text); cursor: pointer; }
.tv-report-actions { display: flex; gap: 10px; }
.tv-report-cancel {
  flex: 1; padding: 11px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; color: var(--text2);
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.tv-report-cancel:hover { background: rgba(255,255,255,.1); color: var(--text); }
.tv-report-submit {
  flex: 1; padding: 11px;
  background: var(--red);
  border: none; border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.tv-report-submit:hover { background: var(--red2); }

/* ── TOAST TV ── */
.tv-toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 100000030;
  background: var(--s2); border: 1px solid rgba(255,255,255,.12);
  color: var(--text); font-size: 13.5px; font-weight: 600;
  padding: 10px 20px; border-radius: 30px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  pointer-events: none; opacity: 0;
  transition: all .3s cubic-bezier(.34,1.4,.64,1);
  white-space: nowrap;
}
.tv-toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* Lecteur TV plein écran — masquer la barre mobile */
body.tv-player-open .mobile-bottom-bar,
body.tv-player-open .mobile-nav-sheet {
  display: none !important;
}

/* ── LECTEUR — barre sources (sous la barre retour, visible au mouvement) ── */
.tv-player-overlay-top {
  position: absolute;
  top: max(70px, calc(env(safe-area-inset-top, 0px) + 62px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  pointer-events: none;
}
.tv-source-bar {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(8, 8, 16, .72);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
}
.tv-source-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .72);
  background: transparent;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}
.tv-source-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}
.tv-source-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(247, 127, 0, .95), rgba(168, 85, 247, .85));
  box-shadow: 0 4px 18px rgba(247, 127, 0, .35);
}
.tv-source-btn:disabled,
.tv-source-btn[aria-disabled="true"] {
  opacity: .38;
  cursor: not-allowed;
  color: rgba(255, 255, 255, .45);
  background: transparent;
  box-shadow: none;
}
.tv-player-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
}
.tv-player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(255, 255, 255, .75);
  font-size: 14px;
}
.tv-player-loading-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: var(--gold, #f77f00);
  animation: tv-spin .8s linear infinite;
}
@keyframes tv-spin { to { transform: rotate(360deg); } }
.tv-player-error-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted, rgba(255, 255, 255, .55));
}
.tv-player-fs-wrap.tv-controls-hidden .tv-player-overlay-top {
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.tv-player-fs-wrap:not(.tv-controls-hidden) .tv-player-overlay-top {
  opacity: 1;
  transition: opacity .25s ease;
}

/* Au-dessus de l'iframe uniquement quand le chrome est masqué → détecte le mouvement souris */
.tv-controls-catcher {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background: transparent;
}
.tv-player-fs-wrap.tv-controls-hidden .tv-controls-catcher {
  pointer-events: auto;
}

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 900px) {
  .tv-select-header {
    flex-direction: column;
    align-items: stretch;
  }
  .tv-select-search { min-width: 0; }
  .tv-title { font-size: 22px; }
  .tv-shortcuts-row { grid-template-columns: 1fr; }
  .tv-channels-filter { justify-content: flex-start; }
  .tv-channel-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  .tv-channel-card { padding: 20px 10px 16px; }
  .tv-channel-card-logo { width: 58px; height: 58px; }
  .tv-player-mobile-close { display: flex; }
}

@media (max-width: 480px) {
  .tv-select-step { padding: 0 14px 48px; }
  .tv-channel-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .tv-player-bottombar { padding: 10px 12px; gap: 10px; }
  .tv-player-back span { display: none; }
  .tv-channel-program { display: none; }
}

/* ══════════════════════════════════════════════════════
   TV LIVE REDESIGN — hero / populaires / parcourir / rails
══════════════════════════════════════════════════════ */
.tv-select-step {
  padding: 0 clamp(18px, 4vw, 48px) 80px;
  max-width: 1280px;
  margin: 0 auto;
}

.tv-hero {
  padding: 28px 0 36px;
  text-align: center;
  position: relative;
}
.tv-hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}
.tv-hero__top .tv-country-selector {
  margin: 0;
  z-index: 40;
}
.tv-hero__live {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 14px;
}
.tv-hero__title {
  margin: 0 0 14px;
  font-family: var(--font-display, 'Instrument Serif', Georgia, serif);
  font-size: clamp(2.75rem, 7vw, 4.25rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
}
.tv-hero__desc {
  margin: 0 auto 10px;
  max-width: 420px;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 400;
}
.tv-hero__count {
  margin: 0 0 22px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.42);
  font-weight: 500;
}
.tv-hero__search {
  max-width: 560px;
  margin: 0 auto;
  min-width: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
}
.tv-hero__search input {
  font-size: 14.5px;
}

.tv-browse {
  display: flex;
  flex-direction: column;
  gap: 42px;
}

.tv-sec__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.tv-sec__head--list {
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.tv-sec__titles { min-width: 0; }
.tv-sec__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.tv-sec__sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}
.tv-sec__link {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: #8b9cff;
  transition: color 0.15s, opacity 0.15s;
}
.tv-sec__link:hover { color: #b4c0ff; }

.tv-back-browse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tv-back-browse:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

/* Rails horizontales */
.tv-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.tv-rail::-webkit-scrollbar { height: 6px; }
.tv-rail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

/* Cartes chaînes (nouveau) */
.tv-ch-card {
  flex: 0 0 auto;
  width: 168px;
  scroll-snap-align: start;
  cursor: pointer;
  text-align: left;
  font-family: var(--ff-body, inherit);
  transition: transform 0.2s ease;
}
.tv-ch-card:hover { transform: scale(1.04); }
.tv-ch-card:focus-visible {
  outline: 2px solid var(--accent-bright, #b8aaf9);
  outline-offset: 3px;
  border-radius: 12px;
}
.tv-ch-card--sm { width: 140px; }

.tv-ch-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%),
    rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.tv-ch-card:hover .tv-ch-card__thumb {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 45%),
    rgba(255, 255, 255, 0.07);
}
.tv-ch-card__live {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ff6b7a;
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 7px;
  border-radius: 999px;
}
.tv-ch-card__thumb .tv-fav-star {
  z-index: 2;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}
.tv-ch-card__logo {
  width: 58%;
  max-width: 88px;
  height: 48%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tv-ch-card__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}
.tv-ch-card__logo .tv-logo-fallback {
  font-weight: 800;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  line-height: 1.2;
}
.tv-ch-card--sm .tv-ch-card__logo {
  max-width: 70px;
}
.tv-ch-card__meta {
  padding: 10px 2px 0;
}
.tv-ch-card__name {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-ch-card__country {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.42);
}
.tv-ch-card__country .tv-live-dot {
  width: 5px;
  height: 5px;
}

/* Grille catégorie / recherche */
.tv-ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 18px 14px;
}
.tv-ch-grid .tv-ch-card {
  width: auto;
}

/* Catégories — tuiles Parcourir */
.tv-cat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.tv-cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 112px;
  padding: 18px 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s, background 0.18s;
  font-family: inherit;
}
.tv-cat-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
}
.tv-cat-tile__icon {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.55);
}
.tv-cat-tile__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.tv-cat-tile__name {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.tv-cat-tile__count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

/* Skeletons accueil */
.tv-skeleton-home { display: flex; flex-direction: column; gap: 36px; }
.tv-sk-rail {
  display: flex;
  gap: 14px;
  overflow: hidden;
}
.tv-sk-rail .tv-sk-card {
  flex: 0 0 168px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0;
  height: 148px;
}
.tv-sk-cats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.tv-sk-cat {
  height: 112px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  animation: tv-shimmer 1.4s ease infinite;
}

.tv-empty--inline {
  padding: 24px 0;
  text-align: left;
}

@media (max-width: 1100px) {
  .tv-cat-grid,
  .tv-sk-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .tv-hero { padding: 18px 0 28px; text-align: left; }
  .tv-hero__desc { margin-left: 0; margin-right: 0; }
  .tv-hero__search { margin: 0; }
  .tv-cat-grid,
  .tv-sk-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tv-ch-card { width: 148px; }
  .tv-ch-card--sm { width: 128px; }
  .tv-browse { gap: 34px; }
}
@media (max-width: 560px) {
  .tv-hero__top { flex-wrap: wrap; }
  .tv-hero__title { font-size: 2.5rem; }
  .tv-cat-grid,
  .tv-sk-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv-ch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
  .tv-cat-tile { min-height: 100px; padding: 16px 10px 14px; }
  .tv-sec__title { font-size: 1.2rem; }
}
