/* =========================================================
   STORIMA — Styles
   Couleurs de la marque : modifier les variables ci-dessous.
   ========================================================= */
:root {
  --red: #E11D48;
  --red-dark: #1F0A10;
  --bg: #0B0B0F;
  --surface: #18181B;
  --surface-2: #111114;
  --line: #27272A;
  --text: #FFFFFF;
  --text-2: #D4D4D8;
  --muted: #A1A1AA;
  --radius: 14px;
  --font-title: "Outfit", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 68px;
}

* { box-sizing: border-box; }
html { background: #000; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  max-width: 480px;
  min-height: 100vh;
  margin-inline: auto;
  position: relative;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 22px; height: 22px; flex-shrink: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-title); }
h2 { font-size: 19px; font-weight: 600; }
p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 16px 20px 24px; }
.pad-x { padding-inline: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--muted); padding: 12px 20px 24px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

#view { padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
body.watching #view { padding-bottom: 0; }

/* ---------- Logo ---------- */
.logo { font-family: var(--font-title); font-weight: 800; letter-spacing: -0.03em; line-height: 1; display: inline-flex; align-items: baseline; }
.logo-dot { display: inline-block; width: 0.24em; height: 0.24em; border-radius: 50%; background: var(--red); margin-left: 0.1em; }

