/* ═══════════════════════════════════════════════════════════════════
   axiomes.css — Système d'Axiomes v2 (Node Guardians · navy + or)
   Polices : Orbitron + Rajdhani uniquement.
   Base font-size : 18px (toutes les valeurs en rem grossissent).
   ═════════════════════════════════════════════════════════════════════ */

:root {
  --bg:         #07090f;
  --bg-2:       #0c1019;
  --bg-3:       #141a28;

  --gold:       #c9a961;
  --gold-2:     #e8c876;
  --gold-dim:   #6b5530;
  --gold-deep:  #3d3018;

  --text:       #d4c896;
  --text-2:     #f1e6b8;
  --text-dim:   #7f7556;
  --text-mute:  #4a4533;

  --red:        #e7484b;
  --green:      #5fb878;

  --font-d:  'Orbitron', sans-serif;
  --font-m:  'Rajdhani', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 18px; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-m);
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.ax-body {
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(201, 169, 97, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(40, 45, 60, 0.4) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
}

a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--text-2); }
code {
  font-family: var(--font-m); font-weight: 500;
  font-size: 0.85em; color: var(--gold-2);
  background: rgba(201, 169, 97, 0.08);
  padding: 1px 6px;
  border: 1px solid rgba(201, 169, 97, 0.18);
}

/* ═══ BACKGROUND ═══ */
.ax-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: url("data:image/svg+xml;utf8,<svg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/></svg>");
  opacity: .04; mix-blend-mode: overlay;
}
.ax-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  box-shadow: inset 0 0 240px 80px rgba(0, 0, 0, 0.92);
}

/* ═══ TOPBAR ═══ */
.ax-topbar {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 24px;
  padding: 16px 28px;
  background: linear-gradient(180deg, rgba(7, 9, 15, 0.95), rgba(7, 9, 15, 0.65));
  border-bottom: 1px solid rgba(201, 169, 97, 0.14);
  backdrop-filter: blur(8px);
}
.ax-topbar::after {
  content: ''; position: absolute;
  bottom: -1px; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  opacity: 0.55;
}

.ax-back {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  border: 1px solid var(--gold-dim);
  color: var(--text);
  font-family: var(--font-m); font-weight: 600;
  font-size: 0.85rem; letter-spacing: 0.3em;
  text-transform: uppercase; text-decoration: none;
  cursor: pointer; transition: all 0.25s; position: relative;
}
.ax-back::before, .ax-back::after {
  content: ''; position: absolute; width: 7px; height: 7px; border: 1px solid var(--gold);
}
.ax-back::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.ax-back::after  { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.ax-back:hover { color: var(--gold-2); background: rgba(201, 169, 97, 0.06); box-shadow: 0 0 18px rgba(201, 169, 97, 0.25); border-color: var(--gold); }
.ax-back-arrow { font-size: 1.1rem; transition: transform 0.25s; }
.ax-back:hover .ax-back-arrow { transform: translateX(-3px); }

.ax-title {
  justify-self: center;
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-d); font-weight: 800;
  font-size: 1.7rem; letter-spacing: 0.36em;
  color: var(--text-2); text-transform: uppercase;
  text-shadow: 0 0 18px rgba(201, 169, 97, 0.35);
}
.ax-title-glyph { color: var(--gold); font-size: 0.65rem; }

.ax-char-chip {
  justify-self: end;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 8px;
  background: rgba(201, 169, 97, 0.05);
  border: 1px solid var(--gold-dim); color: var(--text);
  cursor: pointer; transition: all 0.25s;
  font-family: var(--font-m); position: relative;
}
.ax-char-chip::before, .ax-char-chip::after {
  content: ''; position: absolute; width: 6px; height: 6px; border: 1px solid var(--gold);
}
.ax-char-chip::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.ax-char-chip::after  { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.ax-char-chip:hover { border-color: var(--gold); background: rgba(201, 169, 97, 0.1); }
.ax-chip-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: rgba(201, 169, 97, 0.12);
  border: 1px solid var(--gold-dim);
  font-size: 1rem;
}
.ax-chip-body { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.ax-chip-name { font-family: var(--font-d); font-weight: 700; font-size: 1rem; color: var(--text-2); letter-spacing: 0.08em; }
.ax-chip-meta { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); }
.ax-chip-caret { color: var(--gold); font-size: 0.8rem; margin-left: 4px; }

