:root {
  --bg: #f1efe9; --ink: #201c16; --ink-dim: #5c5647;
  --red: #9a2b1f; --gold: #8a611f; --ok: #3f8a4c; --warn: #a3781f;
  --glass: rgba(255,255,255,.84); --edge: rgba(60,50,35,.22);
  --edge-hi: rgba(255,255,255,.95); --edge-hi2: rgba(255,255,255,.3);
  --edge-soft: rgba(60,50,35,.14); --specular: rgba(255,255,255,.8);
  --v-badge: #fdf3ea;
}
:root[data-theme="void"] {
  --bg: #07080c; --ink: #f5f1e6; --ink-dim: #b3ab97;
  --red: #e0562f; --gold: #d9a441; --ok: #6fbf7a; --warn: #e0b84a;
  --glass: rgba(38,35,46,.72); --edge: rgba(255,255,255,.16);
  --edge-hi: rgba(255,255,255,.14); --edge-hi2: rgba(255,255,255,.05);
  --edge-soft: rgba(255,255,255,.08); --specular: rgba(255,255,255,.14);
  --v-badge: #1a0a04;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }

/* Barre de défilement toujours visible sur tout le site, demandé par
   Sébastien — par défaut macOS/WebKit masque les barres de défilement
   jusqu'au survol/scroll actif, ce qui les rendait invisibles sur les
   colonnes qui défilent (Consultation, sélecteur du constructeur...)
   même quand il y avait largement de quoi défiler (ex. 298 fiches Space
   Marines, une dizaine visibles). Définir ::-webkit-scrollbar bascule
   Chrome/Safari sur un rendu de barre classique toujours affiché au lieu
   du survol façon macOS ; scrollbar-width/-color fait pareil sur Firefox.
   S'applique à toute zone qui défile, pas une case par case. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--edge);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--ink-dim);
  background-clip: padding-box;
}
body {
  background: var(--bg); color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  transition: background .3s ease, color .3s ease;
}
.cap { font-family: 'Rajdhani', sans-serif; text-transform: uppercase; letter-spacing: .12em; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.4; }

.glass {
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 var(--edge-hi), inset 0 0 0 1px var(--edge-hi2),
              0 1px 1px rgba(0,0,0,.12), 0 20px 44px -14px rgba(0,0,0,.4);
  position: relative; overflow: hidden;
  /* CSS flexbox trap: a flex item's automatic minimum size resolves to 0
     (instead of its content size) once overflow isn't visible — exactly
     .glass's overflow:hidden above, needed for the specular-highlight
     clip. Without flex-shrink:0, any .glass card inside a scrolling flex
     list gets silently crushed toward 0px by its siblings instead of
     asserting its real size and letting the LIST scroll — the actual
     cause of "cards with unreadable/unclickable content" reported after
     testing the list-building screens. */
  flex-shrink: 0;
}
.glass-pill { border-radius: 999px; }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select { font: inherit; color: inherit; }

.top-bar {
  position: relative; z-index: 2; flex: 0 0 auto; margin: 20px 20px 0;
  border-radius: 22px; height: 88px; display: flex; align-items: center; gap: 18px; padding: 0 24px;
}
.top-bar .logo { width: 80px; height: 64px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.top-bar .logo img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); transform: scaleX(-1); }
.top-bar .title { font-size: 20px; font-weight: 700; letter-spacing: .1em; }
.top-bar .subtitle { font-size: 9px; color: var(--ink-dim); letter-spacing: .22em; }
.top-bar .search-wrap {
  flex: 1; max-width: 400px; margin-left: 12px; position: relative;
}
.top-bar .search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; color: var(--ink-dim); font-size: 13px; border: none; outline: none; background: transparent;
}
.top-bar .search input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--ink); font: inherit; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-bar .search input::placeholder { color: var(--ink-dim); }
.toggle-btn { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--edge); background: transparent; }
.edition-switch { display: flex; font-size: 12px; overflow: hidden; padding: 3px; gap: 2px; border: none; }
.edition-switch span[data-ed] { padding: 6px 15px; border-radius: 999px; background: transparent; color: var(--ink-dim); cursor: pointer; }
.edition-switch span[data-ed].active { background: var(--red); color: var(--v-badge); font-weight: 700; }

.tab-pill { display: inline-flex; padding: 4px; gap: 2px; }
.tab-pill button { border: none; padding: 9px 20px; border-radius: 999px; font-size: 12px; font-weight: 600; background: transparent; color: var(--ink-dim); }
.tab-pill button.active { background: var(--red); color: var(--v-badge); }

.has-tip { cursor: help; border-bottom: 1px dotted currentColor; }
/* info au passage : curseur d'aide, sans soulignement (réservé aux règles) ; les boutons gardent leur curseur de clic */
[data-tip]:not(button):not(a):not(input):not(select):not(label):not(.item-card):not(.faction-group) { cursor: help; }
.hover-tip.glass {
  position: fixed; z-index: 999; display: none; max-width: 260px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 11px; line-height: 1.5; font-weight: 500;
  text-transform: none; letter-spacing: normal;
  color: var(--ink); pointer-events: none;
  white-space: pre-line;
}

.page-shell {
  width: 100%; height: 100vh; display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.content { position: relative; z-index: 1; flex: 1; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow: auto; }

.aurora-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.aurora-bg span { position: absolute; border-radius: 50%; filter: blur(10px); }
:root[data-theme="void"] .aurora-bg { display: none; }
:root:not([data-theme="void"]) .void-bg { display: none; }
.void-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.9), transparent),
    radial-gradient(1px 1px at 25% 65%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 40% 15%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 55% 80%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.5px 1.5px at 70% 35%, rgba(255,255,255,.9), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 95% 10%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.5px 1.5px at 15% 90%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 60% 5%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 33% 45%, rgba(255,255,255,.5), transparent),
    radial-gradient(ellipse 900px 700px at 20% 0%, rgba(224,86,47,.14), transparent 60%),
    radial-gradient(ellipse 800px 600px at 100% 100%, rgba(217,164,65,.10), transparent 60%);
  background-repeat: no-repeat;
}

.loading, .empty-state { color: var(--ink-dim); font-size: 13px; padding: 24px; text-align: center; }
.error-state { color: var(--red); font-size: 13px; padding: 24px; text-align: center; }
