/* ════════════════════════════════════════════════════════════════════
   fanhentai — design system (source unique)
   Source : REBOOT FH/public/design/fh-design.css
   Copie  : OLDFH/css/fh-design.css (node scripts/sync-design.mjs)
   À charger AVANT les feuilles propres au site / au studio.
   Clair et lumineux par défaut (sombre en option), mobile-first (80 % d'audience mobile), accent rose + dégradé rose→violet.
   ════════════════════════════════════════════════════════════════════ */
/* Thème clair par défaut (façon betterwaifu : fond blanc, cartes blanches à bord fin), boutons d'action noirs « galaxie », accent rose.
   Thème sombre optionnel : <html data-theme="dark"> (bouton 🌙, mémorisé dans localStorage fh_theme). */
:root {
  color-scheme: light;

  /* Surfaces — du fond de page à la carte */
  --bg: #f5f5f7;   --bg-rgb: 245 245 247;
  --bg2: #eeeef2;  --bg3: #ffffff;
  --surf: #ffffff; --surf-rgb: 255 255 255;
  --surf2: #f2f2f5; --surf3: #e6e6ec;
  --bdr: rgba(20, 20, 30, .10); --bdr2: rgba(20, 20, 30, .17);
  /* Voile sombre posé sur les images / vidéos (texte blanc dessus) et fonds de fenêtres : identique dans les deux thèmes */
  --ink-rgb: 10 10 14;

  /* Accents lumineux : rose (action) + violet ; --grad pour les boutons d'action principaux */
  --acc: #f0389a;  --acc-rgb: 240 56 154;
  --acc2: #c2186f; --acc2-rgb: 194 24 111;     /* rose foncé lisible sur blanc (textes actifs) */
  --acc-ink: #ffffff;                          /* texte posé sur l'accent */
  --acc-bg: rgb(var(--acc-rgb) / .10); --acc-bd: rgb(var(--acc-rgb) / .40);
  --vio: #4f5d7a;  --vio-rgb: 79 93 122;          /* ex-violet : bleu ardoise « nuit » (plus de violet) */
  /* Boutons d'action : noir profond « galaxie » (reflet gris-bleu + micro-étoiles), sans violet */
  --grad: radial-gradient(1px 1px at 14% 30%, rgba(255, 255, 255, .8), transparent 70%),
    radial-gradient(1px 1px at 63% 72%, rgba(255, 255, 255, .5), transparent 70%),
    radial-gradient(1.2px 1.2px at 86% 24%, rgba(255, 255, 255, .65), transparent 70%),
    radial-gradient(1px 1px at 36% 62%, rgba(255, 255, 255, .35), transparent 70%),
    radial-gradient(1px 1px at 52% 18%, rgba(200, 220, 255, .45), transparent 70%),
    radial-gradient(140% 130% at 0% 0%, rgba(70, 72, 88, .9) 0%, rgba(70, 72, 88, 0) 52%),
    radial-gradient(110% 120% at 100% 100%, rgba(28, 38, 58, .9) 0%, rgba(28, 38, 58, 0) 60%),
    linear-gradient(160deg, #18181f 0%, #060609 100%);
  --grad-soft: linear-gradient(120deg, rgb(20 20 30 / .03), rgb(20 20 30 / .06));
  --btn-shadow: 0 8px 22px rgba(6, 6, 12, .30), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 0 0 1px rgba(255, 255, 255, .06);

  /* Texte */
  --txt: #15151c;  --txt-rgb: 21 21 28;
  --txt2: #45454f; --txt3: #6b6b77; --txt4: #9a9aa5;

  /* États */
  --ok: #16a34a;   --ok-rgb: 22 163 74;
  --warn: #d97706; --warn-rgb: 217 119 6;
  --err: #e11d48;  --err-rgb: 225 29 72;

  /* Typographie */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 11px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px;
  --fs-2xl: clamp(22px, 2.6vw, 30px); --fs-3xl: clamp(28px, 3.3vw, 48px);

  /* Espacements (grille de 4 px), rayons, élévation */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --r: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --shadow: 0 10px 30px rgba(10, 10, 20, .10);
  --shadow-sm: 0 2px 8px rgba(10, 10, 20, .07);
  --gutter: clamp(16px, 3vw, 48px);
  --nav-h: 64px;
  --t: .18s ease;
  --z-nav: 100; --z-modal: 1000; --z-gate: 10000;
}
/* Thème sombre : noir profond « galaxie » (étoiles + nébuleuses bleu nuit, touche de rose), sans violet */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060608;   --bg-rgb: 6 6 8;
  --bg2: #0a0a0d;  --bg3: #101014;
  --surf: #121216; --surf-rgb: 18 18 22;
  --surf2: #1a1a20; --surf3: #24242c;
  --bdr: rgba(255, 255, 255, .08); --bdr2: rgba(255, 255, 255, .15);
  --acc: #ff4fa3;  --acc-rgb: 255 79 163;
  --acc2: #ff9fd0; --acc2-rgb: 255 159 208;
  --acc-bg: rgb(var(--acc-rgb) / .13); --acc-bd: rgb(var(--acc-rgb) / .38);
  --vio: #8ea2c8;  --vio-rgb: 142 162 200;
  --grad-soft: linear-gradient(120deg, rgb(255 255 255 / .03), rgb(255 255 255 / .06));
  --btn-shadow: 0 8px 24px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .16);
  --txt: #f5f5f7;  --txt-rgb: 245 245 247;
  --txt2: #c9c9d2; --txt3: #9898a4; --txt4: #6c6c78;
  --ok: #4ade80;   --ok-rgb: 74 222 128;
  --warn: #fbbf24; --warn-rgb: 251 191 36;
  --err: #ff6b81;  --err-rgb: 255 107 129;
  --shadow: 0 14px 36px rgba(0, 0, 0, .55);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .45);
}
:root[data-theme="dark"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1.3px 1.3px at 13% 22%, rgba(255, 255, 255, .85), transparent 70%),
    radial-gradient(1px 1px at 67% 41%, rgba(255, 255, 255, .7), transparent 70%),
    radial-gradient(1.1px 1.1px at 38% 78%, rgba(220, 210, 255, .75), transparent 70%),
    radial-gradient(1px 1px at 86% 12%, rgba(255, 220, 240, .7), transparent 70%),
    radial-gradient(900px 620px at 88% -8%, rgb(56 92 170 / .20), transparent 62%),
    radial-gradient(760px 560px at -12% 34%, rgb(236 72 153 / .10), transparent 62%),
    radial-gradient(980px 700px at 55% 118%, rgb(40 110 150 / .14), transparent 62%);
  background-size: 290px 290px, 230px 230px, 340px 340px, 410px 410px, auto, auto, auto;
  background-attachment: fixed;
}

