/* ═══════════════════════════════════════════════════════════════
   MangaVault — main.css (redesign complet, 6 thèmes)
   Drop-in : remplace ton main.css existant
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Sora:wght@300;400;500;600;700;800&family=Noto+Serif+JP:wght@400;700;900&family=Noto+Sans+JP:wght@700;900&family=Bungee&family=Bungee+Shade&family=Playfair+Display:wght@700;900&family=Cormorant+Garamond:wght@400;600&family=Inter:wght@400;500;600;700&family=Major+Mono+Display&family=VT323&family=Press+Start+2P&family=Audiowide&display=swap');

/* ── THEME : OTAKU NEON (default) ───────────────────────────── */
:root,
[data-theme="otaku-neon"] {
  --bg:        #07070d;
  --bg2:       #0d0d1a;
  --surface:   #181830;
  --surface2:  #232342;
  --accent:    #e8384f;
  --accent2:   #00d9ff;
  --accent-glow: rgba(232,56,79,.4);
  --text:      #ecedf7;
  --text-dim:  #b7b8d0;
  --muted:     #6c6e94;
  --border:    #26264a;
  --gold:      #f0b429;
  --radius:    10px;
  --radius-lg: 14px;
  --font:      'Sora', sans-serif;
  --display:   'Bebas Neue', sans-serif;
  --jp:        'Noto Sans JP', sans-serif;
  --shadow-lg: 0 18px 40px rgba(0,0,0,.5);
}

/* ── THEME : SAKURA ZEN — papier japonais, serif élégant ───── */
[data-theme="sakura-zen"] {
  --bg:        #fdf5f3;
  --bg2:       #f7e8e4;
  --surface:   #ffffff;
  --surface2:  #fbeae5;
  --accent:    #d96b86;
  --accent2:   #8b5a8a;
  --accent-glow: rgba(217,107,134,.3);
  --text:      #3a2a2e;
  --text-dim:  #6b5560;
  --muted:     #a89098;
  --border:    #e8d0d3;
  --gold:      #c89a4f;
  --radius:    2px;
  --radius-lg: 4px;
  --font:      'Cormorant Garamond', serif;
  --display:   'Noto Serif JP', serif;
  --jp:        'Noto Serif JP', serif;
  --letter:    .04em;
  --bg-pattern: radial-gradient(circle at 20% 30%, rgba(217,107,134,.04) 0, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(139,90,138,.04) 0, transparent 40%);
}

/* ── THEME : SHONEN PUNCH — comic burst, bordures épaisses ─── */
[data-theme="shonen-punch"] {
  --bg:        #fff7e0;
  --bg2:       #ffe9b3;
  --surface:   #ffffff;
  --surface2:  #fff2cc;
  --accent:    #ff1744;
  --accent2:   #1a1a1a;
  --accent-glow: rgba(255,23,68,.4);
  --text:      #0a0a0a;
  --text-dim:  #2a2a2a;
  --muted:     #6a5a3a;
  --border:    #0a0a0a;
  --gold:      #ffd400;
  --radius:    0px;
  --radius-lg: 0px;
  --font:      'Bungee', sans-serif;
  --display:   'Bungee Shade', sans-serif;
  --shadow-lg: 6px 6px 0 #0a0a0a;
  --letter:    .02em;
  --bg-pattern: repeating-radial-gradient(circle at 10% 20%, transparent 0 8px, rgba(0,0,0,.04) 8px 9px),
                repeating-linear-gradient(-45deg, transparent 0 24px, rgba(255,212,0,.15) 24px 26px);
}

/* ── THEME : DARK CINEMA — Letterboxd, serif, lettrespacing ── */
[data-theme="dark-cinema"] {
  --bg:        #14171c;
  --bg2:       #1c2028;
  --surface:   #232830;
  --surface2:  #2c323c;
  --accent:    #d4af37;
  --accent2:   #6b8aa8;
  --accent-glow: rgba(212,175,55,.25);
  --text:      #e8e4d8;
  --text-dim:  #a8a49a;
  --muted:     #707078;
  --border:    #3a3f48;
  --gold:      #d4af37;
  --radius:    1px;
  --radius-lg: 2px;
  --font:      'Inter', sans-serif;
  --display:   'Playfair Display', serif;
  --letter:    .12em;
  --bg-pattern: linear-gradient(180deg, rgba(0,0,0,.4), transparent 30%, transparent 70%, rgba(0,0,0,.5));
}

/* ── THEME : LIGHT CRISP — Notion / Linear, propre ──────────── */
[data-theme="light-crisp"] {
  --bg:        #fbfbfd;
  --bg2:       #f4f4f7;
  --surface:   #ffffff;
  --surface2:  #f7f7fa;
  --accent:    #1e1e24;
  --accent2:   #e8384f;
  --accent-glow: rgba(30,30,36,.12);
  --text:      #1a1a24;
  --text-dim:  #52525b;
  --muted:     #9a9aa5;
  --border:    #e8e8ee;
  --gold:      #c89a1f;
  --radius:    8px;
  --radius-lg: 16px;
  --font:      'Inter', sans-serif;
  --display:   'Inter', sans-serif;
  --display-weight: 800;
  --letter:    -.02em;
  --shadow-lg: 0 1px 2px rgba(0,0,0,.04), 0 12px 30px rgba(0,0,0,.06);
}

/* ── THEME : SYNTHWAVE 80s — neon, grid, scanlines ──────────── */
[data-theme="synthwave"] {
  --bg:        #0d0524;
  --bg2:       #1a0936;
  --surface:   #261148;
  --surface2:  #341660;
  --accent:    #ff2eaf;
  --accent2:   #00f0ff;
  --accent-glow: rgba(255,46,175,.6);
  --text:      #f0e8ff;
  --text-dim:  #b8a8d0;
  --muted:     #7868a0;
  --border:    #5a2fa8;
  --gold:      #ffd700;
  --radius:    0px;
  --radius-lg: 0px;
  --font:      'Audiowide', sans-serif;
  --display:   'Audiowide', sans-serif;
  --letter:    .08em;
  --bg-pattern:
    linear-gradient(180deg, transparent 60%, rgba(0,240,255,.08) 100%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,240,255,.03) 3px 4px),
    linear-gradient(180deg, transparent 50%, transparent 50%);
}

