/* ROMÂNIA+ — thème sombre. Accent cobalt, motif de losanges empilés :
   la Colonne sans fin de Brâncuși, qui est aussi le losange (rombul) de la
   broderie roumaine. Aucun élément grec ne subsiste.
   Épure : relief par lumière et ombre, pas de traits. */

:root {
  --bg: #06080d;
  --bg-elev: #0d121d;
  --panel: #131a29;
  --text: #eef1f7;
  --muted: #8b94a7;
  --cobalt: #6f8dff;
  --or: #f2b544;
  --live: #ff3b4d;
  --ok: #2ee6a8;
  --warn: #ffb454;
  --radius: 14px;
  --header-h: 64px;
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }

/* ---------- barre haute ---------- */
#topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 28px;
  background: linear-gradient(180deg, rgba(6, 8, 13, 0.95), rgba(6, 8, 13, 0.72));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: 0.06em; }
.logo-plus { color: var(--cobalt); }
#topbar nav { display: flex; gap: 6px; }
.navlink {
  padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-weight: 500; font-size: 0.95rem;
  transition: color 0.18s, background 0.18s;
}
.navlink:hover { color: var(--text); }
.navlink.is-active { color: var(--text); background: rgba(255, 255, 255, 0.09); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.82rem; color: var(--muted); white-space: nowrap;
}
.pill-vpn { transition: background 0.2s; }
.pill-vpn:hover { background: rgba(255, 255, 255, 0.14); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.is-ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.is-warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--text); opacity: 0.85;
  transition: background 0.18s, opacity 0.18s;
}
.iconbtn:hover { background: rgba(255, 255, 255, 0.1); opacity: 1; }

/* ---------- vues ---------- */
.view { display: none; }
.view.is-visible { display: block; }
#view-home, #view-channels, #view-replay, #view-guide, #view-settings {
  padding: calc(var(--header-h) + 24px) 28px 60px;
  max-width: 1500px; margin: 0 auto;
}

/* ---------- héros ---------- */
.hero {
  position: relative;
  border-radius: 22px;
  min-height: 320px;
  display: flex; align-items: center;
  overflow: hidden;
  padding: 44px 52px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='120' viewBox='0 0 72 120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.055' stroke-width='3'%3E%3Cpath d='M36 4 66 30 36 56 6 30Z'/%3E%3Cpath d='M36 64 66 90 36 116 6 90Z'/%3E%3Cpath d='M36 20 52 30 36 40 20 30Z' stroke-opacity='0.035'/%3E%3Cpath d='M36 80 52 90 36 100 20 90Z' stroke-opacity='0.035'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(900px 420px at 88% 18%, rgba(242, 181, 68, 0.10), transparent 62%),
    radial-gradient(1200px 520px at 20% 85%, rgba(111, 141, 255, 0.16), transparent 60%),
    linear-gradient(120deg, #101427 0%, #0b0f1f 55%, #06080d 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.hero-inner { position: relative; z-index: 2; max-width: 60%; }
.hero-live {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 10px var(--live);
  animation: pulse 2s ease-in-out infinite;
  display: inline-block; flex: none;
}
@keyframes pulse { 50% { opacity: 0.45; } }
.hero-title { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 800; letter-spacing: 0.01em; line-height: 1.05; }
.hero-sub { color: var(--muted); margin-top: 12px; font-size: 1.05rem; font-weight: 300; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; }
.hero-logo {
  position: absolute; right: 52px; top: 50%; transform: translateY(-50%);
  width: 240px; height: 240px; z-index: 1;
  background-position: center; background-size: contain; background-repeat: no-repeat;
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.55));
  opacity: 0.95;
}

.btn-primary {
  background: var(--text); color: #0a0c12;
  font-weight: 700; font-size: 1rem;
  padding: 13px 30px; border-radius: 999px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.btn-primary:hover { transform: scale(1.04); box-shadow: 0 8px 30px rgba(255, 255, 255, 0.18); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text); font-weight: 500;
  padding: 13px 24px; border-radius: 999px;
  transition: background 0.18s;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- rails ---------- */
.rail-section { margin-top: 42px; }
.rail-section h2, .page-head h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.01em; margin-bottom: 16px; }
.rail {
  display: flex; gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
/* a la souris, rien ne disait que les rangees defilent : les favoris 6 et 7
   etaient invisibles sans aucun indice (audit 27/07, n9) */
@media (hover: hover) {
  .rail { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.22) transparent; padding-bottom: 14px; }
  .rail::-webkit-scrollbar { display: block; height: 8px; }
  .rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 99px; }
  .rail::-webkit-scrollbar-track { background: transparent; }
}

