/* ============================================================
   NÉBULA - Thème global
   ============================================================ */

:root {
  --bg: #0a0a12;
  --bg-soft: #10101c;
  --surface: #161625;
  --surface-2: #1d1d30;
  --border: #26263b;
  --text: #f3f3f8;
  --muted: #9b9bb4;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --gradient: linear-gradient(120deg, #8b5cf6, #ec4899);
  --danger: #f43f5e;
  --ok: #22c55e;
  --radius: 14px;
  --header-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139, 92, 246, .18), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(236, 72, 153, .12), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; }

::selection { background: var(--accent); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: #33334d; border-radius: 8px; border: 2px solid var(--bg-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   Header
   ============================================================ */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 32px;
  background: rgba(10, 10, 18, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header.scrolled { background: rgba(10, 10, 18, .94); }

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em;
}
.logo-img {
  width: 42px; height: 42px; border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 18px rgba(139, 92, 246, .4);
}
.logo .dot {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--gradient);
  display: grid; place-items: center;
  font-size: 1rem; color: #fff; box-shadow: 0 4px 18px rgba(139, 92, 246, .5);
}

.nav { display: flex; gap: 6px; flex: 1; }
.nav a {
  padding: 8px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: .95rem;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: #fff; background: var(--gradient); }

.header-right { display: flex; align-items: center; gap: 12px; }
.search-box { position: relative; }
.search-box input {
  width: 220px; padding: 9px 14px 9px 38px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  outline: none; font-size: .92rem;
  transition: width .2s, border-color .2s;
}
.search-box input:focus { border-color: var(--accent); width: 280px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box.collapsed input { width: 40px; padding-left: 12px; cursor: pointer; }
.search-box:focus-within input, .search-box.collapsed:focus-within input { width: 280px; padding-left: 38px; cursor: text; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  transition: color .15s, transform .15s, border-color .15s;
  position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--gradient); color: #fff;
  font-size: .7rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 4px;
}
.icon-btn.hidden { display: none; }

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; min-height: 78vh; display: flex; align-items: flex-end; overflow: hidden; padding: 0 32px 72px; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(10,10,18,.35) 45%, rgba(10,10,18,.15) 100%),
    linear-gradient(to right, rgba(10,10,18,.9) 0%, rgba(10,10,18,.25) 55%, transparent 100%);
}
.hero-dots { position: absolute; right: 32px; bottom: 100px; display: flex; gap: 8px; z-index: 3; }
.hero-dots button {
  width: 9px; height: 9px; border-radius: 999px; background: rgba(255,255,255,.35);
  transition: all .2s;
}
.hero-dots button.active { width: 26px; background: var(--gradient); }

