/* ============================================================
   Solarune VFX Tracker — Style (inspiré de la galerie originale)
   ============================================================ */

/* ── Palette Parchemin (clair) ── */
:root {
  --bg: #ece0c6;
  --ink: #2a1d10;
  --ink-soft: #6b5840;
  --rule: #c2ad81;
  --card: #f7eed8;
  --card-edge: #c8b079;
  --accent: #a8541b;
  --accent-soft: rgba(168,84,27,.13);
  --dye: #2e8b3e;
  --shadow: 0 1px 0 rgba(120,80,20,.08), 0 10px 28px -18px rgba(80,50,10,.4);
  --texture: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.10  0 0 0 0 0.03  0 0 0 0.09 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --vignette: radial-gradient(120% 80% at 50% 0%, transparent 55%, rgba(60,30,5,.22) 100%);
  --img-bg: #f1e7d0;
  --owned: #2e8b3e;
  --owned-bg: rgba(46,139,62,.12);
  --owned-bdr: rgba(46,139,62,.4);
  --wanted: #a8541b;
  --wanted-bg: rgba(168,84,27,.12);
  --wanted-bdr: rgba(168,84,27,.4);
  --danger: #c0392b;
  --fs: Spectral, Georgia, serif;
  --fd: Cinzel, serif;
  --fm: 'JetBrains Mono', monospace;
}

/* ── Palette Nuit (sombre) ── */
html[data-theme="dark"] {
  --bg: #0e1426;
  --ink: #e9e2cf;
  --ink-soft: #a39c87;
  --rule: #2a3354;
  --card: #131a30;
  --card-edge: #2c365a;
  --accent: #e8b34a;
  --accent-soft: rgba(232,179,74,.13);
  --dye: #6cd97e;
  --shadow: 0 1px 0 rgba(255,220,140,.04), 0 14px 32px -18px rgba(0,0,0,.7);
  --texture: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='2' seed='9'/><feColorMatrix values='0 0 0 0 0.85  0 0 0 0 0.78  0 0 0 0 0.55  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --vignette: radial-gradient(120% 80% at 50% 0%, transparent 55%, rgba(0,0,0,.55) 100%);
  --img-bg: #0a0f1c;
  --owned: #6cd97e;
  --owned-bg: rgba(108,217,126,.12);
  --owned-bdr: rgba(108,217,126,.4);
  --wanted: #e8b34a;
  --wanted-bg: rgba(232,179,74,.12);
  --wanted-bdr: rgba(232,179,74,.4);
  --danger: #e87070;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--fs);
  color: var(--ink);
  background: var(--bg);
  background-image: var(--texture), var(--vignette);
  background-blend-mode: multiply, normal;
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--card-edge); border-radius: 999px;
  padding: 10px 20px; font-family: var(--fd); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  z-index: 500; transition: opacity .4s; pointer-events: none;
  white-space: nowrap; box-shadow: var(--shadow);
}

/* ── Topbar ── */
.topbar {
  max-width: 1180px; margin: 0 auto;
  padding: 22px 40px 0;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--fd); font-size: 12px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-soft);
  flex-wrap: wrap; gap: 10px;
}
.topbar-left  { display: flex; align-items: center; gap: 16px; }
.topbar-right {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 6px;
}
.topbar-right-inner {
  display: flex; align-items: center; gap: 10px;
}
.topbar-right-theme {
  display: flex; justify-content: flex-end;
}

.logo {
  font-family: var(--fd); font-size: 13px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink); display: flex; align-items: center; gap: 10px;
}
.logo svg { width: 22px; height: 22px; color: var(--accent); }

.nav-sep { color: var(--rule); }

.nav-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--fd); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 4px 0; transition: color .2s;
}
.nav-btn:hover { color: var(--accent); }
.nav-btn.active { color: var(--accent); border-bottom: 1px solid var(--accent); }

/* Bouton thème */
.mode-btn {
  appearance: none; border: 1px solid var(--rule);
  background: rgba(255,255,255,.05);
  color: var(--ink-soft); font-family: var(--fd);
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; transition: all .2s;
}
.mode-btn:hover { color: var(--ink); border-color: var(--accent); }
.mode-btn svg { width: 13px; height: 13px; color: var(--accent); }

