/* Zemi — styles de l'application spectateur. Couleurs et formes : design system Zemi. */
:root {
  --nuit: #0F0D0B;
  --nuit-elevee: #1C1915;
  --ligne: #3A342C;
  --creme: #FFF6E5;
  --creme-doux: #B9AE9C;
  --zem: #FFC21A;
  --on-zem: #15110D;
  --braise: #FF5A3C;
  --lagune: #4CC3D1;
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 40px;
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 28px;
  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--nuit); color: var(--creme); font-family: var(--font-sans); font-size: 16px; line-height: 24px; }
body { min-height: 100vh; overscroll-behavior-y: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--zem); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 var(--space-2); }

/* ---------- en-tête ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-top) + 12px) var(--space-2) 12px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  background: linear-gradient(to bottom, rgba(15,13,11,.96) 60%, rgba(15,13,11,0));
}
.top .logo img { height: 30px; width: auto; }
.top-actions { display: flex; align-items: center; gap: var(--space-1); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--ligne); border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--creme);
  background: rgba(28,25,21,.7);
}
.chip svg { width: 18px; height: 18px; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; display: inline-grid; place-items: center; background: rgba(28,25,21,.7); border: 1px solid var(--ligne); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 var(--space-3); border-radius: var(--radius-md);
  font-weight: 800; font-size: 15px; line-height: 20px; letter-spacing: .01em;
  border: 1px solid transparent; transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.98); }
.btn-zem { background: var(--zem); color: var(--on-zem); }
.btn-zem:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--creme); border-color: var(--ligne); }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- accueil ---------- */
.hero { position: relative; margin: 0 var(--space-2) var(--space-3); border-radius: var(--radius-lg); overflow: hidden; min-height: 460px; display: flex; align-items: flex-end; background: var(--nuit-elevee); }
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--nuit) 30%, rgba(15,13,11,.6) 55%, rgba(15,13,11,0) 78%); }
.hero .txt { position: relative; z-index: 1; padding: var(--space-3); max-width: 560px; }
.hook { color: var(--braise); font-weight: 800; font-size: 13px; line-height: 18px; text-transform: uppercase; letter-spacing: .06em; }
.h-display { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 40px; margin: 6px 0 10px; letter-spacing: -.01em; }
.muted { color: var(--creme-doux); }
.small { font-size: 13px; line-height: 18px; font-weight: 600; }
.row { margin: 0 0 var(--space-4); }
.row-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--space-2); margin-bottom: 12px; }
.row-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 26px; margin: 0; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 42%; gap: 12px; overflow-x: auto; padding: 0 var(--space-2) 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .rail { grid-auto-columns: 200px; } .hero { min-height: 520px; } .h-display { font-size: 44px; line-height: 50px; } }
.card { scroll-snap-align: start; display: block; }
.poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius-md); overflow: hidden; background: var(--nuit-elevee); border: 1px solid var(--ligne); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .badge-top { position: absolute; top: 8px; left: 8px; }
.poster .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,246,229,.2); }
.poster .prog i { display: block; height: 100%; background: var(--zem); }
.card .t { margin-top: 8px; font-weight: 700; font-size: 15px; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .s { font-size: 13px; line-height: 18px; color: var(--creme-doux); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 18px; font-weight: 800; padding: 2px 9px; border-radius: var(--radius-sm); background: rgba(15,13,11,.8); color: var(--creme); border: 1px solid var(--ligne); }
.badge.new { color: var(--lagune); border-color: var(--lagune); }
.badge.zem { background: var(--zem); color: var(--on-zem); border-color: var(--zem); }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 0 var(--space-2) var(--space-3); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ligne); font-weight: 700; font-size: 14px; color: var(--creme-doux); }
.tab.on { background: var(--creme); color: var(--on-zem); border-color: var(--creme); }
.empty { padding: var(--space-4) var(--space-2); text-align: center; color: var(--creme-doux); }
.foot { padding: var(--space-4) var(--space-2) calc(var(--space-4) + var(--safe-bottom)); text-align: center; color: var(--creme-doux); font-size: 13px; line-height: 20px; }
.foot img { height: 26px; margin: 0 auto 10px; opacity: .9; }