/* ── Base ─────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--txt); font-family: var(--font); }
::selection { background: rgb(var(--acc-rgb) / .28); color: var(--txt); }
:where(button, a, select, textarea, input, summary, [role="button"], [tabindex]):focus-visible { outline: 2px solid var(--acc2); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ── Boutons ──────────────────────────────────────────────────────── */
.fh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5); border-radius: var(--r-lg); border: 1px solid transparent;
  font: 700 var(--fs-md)/1 var(--font); cursor: pointer; text-decoration: none; transition: background var(--t), border-color var(--t), color var(--t);
}
.fh-btn-primary { background: var(--grad); color: #fff; box-shadow: var(--btn-shadow); }
.fh-btn-primary:hover { filter: brightness(1.25); }
.fh-btn-ghost { background: var(--surf2); border-color: var(--bdr2); color: var(--txt); }
.fh-btn-ghost:hover { background: var(--surf3); }
.fh-btn-quiet { background: transparent; color: var(--txt2); }
.fh-btn-quiet:hover { color: var(--txt); }
.fh-btn-lg { min-height: 52px; font-size: var(--fs-lg); }
.fh-btn-block { width: 100%; }

/* ── Cartes, champs, puces ────────────────────────────────────────── */
.fh-card { background: var(--surf); border: 1px solid var(--bdr); border-radius: var(--r-xl); }
.fh-input { width: 100%; min-height: 44px; padding: 0 var(--s3); background: var(--bg3); color: var(--txt); border: 1px solid var(--bdr2); border-radius: var(--r); font: 400 var(--fs-md) var(--font); }
.fh-chip { display: inline-flex; align-items: center; gap: var(--s1); padding: 6px var(--s3); border-radius: var(--r-pill); border: 1px solid var(--bdr); background: var(--surf); color: var(--txt2); font-size: var(--fs-sm); }
.fh-chip.is-active { background: var(--acc-bg); border-color: var(--acc-bd); color: var(--acc2); }

/* ── Porte d'âge (fh-shell.js) ────────────────────────────────────── */
.fh-gate { position: fixed; inset: 0; z-index: var(--z-gate); display: flex; align-items: center; justify-content: center; padding: var(--s4); background: rgb(var(--bg-rgb) / .97); overflow-y: auto; }
.fh-gate-box { box-sizing: border-box; width: 100%; max-width: 420px; padding: var(--s8) var(--s6); text-align: center; background: var(--surf); border: 1px solid var(--bdr2); border-radius: var(--r-xl); box-shadow: var(--shadow); }
/* Isolée des styles de la page hôte (titres décorés des pages légales, etc.) */
.fh-gate h2 { all: unset; display: block; margin: 0 0 var(--s3); font: 700 var(--fs-xl)/1.3 var(--font); color: var(--txt); }
.fh-gate h2::before, .fh-gate h2::after, .fh-gate p::before, .fh-gate p::after { content: none; display: none; }
.fh-gate p { all: unset; display: block; font: 400 var(--fs-md)/1.6 var(--font); color: var(--txt2); }
.fh-gate-actions { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s6); }
.fh-gate-legal { margin-top: var(--s5); font-size: var(--fs-xs); line-height: 1.6; color: var(--txt4); }
.fh-gate-legal a { color: var(--txt3); }
html.fh-gate-open, html.fh-gate-open body { overflow: hidden; }