/* Bouton connexion */
.btn-login {
  appearance: none; border: 1px solid var(--accent);
  background: rgba(168,84,27,.1);
  color: var(--accent); font-family: var(--fd);
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all .2s;
}
html[data-theme="dark"] .btn-login { background: rgba(232,179,74,.1); }
.btn-login:hover { background: var(--accent); color: var(--bg); }

/* User chip */
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-size: 11px; color: var(--accent); font-weight: 600;
}
.user-name { font-family: var(--fd); font-size: 11px; letter-spacing: .12em; color: var(--ink-soft); text-transform: uppercase; }
.btn-perso {
  appearance: none; border: 1px solid var(--rule); border-radius: 999px;
  background: transparent; color: var(--ink-soft); font-family: var(--fd);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 12px; cursor: pointer; transition: all .2s;
}
.btn-perso:hover { border-color: var(--accent); color: var(--accent); }

/* Switcher PJ */
.pj-sw { display: flex; align-items: center; gap: 8px; }
.pj-sw-label { font-family: var(--fd); font-size: 10px; letter-spacing: .14em; color: var(--ink-soft); text-transform: uppercase; }
.pj-select {
  background: rgba(255,255,255,.05); border: 1px solid var(--rule);
  border-radius: 999px; padding: 5px 14px; color: var(--ink);
  font-family: var(--fd); font-size: 11px; outline: none;
  cursor: pointer; max-width: 160px; transition: border-color .2s;
}
.pj-select:focus { border-color: var(--accent); }

/* ── Hero ── */
.hero {
  max-width: 1180px; margin: 12px auto 0;
  padding: 32px 40px 16px; text-align: center;
}
.hero-kicker {
  font-family: var(--fd); font-size: 11px;
  letter-spacing: .42em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.hero h1 {
  font-family: var(--fd); font-weight: 600;
  font-size: clamp(34px, 5.4vw, 56px); line-height: 1;
  margin: 0 0 12px; letter-spacing: .015em; color: var(--ink);
}
.hero-sub {
  max-width: 560px; margin: 0 auto;
  font-size: 16px; color: var(--ink-soft); font-style: italic;
}

/* ── Ornement ── */
.rule-orn {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin: 22px auto 18px;
  max-width: 1100px; padding: 0 40px; color: var(--ink-soft);
}
.rule-orn::before, .rule-orn::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule) 30%, var(--rule) 70%, transparent);
}
.rule-orn svg { width: 18px; height: 18px; color: var(--accent); }

/* ── Légende teinture ── */
.legend {
  max-width: 1180px; margin: 0 auto;
  padding: 0 40px 8px;
  display: flex; justify-content: center; align-items: center; gap: 10px;
  font-family: var(--fs); font-style: italic;
  font-size: 13.5px; color: var(--ink-soft);
}
.dye-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--dye);
  box-shadow: 0 0 0 3px rgba(46,139,62,.25);
  display: inline-block; flex: 0 0 auto;
}
html[data-theme="dark"] .dye-dot { box-shadow: 0 0 0 3px rgba(108,217,126,.25); }

/* ── Main ── */
main { max-width: 1180px; margin: 0 auto; padding: 0 40px 60px; }