.card {
  position: relative;
  flex: 0 0 210px;
  scroll-snap-align: start;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--panel), var(--bg-elev) 70%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 0 1.5px rgba(111, 141, 255, 0.55);
  z-index: 2;
}
.card img { max-width: 62%; max-height: 52%; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5)); }
.card .mono { font-size: 1.6rem; font-weight: 800; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.92); }
.card .badge-live {
  position: absolute; top: 10px; left: 10px;
  display: flex; align-items: center; gap: 5px;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 4px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
}
.card .badge-geo {
  position: absolute; top: 36px; left: 10px;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em;
  padding: 4px 8px; border-radius: 6px;
  background: var(--warn); color: #1c1204;
}
.card .badge-ok { background: var(--ok); color: #032015; }
.card .badge-ko { background: #454b59; color: #dfe3ec; }
/* Sept chaînes savent se sous-titrer, l'annuaire en propose cent-sept : la
   pastille le dit sur la carte, en haut
   à GAUCHE, sous l'étiquette de VPN : le coin haut-droit est déjà pris par
   l'étoile des favoris. */
.etats {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  margin: 14px 0 4px; color: #b6bdcb; font-size: 0.9rem; font-weight: 400;
}
.lg { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 6px; margin-right: 6px; }
.lg-ok { background: var(--ok); color: #032015; }
.lg-vpn { background: var(--warn); color: #1c1204; }
.lg-ko { background: #454b59; color: #dfe3ec; }
.card .card-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 22px 12px 9px;
  font-size: 0.85rem; font-weight: 600;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- grille toutes chaînes ---------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin-bottom: 8px; flex-wrap: wrap;
}
.page-head .count { color: var(--muted); font-weight: 400; font-size: 1rem; }
#ch-search {
  background: var(--panel); border: 0;
  color: var(--text); font: inherit;
  padding: 12px 20px; border-radius: 999px; width: 320px; max-width: 100%;
}
#ch-search::placeholder { color: var(--muted); }
.page-intro { color: var(--muted); max-width: 640px; margin-bottom: 26px; font-weight: 300; line-height: 1.55; }
.grid {
  display: grid; gap: 14px; margin-top: 18px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.grid .card { flex: none; width: 100%; }

/* ---------- replay ---------- */
.replay-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.replay-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 26px;
  background: linear-gradient(160deg, var(--panel), var(--bg-elev) 75%);
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
}
.replay-card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); }
.replay-card h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: 0.03em; }
.replay-card p { color: var(--muted); font-weight: 300; line-height: 1.5; flex: 1; }
.replay-card .chip { align-self: flex-start; }

/* ---------- lecteur ---------- */
#view-player { position: fixed; inset: 0; z-index: 100; background: #000; }
#player-stage { position: absolute; inset: 0; }
#video { width: 100%; height: 100%; object-fit: contain; background: #000; }

#player-ui { position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
#player-ui.is-shown { opacity: 1; pointer-events: auto; }
.player-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 22px 26px 60px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent);
}
.player-chinfo { display: flex; align-items: center; gap: 14px; }
.player-chinfo img { height: 44px; max-width: 90px; object-fit: contain; }
.p-name { font-size: 1.3rem; font-weight: 800; letter-spacing: 0.03em; }
.p-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.82rem; letter-spacing: 0.08em; margin-top: 2px; }

.player-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 60px 26px 18px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent);
}
.player-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.player-controls .spacer { flex: 1; }
#volume { width: 110px; accent-color: var(--cobalt); }
.chip {
  display: inline-flex; align-items: center;
  padding: 8px 15px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.85rem; font-weight: 500;
  transition: background 0.18s;
}
.chip:hover { background: rgba(255, 255, 255, 0.18); }
/* Bouton dont l'action n'a rien a offrir sur cette chaine : il reste cliquable,
   il explique pourquoi, mais il ne promet plus rien. */
.chip-off { opacity: 0.45; }