.hero-content { position: relative; z-index: 3; max-width: 620px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: var(--gradient);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.hero-tag.plain { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.hero-content h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin-bottom: 10px; text-shadow: 0 4px 24px rgba(0,0,0,.6); }
.hero-meta { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: .95rem; margin-bottom: 14px; flex-wrap: wrap; }
.hero-meta .rating { color: #fbbf24; font-weight: 700; }
.hero-overview {
  color: #d7d7e6; font-size: .98rem; max-width: 560px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 22px;
}
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 700; font-size: .95rem;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-play { background: #fff; color: #101018; box-shadow: 0 8px 24px rgba(255,255,255,.25); }
.btn-play:hover { background: #f0f0f5; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 24px rgba(139,92,246,.4); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline { border: 1px solid var(--border); color: var(--text); background: rgba(255,255,255,.06); }
.btn-outline:hover { border-color: var(--accent); background: var(--surface); }
.btn-outline.active { border-color: var(--accent); color: #fff; background: var(--gradient); }
.btn svg { flex-shrink: 0; }

/* ============================================================
   Rangées / Cards
   ============================================================ */
.main { padding-bottom: 80px; }
.main > .hero + .rows { margin-top: -30px; }
.rows { display: flex; flex-direction: column; gap: 34px; padding: 24px 32px 0; }

.row-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.row-title { font-size: 1.35rem; }
.row-more { color: var(--muted); font-size: .86rem; font-weight: 600; }
.row-more span { color: var(--accent); }
.row-more:hover { color: var(--text); }

.row-scroller { position: relative; display: flex; align-items: center; }
.row-track {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity;
  padding: 6px 2px 12px; scrollbar-width: none;
}
.row-track::-webkit-scrollbar { display: none; }
.row-track > * { scroll-snap-align: start; flex-shrink: 0; }

.scroll-btn {
  position: absolute; z-index: 5; top: 50%; transform: translateY(-70%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(16,16,28,.85); border: 1px solid var(--border);
  color: #fff; font-size: 1.6rem; line-height: 1;
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
  transition: background .15s, transform .15s, opacity .2s;
  opacity: 0; pointer-events: none;
}
.row-scroller:hover .scroll-btn { opacity: 1; pointer-events: auto; }
.scroll-btn:hover { background: var(--accent); }
.scroll-btn.prev { left: 0; }
.scroll-btn.next { right: 0; }
.scroll-btn:active { transform: translateY(-70%) scale(.92); }

/* Card */
.card {
  width: 172px; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; outline: none;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover, .card:focus-visible {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
  border-color: var(--accent);
}
.card-media { position: relative; aspect-ratio: 2/3; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-media img { transform: scale(1.06); }
.card-rating { position: absolute; top: 8px; left: 8px; z-index: 2; }
.rating-badge {
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  color: #fbbf24; font-weight: 800; font-size: .76rem;
  padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(251,191,36,.35);
}
.card-save {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 32px; height: 32px; border-radius: 9px;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: grid; place-items: center; color: #fff;
  opacity: 0; transition: opacity .18s, background .15s;
}
.card:hover .card-save, .card:focus-visible .card-save { opacity: 1; }
.card-save:hover { background: var(--accent); }

/* Grid (browse / résultats) */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
}
@media (max-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .card { width: 100%; } }

/* ============================================================
   Pages internes (browse / détails / watch / mylist)
   ============================================================ */
.page { padding: 32px; max-width: 1500px; margin: 0 auto; }
.page-title { font-size: 2rem; margin-bottom: 6px; }
.page-sub { color: var(--muted); margin-bottom: 24px; }

.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 28px;
}
.filters select, .filters input {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: .9rem; outline: none; font-family: inherit;
}
.filters select:focus, .filters input:focus { border-color: var(--accent); }
.filters label { color: var(--muted); font-size: .85rem; font-weight: 600; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button {
  padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--muted);
  transition: all .15s;
}
.seg button.active { background: var(--gradient); color: #fff; }
.seg button:hover:not(.active) { color: var(--text); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 34px; }
.pagination .page-btn {
  padding: 10px 20px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--border); font-weight: 600;
  transition: all .15s;
}
.pagination .page-btn:hover:not(:disabled) { border-color: var(--accent); color: #fff; }
.pagination .page-btn:disabled { opacity: .4; cursor: not-allowed; }
.pagination span { color: var(--muted); font-size: .9rem; }

/* ============================================================
   Détails
   ============================================================ */
.detail-hero { position: relative; min-height: 70vh; display: flex; align-items: flex-end; padding: 0 32px 56px; overflow: hidden; }
.detail-hero .hero-bg::after {
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(10,10,18,.4) 50%, rgba(10,10,18,.2) 100%),
    linear-gradient(to right, rgba(10,10,18,.92) 0%, rgba(10,10,18,.3) 60%, transparent);
}
.detail-hero .hero-content { max-width: 720px; }
.detail-synopsis { color: #dfdfEF; }
.detail-facts { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; color: var(--muted); }
.detail-facts .tag {
  background: var(--surface); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600;
}
.detail-facts .tag.rating { color: #fbbf24; }

.detail-body { padding: 28px 32px 60px; max-width: 1500px; margin: 0 auto; }
.section { margin-top: 40px; }
.section-title { font-size: 1.3rem; margin-bottom: 16px; }

.cast-scroller { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.cast-card { width: 130px; flex-shrink: 0; text-align: center; }
.cast-card img { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); margin-bottom: 8px; }
.cast-card h5 { font-size: .82rem; }
.cast-card p { font-size: .74rem; color: var(--muted); }
.cast-ph { width: 130px; height: 130px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); margin-bottom: 8px; }

.trailer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.trailer {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); cursor: pointer; aspect-ratio: 16/9;
}
.trailer img { width: 100%; height: 100%; object-fit: cover; }
.trailer .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.35); color: #fff; transition: background .15s;
}
.trailer:hover .play { background: rgba(0,0,0,.55); }
.trailer .play span {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gradient); display: grid; place-items: center;
  font-size: 1.3rem; padding-left: 4px; box-shadow: 0 8px 24px rgba(139,92,246,.5);
}
.trailer p { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px 14px 10px; font-size: .85rem; font-weight: 600;
  background: linear-gradient(to top, rgba(0,0,0,.85), transparent); }

/* Saisons */
.seasons { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.season-pill {
  padding: 10px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-weight: 600; color: var(--muted); font-size: .88rem;
}
.season-pill.active { background: var(--gradient); color: #fff; border-color: transparent; }
.season-pill:hover:not(.active) { color: var(--text); border-color: var(--accent); }

.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.ep-card {
  display: flex; gap: 12px; padding: 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: border-color .15s, transform .15s; text-align: left;
}
.ep-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.ep-card img { width: 136px; min-width: 136px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.ep-card .ep-info { overflow: hidden; }
.ep-card h5 { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-card .ep-num { color: var(--accent); font-size: .76rem; font-weight: 700; margin: 2px 0 4px; }
.ep-card p { font-size: .78rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Lightscreen genres suggestions */
.genre-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  padding: 9px 18px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  transition: all .15s;
}
.chip:hover { color: #fff; border-color: var(--accent); background: var(--surface-2); }

/* ============================================================
   Watch page
   ============================================================ */
.watch-page { max-width: 1280px; margin: 0 auto; padding: 24px 32px 60px; }
.watch-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.watch-title { font-size: 1.4rem; }
.watch-back { color: var(--muted); font-size: .9rem; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.watch-back:hover { color: var(--text); }

.player-wrap {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── Overlay de déblocage (smartlink) ── */
.unlock-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(139,92,246,.25), transparent 60%),
    linear-gradient(180deg, rgba(10,10,18,.94), rgba(10,10,18,.98));
}
.unlock-box {
  max-width: 460px; width: 100%; text-align: center;
}
.unlock-icon {
  width: 70px; height: 70px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--gradient);
  display: grid; place-items: center; font-size: 1.8rem;
  box-shadow: 0 10px 30px rgba(139,92,246,.45);
}
.unlock-box h3 { font-size: 1.5rem; margin-bottom: 6px; }
.unlock-box > p { color: var(--muted); font-size: .93rem; margin-bottom: 16px; }

.unlock-dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 22px; }
.unlock-dots span {
  width: 34px; height: 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: all .2s;
}
.unlock-dots span.done { background: var(--gradient); border-color: transparent; box-shadow: 0 0 12px rgba(139,92,246,.6); }

.unlock-btn { width: 100%; padding: 14px; font-size: 1rem; font-weight: 800; }
.unlock-note {
  margin-top: 14px; font-size: .78rem; color: var(--muted) !important;
  line-height: 1.5;
}
.unlock-note b { color: var(--text); }
.unlock-manual {
  display: block; margin-top: 6px; font-size: .72rem;
  color: #f5b759;
}

/* Message discret sous le player */
.ad-note {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: .8rem; margin-top: 12px;
}
.ad-note b { color: var(--accent-2); }

.player-bar {
  display: flex; align-items: center; gap: 18px; margin-top: 18px; flex-wrap: wrap;
}
.lang-seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px; }
.lang-seg button {
  padding: 8px 20px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--muted);
  transition: all .15s;
}
.lang-seg button.active { background: var(--gradient); color: #fff; }
.lang-seg button:hover:not(.active) { color: var(--text); }

.avail-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 700; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border);
}
.avail-badge.ok { color: var(--ok); border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.08); }
.avail-badge.warn { color: #fbbf24; border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.08); }
.avail-badge.bad { color: var(--danger); border-color: rgba(244,63,94,.4); background: rgba(244,63,94,.08); }

.watch-grid { display: grid; grid-template-columns: 1fr 360px; gap: 28px; margin-top: 26px; align-items: start; }
@media (max-width: 900px) { .watch-grid { grid-template-columns: 1fr; } }

.watch-info { color: var(--muted); font-size: .93rem; }
.watch-info strong { color: var(--text); }

.episode-list { display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow-y: auto; padding-right: 6px; }
.ep-item {
  display: flex; gap: 12px; align-items: center; padding: 8px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; transition: all .15s;
}
.ep-item:hover { border-color: var(--accent); }
.ep-item.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ep-item img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.ep-item .ep-text { flex: 1; min-width: 0; }
.ep-item h5 { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-item span { font-size: .72rem; color: var(--accent); font-weight: 700; }
.ep-item .ep-play { color: var(--muted); }
.ep-item.current .ep-play, .ep-item:hover .ep-play { color: #fff; }

.ep-nav { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* ============================================================
   Mylist
   ============================================================ */
.empty {
  text-align: center; padding: 80px 20px; color: var(--muted);
  border: 2px dashed var(--border); border-radius: var(--radius);
}
.empty h2 { color: var(--text); margin-bottom: 6px; }

/* ============================================================
   Overlays / misc
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; padding: 32px;
}
.lightbox.open { display: flex; }
.lightbox iframe { width: min(960px, 100%); aspect-ratio: 16/9; border-radius: var(--radius); border: none; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); color: #fff; font-size: 1.4rem;
  display: grid; place-items: center; border: 1px solid var(--border);
}
.lightbox-close:hover { background: var(--danger); }

#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #23233a; color: #fff; padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: .9rem; border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0,0,0,.4); z-index: 300;
  opacity: 0; pointer-events: none; transition: all .25s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 60px 0; color: var(--muted); }
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  padding: 24px; border-radius: var(--radius); text-align: center;
  background: rgba(244,63,94,.08); border: 1px solid rgba(244,63,94,.35); color: #fda4af;
  margin: 20px 0;
}

footer {
  border-top: 1px solid var(--border); padding: 28px 32px;
  text-align: center; color: var(--muted); font-size: .85rem; margin-top: 40px;
}
footer b { background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .header { padding: 0 16px; gap: 12px; }
  .nav a { padding: 8px 10px; font-size: .86rem; }
  .search-box input, .search-box input:focus { width: 40px; padding-left: 12px; }
  .search-box:focus-within input { width: 150px; padding-left: 38px; }
  .hero, .detail-hero { padding-left: 16px; padding-right: 16px; }
  .rows { padding: 20px 16px 0; }
  .page { padding: 20px 16px; }
  .detail-body { padding: 20px 16px 50px; }
  .watch-page { padding: 16px 14px 50px; }
  .hero { min-height: 60vh; }
  .main > .hero + .rows { margin-top: -40px; }
  .card { width: 148px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .ep-grid { grid-template-columns: 1fr; }
  .ep-card img { width: 110px; min-width: 110px; }
}
@media (max-width: 520px) {
  .card { width: 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero-btns .btn { flex: 1; text-align: center; }
  .watch-title { font-size: 1.15rem; }
}

/* ============================================================
   Modale / Comptes
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .7);
  display: none; place-items: center;
  z-index: 300;
}
.modal.open { display: grid; }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 92%; max-width: 420px; max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { font-size: 1.2rem; }
.modal-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-soft); border: 1px solid var(--border);
  font-size: 1.1rem; display: grid; place-items: center;
}
.modal-close:hover { border-color: var(--accent); color: var(--text); }

.acc-btn .acc-avatar {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 1.2rem; border-radius: 50%;
  background: var(--gradient);
  color: #fff;
}
.acc-avatar.lg { width: 38px; height: 38px; font-size: 1.3rem; }

.acc-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.acc-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  width: 100%; text-align: left;
  transition: border-color .15s;
}
.acc-row:hover { border-color: var(--accent); }
.acc-row.active { border-color: var(--accent); background: rgba(139, 92, 246, .12); }
.acc-row .acc-name { flex: 1; font-weight: 600; font-size: .95rem; }
.acc-tag {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--gradient); color: #fff;
}
.acc-del {
  width: 26px; height: 26px; border-radius: 50%;
  background: transparent; color: var(--muted);
  font-size: .85rem; display: grid; place-items: center;
}
.acc-del:hover { background: var(--danger); color: #fff; }
.acc-mini {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  font-size: .8rem; display: grid; place-items: center;
}
.acc-mini:hover { border-color: var(--accent); }
.acc-prov {
  font-size: .7rem; font-weight: 800; color: #fff;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: #5865F2;
}
.acc-avatar.pic {
  overflow: hidden; padding: 0;
  object-fit: cover;
  background: var(--surface-2);
}
.acc-avatar.lg.pic { width: 38px; height: 38px; }
.acc-avatar.pic.big { width: 54px; height: 54px; border-radius: 50%; }
.acc-sep.slim { border: none; margin: 4px 0 14px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; }
.acc-sep.slim::before, .acc-sep.slim::after { content: ''; flex: 1; border-top: 1px solid var(--border); }

/* connexion rapide */
.quick-login { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 2px; }
.quick-login .gbtn { display: grid; place-items: center; }
.discord-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #5865F2; color: #fff; font-weight: 700;
  border-radius: 999px; padding: 12px 16px; font-size: .95rem;
  border: none; width: 100%;
}
.discord-btn:hover { filter: brightness(1.1); }
.acc-lock {
  font-size: .8rem; color: var(--accent);
  margin-left: -6px;
}
.acc-empty { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.acc-note { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.lock-note { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0; }
.acc-sep { border-top: 1px solid var(--border); margin: 14px 0; }

/* vues connexion / mot de passe */
.acc-auth {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 10px; padding: 8px 0 16px;
}
.acc-auth .acc-avatar.big { width: 54px; height: 54px; font-size: 1.7rem; }
.acc-auth h4 { font-size: 1.1rem; }
.acc-auth p { color: var(--muted); font-size: .9rem; }
.acc-auth .acc-form { width: 100%; max-width: 300px; text-align: left; }
.acc-hint { font-style: italic; color: var(--muted); }
.acc-err { color: var(--danger); font-size: .85rem; }
.acc-back { margin-top: 6px; }
.acc-form { display: flex; flex-direction: column; gap: 10px; }
.acc-form input {
  padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft);
  color: var(--text); font-size: .95rem;
}
.acc-form input:focus { outline: none; border-color: var(--accent); }
.acc-emojis { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-emojis button {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 1.15rem;
}
.acc-emojis button:hover, .acc-emojis button.picked {
  border-color: var(--accent); background: rgba(139, 92, 246, .18);
}

/* ============================================================
   Carte overlay (progression, continue)
   ============================================================ */
.card-ov {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .55);
  display: none; place-items: center;
  border-radius: 14px;
}
.card:hover .card-ov, .card:focus .card-ov, .card-ov.nohide { display: grid; }
.card-ov span { font-size: .9rem; font-weight: 700; color: #fff; text-align: center; padding: 10px; }

.resume-pill { font-size: .85rem; }
.btn-continue { font-size: .88rem; }

/* ============================================================
   Épisodes vus (badge)
   ============================================================ */
.ep-card.watched { border-color: var(--ok); }
.ep-card.watched::after {
  content: ''; position: absolute; top: 6px; right: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok);
}
.ep-card { position: relative; }
.ep-check {
  font-size: .72rem; font-weight: 700; color: var(--ok);
  margin-right: 6px;
}

/* ============================================================
   Page connexion / inscription (login.html)
   ============================================================ */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.auth-center { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.auth-brand .dot {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gradient); display: grid; place-items: center; font-size: 0;
  box-shadow: 0 4px 18px rgba(139, 92, 246, .45);
}

.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 26px 26px 22px; width: 100%;
  display: flex; flex-direction: column; gap: 0;
}

.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
}
.auth-tabs button {
  flex: 1; padding: 10px 0; border-radius: 10px; font-weight: 700; font-size: .92rem;
  color: var(--muted); background: var(--bg-soft); border: 1px solid transparent;
}
.auth-tabs button.active { background: var(--gradient); color: #fff; border-color: var(--accent); }
.auth-tabs button:not(.active):hover { color: var(--text); border-color: var(--border); }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.auth-form input {
  padding: 11px 14px; border-radius: 10px; font-size: .95rem;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
}
.auth-form input::placeholder { color: #555; }
.auth-form input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }

.auth-view { display: flex; flex-direction: column; gap: 0; }
.auth-view.hidden { display: none; }

.btn-block { width: 100%; }

.err { color: var(--danger); font-size: .84rem; }
.muted { color: var(--muted); }

.link-btn { background: none; border: none; color: var(--accent); font-size: .82rem; margin-top: -4px; }
.link-btn:hover { text-decoration: underline; }

.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 14px 0 12px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px solid var(--border); }

.auth-guest {
  background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 11px 20px;
  color: var(--muted); font-weight: 600; font-size: .9rem;
}
.auth-guest:hover { color: var(--text); border-color: var(--accent); }

.auth-foot { text-align: center; color: #555; font-size: .78rem; margin-top: -4px; }

.forgot-note { font-size: .84rem; color: var(--muted); line-height: 1.45; margin-bottom: 6px; }
.forgot-result { background: var(--bg-soft); border-radius: 10px; padding: 14px; font-size: .9rem; line-height: 1.45; display: flex; flex-direction: column; gap: 8px; }
.forgot-result .hint-box { color: var(--accent); font-style: italic; }
.forgot-giveup { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.forgot-danger { margin-top: 10px; }

.hidden { display: none !important; }

/* ============================================================
   Commentaires (page détails)
   ============================================================ */
.comments-section { margin-top: 26px; }
.comments-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.comments-head { display: flex; align-items: center; gap: 10px; }
.comments-count {
  min-width: 22px; height: 22px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--muted); font-size: .76rem; font-weight: 700;
}

.comment-form { display: flex; flex-direction: column; gap: 10px; }
.comment-form-row { display: flex; gap: 10px; align-items: center; }
.comment-name {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft);
  color: var(--text); font-size: .92rem; min-width: 0;
}
.comment-name:focus, .comment-text:focus { outline: none; border-color: var(--accent); }
.comment-text {
  resize: vertical; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft);
  color: var(--text); font-size: .92rem; font-family: inherit; line-height: 1.5;
}

.comments-list { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.comments-empty { color: var(--muted); font-size: .9rem; text-align: center; padding: 14px 0; }

.comment {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
  position: relative;
}
.comment-avatar {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gradient); color: #fff; font-weight: 800; font-size: 1.05rem;
  margin-top: 2px;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.comment-name-display { font-weight: 700; color: var(--text); font-size: .95rem; }
.comment-date { color: var(--muted); font-size: .76rem; }
.comment-text-display { color: #c7c7da; font-size: .92rem; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.comment-del {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); font-size: .8rem; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.comment-del:hover { color: #fff; border-color: var(--danger, #ef4444); background: rgba(239, 68, 68, .18); }