/* ── Toolbar ── */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  margin: 16px -40px 18px; padding: 14px 40px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr 240px auto auto;
  gap: 12px; align-items: center;
}
.field { position: relative; display: flex; align-items: center; }
.field svg {
  width: 15px; height: 15px;
  position: absolute; left: 14px;
  color: var(--ink-soft); pointer-events: none;
}
.field input, .field select {
  width: 100%; appearance: none;
  background: color-mix(in srgb, var(--card) 75%, transparent);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 10px 16px 10px 40px;
  font-family: var(--fs); font-size: 14px;
  color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field select {
  cursor: pointer; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
                    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.field input::placeholder { color: var(--ink-soft); font-style: italic; }
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(168,84,27,.15);
}
html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .field select:focus {
  box-shadow: 0 0 0 4px rgba(232,179,74,.15);
}
.field select option { background: var(--card); color: var(--ink); }

.reset-btn {
  appearance: none; border: 1px solid var(--rule);
  background: transparent; color: var(--ink-soft);
  font-family: var(--fd); font-size: 10px;
  letter-spacing: .2em; text-transform: uppercase;
  padding: 10px 14px; border-radius: 999px; cursor: pointer;
  transition: color .2s, border-color .2s; white-space: nowrap;
}
.reset-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Bouton filtre possédés */
.filter-owned-btn {
  appearance: none; border: 1px solid var(--rule);
  background: transparent; color: var(--ink-soft);
  font-family: var(--fd); font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase;
  padding: 10px 14px; border-radius: 999px; cursor: pointer;
  transition: all .2s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-owned-btn:hover { color: var(--owned); border-color: var(--owned-bdr); }
.filter-owned-btn.active {
  background: var(--owned-bg); border-color: var(--owned-bdr);
  color: var(--owned);
}

/* ── Sommaire ── */
#summary {
  display: flex; flex-wrap: wrap; gap: 8px 10px;
  margin-bottom: 28px; padding: 14px 16px;
  background: var(--card); background-image: var(--texture);
  background-blend-mode: multiply;
  border: 1px solid var(--card-edge); border-radius: 4px;
}
#summary a, #summary button.sum-link {
  font-family: var(--fd); font-size: 11.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); cursor: pointer;
  padding: 7px 13px; border: 1px solid var(--accent); border-radius: 999px;
  background: rgba(168,84,27,.1);
  transition: color .2s, background .2s, transform .2s;
  display: inline-block;
}
html[data-theme="dark"] #summary a,
html[data-theme="dark"] #summary button.sum-link {
  background: rgba(232,179,74,.1);
}
#summary a:hover, #summary button.sum-link:hover {
  color: var(--bg); background: var(--accent); transform: translateY(-1px);
}

/* ── Sections catégories ── */
section.cat, .cat-section { margin-top: 28px; }
.cat-toggle, .toggle {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  font-family: var(--fd); font-weight: 600;
  font-size: 19px; letter-spacing: .04em; color: var(--ink);
  padding: 10px 0 6px; border-bottom: 1px solid var(--rule);
  user-select: none;
}
.cat-toggle:hover .cat-name,
.toggle:hover .name { color: var(--accent); }
.chev, .cat-chev {
  width: 22px; height: 22px; display: grid; place-items: center;
  color: var(--accent); transition: transform .25s ease; font-size: 14px;
}
.cat-toggle.open .cat-chev,
.toggle.is-open .chev { transform: rotate(90deg); }
.cat-count, .count {
  margin-left: auto; font-family: var(--fm);
  font-size: 11px; letter-spacing: .14em;
  color: var(--ink-soft); text-transform: uppercase;
}

/* ── Galerie ── */
.gallery, .cat-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px; margin-top: 16px;
}
.gallery.hidden, .cat-gallery:not(.open) { display: none; }

/* ── Carte VFX ── */
.card, .vfx-card {
  position: relative;
  background: var(--card); background-image: var(--texture);
  background-blend-mode: multiply;
  border: 1px solid var(--card-edge); border-radius: 4px;
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card::before, .vfx-card::before {
  content: ""; position: absolute; inset: 6px;
  pointer-events: none; opacity: .5;
  background:
    linear-gradient(var(--card-edge), var(--card-edge)) top left/12px 1px no-repeat,
    linear-gradient(var(--card-edge), var(--card-edge)) top left/1px 12px no-repeat,
    linear-gradient(var(--card-edge), var(--card-edge)) top right/12px 1px no-repeat,
    linear-gradient(var(--card-edge), var(--card-edge)) top right/1px 12px no-repeat,
    linear-gradient(var(--card-edge), var(--card-edge)) bottom left/12px 1px no-repeat,
    linear-gradient(var(--card-edge), var(--card-edge)) bottom left/1px 12px no-repeat,
    linear-gradient(var(--card-edge), var(--card-edge)) bottom right/12px 1px no-repeat,
    linear-gradient(var(--card-edge), var(--card-edge)) bottom right/1px 12px no-repeat;
  z-index: 2;
}
.card:hover, .vfx-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 0 rgba(120,80,20,.08), 0 18px 36px -18px rgba(80,50,10,.55);
  border-color: var(--accent);
}
.vfx-card.owned { border-color: var(--owned-bdr); box-shadow: 0 0 0 1px rgba(46,139,62,.1), var(--shadow); }
.vfx-card.wanted { border-color: var(--wanted-bdr); box-shadow: 0 0 0 1px rgba(168,84,27,.1), var(--shadow); }