/* ── OTAKU NEON — futurist, mono accents ────────────────────── */
[data-theme="otaku-neon"] {
  --letter:    .02em;
  --bg-pattern:
    radial-gradient(circle at 15% 20%, rgba(232,56,79,.08) 0, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(0,217,255,.06) 0, transparent 45%),
    repeating-linear-gradient(90deg, transparent 0 80px, rgba(0,217,255,.02) 80px 81px);
}

*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  background: var(--bg);
  background-image: var(--bg-pattern, none);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  letter-spacing: var(--letter, 0);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

/* ── PER-THEME OVERRIDES (look distinctif) ──────────────────── */

/* SAKURA — papier washi, encre noire, lignes fines */
[data-theme="sakura-zen"] .hero h1 { font-weight: 700; letter-spacing: .08em; }
[data-theme="sakura-zen"] .section-header h2::before,
[data-theme="sakura-zen"] .section-title::before { display: none; }
[data-theme="sakura-zen"] .section-header h2,
[data-theme="sakura-zen"] .section-title {
  font-style: italic; border-left: 2px solid var(--accent); padding-left: 14px;
}
[data-theme="sakura-zen"] .manga-cover { border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(217,107,134,.12); }
[data-theme="sakura-zen"] .manga-cover::after { background: linear-gradient(180deg, transparent 70%, rgba(58,42,46,.5)); }
[data-theme="sakura-zen"] .btn-accent { border-radius: 2px; box-shadow: none; border: 1px solid var(--accent); }
[data-theme="sakura-zen"] .btn-ghost { border-radius: 2px; }
[data-theme="sakura-zen"] .src-pill { border-radius: 2px; }
[data-theme="sakura-zen"] .logo-icon { border-radius: 2px; box-shadow: none; }