/* ═══ MAIN ═══ */
.ax-main { position: relative; z-index: 5; max-width: 1200px; margin: 0 auto; padding: 40px 28px 80px; }

/* ═══ STATE ═══ */
.ax-state { text-align: center; padding: 80px 24px; max-width: 760px; margin: 40px auto; }
.ax-state p { color: var(--text-dim); letter-spacing: 0.18em; font-size: 0.9rem; font-weight: 500; text-transform: uppercase; margin-top: 14px; }
.ax-spinner {
  display: inline-block; font-size: 2.4rem; color: var(--gold);
  animation: spin 3s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ax-state-glyph {
  font-size: 3.6rem; color: var(--gold); margin-bottom: 18px;
  filter: drop-shadow(0 0 14px rgba(201, 169, 97, 0.4));
}
.ax-state-title {
  font-family: var(--font-d); font-weight: 800;
  font-size: 2rem; letter-spacing: 0.16em;
  color: var(--text-2); text-transform: uppercase;
  margin-bottom: 14px;
}
.ax-state-text { font-size: 1.05rem; line-height: 1.6; color: var(--text); margin-bottom: 22px; }

/* ═══ HERO CARD ═══ */
.ax-hero {
  position: relative; text-align: center;
  padding: 48px 36px 40px;
  background:
    linear-gradient(180deg, rgba(201, 169, 97, 0.04), transparent 30%),
    linear-gradient(135deg, var(--bg-2), var(--bg));
  border: 1px solid var(--gold-dim);
  margin-bottom: 56px;
}
.ax-hero-corner { position: absolute; width: 16px; height: 16px; border: 1px solid var(--gold); }
.ax-hero-corner-tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.ax-hero-corner-tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.ax-hero-corner-bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.ax-hero-corner-br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.ax-hero-eyebrow {
  font-family: var(--font-m); font-weight: 500;
  font-size: 0.85rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--gold-dim);
  margin-bottom: 18px;
}
.ax-hero-emoji {
  font-size: 4rem; margin-bottom: 16px; line-height: 1;
  filter: drop-shadow(0 0 16px rgba(201, 169, 97, 0.4));
}
.ax-hero-active .ax-hero-emoji { font-size: 4.5rem; filter: drop-shadow(0 0 22px rgba(232, 200, 118, 0.55)); }
.ax-hero-title {
  font-family: var(--font-d); font-weight: 800;
  font-size: 2.8rem; letter-spacing: 0.18em;
  color: var(--text-2); text-transform: uppercase;
  text-shadow: 0 0 22px rgba(201, 169, 97, 0.35);
  margin-bottom: 16px;
}
.ax-hero-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin: 6px auto 18px; max-width: 340px;
  color: var(--gold); font-size: 0.6rem;
}
.ax-hero-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim), transparent); }
.ax-hero-meta {
  font-family: var(--font-m); font-weight: 500;
  font-size: 0.95rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 16px;
}
.ax-hero-desc {
  max-width: 620px; margin: 0 auto 24px;
  font-size: 1.1rem; line-height: 1.55; color: var(--text);
}
.ax-hero-desc strong { color: var(--gold-2); font-weight: 600; }

.ax-hero-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center; margin-top: 20px;
}

/* Stat modifiers panel (buff/malus on chosen) */
.ax-stat-mods {
  display: flex; gap: 18px; justify-content: center;
  margin: 4px auto 24px; flex-wrap: wrap;
}
.ax-stat-mod {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 22px;
  border: 1px solid var(--gold-dim);
  background: rgba(201, 169, 97, 0.04);
}
.ax-stat-mod-buff { border-color: rgba(95, 184, 120, 0.5); }
.ax-stat-mod-malus { border-color: rgba(231, 72, 75, 0.45); }
.ax-stat-mod-label {
  font-family: var(--font-m); font-weight: 500;
  font-size: 0.65rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--text-dim);
}
.ax-stat-mod-buff .ax-stat-mod-label { color: var(--green); }
.ax-stat-mod-malus .ax-stat-mod-label { color: var(--red); }
.ax-stat-mod-stat {
  font-family: var(--font-d); font-weight: 700;
  font-size: 1rem; letter-spacing: 0.1em;
  color: var(--text-2); text-transform: uppercase;
}
.ax-stat-mod-value {
  font-family: var(--font-d); font-weight: 800;
  font-size: 1.15rem; letter-spacing: 0.06em;
  color: var(--text-2);
}
.ax-stat-mod-buff .ax-stat-mod-value { color: var(--green); }
.ax-stat-mod-malus .ax-stat-mod-value { color: var(--red); }