/* Image */
.img-wrap, .vfx-img-wrap {
  width: 100%; aspect-ratio: 1;
  background: var(--img-bg);
  border-bottom: 1px solid var(--card-edge);
  overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.card img, .vfx-img {
  width: 100%; height: 100%; object-fit: contain;
  cursor: zoom-in; transition: transform .3s, opacity .3s;
  padding: 4px;
}
.vfx-img { opacity: 0; }
.vfx-img.loaded { opacity: 1; }
.card:hover img, .vfx-card:hover .vfx-img { transform: scale(1.03); }
.img-placeholder {
  font-family: var(--fm); font-size: 11px; letter-spacing: .14em;
  color: var(--ink-soft); text-transform: uppercase;
}

/* Badges statut */
.status-pip {
  position: absolute; top: 6px; right: 6px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 3;
}
.vfx-card.owned .pip-own   { opacity: 1; background: var(--owned);  color: #fff; }
.vfx-card.wanted .pip-want { opacity: 1; background: var(--wanted); color: #fff; }

/* Point teinture */
.teinture-dot {
  position: absolute; top: 6px; left: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dye); box-shadow: 0 0 0 2px rgba(46,139,62,.25);
  z-index: 3;
}
html[data-theme="dark"] .teinture-dot { box-shadow: 0 0 0 2px rgba(108,217,126,.25); }

/* Corps de la carte */
.info, .vfx-card-body {
  padding: 12px 14px 6px; text-align: center;
  flex: 1; display: flex; flex-direction: column; gap: 3px;
}
.cat-ig, .vfx-cat-ig {
  font-family: var(--fd); font-weight: 600;
  font-size: 13px; letter-spacing: .04em; color: var(--ink); margin-bottom: 2px;
}
.num-3d, .vfx-ids {
  font-family: var(--fm); font-size: 10.5px;
  letter-spacing: .04em; color: var(--ink-soft); text-transform: uppercase;
}
.name-row, .vfx-card-name {
  font-size: 13.5px; color: var(--ink); margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; flex-wrap: wrap;
}
.where, .vfx-card-lieu {
  font-size: 12px; color: var(--ink-soft); font-style: italic;
  margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--rule);
}
.where strong, .vfx-card-monnaie {
  font-style: normal; font-family: var(--fd); font-weight: 500;
  letter-spacing: .04em; font-size: 11px;
  color: var(--accent); text-transform: uppercase; margin-left: 4px;
}
.vfx-card-sep { display: none; }

/* Boutons tracking */
.track-btns {
  display: flex; gap: 6px; padding: 0 10px 10px;
  justify-content: center; position: relative; z-index: 3;
}
.t-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.05); border: 1px solid var(--rule);
  font-size: 14px; color: var(--ink-soft);
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.t-btn.own:hover, .t-btn.own.on  { background: var(--owned-bg);  border-color: var(--owned-bdr);  color: var(--owned); }
.t-btn.want:hover,.t-btn.want.on { background: var(--wanted-bg); border-color: var(--wanted-bdr); color: var(--wanted); }
.t-btn.disabled { opacity: .3; cursor: default; }