/* SHONEN — comic, traits épais noirs, halftone */
[data-theme="shonen-punch"] * { letter-spacing: 0 !important; }
[data-theme="shonen-punch"] .manga-card .manga-cover,
[data-theme="shonen-punch"] .blog-card,
[data-theme="shonen-punch"] .sources-shell,
[data-theme="shonen-punch"] .btn-accent,
[data-theme="shonen-punch"] .btn-ghost {
  border: 3px solid #0a0a0a !important;
  box-shadow: 5px 5px 0 #0a0a0a !important;
  border-radius: 0 !important;
}
[data-theme="shonen-punch"] .btn-accent:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 #0a0a0a !important; }
[data-theme="shonen-punch"] .manga-card:hover .manga-cover { transform: translate(-3px,-3px); box-shadow: 8px 8px 0 #0a0a0a !important; }
[data-theme="shonen-punch"] .hero {
  background: var(--bg);
  background-image:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 14px, rgba(255,23,68,.06) 14px 16px),
    radial-gradient(circle at 80% 30%, var(--gold) 0 80px, transparent 81px);
  border-bottom: 4px solid #0a0a0a;
}
[data-theme="shonen-punch"] .hero h1 {
  font-family: 'Bungee Shade', sans-serif;
  -webkit-text-stroke: 0;
  text-shadow: 4px 4px 0 var(--accent), 8px 8px 0 #0a0a0a;
  color: var(--gold);
}
[data-theme="shonen-punch"] .hero h1 span { color: #fff; text-shadow: 4px 4px 0 #0a0a0a; }
[data-theme="shonen-punch"] .logo, [data-theme="shonen-punch"] .nav-links a { font-family: 'Bungee', sans-serif; }
[data-theme="shonen-punch"] .nav-links a.active::after { height: 4px; background: var(--accent); }
[data-theme="shonen-punch"] .src-pill { border: 2px solid #0a0a0a !important; border-radius: 0 !important; box-shadow: 3px 3px 0 #0a0a0a !important; }
[data-theme="shonen-punch"] .manga-badge { border: 2px solid #0a0a0a; background: var(--gold); color: #0a0a0a; box-shadow: 2px 2px 0 #0a0a0a; }
[data-theme="shonen-punch"] #header { border-bottom: 3px solid #0a0a0a; background: var(--bg); }
[data-theme="shonen-punch"] .logo-icon { border: 2px solid #0a0a0a; box-shadow: 3px 3px 0 #0a0a0a; border-radius: 0; }

/* DARK CINEMA — Letterboxd, espacements généreux, mono numbers */
[data-theme="dark-cinema"] .hero h1 {
  font-family: 'Playfair Display', serif; font-weight: 900;
  letter-spacing: -.02em; text-transform: none;
}
[data-theme="dark-cinema"] .hero h1 span { font-style: italic; font-weight: 400; color: var(--accent); }
[data-theme="dark-cinema"] .section-header h2,
[data-theme="dark-cinema"] .section-title {
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: .3em; text-transform: uppercase; color: var(--text-dim);
}
[data-theme="dark-cinema"] .section-header h2::before,
[data-theme="dark-cinema"] .section-title::before {
  width: 32px; height: 1px; background: var(--accent);
}
[data-theme="dark-cinema"] .manga-cover { border-radius: 1px; }
[data-theme="dark-cinema"] .btn-accent {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  letter-spacing: .2em; text-transform: uppercase; font-size: 11px;
  box-shadow: none; padding: 11px 22px;
}
[data-theme="dark-cinema"] .btn-accent:hover { background: var(--accent); color: var(--bg); }
[data-theme="dark-cinema"] .btn-ghost { letter-spacing: .15em; text-transform: uppercase; font-size: 11px; }
[data-theme="dark-cinema"] .logo { letter-spacing: .25em; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 18px; }
[data-theme="dark-cinema"] .nav-links a { letter-spacing: .2em; text-transform: uppercase; font-size: 10px; font-weight: 600; }
[data-theme="dark-cinema"] .src-pill { border-radius: 0; letter-spacing: .15em; text-transform: uppercase; font-size: 10px; }
[data-theme="dark-cinema"] .manga-title { letter-spacing: .04em; }
[data-theme="dark-cinema"] .manga-meta { font-variant-numeric: tabular-nums; letter-spacing: .15em; text-transform: uppercase; font-size: 10px; }

/* LIGHT CRISP — Notion vibes */
[data-theme="light-crisp"] .hero {
  background: var(--bg);
  border-bottom: none;
}
[data-theme="light-crisp"] .hero h1 {
  font-family: 'Inter', sans-serif; font-weight: 800;
  letter-spacing: -.04em; text-transform: none;
}
[data-theme="light-crisp"] .hero h1 span { color: var(--accent2); }
[data-theme="light-crisp"] .section-header h2,
[data-theme="light-crisp"] .section-title {
  font-family: 'Inter', sans-serif; font-weight: 700;
  letter-spacing: -.02em; text-transform: none; font-size: 22px;
}
[data-theme="light-crisp"] .section-header h2::before,
[data-theme="light-crisp"] .section-title::before { display: none; }
[data-theme="light-crisp"] .manga-cover {
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
}
[data-theme="light-crisp"] .blog-card,
[data-theme="light-crisp"] .sources-shell {
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
[data-theme="light-crisp"] .btn-accent {
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 1px 2px rgba(0,0,0,.1);
  color: #fff;
}
[data-theme="light-crisp"] .logo-icon { box-shadow: 0 1px 2px rgba(0,0,0,.1); }
[data-theme="light-crisp"] #header { background: rgba(255,255,255,.85); }

/* SYNTHWAVE — neon, scanlines, grid floor */
[data-theme="synthwave"] body {
  background-image:
    linear-gradient(180deg, transparent 0 60%, rgba(255,46,175,.15) 60%, transparent 100%),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,240,255,.025) 2px 3px),
    var(--bg-pattern);
  background-attachment: fixed;
}
[data-theme="synthwave"] .hero {
  background:
    linear-gradient(180deg, transparent 0 70%, rgba(0,240,255,.15) 100%),
    radial-gradient(ellipse 600px 200px at 50% 100%, rgba(255,46,175,.4), transparent 70%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  overflow: hidden; position: relative;
}
[data-theme="synthwave"] .hero::after {
  content:''; position:absolute; left:-20%; right:-20%; bottom:-50px;
  height: 250px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0,240,255,.4) 100%),
    repeating-linear-gradient(90deg, transparent 0 60px, rgba(0,240,255,.6) 60px 62px),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(0,240,255,.6) 30px 32px);
  transform: perspective(400px) rotateX(60deg);
  transform-origin: center top;
  mask-image: linear-gradient(180deg, transparent, #000 30%);
}
[data-theme="synthwave"] .hero h1 {
  font-family: 'Audiowide', sans-serif;
  color: var(--accent2);
  text-shadow:
    0 0 8px var(--accent2),
    0 0 22px rgba(0,240,255,.6),
    4px 0 0 var(--accent),
    -4px 0 0 rgba(255,46,175,.5);
  letter-spacing: .04em;
}
[data-theme="synthwave"] .hero h1 span {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent), 0 0 28px rgba(255,46,175,.7);
}
[data-theme="synthwave"] .logo { font-family: 'Audiowide', sans-serif; }
[data-theme="synthwave"] .nav-links a { font-family: 'Audiowide', sans-serif; font-size: 11px; }
[data-theme="synthwave"] .manga-cover {
  border: 1px solid var(--accent2);
  box-shadow: 0 0 12px rgba(0,240,255,.3), inset 0 0 20px rgba(255,46,175,.1);
}
[data-theme="synthwave"] .manga-card:hover .manga-cover {
  box-shadow: 0 0 30px var(--accent), inset 0 0 25px rgba(255,46,175,.2);
}
[data-theme="synthwave"] .btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 0; text-shadow: 0 0 8px rgba(0,0,0,.5);
  box-shadow: 0 0 20px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.3);
}
[data-theme="synthwave"] .btn-ghost {
  border: 1px solid var(--accent2); color: var(--accent2);
  border-radius: 0; text-shadow: 0 0 6px var(--accent2);
}
[data-theme="synthwave"] .src-pill { border-radius: 0; border-color: var(--accent2); }
[data-theme="synthwave"] .src-pill.active {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
[data-theme="synthwave"] .section-header h2,
[data-theme="synthwave"] .section-title {
  font-family: 'Audiowide', sans-serif;
  color: var(--accent2); text-shadow: 0 0 10px rgba(0,240,255,.5);
}
[data-theme="synthwave"] .logo-icon {
  border-radius: 0; box-shadow: 0 0 16px var(--accent-glow);
}

/* OTAKU NEON — minor distinctives (le base de référence) */
[data-theme="otaku-neon"] .hero h1 { text-shadow: 0 0 30px var(--accent-glow); }
[data-theme="otaku-neon"] .logo-icon::after {
  content:''; position:absolute; inset:0; border-radius:8px;
  box-shadow: 0 0 14px var(--accent-glow); pointer-events:none;
}

::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius:99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.noise {
  position:fixed; inset:0; pointer-events:none; z-index:9999; opacity:.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}
[data-theme="light-crisp"] .noise,
[data-theme="sakura-zen"] .noise { opacity: .08; }

.hidden { display:none !important; }

/* ── HEADER ─────────────────────────────────────────────────── */
#header {
  position: sticky; top:0; z-index: 500;
  display: flex; align-items: center; gap: 24px;
  padding: 0 32px; height: 64px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: var(--display); font-size: 22px; letter-spacing: 3px;
  color: var(--text); text-decoration:none;
  display:flex; align-items:center; gap:10px;
}
.logo-icon {
  width: 30px; height: 30px; border-radius:8px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
  display:grid; place-items:center; color:#fff;
  font-family: var(--jp); font-size: 14px; font-weight:700;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.logo > span { color: var(--accent); }

.nav-links { display:flex; gap:2px; }
.nav-links a {
  position:relative; color: var(--text-dim);
  font-size: 13px; font-weight: 500; text-decoration:none;
  padding: 8px 14px; border-radius: 8px;
  transition: all .15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content:''; position:absolute; left:14px; right:14px; bottom:0;
  height: 2px; background: var(--accent); border-radius: 2px;
}

.header-right { margin-left:auto; display:flex; gap:10px; align-items:center; }

.btn-accent {
  padding: 10px 20px;
  background: var(--accent); border: none; color: #fff;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  border-radius: var(--radius); cursor: pointer;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px var(--accent-glow);
  letter-spacing: .01em;
}
.btn-accent:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-ghost {
  padding: 9px 17px; background: transparent;
  border: 1.5px solid var(--border); color: var(--text);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  border-radius: var(--radius); cursor: pointer; transition: all .15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display:grid; place-items:center; font-weight:700; color:#fff; font-size:13px;
}

/* ── HERO (animé, kanji qui dérive) ─────────────────────────── */
.hero {
  position: relative;
  padding: 70px 32px 56px;
  background:
    radial-gradient(ellipse 600px 300px at 0% 0%, var(--accent-glow), transparent 60%),
    radial-gradient(ellipse 500px 400px at 100% 100%, color-mix(in srgb, var(--accent2) 30%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-text { position:relative; z-index:2; }
.hero h1 {
  font-family: var(--display); font-size: clamp(48px, 7vw, 88px);
  letter-spacing: 4px; line-height: .95; margin-bottom: 14px;
}
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-dim); font-size: 15px; max-width: 560px; }
/* Police de secours pour les langues CJK/AR dans le héro */
:lang(ja) .hero h1, :lang(ja) .hero p { font-family: 'Noto Sans JP', 'Noto Serif JP', sans-serif; }
:lang(ar) .hero h1, :lang(ar) .hero p { font-family: 'Noto Naskh Arabic', 'Arial', sans-serif; letter-spacing: 0; }
.hero-kanji {
  position:absolute; pointer-events:none; user-select:none;
  font-family: var(--jp); font-weight:700; line-height:1;
  color: color-mix(in srgb, var(--accent) 25%, transparent);
  animation: drift 20s ease-in-out infinite;
}
.hero-kanji.k1 { right: -20px; top: -30px; font-size: 280px; opacity:.15; }
.hero-kanji.k2 { right: 30%; top: 50%; font-size: 120px; opacity:.08; animation-delay: -7s; }
.hero-kanji.k3 { left: 20%; bottom: -10%; font-size: 90px; opacity:.06; animation-delay: -13s; }
@keyframes drift {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  33%     { transform: translate(-20px,15px) rotate(-2deg); }
  66%     { transform: translate(15px,-10px) rotate(2deg); }
}

/* particules */
.hero-particle {
  position:absolute; width: 4px; height: 4px; border-radius:50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  pointer-events:none; opacity:.6;
  animation: float-up linear infinite;
}
@keyframes float-up {
  from { transform: translateY(0); opacity: 0; }
  10%  { opacity: .8; }
  90%  { opacity: .8; }
  to   { transform: translateY(-200px); opacity: 0; }
}

/* ── SECTIONS ───────────────────────────────────────────────── */
.section { padding: 36px 32px; }
.section-header {
  display:flex; align-items:flex-end; justify-content:space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.section-header h2,
.section-title {
  font-family: var(--display); font-size: 28px; letter-spacing: 2.5px;
  display:flex; align-items:center; gap: 10px;
}
.section-header h2::before,
.section-title::before {
  content:''; width: 3px; height: 22px;
  background: var(--accent); border-radius: 2px;
}
.section-divider { border:none; height:1px; background: var(--border); margin: 32px 0; }

.search-wrap input,
#blogSearch {
  padding: 9px 16px; background: var(--surface);
  border: 1.5px solid var(--border); color: var(--text);
  font-family: var(--font); font-size: 13px;
  border-radius: var(--radius); width: 240px;
  transition: border-color .2s, box-shadow .2s;
}
.search-wrap input:focus,
#blogSearch:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ── MANGA GRID ─────────────────────────────────────────────── */
.manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 22px;
}
.manga-grid.mini {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.manga-card {
  position: relative; cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.manga-card:hover { transform: translateY(-6px); }
.manga-cover {
  width: 100%; aspect-ratio: 2/3; overflow:hidden;
  border-radius: var(--radius);
  background: var(--surface2);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  position: relative;
  transition: box-shadow .25s ease, transform .4s ease;
}
.manga-card:hover .manga-cover {
  box-shadow: 0 18px 40px var(--accent-glow);
}
.manga-cover img {
  width:100%; height:100%; object-fit:cover;
  transition: transform .5s ease;
}
.manga-card:hover .manga-cover img { transform: scale(1.06); }
.manga-cover::after {
  content:''; position:absolute; inset:0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.85));
  pointer-events:none;
}

/* parallax glow on hover */
.manga-card::before {
  content:''; position:absolute; inset:-2px;
  border-radius: calc(var(--radius) + 2px);
  background: conic-gradient(from var(--angle, 0deg),
    transparent 0deg, var(--accent) 30deg, transparent 60deg);
  opacity: 0; transition: opacity .3s;
  z-index: -1; filter: blur(12px);
  animation: rotate-glow 4s linear infinite;
}
.manga-card:hover::before { opacity: .6; }
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes rotate-glow { to { --angle: 360deg; } }

.manga-info { padding: 10px 4px 0; }
.manga-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.3;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow: hidden;
}
.manga-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.manga-badge {
  position:absolute; top: 10px; right: 10px;
  padding: 3px 9px;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: #fff; z-index: 2;
}