/* ---------- page série ---------- */
.series-head { position: relative; overflow: hidden; }
.series-head .blur { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.45); transform: scale(1.1); }
.series-head .inner { position: relative; display: grid; grid-template-columns: 130px 1fr; gap: var(--space-2); padding: var(--space-2); align-items: end; }
@media (min-width: 640px) { .series-head .inner { grid-template-columns: 220px 1fr; padding: var(--space-3); } }
.series-head h1 { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 32px; margin: 6px 0; }
@media (min-width: 640px) { .series-head h1 { font-size: 36px; line-height: 42px; } }
.synopsis { padding: 0 var(--space-2); margin: var(--space-2) 0; color: var(--creme); max-width: 720px; }
.actions { display: grid; gap: 10px; padding: 0 var(--space-2); max-width: 520px; }
.offer { margin: var(--space-3) var(--space-2); padding: var(--space-2); border: 1px solid var(--ligne); border-radius: var(--radius-md); background: var(--nuit-elevee); max-width: 520px; }
.offer h3 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 24px; }
.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; padding: 0 var(--space-2); margin: var(--space-2) 0 var(--space-4); }
.ep { position: relative; aspect-ratio: 1; border-radius: 14px; background: var(--nuit-elevee); border: 1px solid var(--ligne); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.ep.free::after { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 9px; background: var(--lagune); }
.ep.lock { color: var(--creme-doux); }
.ep.lock svg { position: absolute; bottom: 6px; right: 6px; width: 14px; height: 14px; color: var(--braise); }
.ep.cur { background: var(--zem); color: var(--on-zem); border-color: var(--zem); }
.sec-title { padding: 0 var(--space-2); font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: var(--space-3) 0 0; }
.legend { padding: 4px var(--space-2) 0; display: flex; gap: 16px; font-size: 13px; color: var(--creme-doux); font-weight: 600; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 8px; background: var(--lagune); margin-right: 6px; vertical-align: middle; }

/* ---------- lecteur ---------- */
.player { position: fixed; inset: 0; background: #000; z-index: 50; overflow: hidden; touch-action: none; user-select: none; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; transition: transform .28s ease, opacity .28s ease; }
.player .shade-top, .player .shade-bot { position: absolute; left: 0; right: 0; pointer-events: none; }
.player .shade-top { top: 0; height: 140px; background: linear-gradient(to bottom, rgba(0,0,0,.65), transparent); }
.player .shade-bot { bottom: 0; height: 200px; background: linear-gradient(to top, rgba(0,0,0,.75), transparent); }
.p-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(var(--safe-top) + 10px) 12px 0; display: flex; align-items: center; gap: 10px; z-index: 3; }
.p-top .ttl { flex: 1; min-width: 0; }
.p-top .ttl b { display: block; font-size: 15px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-top .ttl span { font-size: 13px; line-height: 18px; color: var(--creme-doux); font-weight: 600; }
.p-side { position: absolute; right: 10px; bottom: calc(var(--safe-bottom) + 90px); display: grid; gap: 18px; z-index: 3; justify-items: center; }
.p-side button { display: grid; justify-items: center; gap: 4px; font-size: 12px; font-weight: 800; line-height: 14px; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.p-side .ic { width: 46px; height: 46px; border-radius: 999px; display: grid; place-items: center; background: rgba(28,25,21,.65); border: 1px solid rgba(255,246,229,.18); }
.p-side svg { width: 22px; height: 22px; }
.p-bot { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 14px calc(var(--safe-bottom) + 14px); z-index: 3; }
.p-bot .ep-name { font-weight: 800; font-size: 16px; line-height: 22px; margin-bottom: 4px; padding-right: 60px; }
.p-bot .hint { font-size: 12px; color: var(--creme-doux); font-weight: 700; margin-bottom: 10px; }
.bar { height: 4px; background: rgba(255,246,229,.22); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--zem); }
.p-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.p-center .big { width: 84px; height: 84px; border-radius: 999px; background: rgba(15,13,11,.55); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.p-center .big.show { opacity: 1; }
.p-center svg { width: 38px; height: 38px; color: var(--creme); }
.spinner { width: 44px; height: 44px; border-radius: 99px; border: 4px solid rgba(255,246,229,.2); border-top-color: var(--zem); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.unmute { position: absolute; top: calc(var(--safe-top) + 64px); left: 50%; transform: translateX(-50%); z-index: 4; background: var(--zem); color: var(--on-zem); font-weight: 800; font-size: 14px; padding: 10px 16px; border-radius: 999px; display: inline-flex; gap: 8px; align-items: center; }
.unmute svg { width: 18px; height: 18px; }
.endcard { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; text-align: center; padding: var(--space-3); background: rgba(15,13,11,.86); }
.endcard h2 { font-family: var(--font-display); font-size: 26px; line-height: 32px; margin: 10px 0; }

/* ---------- feuilles (paiement, connexion, épisodes) ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 80; animation: fade .2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; max-height: 92vh; overflow-y: auto;
  background: var(--nuit-elevee); border-top: 1px solid var(--ligne); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px var(--space-3) calc(var(--space-3) + var(--safe-bottom)); animation: up .25s ease;
}
@media (min-width: 640px) { .sheet { left: 50%; right: auto; width: 440px; transform: translateX(-50%); bottom: 24px; border-radius: var(--radius-lg); border: 1px solid var(--ligne); animation: none; } }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--ligne); margin: 0 auto 14px; }
.sheet h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 28px; margin: 4px 0 6px; }
.sheet p { margin: 0 0 var(--space-2); color: var(--creme-doux); }
.sheet .lock-n { color: var(--braise); font-weight: 800; }
.sheet .stack { display: grid; gap: 10px; }
.sheet .pay-note { margin-top: 14px; text-align: center; font-size: 13px; line-height: 18px; color: var(--creme-doux); font-weight: 600; }
.sheet .x { position: absolute; right: 14px; top: 14px; }
.offer-btn { display: flex; flex-direction: column; align-items: flex-start; text-align: left; height: auto; padding: 14px 18px; gap: 2px; }
.offer-btn small { font-weight: 700; font-size: 13px; line-height: 18px; opacity: .8; }
.offer-btn .price { font-family: var(--font-display); font-size: 17px; line-height: 22px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--nuit); border: 1px solid var(--ligne); border-radius: 14px; padding: 4px; margin: 6px 0 var(--space-2); }
.seg button { height: 40px; border-radius: 10px; font-weight: 800; font-size: 14px; color: var(--creme-doux); }
.seg button.on { background: var(--creme); color: var(--on-zem); }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 700; color: var(--creme-doux); }
.field input, .field select, .field textarea {
  height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--ligne); background: var(--nuit); color: var(--creme); font: inherit; font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--zem); }
.form-err { color: var(--braise); font-weight: 700; font-size: 14px; min-height: 20px; margin-bottom: 8px; }
.eps-sheet .eps { padding: 0; margin: var(--space-2) 0 0; }

/* ---------- divers ---------- */
.page { padding-bottom: var(--space-4); }
.center-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: var(--space-3); }
.center-page .box { max-width: 420px; }
.center-page h1 { font-family: var(--font-display); font-size: 26px; line-height: 32px; margin: var(--space-2) 0 8px; }
.big-ic { width: 72px; height: 72px; border-radius: 99px; margin: 0 auto; display: grid; place-items: center; background: var(--zem); color: var(--on-zem); }
.big-ic svg { width: 34px; height: 34px; }
.test-banner { background: var(--lagune); color: var(--on-zem); text-align: center; font-weight: 800; font-size: 13px; padding: 6px 12px; }
.acc-card { background: var(--nuit-elevee); border: 1px solid var(--ligne); border-radius: var(--radius-md); padding: var(--space-2); margin: 0 var(--space-2) var(--space-2); }
.acc-card h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 17px; }
#toast { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 24px); transform: translateX(-50%) translateY(30px); opacity: 0; z-index: 200; background: var(--creme); color: var(--on-zem); font-weight: 800; padding: 12px 18px; border-radius: 14px; transition: all .25s; max-width: 90vw; text-align: center; pointer-events: none; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.skel { background: linear-gradient(90deg, var(--nuit-elevee) 0, #26221d 50%, var(--nuit-elevee) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- page d'accueil visiteurs ---------- */
.lp-hero { min-height: 520px; }
.lp-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.lp-sec { padding: 0 var(--space-2); margin: 0 auto var(--space-4); max-width: 1100px; }
.lp-h { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 28px; margin: 0 0 var(--space-2); }
.lp-steps { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .lp-steps { grid-template-columns: repeat(3, 1fr); } }
.lp-step { background: var(--nuit-elevee); border: 1px solid var(--ligne); border-radius: var(--radius-md); padding: var(--space-2); }
.lp-step b { display: block; font-size: 17px; line-height: 22px; margin: 8px 0 4px; }
.lp-step p { margin: 0; color: var(--creme-doux); font-size: 15px; line-height: 22px; }
.lp-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 99px; background: var(--zem); color: var(--on-zem); font-family: var(--font-display); font-weight: 700; }
.lp-offers { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .lp-offers { grid-template-columns: 1fr; } }
.lp-offer { display: grid; gap: 4px; padding: var(--space-2); border-radius: var(--radius-md); border: 1px solid var(--ligne); background: var(--nuit-elevee); }
.lp-offer small { font-weight: 800; font-size: 13px; color: var(--creme-doux); }
.lp-offer b { font-family: var(--font-display); font-size: 24px; line-height: 30px; }
.lp-offer.zem { background: var(--zem); color: var(--on-zem); border-color: var(--zem); }
.lp-offer.zem small, .lp-offer.zem span { color: var(--on-zem); }