/* ---------- Barre du haut ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 10px 20px; }
.page-title { font-size: 26px; font-weight: 800; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; border: 0; }
.icon-btn.dark { background: rgba(0, 0, 0, 0.45); }

/* ---------- Puces de catégories ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 20px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 9px 15px; border-radius: 20px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; border: 0; white-space: nowrap; }
.chip.on { background: #FFFFFF; color: var(--bg); font-weight: 600; }

/* ---------- Bannière à la une ---------- */
.hero { position: relative; margin: 18px 20px 6px; min-height: 340px; border-radius: 20px; overflow: hidden; display: flex; align-items: flex-end; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0) 60%); }
.hero-tag { position: absolute; top: 16px; left: 16px; z-index: 1; padding: 5px 10px; border-radius: 8px; background: var(--red); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.hero-body { position: relative; z-index: 1; padding: 20px; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.hero-body h1 { font-size: 30px; font-weight: 800; line-height: 1.05; }
.hero-body p { font-size: 13px; color: #F4F4F5; }
.hero-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ---------- Boutons ---------- */
.btn { min-height: 50px; border-radius: 12px; border: 0; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 15px; text-align: center; }
.btn svg { width: 18px; height: 18px; }
.btn-red { background: var(--red); color: #FFFFFF; }
.btn-white { background: #FFFFFF; color: var(--bg); flex-grow: 1; }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 500; }
.btn-ghost-border { background: transparent; border: 1px solid var(--line); color: var(--text); }
.grow { flex-grow: 1; }
.btn-square { width: 50px; height: 50px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, 0.16); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-square.dark { background: var(--surface); }

/* ---------- Rangées et cartes ---------- */
.row { margin-top: 26px; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 20px 12px; }
.pad .row-head, .stack .row-head { padding-inline: 0; padding-bottom: 0; }
.row-head a { font-size: 13px; }
.row-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 0 20px; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; scrollbar-width: none; }
.row-scroll::-webkit-scrollbar { display: none; }
.card { width: 112px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; scroll-snap-align: start; }
.grid .card { width: auto; }
.card-media { position: relative; display: block; }
.card-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster { display: flex; align-items: flex-end; aspect-ratio: 9 / 13; width: 100%; border-radius: var(--radius); overflow: hidden; padding: 10px; position: relative; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster-title { font-family: var(--font-title); font-weight: 800; font-size: 14px; line-height: 1.1; }
.poster.mini { width: 56px; aspect-ratio: 9 / 13; padding: 0; border-radius: 10px; flex-shrink: 0; }
.poster.mini .poster-title { display: none; }
.rank { position: absolute; top: 8px; left: 8px; min-width: 22px; height: 22px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; padding: 16px 20px; }

/* ---------- Recherche ---------- */
.search { display: flex; align-items: center; gap: 10px; margin: 0 20px 14px; padding: 0 14px; height: 48px; border-radius: 12px; background: var(--surface); color: var(--muted); }
.search input { flex-grow: 1; height: 100%; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; }

/* ---------- Fiche série ---------- */
.banner { position: relative; height: 210px; padding: 16px 20px; overflow: hidden; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner .icon-btn { position: relative; z-index: 1; }
.series-title { font-size: 28px; font-weight: 800; line-height: 1.05; margin-bottom: 6px; }
.desc { color: var(--text-2); line-height: 1.5; }
.actions { display: flex; gap: 10px; }
.episodes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ep { height: 46px; border-radius: 10px; background: var(--surface); border: 1px solid transparent; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 4px; }
.ep.current { border-color: var(--red); }
.ep.locked { background: var(--surface-2); border-color: var(--line); color: #8B8B95; font-weight: 500; font-size: 13px; }
.ep.locked svg { width: 11px; height: 11px; }

/* ---------- Lecteur vertical ---------- */
body.watching #nav { display: none; }
.player { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.player-top { position: absolute; top: 0; left: 0; right: 0; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.pill { padding: 8px 12px; border-radius: 16px; background: rgba(0, 0, 0, 0.45); font-size: 13px; font-weight: 600; }
.player-side { position: absolute; right: 10px; bottom: 150px; display: flex; flex-direction: column; gap: 16px; z-index: 2; }
.player-side button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px; font-size: 11px; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.player-side svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); }
.player-side button.on svg { color: var(--red); }
.player-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0)); z-index: 2; }
.player-title { font-family: var(--font-title); font-weight: 800; font-size: 20px; margin-bottom: 12px; padding-right: 70px; }
.player-nav { position: absolute; right: 16px; bottom: calc(30px + env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.nav-ep { width: 44px; height: 44px; border-radius: 22px; background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; }
.progress { height: 3px; background: rgba(255, 255, 255, 0.25); border-radius: 2px; overflow: hidden; margin-right: 110px; }
.progress span { display: block; height: 100%; width: 0; background: var(--red); }
.bigplay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 1; }
.bigplay svg { width: 34px; height: 34px; margin-left: 4px; }
.vmsg { position: absolute; top: 45%; left: 0; right: 0; text-align: center; color: var(--text-2); z-index: 1; }
.player-locked { position: absolute; top: 38%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-2); }
.player-locked svg { width: 40px; height: 40px; color: var(--red); }

/* ---------- Feuille du bas ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0); display: flex; align-items: flex-end; justify-content: center; transition: background 0.2s; }
.sheet[hidden] { display: none; }
.sheet.open { background: rgba(0, 0, 0, 0.55); }
.sheet-body { width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 14px 20px calc(24px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform 0.2s ease-out; }
.sheet.open .sheet-body { transform: translateY(0); }
.sheet-body::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #3F3F46; margin: 0 auto 16px; }
.sheet-title { font-size: 20px; margin-bottom: 14px; }
.paywall { display: flex; flex-direction: column; gap: 12px; }
.paywall-head { display: flex; gap: 12px; align-items: center; }
.paywall-head h3 { font-size: 20px; font-weight: 800; }
.paywall-icon { width: 44px; height: 44px; border-radius: 12px; background: #2A0A12; color: var(--red); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- Pass ---------- */
.pass-title { font-size: 32px; font-weight: 800; display: flex; align-items: baseline; gap: 8px; }
.lead { font-size: 15px; color: var(--text-2); margin-top: 6px; }
.perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: #E4E4E7; font-size: 14px; }
.perks li { display: flex; gap: 10px; align-items: center; }
.perks svg { width: 18px; height: 18px; color: var(--red); }
.plans { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.plan { position: relative; min-height: 70px; border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; background: var(--surface-2); border: 2px solid var(--line); }
.plan.on { background: var(--red-dark); border-color: var(--red); }
.plan-info { display: flex; flex-direction: column; gap: 2px; }
.plan-info strong { font-size: 16px; }
.plan-price { font-family: var(--font-title); font-weight: 800; font-size: 20px; white-space: nowrap; }
.plan-price small { font-size: 13px; font-weight: 600; }
.plan-badge { position: absolute; top: -10px; right: 16px; padding: 3px 9px; border-radius: 8px; background: var(--red); font-size: 11px; font-weight: 700; }
.summary { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--surface); }
.summary > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--surface); color: var(--text-2); display: flex; gap: 10px; align-items: center; }
.notice.ok svg { color: #4ADE80; width: 18px; height: 18px; }

/* ---------- Ma liste / Profil ---------- */
.hist { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: var(--surface-2); }
.hist > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; }
.hist-play { width: 40px; height: 40px; border-radius: 20px; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.hist-play svg { width: 16px; height: 16px; }
.pass-card { padding: 18px; border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.pass-card .btn { margin-top: 8px; }
.faq { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; }
.faq summary::after { content: "+"; float: right; color: var(--muted); }
.faq[open] summary::after { content: "–"; }
.faq p { color: var(--text-2); padding-bottom: 12px; }

/* ---------- Barre de navigation ---------- */
#nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(11, 11, 15, 0.96); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: center; z-index: 20; backdrop-filter: blur(8px); }
#nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); min-width: 60px; padding: 6px 0; }
#nav a.on { color: #FFFFFF; font-weight: 600; }

/* ---------- Message rapide ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translate(-50%, 20px); background: #FFFFFF; color: var(--bg); padding: 10px 16px; border-radius: 20px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 60; white-space: nowrap; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 481px) {
  html { background: #050507; }
  body { box-shadow: 0 0 0 1px #18181B; }
}