/* Lvl progress */
.ax-lvl-progress { max-width: 320px; margin: 18px auto 0; }
.ax-lvl-bar {
  position: relative; height: 8px;
  background: rgba(201, 169, 97, 0.08);
  border: 1px solid var(--gold-dim); overflow: hidden;
}
.ax-lvl-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-2));
  box-shadow: 0 0 14px rgba(232, 200, 118, 0.4);
  transition: width 0.8s ease-out;
}
.ax-lvl-label {
  margin-top: 8px;
  font-family: var(--font-m); font-weight: 500;
  font-size: 0.85rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-dim);
}

/* ═══ BUTTONS ═══ */
.ax-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 12px; padding: 13px 26px;
  border: 1px solid var(--gold-dim); background: transparent;
  color: var(--text);
  font-family: var(--font-m); font-weight: 600;
  font-size: 0.9rem; letter-spacing: 0.24em;
  text-transform: uppercase; cursor: pointer;
  transition: all 0.22s; position: relative; text-decoration: none;
}
.ax-btn::before, .ax-btn::after { content: ''; position: absolute; width: 7px; height: 7px; border: 1px solid var(--gold); }
.ax-btn::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.ax-btn::after  { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.ax-btn:hover { border-color: var(--gold); color: var(--gold-2); background: rgba(201, 169, 97, 0.06); box-shadow: 0 0 22px rgba(232, 200, 118, 0.22); }
.ax-btn:disabled, .ax-btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.ax-btn-primary {
  background: linear-gradient(180deg, rgba(201, 169, 97, 0.18), rgba(201, 169, 97, 0.05));
  border-color: var(--gold); color: var(--text-2);
}
.ax-btn-primary:hover {
  background: linear-gradient(180deg, rgba(232, 200, 118, 0.28), rgba(201, 169, 97, 0.08));
  box-shadow: 0 0 28px rgba(232, 200, 118, 0.35);
}
.ax-btn-ghost { border-color: rgba(201, 169, 97, 0.3); background: transparent; }
.ax-arrow { font-size: 1.05rem; transition: transform 0.22s; }
.ax-btn:hover .ax-arrow { transform: translateX(3px); }

/* ═══ SECTIONS ═══ */
.ax-section { margin-bottom: 50px; }
.ax-section-head { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.ax-section-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim), transparent); }
.ax-section-title {
  font-family: var(--font-d); font-weight: 700;
  font-size: 1.3rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold-2);
  text-shadow: 0 0 12px rgba(201, 169, 97, 0.3); white-space: nowrap;
}
.ax-section-sub {
  text-align: center; font-size: 0.95rem;
  letter-spacing: 0.08em; color: var(--text-dim);
  margin-bottom: 22px; font-style: italic;
}
.ax-secret-mark { color: var(--gold); margin-left: 6px; filter: drop-shadow(0 0 8px var(--gold)); }

/* ═══ GRID OF AXIOME CARDS ═══ */
.ax-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.ax-card {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 22px 16px 18px;
  background:
    linear-gradient(180deg, rgba(201, 169, 97, 0.03), transparent 30%),
    rgba(7, 9, 15, 0.5);
  border: 1px solid rgba(201, 169, 97, 0.18);
  cursor: pointer; transition: all 0.25s;
  font-family: var(--font-m); color: var(--text);
}
.ax-card:hover {
  border-color: var(--gold);
  background:
    linear-gradient(180deg, rgba(232, 200, 118, 0.08), transparent 40%),
    rgba(7, 9, 15, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 22px rgba(201, 169, 97, 0.18);
}
.ax-card-emoji {
  font-size: 2.4rem; margin-bottom: 10px; line-height: 1;
  filter: drop-shadow(0 0 8px rgba(201, 169, 97, 0.35));
}
.ax-card-name {
  font-family: var(--font-d); font-weight: 700;
  font-size: 1.15rem; letter-spacing: 0.14em;
  color: var(--text-2); text-transform: uppercase;
  margin-bottom: 6px; min-height: 1.4em;
}
.ax-card-meta {
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 4px;
}
.ax-card-tag {
  position: absolute; top: 8px; right: 8px;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-2);
  background: rgba(7, 9, 15, 0.7);
  border: 1px solid var(--gold-dim);
  padding: 3px 8px; pointer-events: none;
}
.ax-card.is-active {
  border-color: var(--gold-2);
  background:
    linear-gradient(180deg, rgba(232, 200, 118, 0.15), transparent 40%),
    rgba(7, 9, 15, 0.7);
  box-shadow: 0 0 28px rgba(232, 200, 118, 0.3);
}
.ax-card.is-active .ax-card-tag { background: var(--gold); color: var(--bg); border-color: var(--gold-2); }
.ax-card.is-secret { border-color: rgba(232, 200, 118, 0.4); }
.ax-card.is-locked { opacity: 0.42; cursor: not-allowed; filter: grayscale(0.45); pointer-events: none; }