/* ── Pied de page légal (fh-shell.js) ─────────────────────────────── */
.fh-footer { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s6) var(--gutter) calc(var(--s6) + env(safe-area-inset-bottom)); border-top: 1px solid var(--bdr); text-align: center; font-size: var(--fs-xs); color: var(--txt4); }
.fh-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s4); }
.fh-footer a { color: var(--txt3); text-decoration: none; }
.fh-footer a:hover { color: var(--acc2); }

/* ── Logo (texte vectoriel, net à toutes les tailles) : « fan » noir profond (blanc en sombre), « hentai » rose, étoile ✦ ── */
.fh-logo { display: inline-flex; align-items: flex-start; font: 900 27px/1 var(--font); letter-spacing: -.055em; white-space: nowrap; user-select: none; }
.fh-logo-a { background: linear-gradient(170deg, #3a3a46 0%, #0b0b10 60%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .02em; }
.fh-logo-b { color: var(--acc); background: linear-gradient(170deg, #ff6bb3 0%, #f0389a 55%, #d81b7a 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; padding-right: .04em; }
.fh-logo-s { width: .5em; height: .5em; margin: -.06em 0 0 .03em; fill: var(--acc); filter: drop-shadow(0 0 4px rgb(var(--acc-rgb) / .55)); animation: fhTwinkle 3.6s ease-in-out infinite; }
:root[data-theme="dark"] .fh-logo-a { background: linear-gradient(170deg, #ffffff 0%, #c9cfdd 100%); -webkit-background-clip: text; background-clip: text; }
@keyframes fhTwinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.78) rotate(45deg); opacity: .8; } }
.fh-gate-logo { display: flex; justify-content: center; margin: 0 auto var(--s5); }
.fh-gate-logo .fh-logo { font-size: 30px; }

/* ── Bouton thème clair / sombre (fh-shell.js : [data-fh-theme]) ── */
.fh-theme-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: var(--r-pill); border: 1px solid var(--bdr); background: var(--surf); color: var(--txt2); font-size: 16px; line-height: 1; cursor: pointer; flex: none; }
.fh-theme-btn svg { display: block; }
.fh-theme-btn:hover { color: var(--txt); border-color: var(--bdr2); }
@media (max-width: 600px) { .nav .fh-logo { font-size: 24px; } }

/* Très petits écrans (≤ 380 px) : la barre du haut tient toujours dans la largeur, sur le site comme dans le studio. */
.nav .nav-logo, .nav .nav-right { min-width: 0; }
@media (max-width: 380px) {
  .nav { padding-left: 10px !important; padding-right: 10px !important; }
  .nav .fh-logo { font-size: 21px; }
  .nav .nav-right { gap: 6px !important; }
  .nav .nav-mana { padding: 0 10px !important; gap: 4px; }
  .nav .nav-mana-add { display: none !important; }
  .nav .fh-theme-btn, .nav .nav-avatar { width: 34px; height: 34px; }
}
@media (max-width: 340px) { .nav .fh-logo { font-size: 19px; } }