/* ── Lightbox ── */
.lightbox, #lightbox {
  position: fixed; inset: 0;
  background: rgba(8,6,2,.88);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 30px;
}
.lightbox.open, #lightbox.is-open { display: flex; }
.lb-inner {
  position: relative;
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: 4px; max-width: 420px; width: 92vw; overflow: hidden;
  box-shadow: 0 0 60px -10px rgba(0,0,0,.8);
}
.lb-img, #lightbox-img {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  background: var(--img-bg); padding: 16px;
  max-width: 90vw; max-height: 70vh;
}
.lb-body { padding: 14px 18px 18px; text-align: center; border-top: 1px solid var(--rule); }
.lb-cat  { font-family: var(--fd); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.lb-ids  { font-family: var(--fm); font-size: 11px; color: var(--ink-soft); margin-bottom: 6px; }
.lb-name { font-family: var(--fd); font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.lb-sep  { height: 1px; background: var(--rule); margin: 8px 0; }
.lb-lieu { font-size: 12px; color: var(--ink-soft); font-style: italic; margin-bottom: 8px; }
.lb-teinture { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dye); font-style: italic; margin-bottom: 10px; }
.lb-track { display: flex; gap: 8px; margin-top: 8px; }
.lb-btn {
  flex: 1; padding: 8px; border-radius: 999px;
  border: 1px solid var(--rule); background: none;
  color: var(--ink-soft); font-family: var(--fd); font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase; cursor: pointer; transition: all .2s;
}
.lb-btn.own:hover, .lb-btn.own.on  { background: var(--owned-bg);  border-color: var(--owned-bdr);  color: var(--owned); }
.lb-btn.want:hover,.lb-btn.want.on { background: var(--wanted-bg); border-color: var(--wanted-bdr); color: var(--wanted); }
.lb-note { font-size: 12px; color: var(--ink-soft); font-style: italic; margin-top: 10px; text-align: center; }
.lb-close, #lightbox-close {
  position: absolute; top: 10px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.3);
  color: white; font-size: 20px; cursor: pointer;
  display: grid; place-items: center; transition: all .2s; z-index: 1;
}
.lb-close:hover, #lightbox-close:hover { border-color: var(--accent); color: var(--accent); }