/* skeleton */
.skeleton {
  aspect-ratio: 2/3; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-grid { display:contents; }

/* ── ANIME SOURCES (Cards pays — la version validée) ────────── */
.sources-shell {
  background: linear-gradient(180deg, var(--surface), var(--bg2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 22px;
}
.country-row {
  display: grid; grid-template-columns: 130px 1fr;
  gap: 18px; align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.country-row:last-child { border-bottom: none; }
.country-tag { display:flex; align-items:center; gap:10px; }
.country-flag {
  width: 36px; height: 26px; border-radius: 5px;
  border: 1px solid var(--border); flex-shrink: 0;
}
.country-flag.fr { background: linear-gradient(90deg,#002654 33%,#fff 33% 66%,#ed2939 66%); }
.country-flag.ru { background: linear-gradient(180deg,#fff 33%,#0039a6 33% 66%,#d52b1e 66%); }
.country-flag.de { background: linear-gradient(180deg,#000 33%,#dd0000 33% 66%,#ffce00 66%); }
.country-flag.es { background: linear-gradient(180deg,#aa151b 25%,#f1bf00 25% 75%,#aa151b 75%); }
.country-flag.en { background: #012169; }
.country-flag.jp { background: radial-gradient(circle, #bc002d 30%, #fff 30%); }
.country-flag.it { background: linear-gradient(90deg,#009246 33%,#fff 33% 66%,#ce2b37 66%); }
.country-flag.pt { background: linear-gradient(90deg,#006600 38%,#ff0000 38%); }
.country-flag.ar { background: linear-gradient(180deg,#000 25%,#fff 25% 50%,#007a3d 50% 75%,#ce1126 75%); }
.country-name { display:flex; flex-direction: column; line-height:1.1; }
.country-name .code {
  font-family: var(--display); font-size: 20px; letter-spacing: 2px; color: var(--text);
}
.country-name .full {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; margin-top: 2px;
}
.src-list { display: flex; gap: 8px; flex-wrap: wrap; }
.src-pill {
  display:inline-flex; align-items:center; gap: 8px;
  padding: 7px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-dim); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.src-pill:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.src-pill.active {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
  border-color: var(--accent); color: #fff; font-weight: 600;
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}
.src-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
}
.src-pill.active .src-dot { background: #fff; box-shadow: 0 0 6px #fff; }

/* ── BLOG GRID ──────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all .25s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px var(--accent-glow);
}
.blog-card-cover {
  height: 160px; background: var(--surface2);
  background-size: cover; background-position: center;
  position: relative;
}
.blog-card-body { padding: 18px 20px 20px; }
.blog-card-title {
  font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 8px;
  color: var(--text);
}
.blog-card-excerpt {
  font-size: 13px; color: var(--text-dim); line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--muted);
}
.blog-tag {
  display: inline-block;
  padding: 3px 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 10px; font-weight: 600;
  color: var(--text-dim);
  margin-right: 4px;
}

/* ── MESSAGES ───────────────────────────────────────────────── */
.messages-shell {
  display: grid; grid-template-columns: 320px 1fr;
  height: 600px; margin: 0 32px 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.msg-side { border-right: 1px solid var(--border); background: var(--bg2); display:flex; flex-direction:column; }
.msg-side-head {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display:flex; align-items:center; gap:10px;
}
.msg-side-head h3 {
  font-family: var(--display); font-size: 22px; letter-spacing: 2px; flex:1;
}
.msg-search { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.msg-search input {
  width: 100%; padding: 9px 14px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 13px;
  border-radius: 8px;
}
.convo-list { flex:1; overflow-y: auto; }
.convo {
  display:flex; align-items:center; gap: 12px;
  padding: 14px 20px; cursor: pointer;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  transition: background .15s; position: relative;
}
.convo:hover { background: var(--surface); }
.convo.active { background: var(--surface); }
.convo.active::before {
  content:''; position:absolute; left:0; top:10px; bottom:10px; width: 3px;
  background: var(--accent); border-radius: 0 3px 3px 0;
}
.convo-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display:grid; place-items:center;
  font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #000));
  flex-shrink: 0;
}
.convo-body { flex:1; min-width:0; }
.convo-row { display:flex; justify-content: space-between; gap: 8px; }
.convo-name { font-size: 14px; font-weight: 600; color: var(--text); }
.convo-time { font-size: 11px; color: var(--muted); }
.convo-last {
  font-size: 12px; color: var(--text-dim); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-badge {
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 99px; margin-left: 4px;
}
.msg-main { display:flex; flex-direction: column; background: var(--bg); }
.msg-main-head {
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  display:flex; align-items:center; gap: 14px; background: var(--bg2);
}
.msg-main-head .name { font-size: 15px; font-weight: 700; }
.msg-main-head .status { font-size: 11px; color: #10b981; }
.msg-bubbles {
  flex:1; padding: 20px 22px; overflow-y: auto;
  display:flex; flex-direction: column; gap: 10px;
}
.bubble {
  max-width: 65%; padding: 10px 14px;
  font-size: 13px; line-height: 1.5; border-radius: 16px;
}
.bubble.them { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 4px; }
.bubble.me {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
  color: #fff; border-bottom-right-radius: 4px;
}
.msg-input-bar {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display:flex; gap: 10px; align-items:center; background: var(--bg2);
}
.msg-input-bar input {
  flex:1; padding: 11px 16px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 13px;
  border-radius: 99px;
}
.msg-send {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); border: none; color: #fff;
  cursor: pointer; box-shadow: 0 4px 12px var(--accent-glow);
}

/* ── READER ─────────────────────────────────────────────────── */
.reader-page { background: #000; min-height: 100vh; }
.reader-toolbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(0,0,0,.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
#scanReaderContent { padding-top: 60px; }
.reader-info { display:flex; flex-direction: column; line-height: 1.2; }
.reader-info .accent { color: var(--accent); font-size: 12px; }

/* ── MINI PLAYER FLOTTANT ───────────────────────────────────── */
.mini-player {
  position: fixed; left: 24px; bottom: 24px; z-index: 1000;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px 10px 10px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 99px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4), 0 0 0 1px var(--accent-glow) inset;
  cursor: pointer;
  transition: transform .25s ease;
  max-width: 360px;
}
.mini-player:hover { transform: translateY(-2px); }
.mini-player-thumb {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  background-size: cover; background-position: center;
}
.mini-player-info { flex:1; min-width: 0; }
.mini-player-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow:hidden; text-overflow: ellipsis;
}
.mini-player-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mini-player-play {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  display:grid; place-items:center; font-size: 14px;
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ── THEME SWITCHER (bouton flottant) ───────────────────────── */
.theme-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 9000;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; cursor: pointer;
  box-shadow: 0 8px 24px var(--accent-glow), 0 0 0 1px rgba(255,255,255,.1) inset;
  display: grid; place-items: center;
  color: #fff; font-size: 22px;
  transition: transform .25s ease;
}
.theme-fab:hover { transform: scale(1.08) rotate(15deg); }
.theme-fab svg { width: 22px; height: 22px; }

.theme-panel {
  position: fixed; right: 24px; bottom: 88px; z-index: 9001;
  width: 320px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
  padding: 20px;
  transform: translateY(20px) scale(.95); opacity: 0; pointer-events: none;
  transition: all .25s cubic-bezier(.2,.8,.2,1);
}
.theme-panel.open {
  transform: translateY(0) scale(1); opacity: 1; pointer-events: auto;
}
.theme-panel h4 {
  font-family: var(--display); font-size: 18px; letter-spacing: 2px;
  margin-bottom: 14px; display:flex; align-items:center; gap: 8px;
}
.theme-panel h4 .bar { width: 3px; height: 16px; background: var(--accent); border-radius: 2px; }
.theme-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin-bottom: 16px;
}
.theme-opt {
  padding: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
  transition: all .15s; text-align: left;
  font-family: var(--font);
}
.theme-opt:hover { border-color: var(--accent); }
.theme-opt.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 4px 12px var(--accent-glow); }
.theme-swatches {
  display: flex; gap: 4px; margin-bottom: 8px;
}
.theme-swatch { width: 18px; height: 18px; border-radius: 4px; }
.theme-opt-name { font-size: 12px; font-weight: 600; color: var(--text); }
.theme-opt-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }

.theme-panel hr { border:none; height:1px; background: var(--border); margin: 14px 0; }

.theme-toggles { display: flex; flex-direction: column; gap: 10px; }
.theme-toggle {
  display:flex; align-items:center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  font-size: 12px; color: var(--text);
}
.theme-toggle input { display:none; }
.theme-toggle .switch {
  width: 32px; height: 18px; background: var(--border);
  border-radius: 99px; position: relative; transition: background .2s;
  flex-shrink: 0;
}
.theme-toggle .switch::after {
  content:''; position:absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  transition: transform .2s;
}
.theme-toggle input:checked + .switch { background: var(--accent); }
.theme-toggle input:checked + .switch::after { transform: translateX(14px); }

.theme-lang {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.theme-lang button {
  padding: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  font-family: var(--font); font-size: 11px; font-weight: 600;
  color: var(--text-dim); transition: all .15s;
  display:flex; flex-direction: column; align-items:center; gap: 4px;
}
.theme-lang button:hover { border-color: var(--accent); }
.theme-lang button.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.theme-lang .flag-mini {
  width: 22px; height: 16px; border-radius: 3px;
}

/* ── ONBOARDING MODAL ───────────────────────────────────────── */
.onboard-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.85); backdrop-filter: blur(20px);
  display: grid; place-items: center;
  animation: fadein .4s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.onboard-card {
  width: min(620px, 92vw); max-height: 90vh;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px var(--accent-glow) inset;
  overflow-y: auto;
}
.onboard-step-indicator {
  display:flex; gap: 6px; margin-bottom: 24px;
}
.onboard-step-indicator span {
  flex:1; height: 4px; background: var(--border); border-radius: 99px;
  transition: background .3s;
}
.onboard-step-indicator span.done { background: var(--accent); }

.onboard-card h2 {
  font-family: var(--display); font-size: 36px; letter-spacing: 3px;
  margin-bottom: 8px; line-height: 1;
}
.onboard-card h2 span { color: var(--accent); }
.onboard-card p.sub {
  font-size: 14px; color: var(--text-dim); margin-bottom: 24px;
}
.onboard-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.onboard-opt {
  padding: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer;
  transition: all .2s; text-align: center;
  display:flex; flex-direction: column; align-items:center; gap: 8px;
  font-family: var(--font);
}
.onboard-opt:hover { border-color: var(--accent); transform: translateY(-2px); }
.onboard-opt.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: 0 8px 20px var(--accent-glow); }
.onboard-opt .flag-big {
  width: 48px; height: 36px; border-radius: 6px;
}
.onboard-opt-name {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.onboard-opt-sub {
  font-size: 11px; color: var(--muted);
}
.onboard-foot {
  display: flex; justify-content: space-between; align-items:center;
  margin-top: 28px;
}
.onboard-foot .skip {
  background:none; border: none; color: var(--muted);
  font-family: var(--font); font-size: 12px; cursor: pointer;
}
.onboard-foot .skip:hover { color: var(--accent); }

.theme-preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.theme-preview {
  padding: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer;
  transition: all .2s;
  font-family: var(--font);
}
.theme-preview:hover { transform: translateY(-3px); }
.theme-preview.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 20px var(--accent-glow); }
.theme-preview-mini {
  height: 80px; border-radius: 8px;
  margin-bottom: 10px;
  position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,.05);
}
.theme-preview-name { font-size: 13px; font-weight: 700; }
.theme-preview-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── FORMS, EDITOR, REQUESTS — minimum viable ──────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display:block; font-size: 12px; font-weight: 600;
  color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase;
  letter-spacing: 1px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 14px;
  border-radius: var(--radius);
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }

/* ── MOBILE / MENU MOBILE ───────────────────────────────────── */
.hamburger {
  display: none; width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 4px; align-items: center; justify-content: center;
}
.hamburger span {
  width: 22px; height: 2px; background: var(--text); border-radius: 2px;
}
.mobile-nav-overlay { display: none; }

@media (max-width: 900px) {
  .hamburger { display: flex; }
  .nav-links, .header-right > div { display: none; }
  .messages-shell { grid-template-columns: 1fr; height: auto; }
  .country-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 48px; }
  .section { padding: 24px 16px; }
  #header { padding: 0 16px; }
  .theme-fab { right: 16px; bottom: 16px; }
}

/* ── PAGES (SPA) ────────────────────────────────────────────── */
.page { display: none; }
.page.active {
  display: block;
  animation: page-in .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── FOCUS MODE (cache UI) ──────────────────────────────────── */
body.focus-mode #header,
body.focus-mode .theme-fab,
body.focus-mode .mini-player,
body.focus-mode .reader-toolbar { opacity: 0; pointer-events: none; transition: opacity .3s; }
body.focus-mode:hover #header,
body.focus-mode:hover .reader-toolbar { opacity: 1; pointer-events: auto; }

/* ── CUSTOM CURSOR ──────────────────────────────────────────── */
body.custom-cursor { cursor: none; }
body.custom-cursor a, body.custom-cursor button { cursor: none; }
.cursor-dot, .cursor-ring {
  position: fixed; pointer-events: none; z-index: 99998;
  border-radius: 50%; transition: transform .15s ease, width .25s, height .25s;
}
.cursor-dot { width: 6px; height: 6px; background: var(--accent); }
.cursor-ring { width: 32px; height: 32px; border: 1.5px solid var(--accent); }
body:not(.custom-cursor) .cursor-dot,
body:not(.custom-cursor) .cursor-ring { display: none; }

/* ── OST MUSIC PLAYER (flottant draggable) ──────────────────── */
#ost-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  z-index: 9990;
  background: rgba(12,12,20,.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99,102,241,.3);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
  user-select: none;
}

/* Bouton minifié */
#ost-mini-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  background: var(--accent);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9991;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  border: none;
  color: #fff;
  transition: transform .15s;
}
#ost-mini-btn:hover { transform: scale(1.1); }

/* Handle drag */
#ost-drag-handle {
  cursor: grab;
  padding: 8px 10px 6px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.07);
  border-radius: 14px 14px 0 0;
}
#ost-drag-handle .drag-label { opacity: .5; pointer-events: none; letter-spacing: 1px; font-size: 10px; }
#ost-drag-handle:active { cursor: grabbing; }

/* Progress bar */
#ost-progress-bar {
  height: 3px;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  transition: height .2s;
}
#ost-progress-bar:hover { height: 5px; }
#ost-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 0 2px 2px 0;
  transition: width .8s linear;
  pointer-events: none;
}

/* Controls row */
.ost-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 56px;
}

/* Track info */
.ost-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.ost-icon {
  font-size: 18px;
  flex-shrink: 0;
  color: var(--accent);
  animation: ostPulse 2.4s ease-in-out infinite;
}
@keyframes ostPulse {
  0%,100% { opacity: 1; } 50% { opacity: .45; }
}
#ost-player.collapsed .ost-icon { animation: none; }
.ost-text { min-width: 0; }
#ost-track-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
#ost-track-artist {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons */
.ost-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ost-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background .15s, color .15s, transform .1s;
  line-height: 1;
}
.ost-btn:hover { background: rgba(99,102,241,.18); color: var(--accent); }
.ost-btn:active { transform: scale(.9); }
.ost-btn.ost-play {
  font-size: 18px;
  padding: 6px 10px;
  background: rgba(99,102,241,.12);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
}
.ost-btn.ost-play:hover { background: rgba(99,102,241,.28); }

/* Right side */
.ost-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#ost-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}
/* Volume popup vertical */
.ost-vol-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ost-vol-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12,12,20,.97);
  border: 1px solid rgba(99,102,241,.35);
  border-radius: 10px;
  padding: 10px 8px;
  display: none;
  flex-direction: column;
  align-items: center;
  z-index: 10001;
  box-shadow: 0 4px 20px rgba(0,0,0,.6);
}
.ost-vol-wrap:hover .ost-vol-popup,
.ost-vol-wrap.active .ost-vol-popup {
  display: flex;
}
#ost-vol-slider {
  -webkit-appearance: slider-vertical;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 80px;
  border-radius: 2px;
  background: rgba(255,255,255,.15);
  outline: none;
  cursor: pointer;
}
#ost-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(99,102,241,.5);
}
#ost-vol-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

/* Bouton loop actif */
#ost-loop-btn.loop-on {
  color: var(--accent);
  background: rgba(99,102,241,.18);
}

/* Context toast */
#ost-context-toast {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(99,102,241,.9);
  color: #fff;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
  z-index: 9999;
}
#ost-context-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* Responsive: hide time & volume on very small screens */
@media (max-width: 480px) {
  #ost-time { display: none; }
  #ost-vol-slider { width: 50px; }
  .ost-controls { padding: 0 8px; gap: 6px; }
  body { padding-bottom: 56px; }
}

/* ── OST Playlist Panel ────────────────────────────────────── */
#ost-playlist-panel {
  position: fixed;
  width: 300px;
  max-height: 420px;
  z-index: 9992;
  background: rgba(12,12,20,.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99,102,241,.35);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.7);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: oppFadeIn .18s ease;
}
@keyframes oppFadeIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: none; } }