.ax-card-identity {
  font-family: var(--font-m); font-size: 0.78rem;
  color: var(--text-dim); letter-spacing: 0.04em;
  line-height: 1.45; margin-top: 8px;
  font-weight: 400; text-transform: none;
}

.ax-neophyte-preview { margin-top: 48px; }

/* ═══ CHAR GRID ═══ */
.ax-char-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-top: 24px;
}
.ax-char-card {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 22px 16px;
  background: rgba(7, 9, 15, 0.5);
  border: 1px solid rgba(201, 169, 97, 0.2);
  cursor: pointer; transition: all 0.25s; position: relative;
}
.ax-char-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); }
.ax-char-portrait {
  width: 70px; height: 70px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201, 169, 97, 0.1); border: 1px solid var(--gold-dim);
  font-size: 1.8rem; margin-bottom: 12px; overflow: hidden;
}
.ax-char-portrait img { width: 100%; height: 100%; object-fit: cover; }
.ax-char-name {
  font-family: var(--font-d); font-weight: 700;
  font-size: 1.25rem; color: var(--text-2);
  letter-spacing: 0.1em; margin-bottom: 4px;
}
.ax-char-meta {
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim); line-height: 1.5;
}
.ax-char-axiome {
  margin-top: 8px;
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-2);
}

/* ═══ AXIOME TREE SECTION ═══ */
.ax-pa-display {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 24px;
  background:
    linear-gradient(180deg, rgba(201, 169, 97, 0.06), rgba(201, 169, 97, 0.02));
  border: 1px solid var(--gold-dim);
  margin-bottom: 24px;
  position: relative;
}
.ax-pa-display::before, .ax-pa-display::after {
  content: ''; position: absolute; width: 10px; height: 10px; border: 1px solid var(--gold);
}
.ax-pa-display::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.ax-pa-display::after  { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.ax-pa-glyph {
  font-size: 2rem; color: var(--gold-2);
  filter: drop-shadow(0 0 12px rgba(232, 200, 118, 0.5));
  line-height: 1;
}
.ax-pa-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ax-pa-value {
  font-family: var(--font-d); font-weight: 800;
  font-size: 2rem; line-height: 1;
  color: var(--text-2); letter-spacing: 0.04em;
}
.ax-pa-label {
  font-family: var(--font-m); font-weight: 500;
  font-size: 0.8rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-dim);
}
.ax-pa-meta {
  font-family: var(--font-m); font-weight: 400;
  font-size: 0.78rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-mute);
  font-style: italic; text-align: right;
}

