/* =====================================================================
   FREECOM IPTV — Application client
   Direction : « salle de diffusion nocturne » — encre profonde, signal
   bleu électrique → vert lime (logo), tickets perforés, focus TV lumineux.
   ===================================================================== */

:root {
  --ink: #05070D;
  --bg: #070B14;
  --surface: #0C1220;
  --raised: #121A2C;
  --raised-2: #18223A;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #EEF3FF;
  --muted: #8A97B2;
  --faint: #5A6680;
  --blue: #1E6BFF;
  --blue-hi: #4C8DFF;
  --lime: #A6F000;
  --lime-hi: #C4FF3D;
  --danger: #FF4D5E;
  --warn: #FFB020;
  --ok: #2BD67B;
  --cyan: #00D1FF;
  --radius: 14px;
  --radius-sm: 9px;

  --f-display: "Unbounded", "Arial Black", sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 64px);
  --header-h: 72px;
  --card-w: clamp(128px, 13vw, 210px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --focus-ring: 0 0 0 3px var(--lime), 0 0 0 7px rgba(166, 240, 0, .18), 0 18px 50px -10px rgba(30, 107, 255, .55);
}

/* Interface 10-foot (téléviseurs) : tout est agrandi */
html.tv { font-size: 20px; --header-h: 88px; --card-w: 230px; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html.tv body { font-size: 20px; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--lime); color: var(--ink); }

/* Atmosphère : halo de signal + grain */
body::before {
  content: ""; position: fixed; inset: -20vh -10vw auto auto; width: 90vw; height: 80vh; z-index: -2;
  background:
    radial-gradient(closest-side, rgba(30, 107, 255, .22), transparent 70%) 10% 20% / 60% 80% no-repeat,
    radial-gradient(closest-side, rgba(166, 240, 0, .10), transparent 70%) 80% 0% / 50% 60% no-repeat;
  filter: blur(20px); pointer-events: none;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------ Focus TV */
:focus { outline: none; }
:focus-visible, .focusable:focus, html.tv :focus {
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}
.card:focus, .card:focus-visible { box-shadow: none; }

/* ============================================================== SPLASH */
.splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--ink);
  transition: opacity .6s var(--ease), visibility .6s;
}
.splash.done { opacity: 0; visibility: hidden; }
.splash__inner { display: grid; justify-items: center; gap: 28px; width: min(560px, 86vw); }