.opp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.opp-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
  text-transform: uppercase;
}
.opp-search-wrap {
  padding: 8px 10px 6px;
  flex-shrink: 0;
}
.opp-search {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(99,102,241,.2);
  color: var(--text);
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
}
.opp-search:focus { border-color: rgba(99,102,241,.55); }
.opp-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,.3) transparent;
}
.opp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  gap: 8px;
}
.opp-item:hover { background: rgba(99,102,241,.14); }
.opp-item-active { background: rgba(99,102,241,.22); }
.opp-item-active .opp-item-name { color: var(--accent); }
.opp-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.opp-item-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.opp-add-section {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 8px 10px;
  flex-shrink: 0;
  background: rgba(0,0,0,.2);
}
.opp-add-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: .5px;
}
.opp-add-form {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 6px;
}
.opp-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 9px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(99,102,241,.2);
  color: var(--text);
  border-radius: 7px;
  font-size: 12px;
  font-family: var(--font);
  outline: none;
}
.opp-input:focus { border-color: rgba(99,102,241,.5); }
.opp-add-btn {
  padding: 7px;
  background: rgba(99,102,241,.2);
  border: 1px solid rgba(99,102,241,.35);
  color: var(--accent);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  transition: background .15s;
}
.opp-add-btn:hover { background: rgba(99,102,241,.35); }
.opp-custom-list {
  max-height: 80px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.opp-custom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: rgba(255,255,255,.04);
  border-radius: 6px;
  gap: 6px;
}
.opp-custom-title {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.opp-custom-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color .15s;
}
.opp-custom-remove:hover { color: #ef4444; }
/* Highlight playlist btn when open */
#ost-playlist-btn.panel-open { color: var(--accent); background: rgba(99,102,241,.18); }

/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE — style sélection de circuit (CTGP-R inspired)
   ═══════════════════════════════════════════════════════════════ */

#page-landing.active {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #07070d;
  animation: none;
  overflow: hidden;
}