.ax-tree-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.ax-tree-node {
  position: relative;
  display: flex; flex-direction: column;
  padding: 18px 20px 16px;
  background:
    linear-gradient(180deg, rgba(201, 169, 97, 0.03), transparent 30%),
    rgba(7, 9, 15, 0.5);
  border: 1px solid rgba(201, 169, 97, 0.18);
  cursor: pointer; transition: all 0.25s;
  font-family: var(--font-m); color: var(--text);
  text-align: left;
}
.ax-tree-node:hover:not(.is-locked):not(.is-unlocked) {
  border-color: var(--gold);
  background:
    linear-gradient(180deg, rgba(232, 200, 118, 0.1), transparent 40%),
    rgba(7, 9, 15, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 22px rgba(201, 169, 97, 0.2);
}
.ax-tree-node-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.ax-tree-node-glyph {
  font-size: 1.4rem; line-height: 1;
  filter: drop-shadow(0 0 6px rgba(201, 169, 97, 0.4));
}
.ax-tree-node-name {
  font-family: var(--font-d); font-weight: 700;
  font-size: 1rem; letter-spacing: 0.1em;
  color: var(--text-2); text-transform: uppercase;
  flex: 1;
}
.ax-tree-node-state {
  font-family: var(--font-m); font-weight: 600;
  font-size: 0.65rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold);
  background: rgba(7, 9, 15, 0.7);
  border: 1px solid var(--gold-dim);
  padding: 3px 8px;
}
.ax-tree-node-effect {
  font-size: 0.92rem; line-height: 1.5;
  color: var(--text); margin-bottom: 10px;
}
.ax-tree-node-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
  border-top: 1px dashed rgba(201, 169, 97, 0.15);
}
.ax-tree-node-cost {
  font-family: var(--font-d); font-weight: 700;
  font-size: 0.85rem; color: var(--gold-2);
  letter-spacing: 0.08em;
}
.ax-tree-node-req {
  font-family: var(--font-m); font-weight: 500;
  font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim);
  text-align: right; max-width: 60%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ax-tree-node.is-unlocked {
  border-color: var(--gold-2);
  background:
    linear-gradient(180deg, rgba(232, 200, 118, 0.15), transparent 50%),
    rgba(7, 9, 15, 0.7);
  box-shadow: 0 0 18px rgba(232, 200, 118, 0.25);
  cursor: default;
}
.ax-tree-node.is-unlocked .ax-tree-node-state { background: var(--gold); color: var(--bg); border-color: var(--gold-2); }
.ax-tree-node.is-unlocked .ax-tree-node-glyph { filter: drop-shadow(0 0 10px var(--gold)); }

.ax-tree-node.is-available { border-color: rgba(232, 200, 118, 0.5); }
.ax-tree-node.is-available .ax-tree-node-state { color: var(--green); border-color: rgba(95, 184, 120, 0.5); }

.ax-tree-node.is-locked {
  opacity: 0.5; cursor: not-allowed;
  filter: grayscale(0.5);
}
.ax-tree-node.is-locked .ax-tree-node-state { color: var(--text-mute); }

.ax-tree-empty {
  text-align: center; padding: 40px 20px;
  background: rgba(7, 9, 15, 0.4);
  border: 1px dashed rgba(201, 169, 97, 0.2);
}
.ax-tree-empty-glyph { font-size: 2rem; color: var(--text-mute); margin-bottom: 10px; }
.ax-tree-empty p {
  font-family: var(--font-m); font-weight: 500;
  font-size: 0.95rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim);
}
.ax-tree-empty-sub {
  margin-top: 6px;
  font-size: 0.85rem !important; color: var(--gold-2) !important;
  letter-spacing: 0.06em !important; text-transform: none !important;
  font-style: italic;
}

/* Tier précédent (sous-section pour les T1 quand on est au T2, etc.) */
.ax-tree-tier-extra {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px dashed rgba(201, 169, 97, 0.18);
}
.ax-tree-tier-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 6px;
}
.ax-tree-tier-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 97, 0.25), transparent);
}
.ax-tree-tier-title {
  font-family: var(--font-d); font-weight: 600;
  font-size: 1rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--gold-dim);
  white-space: nowrap;
}
.ax-tree-tier-sub {
  text-align: center; font-size: 0.82rem;
  letter-spacing: 0.08em; color: var(--text-mute);
  margin-bottom: 16px; font-style: italic;
}
/* Les nodes des tiers précédents sont visuellement légèrement atténués */
.ax-tree-tier-extra .ax-tree-node:not(.is-unlocked) { opacity: 0.85; }