.splash__logo { width: min(380px, 70vw); filter: drop-shadow(0 0 40px rgba(30, 107, 255, .35)); animation: splashIn 1.1s var(--ease) both; }
.splash__text { font: 600 clamp(14px, 1.6vw, 20px)/1.3 var(--f-display); letter-spacing: .02em; text-align: center; animation: fadeUp .8s .3s var(--ease) both; }
.splash__bar { width: 100%; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.splash__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--lime)); box-shadow: 0 0 18px var(--lime); transition: width .45s var(--ease); }
.splash__step { font: 500 13px var(--f-mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; min-height: 1.4em; }
@keyframes splashIn { from { opacity: 0; transform: scale(.92); filter: blur(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================================================= TICKET GATE */
.gate {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center;
  gap: clamp(24px, 5vw, 80px); padding: 40px var(--gutter);
  position: relative; overflow: hidden;
}
.gate::before { /* grand trait de signal diagonal, écho du logo */
  content: ""; position: absolute; left: -10%; top: 58%; width: 130%; height: 2px; transform: rotate(-11deg);
  background: linear-gradient(90deg, transparent, var(--blue) 30%, var(--lime) 70%, transparent);
  box-shadow: 0 0 30px var(--blue); opacity: .55;
}
.gate__brand { position: relative; z-index: 1; animation: fadeUp .9s var(--ease) both; }
.gate__brand picture img { width: min(460px, 80%); margin-left: -3%; }
.gate__title { font: 800 clamp(30px, 4.4vw, 68px)/1.02 var(--f-display); letter-spacing: -.02em; margin: 18px 0 14px; }
.gate__title em { font-style: normal; background: linear-gradient(95deg, var(--blue-hi), var(--lime)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate__slogan { color: var(--muted); font-size: 1.1rem; max-width: 30ch; }
.gate__how { display: flex; gap: 22px; margin-top: 30px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.gate__how b { display: block; font: 700 1.4rem var(--f-display); color: var(--text); }

/* Le ticket perforé : élément signature */
.stub {
  position: relative; z-index: 1; padding: clamp(24px, 3vw, 40px);
  --pad: clamp(24px, 3vw, 40px);
  background: linear-gradient(160deg, var(--raised-2), var(--surface) 60%);
  border-radius: 22px;
  box-shadow: 0 40px 120px -40px rgba(30, 107, 255, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: fadeUp .9s .15s var(--ease) both;
}

.stub__label { font: 700 .78rem var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--lime); }
.stub__h { font: 700 clamp(20px, 2vw, 28px)/1.2 var(--f-display); margin: 8px 0 22px; }
.code-input {
  width: 100%; padding: 18px 20px; border-radius: var(--radius); border: 2px solid var(--line-2);
  background: var(--ink); font: 700 clamp(22px, 2.6vw, 34px) var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  text-align: center; transition: border-color .2s, box-shadow .2s;
}
.code-input::placeholder { color: var(--faint); }
.code-input:focus { border-color: var(--lime); box-shadow: 0 0 0 6px rgba(166, 240, 0, .12); }
.stub__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0 0; }
.stub__foot, .ticket-card__foot { position: relative; margin-top: 28px; padding-top: 28px; }
.stub__foot::before, .ticket-card__foot::before { /* ligne de découpe + encoches */
  content: ""; position: absolute; top: -16px; left: calc(-1 * var(--pad) - 16px); right: calc(-1 * var(--pad) - 16px); height: 32px;
  background: radial-gradient(circle at 0 50%, var(--bg) 16px, transparent 17px), radial-gradient(circle at 100% 50%, var(--bg) 16px, transparent 17px);
}
.stub__foot::after, .ticket-card__foot::after { content: ""; position: absolute; top: -1px; left: 10px; right: 10px; border-top: 2px dashed var(--line-2); }
.stub__error { color: var(--danger); font-weight: 600; min-height: 1.5em; margin-top: 12px; display: flex; gap: 8px; align-items: flex-start; }
.stub__hint { color: var(--muted); font-size: .88rem; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted); user-select: none; padding: 6px; border-radius: 8px; }
.check input { width: 20px; height: 20px; accent-color: var(--lime); }

/* ============================================================== BOUTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; font-weight: 700; letter-spacing: .01em;
  background: var(--raised-2); border: 1px solid var(--line-2);
  transition: transform .18s var(--ease), background .18s, box-shadow .18s;
  white-space: nowrap;
}
.btn:hover { background: #1f2b47; }
.btn:focus-visible, html.tv .btn:focus { transform: scale(1.06); }
.btn--primary { background: var(--lime); color: var(--ink); border-color: transparent; box-shadow: 0 10px 40px -12px rgba(166, 240, 0, .7); }
.btn--primary:hover { background: var(--lime-hi); }
.btn--blue { background: var(--blue); border-color: transparent; }
.btn--ghost { background: rgba(255, 255, 255, .06); backdrop-filter: blur(10px); }
.btn--danger { background: transparent; border-color: rgba(255, 77, 94, .5); color: #ff8e99; }
.btn--block { width: 100%; padding: 18px; font: 800 1rem var(--f-display); letter-spacing: .04em; }
.btn--sm { padding: 8px 16px; font-size: .88rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; transition: background .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); }
.icon-btn svg, .btn svg { width: 22px; height: 22px; flex: none; }

/* ============================================================== HEADER */
.header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  display: flex; align-items: center; gap: clamp(12px, 2.4vw, 36px); padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(5, 7, 13, .92), rgba(5, 7, 13, .7));
  backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line);
}
.header__logo img { height: calc(var(--header-h) - 22px); width: auto; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  position: relative; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: .95rem; color: var(--muted);
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); }
.nav a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--blue), var(--lime)); box-shadow: 0 0 12px var(--lime);
}
.header__tools { display: flex; align-items: center; gap: 10px; }