/* Grille animée en arrière-plan */
.landing-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0,217,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,217,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: bgScroll 22s linear infinite;
  pointer-events: none;
}
.landing-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 50%, transparent 20%, rgba(7,7,13,.85) 100%);
}
@keyframes bgScroll { to { background-position: 48px 48px; } }

/* Barre du haut */
.landing-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 44px;
  z-index: 3;
}
.landing-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 5px;
  color: #ecedf7;
  display: flex;
  align-items: center;
  gap: 10px;
}
.landing-logo .landing-logo-kanji {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 17px;
  background: #e8384f;
  color: #fff;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.landing-logo .landing-logo-accent { color: #e8384f; }
.landing-auth-row { display: flex; gap: 10px; align-items: center; }

/* Titre central */
.landing-headline {
  position: relative;
  z-index: 3;
  text-align: center;
  margin-bottom: 48px;
}
.landing-headline h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: 8px;
  color: #fff;
  line-height: 1;
  margin-bottom: 8px;
}
.landing-headline h1 span { color: #e8384f; }
.landing-headline p {
  font-size: 13px;
  letter-spacing: 4px;
  color: rgba(255,255,255,.28);
  text-transform: uppercase;
}

/* Conteneur des 3 cartes */
.landing-cards {
  display: flex;
  gap: 22px;
  align-items: stretch;
  justify-content: center;
  padding: 0 24px;
  position: relative;
  z-index: 3;
  perspective: 1400px;
}

/* Carte individuelle */
.lcard {
  width: 300px;
  min-height: 340px;
  border-radius: 18px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.07);
  background: #0d0d1a;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s, border-color .3s;
  transform-style: preserve-3d;
  will-change: transform;
}
.lcard:hover {
  transform: translateY(-16px) scale(1.05) rotateX(-6deg);
  border-color: var(--lc-color);
  box-shadow: 0 36px 90px rgba(0,0,0,.75), 0 0 60px var(--lc-glow);
}
.lcard:active { transform: translateY(-4px) scale(.97); transition-duration: .1s; }