/* ═══ MODAL ═══ */
.ax-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.ax-modal[hidden] { display: none; }
.ax-modal-bg {
  position: absolute; inset: 0;
  background: rgba(7, 9, 15, 0.88);
  backdrop-filter: blur(6px);
}
.ax-modal-content {
  position: relative; width: min(560px, 100%);
  max-height: 90vh; overflow-y: auto;
  padding: 40px 32px 32px;
  background:
    linear-gradient(180deg, rgba(201, 169, 97, 0.05), transparent 25%),
    linear-gradient(135deg, var(--bg-2), var(--bg));
  border: 1px solid var(--gold-dim);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 80px rgba(201, 169, 97, 0.12);
}
.ax-modal-content.ax-modal-wide { width: min(720px, 100%); text-align: left; padding: 36px 32px; }
.ax-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid rgba(201, 169, 97, 0.3);
  color: var(--text-dim); cursor: pointer;
  font-size: 0.95rem; z-index: 2;
  transition: all 0.2s;
}
.ax-modal-close:hover { border-color: var(--gold); color: var(--gold-2); }
.ax-modal-eyebrow {
  font-family: var(--font-m); font-weight: 500;
  font-size: 0.8rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--gold-dim); margin-bottom: 10px;
}
.ax-modal-emoji { font-size: 3rem; margin: 4px 0 8px; line-height: 1; filter: drop-shadow(0 0 14px rgba(201, 169, 97, 0.4)); }
.ax-modal-title {
  font-family: var(--font-d); font-weight: 800;
  font-size: 2rem; letter-spacing: 0.16em;
  color: var(--text-2); text-transform: uppercase; margin-bottom: 6px;
}
.ax-modal-kind {
  font-family: var(--font-m); font-weight: 600;
  font-size: 0.8rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 8px;
}
.ax-modal-desc { font-size: 1.05rem; line-height: 1.6; color: var(--text); margin: 16px 0 22px; text-align: center; }
.ax-modal-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 22px;
}
.ax-modal-stat {
  text-align: center; padding: 10px 8px;
  border: 1px solid rgba(201, 169, 97, 0.18);
  background: rgba(201, 169, 97, 0.025);
}
.ax-modal-stat .lbl {
  font-family: var(--font-m); font-weight: 500;
  font-size: 0.7rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--text-mute); margin-bottom: 6px;
}
.ax-modal-stat .val {
  font-family: var(--font-d); font-weight: 700;
  font-size: 1.05rem; color: var(--text-2);
}
.ax-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ax-modal-actions .ax-btn { flex: 1 1 auto; min-width: 0; }

/* ═══ TOPBAR LEFT (back + codex) ═══ */
.ax-topbar-left {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 10px;
}

.ax-codex-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--gold-dim); background: transparent;
  color: var(--text-dim);
  font-family: var(--font-m); font-weight: 600;
  font-size: 0.78rem; letter-spacing: 0.24em;
  text-transform: uppercase; cursor: pointer; transition: all 0.25s;
}
.ax-codex-btn:hover {
  border-color: var(--gold); color: var(--gold-2);
  background: rgba(201, 169, 97, 0.06);
  box-shadow: 0 0 14px rgba(201, 169, 97, 0.2);
}

/* ═══ MODAL CODEX ═══ */
.ax-modal-codex {
  width: min(900px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column;
  padding: 32px 28px 0; text-align: left; overflow: hidden;
}
.ax-codex-header { flex-shrink: 0; padding-bottom: 16px; text-align: center; }
.ax-codex-search {
  display: block; width: 100%; max-width: 440px; margin: 14px auto 0;
  padding: 10px 16px;
  background: rgba(201, 169, 97, 0.04);
  border: 1px solid var(--gold-dim); color: var(--text-2);
  font-family: var(--font-m); font-size: 0.9rem; letter-spacing: 0.06em;
  outline: none; transition: border-color 0.2s;
}
.ax-codex-search:focus { border-color: var(--gold); }
.ax-codex-search::placeholder { color: var(--text-mute); }

.ax-codex-body {
  flex: 1; overflow-y: auto; padding: 4px 0 28px;
  scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent;
}
.ax-codex-body::-webkit-scrollbar { width: 5px; }
.ax-codex-body::-webkit-scrollbar-thumb { background: var(--gold-dim); }

/* Section headers */
.ax-codex-section {
  margin-top: 28px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 14px;
}
.ax-codex-section span {
  font-family: var(--font-d); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.38em; text-transform: uppercase; color: var(--gold-dim);
  white-space: nowrap;
}
.ax-codex-section::before, .ax-codex-section::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,97,0.2), transparent);
}

/* ── Accordéon details/summary ── */
.ax-cdx-details { display: block; margin-bottom: 4px; }
.ax-cdx-details summary { list-style: none; cursor: pointer; user-select: none; }
.ax-cdx-details summary::-webkit-details-marker { display: none; }