/* ── Modales ── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7); z-index: 400;
  align-items: center; justify-content: center; min-height: 100vh;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--card); background-image: var(--texture);
  background-blend-mode: multiply;
  border: 1px solid var(--card-edge); border-radius: 4px;
  padding: 28px; width: 380px; max-width: 94vw;
  box-shadow: var(--shadow);
}
.modal-wide { width: 500px; }
.modal-title { font-family: var(--fd); font-size: 15px; color: var(--ink); margin-bottom: 20px; letter-spacing: .05em; }
.fg { margin-bottom: 14px; }
.fg label { display: block; font-family: var(--fd); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 5px; }
.fi, .fi-sm {
  width: 100%; background: color-mix(in srgb, var(--card) 75%, transparent);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 9px 16px; color: var(--ink);
  font-family: var(--fs); font-size: 14px; outline: none; transition: border-color .2s;
}
.fi-sm { font-size: 13px; padding: 8px 14px; }
.fi:focus, .fi-sm:focus { border-color: var(--accent); }
.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.btn-p {
  background: var(--accent); border: none; border-radius: 999px;
  padding: 10px 20px; color: var(--bg);
  font-family: var(--fd); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; cursor: pointer; font-weight: 600;
  transition: opacity .2s; flex: 1;
}
.btn-p:hover { opacity: .85; }
.btn-s {
  flex: 1; background: none; border: 1px solid var(--rule); border-radius: 999px;
  padding: 10px; color: var(--ink-soft);
  font-family: var(--fd); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; cursor: pointer; transition: all .2s;
}
.btn-s:hover { border-color: var(--accent); color: var(--accent); }
.pj-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; margin-bottom: 4px; }
.pj-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.05); border: 1px solid var(--rule);
  border-radius: 4px; padding: 10px 14px;
}
.pj-row-info  { flex: 1; min-width: 0; }
.pj-row-name  { font-family: var(--fd); font-size: 13px; color: var(--ink); }
.pj-row-meta  { font-size: 11px; color: var(--ink-soft); font-style: italic; }
.pj-row-counts{ font-size: 11px; display: flex; gap: 10px; margin-top: 2px; }
.pj-row-acts  { display: flex; gap: 6px; flex-shrink: 0; }
.ic-btn {
  background: none; border: 1px solid var(--rule); border-radius: 999px;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; transition: all .2s; color: var(--ink-soft);
}
.ic-btn.go:hover  { border-color: var(--accent); color: var(--accent); }
.ic-btn.del:hover { border-color: var(--danger);  color: var(--danger); }
.pj-add-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
.pj-add-label   { font-family: var(--fd); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.pj-add-row     { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-add {
  background: var(--accent); border: none; border-radius: 999px;
  padding: 8px 16px; color: var(--bg);
  font-family: var(--fd); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; cursor: pointer; font-weight: 600;
  white-space: nowrap; transition: opacity .2s;
}
.btn-add:hover { opacity: .85; }
.pj-empty { text-align: center; padding: 20px; color: var(--ink-soft); font-style: italic; font-size: 13px; }

/* ── Dashboard Personnages ── */
.page-title   { font-family: var(--fd); font-size: 20px; color: var(--ink); letter-spacing: .05em; margin-bottom: 4px; }
.page-sub     { font-size: 13px; color: var(--ink-soft); font-style: italic; margin-bottom: 28px; }
.section-title {
  font-family: var(--fd); font-size: 13px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.stat-card  {
  background: var(--card); background-image: var(--texture);
  background-blend-mode: multiply;
  border: 1px solid var(--card-edge); border-radius: 4px;
  padding: 16px 20px; box-shadow: var(--shadow);
}
.stat-label { font-family: var(--fd); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.stat-val   { font-size: 26px; font-weight: 500; font-family: var(--fm); }
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 32px; }
.pj-card {
  background: var(--card); background-image: var(--texture); background-blend-mode: multiply;
  border: 1px solid var(--card-edge); border-radius: 4px;
  padding: 18px 20px; cursor: pointer;
  transition: border-color .2s, transform .15s; position: relative;
  box-shadow: var(--shadow);
}
.pj-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pj-card.sel   { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.pj-card-name  { font-family: var(--fd); font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.pj-card-meta  { font-size: 12px; color: var(--ink-soft); font-style: italic; }
.pj-bar        { height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; margin-top: 10px; }
.pj-bar-fill   { height: 100%; background: var(--owned); border-radius: 2px; transition: width .4s; }
.pj-counts     { display: flex; gap: 12px; margin-top: 5px; font-size: 11px; font-family: var(--fm); }
.pj-del        { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--rule); cursor: pointer; font-size: 16px; transition: color .2s; line-height: 1; }
.pj-del:hover  { color: var(--danger); }
.add-pj-btn {
  background: none; border: 1px dashed var(--rule); border-radius: 4px;
  padding: 18px 20px; cursor: pointer; color: var(--ink-soft);
  font-family: var(--fd); font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  transition: border-color .2s, color .2s;
  display: flex; align-items: center; justify-content: center; min-height: 90px; width: 100%;
}
.add-pj-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── FAB ── */
.fab-stack {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px; z-index: 100;
}
.fab {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--card);
  color: var(--ink); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(0,0,0,.4);
  transition: transform .2s, border-color .2s, color .2s;
}
.fab:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.fab svg { width: 18px; height: 18px; }

/* ── Footer ── */
footer {
  max-width: 1180px; margin: 24px auto 0;
  padding: 22px 40px 60px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  font-family: var(--fm); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft);
}
footer a:hover { color: var(--accent); }
footer .left   { display: flex; align-items: center; gap: 12px; }
footer .left svg { width: 14px; height: 14px; color: var(--accent); }

/* ── Utilitaires ── */
.c-owned  { color: var(--owned);  }
.c-wanted { color: var(--wanted); }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .topbar { padding: 18px 22px 0; }
  .hero   { padding: 22px 22px 8px; }
  .rule-orn { padding: 0 22px; margin: 16px auto 14px; }
  main    { padding: 0 22px 50px; }
  .toolbar { grid-template-columns: 1fr 1fr; margin: 12px -22px 14px; padding: 12px 22px; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .gallery, .cat-gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  footer { padding: 18px 22px 50px; flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .toolbar { grid-template-columns: 1fr; }
  .modal, .modal-wide { width: 95vw; padding: 20px; }
  .pj-add-row { flex-wrap: wrap; }
  .btn-add    { width: 100%; }
}