/* En-tête de la carte (zone colorée) */
.lcard-head {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--lc-grad);
  flex-shrink: 0;
}
.lcard-head::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px);
}
.lcard-icon {
  font-size: 76px;
  line-height: 1;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 24px var(--lc-glow));
  animation: lcFloat 3.5s ease-in-out infinite;
}
.lcard-manga  .lcard-icon { animation-delay: 0s; }
.lcard-series .lcard-icon { animation-delay: -.7s; }
.lcard-live   .lcard-icon { animation-delay: -1.4s; }
@keyframes lcFloat {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-9px) scale(1.04); }
}

/* Corps de la carte */
.lcard-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  text-align: center;
  position: relative;
}
.lcard-body::before {
  content: '';
  position: absolute;
  top: 0; left: 16%; right: 16%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--lc-color), transparent);
  box-shadow: 0 0 8px var(--lc-glow);
}
.lcard-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  letter-spacing: 4px;
  line-height: .88;
  color: #fff;
  margin-bottom: 14px;
  text-shadow: 0 0 24px var(--lc-glow);
}
.lcard-sub {
  font-size: 11px;
  color: rgba(255,255,255,.38);
  letter-spacing: .8px;
  line-height: 1.6;
}
/* Reflet en coin */
.lcard::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.07) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.lcard:hover::after { opacity: 1; }