/* Chevron tourne à l'ouverture */
.ax-cdx-chevron {
  margin-left: auto; flex-shrink: 0;
  font-size: 0.75rem; color: var(--gold-dim);
  transition: transform 0.2s;
  display: inline-block; align-self: center;
}
.ax-cdx-details[open] > summary .ax-cdx-chevron { transform: rotate(90deg); }

/* Conteneur enfants */
.ax-cdx-children { padding-top: 2px; }
.ax-cdx-leaf {
  padding: 8px 14px 8px 26px;
  font-family: var(--font-m); font-size: 0.72rem;
  color: var(--text-mute); letter-spacing: 0.1em; font-style: italic;
}

/* Axiome cards */
.ax-codex-card {
  display: grid; grid-template-columns: auto 1fr;
  gap: 0 12px;
  padding: 12px 14px;
  margin-bottom: 3px;
  background: rgba(7,9,15,0.4);
  border-left: 3px solid var(--gold-dim);
  transition: border-color 0.2s, background 0.2s;
}
.ax-codex-card:hover,
.ax-cdx-details > summary.ax-codex-card:hover { border-color: var(--gold); background: rgba(201,169,97,0.04); }
.ax-cdx-details[open] > summary.ax-codex-card { background: rgba(201,169,97,0.03); }

.ax-codex-card.ax-cdx-t1 { border-color: rgba(201,169,97,0.55); margin-top: 10px; }
.ax-codex-card.ax-cdx-t2 { margin-left: 16px; border-color: rgba(201,169,97,0.28); }
.ax-codex-card.ax-cdx-t3 { margin-left: 32px; border-color: rgba(201,169,97,0.15); }
.ax-codex-card.ax-cdx-t0 { border-color: rgba(201,169,97,0.18); margin-bottom: 10px; }

/* Indentation des children containers */
.ax-cdx-t1 + .ax-cdx-children { padding-left: 0; }
.ax-cdx-t2-details { margin-left: 0; }