/* Compteur du ticket (talon) */
.meter-chip {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border-radius: 12px;
  background:
    radial-gradient(circle at 0 50%, var(--bg) 6px, transparent 7px),
    linear-gradient(135deg, var(--raised-2), var(--raised));
  border: 1px solid var(--line); font-size: .78rem; line-height: 1.15;
}
.meter-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); margin-left: 6px; }
.meter-chip__name { display: block; font: 700 .7rem var(--f-mono); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.meter-chip__time { font: 700 1rem var(--f-mono); letter-spacing: .04em; }
.meter-chip.low .meter-chip__time { color: var(--warn); }
.meter-chip.low .meter-chip__dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }

.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font: 800 1rem var(--f-display); color: var(--ink); flex: none;
}
.avatar--lg { width: clamp(96px, 11vw, 150px); height: clamp(96px, 11vw, 150px); border-radius: 28px; font-size: clamp(34px, 4vw, 56px); }
.av-blue { background: linear-gradient(135deg, #4C8DFF, #1E4FD8); color: #fff; }
.av-lime { background: linear-gradient(135deg, #C4FF3D, #7DC400); }
.av-orange { background: linear-gradient(135deg, #FFB36B, #FF6A1E); }
.av-pink { background: linear-gradient(135deg, #FF8CC0, #E0245E); color: #fff; }
.av-cyan { background: linear-gradient(135deg, #7CEBFF, #00A6D6); }
.av-yellow { background: linear-gradient(135deg, #FFE27A, #FFB020); }
.av-violet { background: linear-gradient(135deg, #B69CFF, #6B45E0); color: #fff; }
.av-white { background: linear-gradient(135deg, #FFFFFF, #B9C4DA); }

/* Barre d'onglets mobile */
.tabbar { display: none; }

/* ============================================================== PAGES */
main { min-height: calc(100vh - var(--header-h)); padding-bottom: 60px; }
.page { padding: 28px var(--gutter) 0; animation: pageIn .45s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page__title { font: 800 clamp(26px, 3.2vw, 46px)/1.05 var(--f-display); letter-spacing: -.02em; margin: 0; }
.page__title small { display: block; font: 600 .8rem var(--f-mono); letter-spacing: .16em; color: var(--lime); text-transform: uppercase; margin-bottom: 8px; }

/* ============================================================== HERO */
.hero {
  position: relative; min-height: clamp(360px, 62vh, 680px); display: flex; align-items: flex-end;
  padding: 0 var(--gutter) clamp(36px, 6vh, 70px); margin-bottom: 8px; overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__bg img, .hero__bg .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 1s var(--ease), transform 7s linear; }
.hero__bg .on { opacity: 1; transform: scale(1); }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(7, 11, 20, .85) 35%, rgba(7, 11, 20, .1) 70%),
    linear-gradient(0deg, var(--bg) 0%, transparent 45%);
}
.hero__content { max-width: min(680px, 90vw); animation: fadeUp .7s var(--ease) both; }
.hero__kicker svg { width: 16px; height: 16px; }
.hero__kicker { white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; font: 700 .75rem var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--lime); }
.hero__title { font: 800 clamp(34px, 5.6vw, 84px)/.98 var(--f-display); letter-spacing: -.03em; margin: 12px 0 14px; text-wrap: balance; }
.hero__meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.hero__syn { color: #C6D0E6; max-width: 58ch; margin: 0 0 24px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__dots { position: absolute; right: var(--gutter); bottom: clamp(36px, 6vh, 70px); display: flex; gap: 8px; }
.hero__dots i { width: 26px; height: 4px; border-radius: 4px; background: var(--line-2); transition: background .3s, width .3s; }
.hero__dots i.on { width: 46px; background: var(--lime); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); font: 600 .78rem var(--f-body); color: var(--text); }
.pill--q { font-family: var(--f-mono); letter-spacing: .06em; }
.pill--lime { background: rgba(166, 240, 0, .12); color: var(--lime); border-color: rgba(166, 240, 0, .3); }
.pill--lock { background: rgba(255, 176, 32, .12); color: var(--warn); border-color: rgba(255, 176, 32, .3); }
.star { color: #FFD24A; }

/* ============================================================== RAILS */
.rail { margin: 26px 0 8px; }
.rail__head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--gutter); margin-bottom: 12px; }
.rail__title { font: 700 clamp(17px, 1.6vw, 24px) var(--f-display); margin: 0; display: flex; align-items: center; gap: 12px; }
.rail__title::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--lime); box-shadow: 0 0 12px var(--lime); transform: rotate(45deg); }
.rail__more { color: var(--muted); font-weight: 600; font-size: .9rem; padding: 4px 8px; border-radius: 8px; }
.rail__track {
  display: flex; gap: clamp(10px, 1.2vw, 18px); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 var(--gutter);
  padding: 14px var(--gutter) 22px; scrollbar-width: none;
}
.rail__track::-webkit-scrollbar { display: none; }
.rail__track > * { scroll-snap-align: start; flex: none; }

/* ============================================================== CARTES */
.card { position: relative; width: var(--card-w); text-align: left; border-radius: var(--radius); transition: transform .25s var(--ease); }
.card__img {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--raised);
  box-shadow: 0 10px 30px -18px #000; transition: box-shadow .25s var(--ease);
}
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__title { margin-top: 10px; font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__sub { color: var(--muted); font-size: .8rem; display: flex; gap: 8px; align-items: center; }
.card:hover .card__img, .card:focus .card__img { box-shadow: var(--focus-ring); }
.card:focus, .card:hover { transform: translateY(-4px) scale(1.04); z-index: 2; }
html.tv .card:focus { transform: scale(1.1); }
.card__badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 6px; }
.card__lock {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 7, 13, .55); backdrop-filter: grayscale(1);
}
.card__lock span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(5, 7, 13, .8); border: 1px solid var(--line-2); }
.card__lock svg { width: 20px; height: 20px; color: var(--warn); }
.progress { height: 4px; background: rgba(255, 255, 255, .15); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--lime)); }
.card__img .progress { position: absolute; left: 10px; right: 10px; bottom: 10px; }

/* Carte paysage (continuer / chaînes) */
.card--wide { width: calc(var(--card-w) * 1.6); }
.card--wide .card__img { aspect-ratio: 16 / 9; }

/* Carte chaîne */
.chan-card { width: calc(var(--card-w) * 1.25); }
.chan-card .card__img { aspect-ratio: 16 / 10; display: grid; place-items: center; background: linear-gradient(145deg, var(--raised-2), var(--surface)); }
.chan-card .card__img img { width: 62%; height: 62%; object-fit: contain; }
.chan-card .live-tag { position: absolute; left: 10px; top: 10px; }

/* Affiche générée (sans image) */
.art {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px;
  font: 800 1.05rem/1.05 var(--f-display); letter-spacing: -.01em; overflow: hidden;
}
.art::before { content: ""; position: absolute; width: 180%; height: 38%; left: -40%; top: 18%; transform: rotate(-18deg); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .16), transparent); }
.art small { font: 600 .65rem var(--f-mono); letter-spacing: .14em; opacity: .75; margin-bottom: 6px; text-transform: uppercase; }
.initials { font: 800 1.5rem var(--f-display); color: var(--muted); }

/* LIVE */
.live-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; background: rgba(255, 77, 94, .16); color: #FF7A86; font: 800 .68rem var(--f-mono); letter-spacing: .14em; }
.live-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 94, .6); } 50% { box-shadow: 0 0 0 6px rgba(255, 77, 94, 0); } }

/* ============================================================== GRILLES */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 6px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-weight: 600; font-size: .9rem; transition: all .15s; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); color: var(--ink); border-color: transparent; }
.field {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2);
  min-height: 46px; transition: border-color .15s;
}
.field:focus-within { border-color: var(--lime); }
.field input, .field select { background: none; border: 0; outline: 0; min-width: 0; flex: 1; padding: 10px 0; }
.field select option { background: var(--surface); }
.field svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr)); gap: clamp(14px, 1.6vw, 26px) clamp(10px, 1.2vw, 18px); }
.grid .card { width: auto; }
.sentinel { height: 1px; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty h3 { font: 700 1.3rem var(--f-display); color: var(--text); margin: 0 0 8px; }
.skeleton { background: linear-gradient(100deg, var(--raised) 30%, var(--raised-2) 50%, var(--raised) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ============================================================== TV LIVE */
.live { display: grid; grid-template-columns: minmax(200px, 250px) 1fr; gap: clamp(16px, 2vw, 32px); }
.cats { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; display: grid; gap: 4px; padding: 4px; scrollbar-width: thin; }
.cats button { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; text-align: left; color: var(--muted); font-weight: 600; transition: background .15s, color .15s; }
.cats button:hover { background: var(--surface); color: var(--text); }
.cats button.on { background: linear-gradient(90deg, rgba(30, 107, 255, .25), rgba(30, 107, 255, .05)); color: var(--text); box-shadow: inset 3px 0 0 var(--lime); }
.cats button span { font: 500 .78rem var(--f-mono); color: var(--faint); }
.chan-list { display: grid; gap: 8px; }
.chan {
  display: grid; grid-template-columns: 34px 88px 1fr auto; align-items: center; gap: 16px; padding: 12px 16px 12px 12px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: left; transition: background .15s, transform .15s var(--ease);
}
.chan:hover { background: var(--raised); }
.chan:focus, .chan:focus-visible { background: var(--raised-2); transform: scale(1.012); }
.chan__num { font: 700 .85rem var(--f-mono); color: var(--faint); text-align: right; }
.chan__logo { width: 88px; height: 56px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; overflow: hidden; }
.chan__logo img { max-width: 80%; max-height: 80%; object-fit: contain; }
.chan__name { font-weight: 700; display: flex; align-items: center; gap: 10px; min-width: 0; }
.chan__name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan__prog { color: var(--muted); font-size: .88rem; margin-top: 3px; display: grid; gap: 5px; min-width: 0; }
.chan__prog .now { color: #D5DDF0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan__prog .next { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan__prog .progress { max-width: 280px; }
.chan__side { display: flex; align-items: center; gap: 8px; }
.chan.locked { opacity: .55; }

/* ============================================================== FICHES */
.detail { position: relative; min-height: calc(100vh - var(--header-h)); }
.detail__backdrop { position: absolute; inset: 0 0 auto 0; height: 78vh; z-index: -1; overflow: hidden; }
.detail__backdrop img, .detail__backdrop .art { width: 100%; height: 100%; object-fit: cover; }
.detail__backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 10%, rgba(7, 11, 20, .6) 55%, rgba(7, 11, 20, .3)), linear-gradient(0deg, var(--bg), transparent 60%); }
.detail__body { display: grid; grid-template-columns: clamp(170px, 20vw, 300px) 1fr; gap: clamp(20px, 3vw, 50px); padding: clamp(40px, 12vh, 140px) var(--gutter) 0; align-items: end; }
.detail__poster { position: relative; aspect-ratio: 2 / 3; border-radius: 18px; overflow: hidden; box-shadow: 0 40px 80px -30px #000, 0 0 0 1px var(--line-2); background: var(--raised); }
.detail__poster img { width: 100%; height: 100%; object-fit: cover; }
.detail__title { font: 800 clamp(30px, 4.6vw, 70px)/1 var(--f-display); letter-spacing: -.03em; margin: 0 0 16px; text-wrap: balance; }
.detail__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-weight: 600; margin-bottom: 18px; }
.detail__syn { max-width: 70ch; color: #C6D0E6; margin: 0 0 26px; }
.detail__actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.detail__resume { font: 600 .85rem var(--f-mono); color: var(--lime); margin: -12px 0 18px; }
.notice { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; background: rgba(255, 176, 32, .08); border: 1px solid rgba(255, 176, 32, .25); color: #FFD48A; font-size: .92rem; margin-top: 18px; max-width: 640px; }
.notice svg { width: 20px; height: 20px; flex: none; }

/* Saisons / épisodes */
.seasons { padding: 40px var(--gutter) 0; }
.season-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 18px; scrollbar-width: none; }
.season-tabs button { flex: none; padding: 10px 20px; border-radius: 12px; font: 700 .92rem var(--f-display); letter-spacing: .02em; color: var(--muted); border: 1px solid var(--line-2); }
.season-tabs button.on { background: var(--blue); color: #fff; border-color: transparent; }
.episodes { display: grid; gap: 10px; }
.ep {
  display: grid; grid-template-columns: 56px clamp(120px, 14vw, 200px) 1fr auto; gap: 18px; align-items: center; padding: 12px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: left; transition: background .15s;
}
.ep:hover, .ep:focus { background: var(--raised); }
.ep__n { font: 800 1.6rem var(--f-display); color: var(--faint); text-align: center; }
.ep__img { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--raised-2); }
.ep__img img { width: 100%; height: 100%; object-fit: cover; }
.ep__img .progress { position: absolute; left: 6px; right: 6px; bottom: 6px; }
.ep__t { font-weight: 700; }
.ep__s { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.ep__d { color: var(--muted); font: 500 .85rem var(--f-mono); }
.ep.done .ep__n { color: var(--lime); }

/* ============================================================== RECHERCHE */
.search-big { font: 700 clamp(22px, 3vw, 40px) var(--f-display); min-height: 70px; border-radius: 18px; padding: 0 22px; }
.search-big svg { width: 28px; height: 28px; }
.results h2 { font: 700 1.1rem var(--f-display); margin: 30px 0 14px; display: flex; gap: 10px; align-items: center; }
.results h2 span { font: 600 .8rem var(--f-mono); color: var(--muted); }

/* ============================================================== COMPTE */
.account { display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.ticket-card {
  position: relative; border-radius: 22px; padding: 26px; overflow: hidden;
  background:
    linear-gradient(150deg, var(--raised-2), var(--surface));
  --pad: 26px;
  border: 1px solid var(--line);
}
.ticket-card__band { position: absolute; top: 0; left: 0; right: 0; height: 5px; }
.ticket-card__profile { font: 800 1.5rem var(--f-display); margin: 8px 0 2px; }
.ticket-card__code { font: 700 1.3rem var(--f-mono); letter-spacing: .12em; color: var(--muted); }
.ticket-card__time { font: 700 clamp(34px, 4vw, 52px)/1 var(--f-mono); letter-spacing: .02em; margin: 22px 0 4px; }
.ticket-card__foot { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .85rem; }
.status { display: inline-flex; padding: 4px 10px; border-radius: 999px; font: 700 .7rem var(--f-mono); letter-spacing: .12em; }
.status--active { background: rgba(166, 240, 0, .14); color: var(--lime); }
.status--expired, .status--revoked, .status--blocked { background: rgba(255, 77, 94, .14); color: #FF8E99; }
.status--suspended { background: rgba(255, 176, 32, .14); color: var(--warn); }
.status--unused { background: rgba(30, 107, 255, .16); color: var(--blue-hi); }
.quotas { display: grid; gap: 14px; margin-top: 18px; }
.quota__row { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.quota__row b { font-family: var(--f-mono); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 2vw, 28px); margin-bottom: 20px; }
.panel h3 { font: 700 1.1rem var(--f-display); margin: 0 0 16px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.kv div span { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.kv div b { font-weight: 600; }
.devices { display: grid; gap: 8px; }
.device { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--raised); }
.device svg { width: 26px; height: 26px; color: var(--muted); }
.device__meta { flex: 1; min-width: 0; }
.device__meta small { color: var(--muted); display: block; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ============================================================== PROFILS */
.who { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 40px var(--gutter); }
.who h1 { font: 800 clamp(30px, 4vw, 58px) var(--f-display); letter-spacing: -.02em; margin: 0 0 40px; }
.who__list { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(18px, 3vw, 44px); }
.who__item { display: grid; justify-items: center; gap: 14px; padding: 12px; border-radius: 22px; transition: transform .2s var(--ease); }
.who__item:focus, .who__item:hover { transform: scale(1.08); }
.who__item:focus .avatar, .who__item:hover .avatar { box-shadow: var(--focus-ring); }
.who__item:focus { box-shadow: none; }
.who__name { font-weight: 700; font-size: 1.1rem; color: var(--muted); }
.who__item:focus .who__name, .who__item:hover .who__name { color: var(--text); }
.who__kids { font: 700 .65rem var(--f-mono); letter-spacing: .14em; color: var(--warn); }
.avatar--add { background: transparent; border: 2px dashed var(--line-2); color: var(--muted); }

/* ============================================================== MODALES / TOASTS */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 10, .72); backdrop-filter: blur(8px); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal__box { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: linear-gradient(160deg, var(--raised-2), var(--surface)); border: 1px solid var(--line-2); border-radius: 22px; padding: clamp(22px, 3vw, 34px); box-shadow: 0 50px 120px -30px #000; animation: pop .3s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }
.modal__icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 16px; }
.modal__icon svg { width: 28px; height: 28px; }
.modal__icon--warn { background: rgba(255, 176, 32, .14); color: var(--warn); }
.modal__icon--ok { background: rgba(166, 240, 0, .14); color: var(--lime); }
.modal__icon--danger { background: rgba(255, 77, 94, .14); color: var(--danger); }
.modal h2 { font: 800 1.5rem/1.15 var(--f-display); margin: 0 0 10px; }
.modal p { color: #C6D0E6; margin: 0 0 20px; }
.modal__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; }
.modal .field { margin-bottom: 12px; }

.welcome__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 24px; }
.welcome__grid div { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.welcome__grid span { display: block; font: 600 .7rem var(--f-mono); letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.welcome__grid b { font: 700 1.05rem var(--f-display); }

.toasts { position: fixed; z-index: 120; left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; gap: 8px; width: min(520px, 92vw); pointer-events: none; }
.toast { padding: 14px 18px; border-radius: 14px; background: var(--raised-2); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -20px #000; font-weight: 600; animation: pop .25s var(--ease) both; }
.toast--error { border-color: rgba(255, 77, 94, .5); }
.toast--ok { border-color: rgba(166, 240, 0, .45); }

/* ============================================================== LECTEUR */
.player { position: fixed; inset: 0; z-index: 90; background: #000; display: grid; animation: fade .25s both; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player__ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; transition: opacity .35s var(--ease); pointer-events: none; }
.player__ui > * { pointer-events: auto; }
.player.idle .player__ui { opacity: 0; }
.player.idle { cursor: none; }
.player__top { display: flex; align-items: center; gap: 14px; padding: 22px var(--gutter) 80px; background: linear-gradient(180deg, rgba(0, 0, 0, .8), transparent); }
.player__title { flex: 1; min-width: 0; }
.player__title h2 { margin: 0; font: 700 clamp(18px, 2vw, 28px) var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__title p { margin: 4px 0 0; color: #C6D0E6; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__bottom { padding: 110px var(--gutter) 26px; background: linear-gradient(0deg, rgba(0, 0, 0, .92) 30%, transparent); text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.player__epg { display: flex; gap: 24px; align-items: flex-end; margin-bottom: 16px; }
.player__epg .now b { display: block; font: 700 1.2rem var(--f-display); }
.player__epg small { color: #C6D0E6; font: 500 .8rem var(--f-mono); }
.player__seek { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; margin-bottom: 8px; }
.player__seek .progress { flex: 1; height: 5px; }
.player__seek:focus .progress, .player__seek:hover .progress { height: 8px; }
.player__controls { display: flex; align-items: center; gap: 6px; }
.player__controls .icon-btn { width: 50px; height: 50px; }
.player__controls .icon-btn svg { width: 26px; height: 26px; }
.player__controls .play svg { width: 34px; height: 34px; }
.player__time { font: 600 .9rem var(--f-mono); color: #C6D0E6; margin: 0 10px; }
.player__spacer { flex: 1; }
.player__vol { width: 110px; accent-color: var(--lime); }
.player__center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.player__spinner { width: 64px; height: 64px; border: 4px solid rgba(255, 255, 255, .2); border-top-color: var(--lime); border-radius: 50%; animation: spin .8s linear infinite; }
.player__msg { pointer-events: auto; text-align: center; max-width: 480px; padding: 30px; border-radius: 22px; background: rgba(12, 18, 32, .9); border: 1px solid var(--line-2); }
.player__msg h3 { font: 800 1.3rem var(--f-display); margin: 0 0 8px; }
.player__msg p { color: #C6D0E6; margin: 0 0 18px; }
.menu { position: absolute; right: var(--gutter); bottom: 110px; min-width: 240px; max-height: 50vh; overflow: auto; background: rgba(12, 18, 32, .96); border: 1px solid var(--line-2); border-radius: 16px; padding: 8px; }
.menu h4 { margin: 8px 10px; font: 700 .72rem var(--f-mono); letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.menu button { display: flex; width: 100%; justify-content: space-between; padding: 10px 12px; border-radius: 10px; text-align: left; font-weight: 600; }
.menu button:hover, .menu button:focus { background: var(--raised-2); }
.menu button.on::after { content: "✓"; color: var(--lime); }
.zap { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(420px, 80vw); max-height: 70vh; overflow: auto; display: grid; gap: 6px; padding: 10px; border-radius: 18px; background: rgba(7, 11, 20, .92); border: 1px solid var(--line-2); }
.zap .chan { grid-template-columns: 30px 64px 1fr; padding: 8px; }
.zap .chan__logo { width: 64px; height: 42px; }
.zap .chan__side { display: none; }
.osd-num { position: absolute; top: 30px; right: var(--gutter); font: 800 3rem var(--f-mono); color: var(--lime); text-shadow: 0 0 20px rgba(166, 240, 0, .6); }

/* ============================================================== RESPONSIVE */
@media (max-width: 1100px) {
  .nav a { padding: 10px 9px; font-size: .88rem; }
  .meter-chip__name { display: none; }
}
@media (max-width: 860px) {
  :root { --header-h: 60px; --card-w: 124px; }
  .nav { display: none; }
  .header { gap: 10px; }
  .header__logo { flex: 1; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(5, 7, 13, .94); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: .68rem; font-weight: 600; color: var(--muted); border-radius: 10px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--lime); }
  main { padding-bottom: 90px; }
  .gate { grid-template-columns: 1fr; padding-top: 24px; }
  .gate__brand picture img { width: 240px; margin: 0 auto; }
  .gate__brand { text-align: center; }
  .gate__slogan { margin: 0 auto; }
  .gate__how { justify-content: center; }
  .live { grid-template-columns: 1fr; }
  .cats { position: static; display: flex; overflow-x: auto; max-height: none; }
  .cats button { flex: none; }
  .chan { grid-template-columns: 64px 1fr auto; gap: 12px; }
  .chan__num { display: none; }
  .chan__logo { width: 64px; height: 44px; }
  .detail__body { grid-template-columns: 1fr; padding-top: 30vh; }
  .detail__poster { display: none; }
  .account { grid-template-columns: 1fr; }
  .ep { grid-template-columns: 110px 1fr; }
  .ep__n, .ep__d { display: none; }
  .player__vol, .hide-sm { display: none; }
  .welcome__grid { grid-template-columns: 1fr; }
  .meter-chip { padding: 6px 10px 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