/* Couleurs par thème de carte */
.lcard-manga  { --lc-color:#e8384f; --lc-glow:rgba(232,56,79,.5);  --lc-grad:linear-gradient(150deg,#2a0a10,#420f1e); }
.lcard-series { --lc-color:#d4af37; --lc-glow:rgba(212,175,55,.45);--lc-grad:linear-gradient(150deg,#1c1408,#2e2110); }
.lcard-live   { --lc-color:#ef4444; --lc-glow:rgba(239,68,68,.5);  --lc-grad:linear-gradient(150deg,#1c0606,#340c0c); }

/* Flash au clic */
@keyframes lcFlash { 0%{opacity:1} 35%{opacity:.25} 100%{opacity:1} }
.lcard.flashing { animation: lcFlash .28s ease !important; }

/* Tagline bas de page */
.landing-tagline {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 12px;
  letter-spacing: 6px;
  color: rgba(255,255,255,.12);
  white-space: nowrap;
  z-index: 3;
}

/* ── Responsive landing ── */
@media (max-width: 880px) {
  .landing-cards { flex-direction: column; gap: 14px; padding: 74px 20px 60px; overflow-y: auto; }
  .lcard { width: 100%; max-width: 360px; min-height: auto; flex-direction: row; border-radius: 14px; }
  .lcard-head { width: 110px; min-height: 110px; height: auto; flex-shrink: 0; }
  .lcard-icon { font-size: 54px; }
  .lcard-body { align-items: flex-start; text-align: left; padding: 16px 18px; }
  .lcard-title { font-size: 30px; margin-bottom: 6px; }
  #page-landing.active { justify-content: flex-start; overflow-y: auto; }
  .landing-headline { margin-top: 72px; margin-bottom: 24px; }
  .landing-tagline { bottom: 10px; }
}
@media (max-width: 480px) {
  .landing-topbar { padding: 16px 20px; }
  .landing-logo { font-size: 20px; letter-spacing: 3px; }
  .lcard { max-width: 100%; }
}

/* ══ SÉLECTEUR DE THÈME (entrée Manga/Anime) ══ */
.theme-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.tentry {
  border-radius: 12px;
  padding: 10px 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .2s, transform .15s;
  background: var(--surface);
}
.tentry:hover { transform: scale(1.04); border-color: rgba(255,255,255,.25); }
.tentry.selected { border-color: var(--accent); box-shadow: 0 0 18px var(--accent-glow); }
.tentry-mini {
  height: 46px;
  border-radius: 8px;
  margin-bottom: 7px;
  position: relative;
  overflow: hidden;
}
.tentry-name { font-size: 11px; font-weight: 700; color: var(--text); }
.tentry-desc { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Barre d'accès rapide (page Manga) ── */
.home-quick-bar {
  display: flex;
  gap: 8px;
  padding: 12px 32px 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.hqb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: var(--font);
  text-decoration: none;
  letter-spacing: .3px;
}
.hqb-btn:hover { background: var(--surface2); border-color: var(--accent); color: var(--accent); }
.hqb-btn.hqb-home {
  border-color: transparent;
  background: rgba(232,56,79,.12);
  color: var(--accent);
}
.hqb-btn.hqb-home:hover { background: rgba(232,56,79,.22); }