.ax-cdx-info { min-width: 0; }
.ax-codex-emoji {
  font-size: 1.5rem; line-height: 1;
  display: flex; align-items: flex-start; padding-top: 3px;
  filter: drop-shadow(0 0 6px rgba(201,169,97,0.3));
}
.ax-codex-meta-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 3px; flex-wrap: wrap;
}
.ax-codex-name {
  font-family: var(--font-d); font-weight: 700;
  font-size: 0.92rem; letter-spacing: 0.1em;
  color: var(--text-2); text-transform: uppercase;
}
.ax-cdx-t2 .ax-codex-name { font-size: 0.86rem; color: var(--text-2); }
.ax-cdx-t3 .ax-codex-name { font-size: 0.80rem; color: var(--text); }
.ax-codex-tier-badge {
  font-family: var(--font-m); font-size: 0.6rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  padding: 2px 6px; border: 1px solid var(--gold-dim); color: var(--gold-dim);
  flex-shrink: 0;
}
.ax-cdx-t1 .ax-codex-tier-badge { border-color: rgba(201,169,97,0.5); color: var(--gold); }
.ax-codex-kind-badge {
  font-family: var(--font-m); font-size: 0.58rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 2px 7px; flex-shrink: 0;
}
.ax-ckind-common  { color: var(--text-dim); border: 1px solid rgba(201,169,97,0.15); }
.ax-ckind-race    { color: #60a5fa; border: 1px solid rgba(96,165,250,0.3); }
.ax-ckind-secret  { color: var(--gold-2); border: 1px solid rgba(232,200,118,0.35); }
.ax-ckind-special { color: #f472b6; border: 1px solid rgba(244,114,182,0.35); }
.ax-codex-stats { display: flex; gap: 6px; font-size: 0.66rem; font-family: var(--font-m); letter-spacing: 0.12em; text-transform: uppercase; flex-shrink: 0; }
.ax-codex-buff  { color: var(--green); }
.ax-codex-malus { color: var(--red); }
.ax-codex-identity { font-size: 0.80rem; color: var(--text); margin-bottom: 3px; font-style: italic; }
.ax-codex-desc  { font-size: 0.76rem; color: var(--text-dim); line-height: 1.5; }
.ax-codex-lock  { font-size: 0.66rem; color: #60a5fa; letter-spacing: 0.08em; margin-top: 3px; }
.ax-codex-empty { text-align: center; padding: 40px; color: var(--text-mute); font-family: var(--font-m); font-size: 0.9rem; letter-spacing: 0.1em; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 720px) {
  html { font-size: 17px; }
  .ax-topbar { grid-template-columns: auto 1fr auto; padding: 12px 14px; gap: 10px; }
  .ax-title { font-size: 1.1rem; letter-spacing: 0.22em; }
  .ax-title-glyph { display: none; }
  .ax-back span:not(.ax-back-arrow), .ax-chip-meta { display: none; }
  .ax-main { padding: 24px 16px 60px; }
  .ax-hero { padding: 32px 18px; }
  .ax-hero-title { font-size: 1.8rem; letter-spacing: 0.12em; }
  .ax-hero-actions { flex-direction: column; }
  .ax-hero-actions .ax-btn { width: 100%; }
  .ax-stat-mods { gap: 10px; }
  .ax-modal-stats { grid-template-columns: 1fr; }
  .ax-modal-actions { flex-direction: column; }
}

@media (max-width: 720px) {
  .ax-codex-btn span:not(:first-child) { display: none; }
  .ax-codex-card.ax-cdx-t2 { margin-left: 12px; }
  .ax-codex-card.ax-cdx-t3 { margin-left: 24px; }
  .ax-modal-codex { padding: 20px 14px 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   EFFETS DE SKILL — rendu nouveau format `effects: [{type, summary}]`
   ═══════════════════════════════════════════════════════════════════════ */

.ax-eff-glyph {
  display: inline-block;
  min-width: 1.2em;
  color: var(--gold-2, #ffd60a);
  font-family: var(--font-m, 'Share Tech Mono', monospace);
  font-weight: 700;
  margin-right: 4px;
}

.ax-eff-more {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.7em;
  font-family: var(--font-m, 'Share Tech Mono', monospace);
  letter-spacing: 0.08em;
  color: var(--text-3, #5a7a90);
  background: rgba(255, 214, 10, 0.08);
  border: 1px solid rgba(255, 214, 10, 0.15);
  border-radius: 3px;
}

.ax-eff-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 0;
  line-height: 1.5;
  font-family: var(--font-b, 'Rajdhani', sans-serif);
  font-size: 0.95rem;
  color: var(--text, #e2e6f0);
  border-bottom: 1px solid rgba(255, 214, 10, 0.06);
}
.ax-eff-row:last-child { border-bottom: 0; }
.ax-eff-row .ax-eff-glyph {
  flex-shrink: 0;
  margin-top: 2px;
}

.ax-eff-flavor {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 214, 10, 0.12);
  font-family: var(--font-b, 'Rajdhani', sans-serif);
  font-size: 0.9rem;
  color: var(--text-3, #5a7a90);
  font-style: italic;
  text-align: center;
  line-height: 1.55;
}



/* ═══════════════════════════════════════════════════════════════
   AXIOMES — MOBILE REDESIGN  ≤ 480px
   Base 18px → réduit pour les très petits écrans
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {

  /* Réduction de la base typographique pour que tout rentre */
  html { font-size: 15px; }

  .ax-topbar      { padding: 10px 12px; gap: 8px; }
  .ax-title       { font-size: 1rem; letter-spacing: .16em; }
  .ax-back        { padding: 8px 10px; min-height: 44px; }
  .ax-main        { padding: 16px 12px 72px; }
  .ax-hero        { padding: 24px 14px 28px; }
  .ax-hero-title  { font-size: clamp(1.4rem, 8vw, 2.2rem); }
  .ax-hero-actions { gap: 8px; }
  .ax-hero-actions .ax-btn {
    width:       100%;
    min-height:  50px;
    font-size:   .9rem;
  }
  .ax-modal-content {
    padding:    20px 16px;
    max-height: 85vh;
    overflow-y: auto;
  }
  .ax-modal-actions { flex-direction: column; gap: 8px; }
  .ax-modal-actions .ax-btn {
    width:      100%;
    min-height: 50px;
  }
  .ax-node {
    min-height: 52px;
    font-size:  .88rem;
  }
}

@media (hover: none) and (pointer: coarse) {
  .ax-node:active  { transform: scale(.96); opacity: .85; }
  .ax-btn:active   { transform: scale(.97); }
}
