/* ==========================================================================
   NekoFlix — composants
   ========================================================================== */

/* ── Système d'images : un cadre, un ratio, jamais d'image déformée ───────
   .frame[data-r="poster|backdrop|episode|avatar|banner|tile"]
   L'image est en object-fit: cover ; tant qu'elle charge, le cadre montre
   un squelette ; si elle manque ou casse, une vignette de repli propre. */
.frame { position: relative; display: block; width: 100%; overflow: hidden; isolation: isolate; border-radius: var(--r); background: var(--surface-2); }
.frame[data-r="poster"] { aspect-ratio: 2 / 3; }
.frame[data-r="backdrop"], .frame[data-r="episode"] { aspect-ratio: 16 / 9; }
.frame[data-r="avatar"] { aspect-ratio: 1; border-radius: 50%; }
.frame[data-r="banner"] { aspect-ratio: 4 / 1; }
.frame[data-r="tile"] { aspect-ratio: 16 / 10; }
.frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; opacity: 0; transition: opacity .3s ease, transform .45s var(--ease); }
.frame > img.is-loaded { opacity: 1; }
/* Pas d'animation pendant le chargement : sur l'accueil, des centaines d'images
   attendent (chargement différé) et autant d'animations infinies faisaient ramer. */
.frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.frame-fb { position: absolute; inset: 0; z-index: -2; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; background: radial-gradient(120% 80% at 0% 0%, rgba(var(--accent-rgb), .22), transparent 60%), linear-gradient(160deg, var(--surface-3), var(--surface)); color: var(--text); font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.frame-fb img { width: 26px; height: 26px; opacity: .55; }
.frame-fb span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.frame[data-r="episode"] .frame-fb, .frame[data-r="backdrop"] .frame-fb, .frame[data-r="avatar"] .frame-fb { justify-content: center; align-items: center; }
/* ── Carte affiche (PosterCard) : affiche arrondie, titre dessous ─────── */
.card { position: relative; min-width: 0; transition: transform var(--dur-2) var(--ease); }
.card-link { position: absolute; inset: 0; z-index: 1; border-radius: var(--r); }
.card-media { position: relative; border-radius: var(--r); overflow: hidden; }
.card-media .frame { border-radius: var(--r); }
.card-badges { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 2; display: flex; justify-content: flex-end; gap: 4px; pointer-events: none; }
.card-badges > span:empty { display: none; }
.cbadge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-xs); background: rgba(0, 0, 0, .75); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.cbadge .kdot { display: none; }
.cbadge.accent { background: var(--accent); color: var(--on-accent); }
.cbadge.done { background: #22c55e; color: #052e13; }
/* Rang : petite étiquette sur l'affiche (grilles)… */
.card > .card-rank { position: absolute; left: 8px; top: 8px; z-index: 3; pointer-events: none; height: 26px; min-width: 26px; padding: 0 8px; display: grid; place-items: center; border-radius: var(--r-xs); background: var(--accent); color: #fff; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* …et, dans la rangée Top 10 : grand chiffre à gauche de l'affiche, dans sa propre
   colonne (largeur fixe, débordement coupé) : il ne chevauche jamais le titre ni la
   carte voisine, quelle que soit la largeur de l'écran. */
.track.ranked { grid-auto-columns: calc(var(--card-w) * 1.6); }
.track.ranked .card { padding-left: calc(var(--card-w) * .6); }
.track.ranked .card > .card-rank {
  left: 0; top: 0; bottom: auto; width: calc(var(--card-w) * .74); height: calc(var(--card-w) * 1.5); min-width: 0; padding: 0;
  display: flex; align-items: flex-end; justify-content: flex-end; overflow: hidden;
  background: none; border-radius: 0; z-index: 0;
  font-size: calc(var(--card-w) * 1.02); font-weight: 800; line-height: .78; letter-spacing: -.04em;
  color: var(--bg); -webkit-text-stroke: 3px rgba(255, 255, 255, .55); paint-order: stroke fill;
}
.track.ranked .card > .card-rank.r10 { font-size: calc(var(--card-w) * .64); letter-spacing: -.07em; }
.track.ranked .card.has-rank .card-media { z-index: 1; box-shadow: -10px 0 18px -8px rgba(0, 0, 0, .8); }
.track.ranked .card-body { position: relative; z-index: 1; }
html[data-theme="light"] .track.ranked .card > .card-rank { -webkit-text-stroke-color: rgba(0, 0, 0, .3); }
.card-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 4px; background: rgba(255, 255, 255, .25); pointer-events: none; }
.card-progress i { display: block; height: 100%; background: var(--accent); }
.card-overlay { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; background: linear-gradient(180deg, rgba(10, 10, 12, 0) 30%, rgba(10, 10, 12, .96)); opacity: 0; transition: opacity var(--dur) var(--ease); }
.card-ov-title { display: none; }
.card-info { color: #c4c4cc; font-size: 11.5px; font-weight: 600; margin-bottom: 6px; }
.card-desc { color: #dcdce2; font-size: 12px; line-height: 1.45; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { display: flex; gap: 6px; pointer-events: auto; }
.qa { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; transition: background var(--dur) var(--ease), transform var(--dur) var(--ease); }
.qa svg { width: 18px; height: 18px; }
.qa:hover { background: rgba(255, 255, 255, .3); }
.qa.qa-play { background: var(--accent); }
.qa.qa-play:hover { background: var(--accent-hover); }
.qa[aria-pressed="true"] { background: #fff; color: #111; }
.qa.qa-fav[aria-pressed="true"] { background: #fff; color: #e11d48; }
.card-body { padding: 10px 2px 0; }
.card-title { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.card-meta .kdot { display: none; }
.card-meta span:last-child { overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) and (pointer: fine) {
  .card:hover, .card:focus-within { transform: translateY(-4px); }
  .card:hover .card-overlay, .card:focus-within .card-overlay { opacity: 1; }
}
@media (hover: none), (pointer: coarse) { .card-overlay { display: none; } }
.card-skel .card-body .skel-line:last-child { width: 55%; }

/* ── Carte compacte (liste) ────────────────────────────────────────────── */
.ccard { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.ccard:hover { background: var(--surface-2); border-color: var(--line-2); }
.ccard .frame { width: 64px; flex: none; border-radius: var(--r-sm); }
.ccard-body { flex: 1; min-width: 0; }
.ccard-title { font-size: 15px; font-weight: 600; }
.ccard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.ccard-desc { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.ccard-actions { position: relative; z-index: 2; display: flex; gap: 6px; flex: none; }
.ccard .card-link { border-radius: var(--r-lg); }
.ccard .rank-n { width: 36px; flex: none; text-align: center; font-size: 22px; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ccard .rank-n.top { color: var(--gold); }

/* ── Carte « Continuer à regarder » (paysage + progression) ────────────── */
.wcard { position: relative; min-width: 0; }
.wcard-media { position: relative; }
.wcard-play { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity var(--dur) var(--ease); }
.wcard-play span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-2); }
.wcard:hover .wcard-play, .wcard:focus-within .wcard-play { opacity: 1; }
.wcard .card-progress { left: 0; right: 0; bottom: 0; height: 4px; }
.wcard-media { border-radius: var(--r); overflow: hidden; }
.wcard-tag { position: absolute; left: 10px; bottom: 12px; z-index: 2; pointer-events: none; }
.wcard-inset { position: absolute; right: 10px; top: 10px; bottom: 14px; z-index: 2; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-2); pointer-events: none; }
.wcard-inset .frame { height: 100%; border-radius: 8px; }
.wcard-body { display: flex; align-items: flex-start; gap: 8px; padding: 10px 2px 0; }
.wcard-body > div { flex: 1; min-width: 0; }
.wcard-remove { position: relative; z-index: 2; }

/* ── Carte d'épisode ───────────────────────────────────────────────────── */
.ep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 14px; }
.epcard { position: relative; min-width: 0; border-radius: var(--r-lg); }
.epcard .card-link { border-radius: var(--r-lg); }
.ep-thumb { position: relative; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.ep-thumb .frame { border-radius: var(--r); }
.ep-thumb::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: var(--r); background: linear-gradient(0deg, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, .1) 45%, transparent 70%); }
.ep-cover > img { object-position: center 25%; filter: saturate(1.05) brightness(.9); }
.epcard:hover .ep-thumb { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .7); }
.epcard:hover .ep-thumb img { transform: scale(1.04); }
.epcard.is-current .ep-thumb { box-shadow: 0 0 0 2px var(--accent); }
.ep-num { position: absolute; left: 10px; bottom: 9px; z-index: 2; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .02em; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); pointer-events: none; }
.ep-done { position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; background: rgba(16, 16, 22, .78); color: #4ade80; font-size: 11.5px; font-weight: 700; pointer-events: none; backdrop-filter: blur(6px); }
.ep-done svg { width: 13px; height: 13px; }
.ep-done.cur { color: #fff; background: var(--accent); }
.ep-thumb .card-progress { left: 0; right: 0; bottom: 0; z-index: 3; border-radius: 0; height: 3px; }
.ep-play { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity var(--dur) var(--ease); }
.ep-play span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-2); }
.epcard:hover .ep-play, .epcard:focus-within .ep-play { opacity: 1; }
.ep-body { display: flex; align-items: flex-start; gap: 6px; padding: 10px 2px 0; }
.ep-text { flex: 1; min-width: 0; }
.ep-title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.ep-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.ep-seen { position: relative; z-index: 2; flex: none; margin-top: -4px; color: var(--text-3); }
.ep-seen[aria-pressed="true"] { color: var(--success); }
.epcard.is-done .ep-title { color: var(--text-2); }
.epcard.is-done .ep-thumb img { filter: brightness(.6) saturate(.8); }

/* ── Tuiles (genres, catégories, collections) ──────────────────────────── */
.tile { position: relative; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; aspect-ratio: 16 / 10; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface-2); text-align: left; transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.tile > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform .5s var(--ease); }
.tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 8, 12, .1) 0%, rgba(8, 8, 12, .88) 100%); }
.tile-label { display: block; color: #fff; font-size: 17px; font-weight: 650; line-height: 1.2; }
.tile-sub { display: block; margin-top: 2px; color: rgba(255, 255, 255, .72); font-size: 12.5px; font-weight: 500; }
@media (hover: hover) { .tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); } .tile:hover > img { transform: scale(1.05); } }
.gtile { --h: 260; position: relative; display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--text); text-align: left; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.gtile::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h) 65% 65%); flex: none; }
.gtile span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtile .count { flex: none; color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.gtile:hover { border-color: var(--line-2); background: var(--surface-2); }

/* ── Hero de l'accueil ─────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: clamp(520px, 82vh, 860px); padding-top: calc(var(--header-h) + 40px); background: var(--bg);
}
.hero-ambient { display: none; }
/* Fond de la une : UNE seule image fixe (pas d'animation ni de mur d'affiches qui
   glisse : c'était la principale cause de ralentissements).
   - image large (bannière / image horizontale d'anime) : plein écran ;
   - sinon l'affiche verticale, nette, collée à droite et fondue côté texte. */
.hero-backdrop { position: absolute; inset: 0; z-index: -2; background: center 30% / cover no-repeat; transition: opacity .5s ease; }
.hero-backdrop.is-loading { opacity: 0; }
/* Affiche verticale : nette, collée à droite, fondue côté texte */
.hero-backdrop[data-fit="poster"], .detail-backdrop[data-fit="poster"] {
  left: auto; width: auto; aspect-ratio: 2 / 3; background-position: center top;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40%); mask-image: linear-gradient(90deg, transparent 0, #000 40%);
}
/* Image horizontale trop petite pour le plein cadre : à sa taille, en haut à droite, bords fondus */
.hero-backdrop[data-fit="framed"], .detail-backdrop[data-fit="framed"] {
  left: auto; bottom: auto; width: var(--fw); height: auto; aspect-ratio: var(--far); max-height: 100%; background-size: cover; background-position: center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 35%), linear-gradient(0deg, transparent 0, #000 35%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0, #000 35%), linear-gradient(0deg, transparent 0, #000 35%); mask-composite: intersect;
}
.hero.is-changing .hero-backdrop { opacity: 0; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background:
  linear-gradient(90deg, rgba(var(--bg-rgb), .97) 0%, rgba(var(--bg-rgb), .85) 30%, rgba(var(--bg-rgb), .35) 52%, rgba(var(--bg-rgb), 0) 62%),
  linear-gradient(0deg, var(--bg) 0%, rgba(var(--bg-rgb), .6) 16%, rgba(var(--bg-rgb), 0) 42%),
  linear-gradient(180deg, rgba(var(--bg-rgb), .55) 0%, rgba(var(--bg-rgb), 0) 18%); }
.hero-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; padding: 0 var(--gutter); }
.hero-content { display: flex; flex-direction: column; max-width: 640px; }
.hero-eyebrow { order: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 14px; color: #d6d6dc; font-size: 14px; font-weight: 600; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.hero-eyebrow .sep { color: #8a8a92; }
.hero-eyebrow .type-pill { height: 24px; padding: 0 10px; border-radius: var(--r-xs); display: inline-flex; align-items: center; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-shadow: none; }
.hero-title { order: 1; margin-bottom: 14px; text-wrap: balance; font-size: clamp(34px, 4.2vw, 64px); font-weight: 800; line-height: 1.02; letter-spacing: -.015em; text-shadow: 0 4px 30px rgba(0, 0, 0, .55); }
.hero-desc { order: 2; max-width: 560px; color: #dadae0; font-size: 15.5px; line-height: 1.6; text-shadow: 0 1px 10px rgba(0, 0, 0, .6); }
html[data-theme="light"] .hero-desc { color: #2f2f3a; text-shadow: none; }
.hero-actions { order: 3; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-poster { display: none; }
.hero-nav { display: flex; align-items: center; gap: 16px; padding: 28px var(--gutter) 36px; }
.hero-dots { display: flex; gap: 8px; }
.hero-dots button { position: relative; width: 14px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; transition: width var(--dur-2) var(--ease); }
html[data-theme="light"] .hero-dots button { background: rgba(0, 0, 0, .15); }
.hero-dots button::before { content: ""; position: absolute; inset: -10px 0; }
.hero-dots button[aria-current="true"] { width: 36px; }
.hero-dots button i { position: absolute; inset: 0; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left center; }
.hero-dots button[aria-current="true"] i { animation: hero-progress var(--hero-ms, 8000ms) linear forwards; }
.hero.is-paused .hero-dots button[aria-current="true"] i { animation-play-state: paused; }
@keyframes hero-progress { to { transform: scaleX(1); } } /* transform : animé par le GPU, sans recalcul de mise en page */
.hero-arrows { display: none; }
.rows { margin-top: 8px; }
/* Miniatures des titres de la une (remplacent les points sur ordinateur) */
.hero-thumbs { display: flex; gap: 10px; margin-left: auto; }
.hthumb { position: relative; width: 58px; border-radius: var(--r-sm); overflow: hidden; opacity: .5; transform: translateY(0); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.hthumb .frame { border-radius: var(--r-sm); }
.hthumb:hover { opacity: .85; transform: translateY(-3px); }
.hthumb[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--accent); transform: translateY(-4px); }
.hthumb i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; z-index: 3; }
.hthumb[aria-current="true"] i { animation: hero-progress var(--hero-ms, 8000ms) linear forwards; }
.hero.is-paused .hthumb[aria-current="true"] i { animation-play-state: paused; }
.hero-thumbs:not(:empty) ~ .hero-arrows, .hero-nav:has(.hero-thumbs:not(:empty)) .hero-dots { display: none; }
.hero-arrows button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .12); }
.hero-arrows button:hover { background: rgba(255, 255, 255, .22); }
.rows { margin-top: 28px; }

/* ── Franchises & studios : tuiles aux couleurs de chaque marque ───────── */
.ftile { position: relative; display: grid; place-items: center; aspect-ratio: 2.1 / 1; border-radius: var(--r); overflow: hidden; isolation: isolate; background: linear-gradient(135deg, #26262c, #141417); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.ftile:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 12px 28px rgba(0, 0, 0, .45); }
.ftile-bg { display: none; }
.ftile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at 50% 120%, rgba(255, 255, 255, .08), transparent 60%); }
.ftile-name { padding: 0 12px; text-align: center; color: #fff; font-size: clamp(22px, 2vw, 32px); font-weight: 800; line-height: 1; }
.ftile.fr-netflix { background: linear-gradient(135deg, #1a0002, #000 70%); }
.ftile.fr-netflix .ftile-name { color: #e50914; text-transform: uppercase; letter-spacing: .02em; font-size: clamp(26px, 2.4vw, 38px); }
.ftile.fr-prime-video { background: linear-gradient(135deg, #0f171e, #1b2b3a); }
.ftile.fr-prime-video .ftile-name { color: #fff; text-transform: lowercase; font-weight: 700; }
.ftile.fr-prime-video .ftile-name::after { content: ""; display: block; width: 60%; height: 4px; margin: 6px auto 0; border-bottom: 3px solid #1a98ff; border-radius: 0 0 50% 50%; }
.ftile.fr-marvel { background: linear-gradient(135deg, #b0121a, #5c0509); }
.ftile.fr-marvel .ftile-name { padding: 4px 12px; background: #ec1d24; color: #fff; text-transform: uppercase; letter-spacing: -.02em; font-size: clamp(26px, 2.4vw, 38px); box-shadow: 0 0 0 2px #fff; }
.ftile.fr-dc-comics { background: linear-gradient(135deg, #0a3d91, #041a40); }
.ftile.fr-dc-comics .ftile-name { width: 2.4em; height: 2.4em; display: grid; place-items: center; padding: 0; border-radius: 50%; background: #0476f2; box-shadow: 0 0 0 3px #fff; font-size: clamp(20px, 1.8vw, 28px); }
.ftile.fr-star-wars { background: radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent), radial-gradient(1px 1px at 40% 80%, #fff, transparent), radial-gradient(1px 1px at 85% 65%, #fff, transparent), #050505; }
.ftile.fr-star-wars .ftile-name { color: #ffe81f; text-transform: uppercase; letter-spacing: .06em; }
.track.franchises { grid-auto-columns: clamp(240px, 21vw, 320px); }

.hero-swap { transition: opacity .25s ease, transform .25s ease; }
.hero.is-changing .hero-swap { opacity: 0; transform: translateY(6px); }

/* ── Divers ────────────────────────────────────────────────────────────── */
.stars { color: var(--gold); letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); flex: none; }

/* ── États vides / erreurs ─────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 20px; text-align: center; color: var(--text-2); }
.empty-state .ico { width: 56px; height: 56px; margin-bottom: 4px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.empty-state h3 { color: var(--text); font-size: 17px; font-weight: 600; }
.empty-state p { max-width: 440px; font-size: 14px; line-height: 1.55; }
.empty-state .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.empty-state.compact { padding: 28px 16px; }
.empty-inline { padding: 4px 0; color: var(--text-3); font-size: 14px; }
.error-state .ico { background: var(--error-soft); color: var(--error); }

/* ── Modales ───────────────────────────────────────────────────────────── */
.modal-root { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--overlay); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade-in .18s ease both; }
.dialog { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 48px); overflow-y: auto; border-radius: var(--r-xl); background: var(--elevated); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); animation: pop-in .2s var(--ease) both; }
.dialog.wide { max-width: 660px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.dialog-head h2 { font-size: 18px; font-weight: 650; }
.dialog-body { padding: 16px 20px 20px; }
.dialog-body > p { color: var(--text-2); font-size: 14px; line-height: 1.55; }
.dialog-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 0 20px 20px; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 14px; }
.share-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: var(--r); background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.share-btn:hover { background: var(--surface-3); color: var(--text); }
.share-btn svg { width: 22px; height: 22px; }
.copy-row { display: flex; gap: 8px; margin-top: 12px; }
.copy-row .field { font-size: 13px; }
.radio-list { display: flex; flex-direction: column; gap: 6px; }
.radio-list label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); font-size: 14px; cursor: pointer; }
.radio-list input { accent-color: var(--accent); }

/* Menu contextuel / déroulant */
.ctx { position: fixed; z-index: 220; min-width: 220px; padding: 6px; border-radius: 10px; background: rgba(20, 20, 23, .98); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); animation: pop-in .14s var(--ease) both; }
.ctx .menu-item[aria-checked="true"] { color: var(--accent-text); }
.ctx .menu-item[aria-checked="true"] svg { color: var(--accent-text); }

/* ── Toasts ────────────────────────────────────────────────────────────── */
.toasts { position: fixed; right: 24px; bottom: calc(24px + var(--bottom-h)); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; width: 360px; max-width: calc(100vw - 32px); padding: 12px 10px 12px 14px; border-radius: var(--r-lg); background: var(--elevated); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); pointer-events: auto; animation: fade-up .25s var(--ease) both; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }
.toast-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); }
.toast.error .toast-ico { background: var(--error-soft); color: var(--error); }
.toast.success .toast-ico { background: var(--success-soft); color: var(--success); }
.toast-txt { flex: 1; min-width: 0; }
.toast-txt b { display: block; font-size: 14px; font-weight: 600; }
.toast-txt span { color: var(--text-3); font-size: 12.5px; }

/* ── Lecteur ───────────────────────────────────────────────────────────── */
.player-root { position: fixed; inset: 0; z-index: 250; display: flex; flex-direction: column; background: #000; color: #fff; animation: fade-in .2s ease both; }
.player-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #0a0a0d; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.player-top .ttl { flex: 1; min-width: 0; }
.player-top h2 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-top .sub { font-size: 12.5px; color: #9d9db0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-root .icon-btn { color: #d7d7e0; } .player-root .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.player-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.player-stage video, .player-stage iframe { width: 100%; height: 100%; border: 0; background: #000; }
/* Liste des épisodes dans le lecteur (panneau à droite) */
.player-main { position: relative; flex: 1; min-height: 0; display: flex; }
.player-main > .player-stage { flex: 1; min-width: 0; }
.p-eps { position: relative; z-index: 5; flex: none; width: 330px; display: flex; flex-direction: column; background: rgba(12, 12, 16, .96); border-left: 1px solid rgba(255, 255, 255, .08); animation: fade-in .15s ease both; }
.p-eps[hidden] { display: none; }
@media (max-width: 760px) { .p-eps { position: absolute; top: 0; right: 0; bottom: 0; width: min(330px, 88vw); } }
.p-eps-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.p-eps-head b { font-size: 15px; } .p-eps-head span { color: #8d8d9e; font-size: 13px; flex: 1; }
.p-eps-list { flex: 1; overflow-y: auto; padding: 6px; list-style: none; margin: 0; overscroll-behavior: contain; }
.p-eps-list button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); color: #d8d8e2; font-size: 13.5px; text-align: left; }
.p-eps-list button:hover { background: rgba(255, 255, 255, .08); }
.p-eps-list .n { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, .08); font-weight: 800; font-variant-numeric: tabular-nums; }
.p-eps-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-eps-list svg { width: 16px; height: 16px; color: var(--success); flex: none; }
.p-eps-list em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--accent-text); }
.p-eps-list .on { background: rgba(var(--accent-rgb), .18); color: #fff; }
.p-eps-list .on .n { background: var(--accent); color: var(--on-accent); }
.p-eps-list .done:not(.on) { color: #9a9aab; }
/* Plein écran (vrai ou « plein cadre » sur iPhone) : seulement la vidéo */
.p-fs-exit { display: none; }
.player-root.is-fs .player-top, .player-root.is-fs .player-bar { display: none; }
.player-root.is-fs .p-fs-exit { position: absolute; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); z-index: 6; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; opacity: .45; transition: opacity var(--dur) var(--ease); }
.player-root.is-fs .p-fs-exit:hover, .player-root.is-fs .p-fs-exit:focus-visible { opacity: 1; }
.player-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: #0a0a0d; border-top: 1px solid rgba(255, 255, 255, .06); }
.player-bar .spacer { flex: 1; }
.pbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .08); color: #e4e4ec; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background var(--dur) var(--ease); }
.pbtn:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.pbtn:disabled { opacity: .35; cursor: not-allowed; }
.psrc { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.psrc .lbl { color: #a1a1b0; font-size: 12.5px; font-weight: 600; margin-right: 2px; }
.psrc .pbtn { min-width: 34px; justify-content: center; padding: 0 10px; }
.psrc .pbtn.on { background: var(--accent); color: #fff; }
.psrc .player-hint { margin-left: 4px; }
.psrc .pbtn { position: relative; }
.low-ads { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.pbtn[aria-pressed="true"], .pbtn[aria-pressed="true"]:hover:not(:disabled) { background: #fff; color: #111; }
.pbtn.primary { background: var(--accent); color: var(--on-accent); }
.pselect { height: 34px; padding: 0 30px 0 10px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d0d0dc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; border: 0; color: #e4e4ec; font-size: 13px; font-weight: 600; appearance: none; -webkit-appearance: none; }
.pselect option { background: #16161f; }
.player-status { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 440px; padding: 24px; text-align: center; color: #b4b4c4; font-size: 14px; line-height: 1.5; }
.player-status .spinner { border-color: rgba(255, 255, 255, .15); border-top-color: var(--accent); }
.player-hint { color: #7d7d90; font-size: 12px; }
.player-osd { position: absolute; top: 50%; left: 50%; z-index: 4; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: var(--r); background: rgba(0, 0, 0, .7); font-size: 14px; font-weight: 600; pointer-events: none; animation: fade-in .15s ease both; }
/* Écran de fin d'épisode */
.endscreen { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; background: rgba(5, 5, 8, .9); backdrop-filter: blur(6px); text-align: center; animation: fade-in .25s ease both; overflow-y: auto; }
.endscreen h3 { font-size: 20px; font-weight: 650; }
.next-card { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 440px; padding: 12px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .06); text-align: left; }
.next-card .frame { width: 120px; flex: none; }
.countdown-ring { position: relative; width: 44px; height: 44px; flex: none; }
.countdown-ring svg { transform: rotate(-90deg); }
.countdown-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; }
.endscreen .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.endscreen .recos { display: grid; grid-template-columns: repeat(4, 110px); gap: 10px; }
.endscreen .recos button { text-align: left; font-size: 12px; color: #c9c9d6; }
.endscreen .recos .frame { margin-bottom: 6px; }

/* ── Statistiques & graphiques ─────────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat-card { padding: 16px; border-radius: var(--r); background: var(--surface); }
.stat-card .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-card .l { margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.stat-card .d { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.panel-box { padding: 18px; border-radius: var(--r); background: var(--surface); }
.panel-box h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bars .bar { position: relative; flex: 1; min-width: 4px; height: var(--h, 0%); border-radius: 3px 3px 0 0; background: var(--accent); opacity: .85; transition: opacity var(--dur) var(--ease); }
.bars .bar.zero { height: 3px; background: var(--surface-3); opacity: 1; }
.bars .bar:hover { opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--text-3); }
.hbar { display: grid; grid-template-columns: minmax(80px, 170px) 1fr auto; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .bg { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hbar .bg i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.hbar .n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.chart-svg { display: block; width: 100%; height: 190px; overflow: visible; }
.chart-svg .gl { stroke: var(--line); }
.chart-svg .area { fill: rgba(var(--accent-rgb), .14); }
.chart-svg .ln { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-svg .ln2 { fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-svg text { fill: var(--text-3); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--accent); }
.legend i.alt { background: var(--text-3); }

/* ── Badges de profil ──────────────────────────────────────────────────── */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.bdg { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--surface); }
.bdg .e { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); }
.bdg .e svg { width: 20px; height: 20px; }
.bdg b { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.bdg span { display: block; font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.bdg.locked { opacity: .7; border: 1px dashed var(--line-2); background: transparent; } .bdg.locked .e { background: var(--surface-2); color: var(--text-3); }

/* ── Avis ──────────────────────────────────────────────────────────────── */
/* Avis : résumé (note + répartition) à gauche, formulaire à droite, puis les avis en cartes */
.rv-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.rv-sum { display: flex; align-items: center; gap: 28px; padding: 22px 24px; }
.rv-score { display: flex; align-items: center; gap: 14px; flex: none; }
.rv-score b { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.rv-score .stars { font-size: 15px; }
.rv-score span { display: block; margin-top: 3px; color: var(--text-3); font-size: 13px; }
.rv-dist { flex: 1; min-width: 120px; display: grid; gap: 5px; }
.rv-bar { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.rv-bar span { width: 8px; text-align: right; }
.rv-bar i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.rv-bar b { display: block; height: 100%; border-radius: 3px; background: var(--gold); }
.rv-sum-empty { gap: 14px; }
.rv-sum-empty b { display: block; font-size: 15px; }
.rv-sum-empty span { color: var(--text-3); font-size: 13.5px; }
.rv-empty-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-3); color: var(--text-2); }
.rv-empty-ico svg { width: 20px; height: 20px; }
.rv-form { padding: 18px 22px; border-left: 1px solid var(--line); background: var(--surface-2); }
.rv-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rv-form-ttl { font-size: 14.5px; font-weight: 700; }
.rv-form textarea { min-height: 76px; resize: vertical; }
.rv-form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.rv-stars { display: flex; gap: 0; }
.rv-stars button { width: 30px; height: 30px; font-size: 22px; line-height: 1; color: var(--surface-3); border-radius: var(--r-sm); transition: color var(--dur) var(--ease); }
.rv-stars button:hover, .rv-stars:hover button { color: rgba(245, 196, 81, .55); }
.rv-stars button:hover ~ button { color: var(--surface-3); }
.rv-stars button.on { color: var(--gold); }
.rv-locked { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.rv-locked p { color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.rv-locked p b { color: var(--text); }
.rv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; margin-top: 14px; }
.rv-item { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.rv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rv-head .avatar { width: 36px; height: 36px; font-size: 14px; flex: none; }
.rv-name { font-size: 14px; font-weight: 600; }
.rv-date { color: var(--text-3); font-size: 12.5px; }
.rv-text { color: var(--text-2); font-size: 14px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.rv-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 8px 0 -6px -8px; }
.rv-actions .btn-xs[aria-pressed="true"] { color: var(--accent-text); }
@media (max-width: 900px) { .rv-box { grid-template-columns: 1fr; } .rv-form { border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 480px) { .rv-sum { flex-direction: column; align-items: stretch; gap: 16px; } .rv-sum-empty { flex-direction: row; align-items: center; } .rv-locked { flex-direction: column; align-items: stretch; } }
@media (max-width: 768px) {
  .card-title { font-size: 13px; } .card-meta { font-size: 11.5px; }
  .cbadge { height: 20px; padding: 0 6px; font-size: 10px; }
  .card-badges { top: 6px; left: 6px; right: 6px; }
  .card-rank { min-width: 32px; height: 32px; font-size: 16px; padding: 0 8px; }
  .ep-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .ep-title { font-size: 13px; }
  .ep-num { font-size: 13px; }
  .toasts { left: 12px; right: 12px; bottom: calc(12px + var(--bottom-h)); align-items: stretch; }
  .toast { width: auto; }
  .modal-root { align-items: flex-end; padding: 0; }
  .dialog { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .endscreen .recos { grid-template-columns: repeat(3, 1fr); }
  .endscreen .recos button:nth-child(4) { display: none; }
  .player-bar { gap: 6px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .pbtn .lbl { display: none; }
}