.zaprail { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.zaprail::-webkit-scrollbar { display: none; }
.zapitem {
  flex: 0 0 128px; height: 74px;
  border-radius: 10px;
  background: rgba(19, 26, 41, 0.85);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.16s, box-shadow 0.16s;
  position: relative;
}
.zapitem img { max-width: 64%; max-height: 56%; object-fit: contain; }
.zapitem .mono { font-weight: 700; font-size: 0.95rem; }
.zapitem:hover { transform: translateY(-3px); }
.zapitem.is-current { box-shadow: 0 0 0 2px var(--cobalt), 0 6px 22px rgba(111, 141, 255, 0.28); }
.zapitem .num {
  position: absolute; top: 4px; left: 7px;
  font-size: 0.65rem; color: var(--muted); font-weight: 600;
}

.unmute-banner {
  position: absolute; top: 84px; right: 26px;
  background: var(--text); color: #0a0c12;
  font-weight: 700; padding: 11px 22px; border-radius: 999px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
}

#player-error { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(3, 4, 8, 0.88); }
.error-card { max-width: 460px; text-align: center; padding: 40px; }
.error-card h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 12px; }
.error-card p { color: var(--muted); line-height: 1.6; margin-bottom: 26px; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

#player-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background: rgba(3, 4, 8, 0.6); pointer-events: none;
}
#player-loading p { color: var(--muted); font-size: 0.9rem; letter-spacing: 0.06em; }
.loader {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--cobalt);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modale ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(3, 4, 8, 0.7); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 20px 20px; overflow-y: auto;
}
.modal {
  width: 100%; max-width: 620px;
  background: var(--bg-elev);
  border-radius: 18px; padding: 30px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h2 { font-size: 1.4rem; font-weight: 800; }
.set-block { margin-top: 26px; }
.set-block h3 { font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.set-line { color: var(--text); font-weight: 300; line-height: 1.55; margin-bottom: 10px; }
.override-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.override-row label { flex: 0 0 74px; font-weight: 600; font-size: 0.9rem; }
.override-row input {
  flex: 1; background: var(--panel); border: 0;
  color: var(--text); font-size: 0.8rem; font-family: monospace;
  padding: 9px 12px; border-radius: 8px; min-width: 0;
}

#toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 300;
  background: var(--bg-elev);
  padding: 12px 22px; border-radius: 999px;
  font-size: 0.9rem; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.footer-note { margin-top: 70px; }
.footer-note p { color: var(--muted); font-size: 0.82rem; font-weight: 300; line-height: 1.6; max-width: 700px; }

/* ---------- croix de fermeture ---------- */
.btn-fermer {
  background: rgba(0, 0, 0, 0.45);
  flex: none;
}
.btn-fermer:hover { background: rgba(255, 59, 77, 0.85); }
.player-top .btn-fermer { margin-left: 10px; }
.viewer-bar .btn-fermer { margin-right: 2px; }

/* ---------- favoris : glisser-déposer pour réordonner ---------- */
.card-fav .poignee {
  position: absolute; bottom: 6px; right: 8px; z-index: 3;
  font-size: 0.95rem; line-height: 1;
  color: rgba(255, 255, 255, 0.35);
  cursor: grab;
  padding: 4px 2px;
  touch-action: none;
  opacity: 0; transition: opacity 0.15s, color 0.15s;
}
.card-fav:hover .poignee { opacity: 1; }
.card-fav .poignee:hover { color: var(--cobalt); }
.card-fav.is-dragging { opacity: 0.4; cursor: grabbing; }
.card-fav.drop-avant { box-shadow: inset 3px 0 0 var(--cobalt), 0 14px 40px rgba(0, 0, 0, 0.55); }
.card-fav.drop-apres { box-shadow: inset -3px 0 0 var(--cobalt), 0 14px 40px rgba(0, 0, 0, 0.55); }

/* ---------- étoiles favoris ---------- */
.h2-hint { font-size: 0.78rem; font-weight: 300; color: var(--muted); margin-left: 10px; letter-spacing: 0; }
.star {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 1.2rem; line-height: 1;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.45);
  opacity: 0; transition: opacity 0.15s, color 0.15s, transform 0.15s;
}
.card:hover .star, .card:focus-within .star, .star.is-fav { opacity: 1; }
.star.is-fav { color: #ffd257; text-shadow: 0 0 12px rgba(255, 210, 87, 0.85); }
.star:hover { transform: scale(1.18); }
.star-player {
  position: static; opacity: 1; margin-left: auto;
  width: 42px; height: 42px; font-size: 1.3rem;
  background: rgba(0, 0, 0, 0.4);
}

/* ---------- lecteur : programme en cours ---------- */
.program-bar { max-width: 560px; margin-bottom: 12px; }
.program-now { display: flex; align-items: baseline; gap: 12px; }
.program-title { font-weight: 700; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.program-time { color: var(--muted); font-size: 0.82rem; flex: none; }
.program-progress { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); margin: 8px 0 6px; overflow: hidden; }
.program-progress-fill { height: 100%; width: 0%; background: var(--cobalt); border-radius: 2px; }
.program-next { color: var(--muted); font-size: 0.82rem; font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-live { background: rgba(255, 59, 77, 0.25); color: #ffb3bb; font-weight: 700; }
.chip.is-on { background: rgba(111, 141, 255, 0.3); color: #cfd9ff; font-weight: 700; }

/* ---------- programme TV (grille) ---------- */
.guide { background: var(--bg-elev); border-radius: 16px; overflow: hidden; }
.guide-scroller {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - var(--header-h) - 130px);
  scrollbar-width: thin;
}
.guide-ruler {
  position: sticky; top: 0; z-index: 5;
  height: 34px;
  background: #090c13;
}
.guide-ruler .hourmark {
  position: absolute; top: 0; height: 100%;
  display: flex; align-items: center;
  font-size: 0.72rem; color: var(--muted); font-weight: 600;
  padding-left: 8px;
}
.guide-row { position: relative; height: 76px; }
.guide-row:nth-child(odd) { background: rgba(255, 255, 255, 0.015); }
.guide-ch {
  position: sticky; left: 0; z-index: 4;
  width: 190px; height: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  background: #090c13;
  cursor: pointer;
}
.guide-ch img { max-width: 46px; max-height: 34px; object-fit: contain; flex: none; }
.guide-ch .guide-ch-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-ch:hover .guide-ch-name { color: var(--cobalt); }
.guide-prog {
  position: absolute; top: 8px; height: 60px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 10px;
  overflow: hidden;
  text-align: left;
  transition: background 0.15s;
}
.guide-prog:hover { background: rgba(111, 141, 255, 0.16); }
.guide-prog.is-now { background: rgba(111, 141, 255, 0.14); box-shadow: inset 0 0 0 1.5px rgba(111, 141, 255, 0.6); }
.guide-prog .gp-title { display: block; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 200px; }
.guide-prog .gp-time { display: block; font-size: 0.7rem; color: var(--muted); margin-top: 3px; position: sticky; left: 200px; }
.guide-nowline {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
  z-index: 3; pointer-events: none;
}

/* ---------- visionneuse replay ---------- */
#view-viewer { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: none; flex-direction: column; }
#view-viewer.is-visible { display: flex; }
.viewer-bar {
  height: var(--header-h); flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  background: var(--bg-elev);
}
.viewer-title { font-weight: 800; letter-spacing: 0.03em; }
.viewer-hint { color: var(--muted); font-size: 0.78rem; font-weight: 300; margin-left: auto; }
#viewer-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---------- réglages (vue) ---------- */
.settings-cols { display: grid; gap: 12px 40px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); max-width: 1000px; }
.btn-inline { padding: 6px 14px; font-size: 0.85rem; }
.set-line-small { color: var(--muted); font-size: 0.85rem; }
.mono-mini { font-weight: 700; font-size: 0.8rem; }
#video::cue { background: rgba(0, 0, 0, 0.65); color: #fff; font-family: 'Outfit', sans-serif; }

/* ---------- responsive : sur mobile, navigation en barre d'onglets basse ---------- */
@media (max-width: 860px) {
  /* pas de flou sur la barre haute : un ancetre a backdrop-filter emprisonnerait
     la barre d'onglets fixe (containing block), elle resterait collee en haut */
  #topbar { padding: 0 14px; gap: 10px; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(6, 8, 13, 0.97); }
  .logo { font-size: 1.15rem; }
  .pill-clock { display: none; }
  #vpn-label { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pill-vpn { padding: 6px 10px; font-size: 0.72rem; }

  #topbar nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; justify-content: space-around; gap: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(6, 8, 13, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
  }
  .navlink { padding: 9px 10px; font-size: 0.8rem; font-weight: 600; }

  #view-home, #view-channels, #view-replay, #view-guide, #view-settings {
    padding: calc(var(--header-h) + 10px) 14px calc(92px + env(safe-area-inset-bottom));
  }

  .hero { padding: 24px 20px; min-height: 200px; border-radius: 16px; }
  .hero-inner { max-width: 100%; }
  .hero-logo { display: none; }
  .hero-sub { font-size: 0.95rem; }
  .hero-actions .btn-ghost { display: none; }
  .h2-hint { display: none; }
  .etats { font-size: 0.76rem; gap: 6px 10px; }

  .card { flex-basis: 150px; }
  .card-fav .poignee { opacity: 1; font-size: 1.15rem; padding: 8px 6px; bottom: 2px; right: 4px; }
  .card .badge-live { display: none; }
  .card .badge-geo { top: 8px; left: 8px; font-size: 0.62rem; padding: 3px 6px; }
  .card img { max-height: 42%; }
  .card .card-name { font-size: 0.78rem; padding-bottom: 7px; }
  .star { width: 30px; height: 30px; font-size: 1.05rem; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  #ch-search { width: 100%; }
  .page-head { margin-bottom: 4px; }

  .guide-ch { width: 116px; padding: 0 8px; gap: 6px; }
  .guide-ch img { max-width: 32px; max-height: 26px; }
  .guide-ch .guide-ch-name { font-size: 0.72rem; }
  .guide-prog .gp-title, .guide-prog .gp-time { left: 124px; }
  .guide-scroller { max-height: calc(100vh - var(--header-h) - 190px); }

  .player-top { padding: 14px 12px 40px; }
  .player-bottom { padding: 40px 12px calc(10px + env(safe-area-inset-bottom)); }
  .player-controls { flex-wrap: wrap; row-gap: 6px; }
  .player-chinfo img { height: 28px; }
  .p-name { font-size: 1.05rem; }
  #volume { display: none; }
  .chip { padding: 7px 12px; font-size: 0.78rem; }
  .zapitem { flex: 0 0 100px; height: 60px; }
  .program-bar { max-width: 100%; }

  .replay-card { padding: 20px; }
  .viewer-hint { display: none; }
  .unmute-banner { top: 70px; right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* adresse du Mac dans les Reglages : champ + bouton sur une ligne */
.set-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.set-inline input[type="url"] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}
.set-inline input[type="url"]::placeholder { color: var(--muted); }

/* numero de version : discret, meme matiere que le texte d'ambiance */
.version-tag { color: var(--muted); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em; }
.page-head .version-tag { margin-left: 10px; vertical-align: middle; }

/* guide de bienvenue : gros texte, gros boutons, lisible par tous */
#tuto {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.tuto-carte {
  width: min(540px, 94vw);
  border-radius: 22px;
  padding: 34px 34px 28px;
  background: linear-gradient(160deg, #131a29, #0d121d 70%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  text-align: center;
}
.tuto-logo { font-weight: 800; font-size: 1.1rem; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 18px; }
.tuto-carte h2 {
  font-size: 1.7rem; font-weight: 800; margin-bottom: 14px;
  font-family: 'Outfit', -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
.tuto-carte p#tuto-texte { font-size: 1.18rem; font-weight: 300; line-height: 1.55; color: #d6dce8; min-height: 5.2em; }
.tuto-points { display: flex; gap: 8px; justify-content: center; margin: 18px 0 22px; }
.tuto-point { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.tuto-point.est-la { background: var(--cobalt); }
.tuto-actions { display: flex; gap: 12px; justify-content: center; }
.tuto-actions .btn-primary, .tuto-actions .btn-ghost { font-size: 1.05rem; padding: 14px 30px; }
@media (max-width: 520px) {
  .tuto-carte { padding: 26px 20px 22px; }
  .tuto-carte h2 { font-size: 1.4rem; }
  .tuto-carte p#tuto-texte { font-size: 1.05rem; }
}

/* au doigt (telephone, tablette) il n'y a pas de survol : l'etoile des favoris
   doit etre visible en permanence, sinon le geste enseigne par le guide est
   impossible (audit 27/07, bloquant n1) */
@media (hover: none) {
  /* au doigt : l'etoile est toujours visible, et sa zone de touche fait 44 px
     (norme Apple) sans que le dessin grossisse (audit 27/07, n1 et n3) */
  .star { opacity: 1 !important; width: 44px; height: 44px; font-size: 1.15rem; }
  .card .poignee { width: 44px; height: 44px; }
  .tabbar button, .tabbar a { min-height: 44px; font-size: 0.94rem; }
}

/* detail d'une emission du guide TV : lisible au doigt, titre complet */
#prog-detail {
  position: fixed; inset: 0; z-index: 92;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 6, 10, 0.78);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pd-carte {
  width: min(460px, 94vw); border-radius: 20px; padding: 26px 24px 20px;
  background: linear-gradient(160deg, #131a29, #0d121d 70%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.pd-carte h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.35; margin-bottom: 10px; }
.pd-carte p { color: var(--muted); font-size: 1rem; margin-bottom: 20px; }
.pd-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.pd-actions .btn-primary, .pd-actions .btn-ghost { min-height: 44px; padding: 12px 22px; }

/* Menu déroulant de langue : ressemble à une pastille, se comporte en select
   natif (donc lisible et accessible sur tous les navigateurs, mobile compris). */
.chip-select { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chip-select::after {
  content: '';
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .75;
}
.chip-select select {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
  font-size: 16px;           /* iOS ne zoome pas sur un champ à 16 px */
  -webkit-appearance: none; appearance: none;
  border: 0; background: transparent; color: inherit;
}
