/* Pages de classe V2 (GOA-100) — feuille commune aux pages /v2/<classe>/.
   Mise en page identique ; couleurs par classe via <html data-theme="<thème>"> (themes.css).
   Ne modifie ni le site ni la GoatPedia. */

:root {
  --serif: "New York", ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Hiragino Mincho ProN", "Songti SC", "Songti TC", "AppleMyungjo", "Noto Serif CJK JP", serif;
  --sans: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
  --gutter: 16px;
}

/* Couleurs de chaque classe : themes.css, généré par scripts/class-pages/build.mjs depuis themes.json. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 50;
  padding: 12px 18px;
  min-height: 44px;
  background: var(--btn-bottom);
  color: var(--on-accent);
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 14px;
  font-family: var(--serif);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}
.btn--gold {
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom));
  color: var(--on-accent);
  box-shadow: 0 0 0 1px var(--accent-ring), 0 8px 26px var(--accent-glow);
}
.btn--gold:hover { background: linear-gradient(180deg, var(--btn-hover), var(--btn-top)); }
.btn--small { font-size: 16px; padding: 8px 16px; }
.btn--large { min-height: 56px; font-size: 21px; padding: 12px 32px; border-radius: 16px; }
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 17px;
}
.btn--ghost:hover { border-color: var(--accent); }

/* En-tête */
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px var(--gutter);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-soft);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 21px;
}
.brand { min-width: 44px; justify-content: center; }
.brand img { width: 40px; height: 40px; }
.brand__word span { color: var(--accent); }
.site-nav {
  display: none;
  margin-left: auto;
  gap: 8px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink-soft);
  text-decoration: none;
  font-family: var(--serif);
}
.site-nav a:hover { color: var(--promise); }
.site-header > .btn { margin-left: 8px; }
@media (min-width: 720px) {
  .site-nav { display: flex; }
  .site-header > .btn { margin-left: 8px; }
  .site-header { padding-inline: 32px; }
}

/* Sélecteur de classes : le Guerrier est refondu, les autres restent verrouillées */
.class-picker { margin-left: auto; }
.class-picker__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.class-picker__toggle::-webkit-details-marker { display: none; }
.class-picker__toggle img { width: 28px; height: 28px; filter: var(--icon-filter); }
.class-picker__toggle:hover, .class-picker[open] .class-picker__toggle { border-color: var(--accent); color: var(--promise); }
.class-picker__chevron {
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.class-picker[open] .class-picker__chevron { transform: translateY(2px) rotate(-135deg); }
.class-picker__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: var(--gutter);
  right: var(--gutter);
  z-index: 30;
  padding: 16px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px var(--shadow);
}
.class-picker__title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 20px;
  color: var(--heading);
}
.class-picker__note { margin-top: 2px; font-size: 15px; color: var(--ink-mute); }
.class-grid {
  list-style: none;
  padding: 0;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.class-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 10px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
}
.class-tile img { width: 48px; height: 48px; filter: var(--icon-filter); }
.class-tile__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}
.class-tile__state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
}
.class-tile--current {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--heading);
}
.class-tile--current .class-tile__state { color: var(--accent); }
.class-tile--available { background: var(--locked-bg); color: var(--ink); }
.class-tile--available:hover { border-color: var(--line); }
.class-tile--available .class-tile__state { color: var(--accent); }
.class-tile--locked { background: var(--locked-bg); color: var(--locked-ink); cursor: not-allowed; }
.class-tile--locked img { filter: var(--icon-filter) grayscale(1); opacity: 0.45; }
.class-tile__lock { flex: none; }
/* Identité discrète d'une classe verrouillée : un liseré à sa couleur (themes.css), sans signaler de disponibilité. */
.class-tile--locked[data-class] { box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--class-accent, transparent) 45%, transparent); }
/* Le mot « Goat Deeper » revient à la ligne sous 560 px : le logo seul garde le nom accessible du lien. */
@media (max-width: 559px) {
  .brand__word { display: none; }
}
@media (max-width: 479px) {
  /* Téléphone étroit (320 px) : marque, sélecteur et bouton tiennent sur une ligne, cibles de 44 px gardées. */
  .site-header { gap: 8px; }
  .site-header > .btn { margin-left: 0; white-space: nowrap; }
  .site-header > .btn--small { padding-inline: 12px; }
  .class-picker__toggle { padding-inline: 10px; }
  /* Filet de sécurité pour une traduction plus longue : le libellé visible se tronque au lieu de déborder. */
  .class-picker { min-width: 0; }
  .class-picker__toggle { max-width: 100%; }
  .class-picker__toggle > span[data-i18n] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 359px) {
  /* L'icône du sélecteur est décorative (alt="") : à 320 px, la place revient au libellé. */
  .class-picker__toggle img { display: none; }
}
@media (min-width: 480px) {
  .class-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 720px) {
  .class-picker { margin-left: auto; }
  .class-picker__panel { left: auto; right: 32px; width: 680px; padding: 20px; }
  .class-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .site-nav { margin-left: 8px; }
}

/* Langues : sélecteur natif (en-tête sur bureau, pied de page partout) */
html.i18n-pending body { visibility: hidden; }
.lang { display: inline-flex; align-items: center; gap: 8px; }
.lang__select {
  min-height: 44px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-3) var(--select-arrow) no-repeat right 12px center;
  color: var(--ink);
  font: 600 16px var(--sans);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.lang__select:hover { border-color: var(--accent); }
.lang--header { display: none; }
.lang--footer { color: var(--ink-soft); }
@media (min-width: 1100px) {
  .lang--header { display: inline-flex; margin-left: 8px; }
}

/* Héros */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 28px var(--gutter) 36px;
}
.hero__decor { position: absolute; inset: 0; z-index: -2; }
.hero__decor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(var(--veil), 0.5) 0%, rgba(var(--veil), 0.1) 26%, rgba(var(--veil), 0.25) 55%, rgba(var(--veil), 0.7) 82%, var(--bg) 100%);
}
.hero__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  max-width: 820px;
}
.hero__emblem {
  width: 56px;
  height: 56px;
  filter: var(--icon-filter) drop-shadow(0 4px 12px var(--title-drop));
}
.hero__title .eyebrow { text-shadow: 0 2px 8px var(--title-shadow); }
h1 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(44px, 12vw, 104px);
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant: small-caps;
  color: var(--accent-light);
  background: var(--title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 10px var(--title-drop));
}
.ornament {
  display: none;
  width: clamp(40px, 9vw, 120px);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent));
  position: relative;
}
.ornament::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  transform: rotate(45deg);
}
.ornament--right { transform: scaleX(-1); }
@media (min-width: 560px) { .ornament { display: block; } }

.hero__intro {
  margin-top: 6px;
  padding: 12px 18px;
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.45;
  color: var(--heading);
  background: rgba(var(--veil), 0.72);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
}

/* Arches : liste de liens vers chaque voie */
.arches {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  width: 100%;
  display: grid;
  gap: 14px;
}
.arch {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 44px;
  padding: 10px;
  text-decoration: none;
  background: rgba(var(--veil), 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
}
.arch:hover { border-color: var(--accent); }
.arch__frame {
  position: relative;
  display: block;
  padding: 3px;
  border-radius: 50% 50% 12px 12px / 30% 30% 12px 12px;
  background: var(--frame-gradient);
  box-shadow: 0 0 18px var(--accent-glow);
}
.arch__frame::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: var(--accent-light);
  border: 2px solid var(--accent-dark);
  transform: rotate(45deg);
  z-index: 1;
}
.arch__frame picture,
.arch__frame img {
  display: block;
  width: 100%;
  border-radius: inherit;
}
.arch__frame img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: var(--focus, 50% 35%);
  background: var(--panel-2);
}
.arch .arch__frame img { aspect-ratio: var(--thumb-ratio, 4 / 5); object-position: var(--thumb-focus, var(--focus, 50% 35%)); }
.arch__text {
  min-width: 0;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.arch__numeral {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 0.1em;
}
.arch__name {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(21px, 6.6vw, 26px);
  line-height: 1.1;
  color: var(--heading);
}
.arch__promise {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--promise);
}
.arch__gear {
  font-size: 15px;
  color: var(--ink-soft);
}
.arch__more {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
}
.arch__more::after { content: " →"; }

.hero__cta { margin-top: 26px; }

@media (min-width: 720px) {
  .hero { padding: 40px 32px 56px; }
  .arches {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2.4vw, 28px);
    margin-top: 36px;
    max-width: 1080px;
  }
  .arch {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    position: relative;
  }
  .arch__frame { border-radius: 50% 50% 22px 22px / 30% 30% 22px 22px; padding: 4px; }
  .arch__frame::before { top: -9px; width: 18px; height: 18px; margin-left: -9px; }
  .arch .arch__frame img { aspect-ratio: 3 / 4; object-position: var(--focus, 50% 35%); }
  .arch .arch__frame::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50% 50% 18px 18px / 30% 30% 18px 18px;
    background: linear-gradient(180deg, transparent 42%, rgba(var(--veil), 0.84) 70%, rgba(var(--veil), 0.97) 100%);
    pointer-events: none;
  }
  .arch__text {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 18px;
    align-items: center;
    text-align: center;
    padding: 0 12px;
    z-index: 2;
  }
  .arch__numeral::before, .arch__numeral::after { content: " — "; color: var(--accent-deep); }
  .arch__name { font-size: clamp(22px, 2.8vw, 36px); }
  .arch__promise { font-size: clamp(16px, 1.7vw, 21px); }
  .arch__gear { font-size: 14px; }
  .arch:hover .arch__frame { box-shadow: 0 0 30px var(--accent-glow-strong); }
  .hero__cta { margin-top: 36px; min-width: min(560px, 100%); }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 720px) {
  .arch__frame { transition: box-shadow 200ms ease, transform 200ms ease; }
  .arch:hover .arch__frame { transform: translateY(-4px); }
}

/* Navigation entre voies, collée en haut */
.ways-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px var(--gutter);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.ways-nav a {
  flex: 1 1 0;
  max-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  color: var(--ink-soft);
  min-width: 0;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.ways-nav a:hover { color: var(--promise); border-color: var(--accent); }
.ways-nav a[aria-current="true"] {
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom));
  border-color: var(--accent);
  color: var(--on-accent);
}

/* Voies */
.ways { outline: none; }
.way {
  scroll-margin-top: 64px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px var(--gutter) 20px;
  display: grid;
  gap: 24px;
}
.way + .way { border-top: 1px solid var(--line-soft); }
.way__art { max-width: 440px; width: 100%; justify-self: center; }
.way__art .arch__frame { border-radius: 50% 50% 22px 22px / 34% 34% 22px 22px; padding: 4px; }
.way__art .arch__frame img { aspect-ratio: 1 / 1; }
.way__body { display: flex; flex-direction: column; gap: 14px; min-width: 0; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.way h2 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(38px, 6vw, 56px);
  line-height: 1.05;
  color: var(--heading);
}
.way__promise {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(21px, 2.4vw, 25px);
  line-height: 1.35;
  color: var(--promise);
  max-width: 34ch;
}
.beats { display: grid; gap: 12px; margin-top: 6px; }
.beat {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
}
.beat dt {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.beat dd { color: var(--ink-soft); }
.beat dd strong { color: var(--ink); }
.beat--cost { border-left-color: var(--cost); }
.beat--cost dt { color: var(--cost); }
.way__solo { color: var(--ink-soft); }
.way__solo strong { color: var(--ink); }

.skills__title {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--heading);
}
.skills {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}
.skills li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: 12px;
}
.skills img { width: 56px; height: 56px; border-radius: 10px; }
.skills p { color: var(--ink-soft); font-size: 16px; line-height: 1.45; }
.skills .skill__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 2px;
}
.lvl {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  vertical-align: 2px;
  white-space: nowrap;
}

@media (min-width: 900px) {
  .way {
    grid-template-columns: 440px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
    padding: 72px 32px 40px;
  }
  .way__art { position: sticky; top: 84px; }
  .way__art .arch__frame img { aspect-ratio: var(--detail-ratio, 4 / 5); }
  .beat { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: baseline; }
  .beat dt { margin-bottom: 0; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Socle commun */
.common {
  max-width: 1120px;
  margin: 40px auto 0;
  padding: 36px var(--gutter) 48px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.common h2 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(30px, 4.6vw, 42px);
  line-height: 1.1;
  color: var(--heading);
}
.common__lead { color: var(--ink-soft); max-width: 62ch; }
.common__list { list-style: none; padding: 0; display: grid; gap: 10px; }
.common__list li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel);
  border-radius: 12px;
}
.common__list img { width: 48px; height: 48px; border-radius: 10px; }
.common__list p { color: var(--ink-soft); }
.common__list strong, .common__rule strong { color: var(--ink); }
.common__rule {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
}
.status { font-size: 15px; color: var(--ink-mute); max-width: 70ch; }
.common__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
@media (min-width: 900px) {
  .common { padding-inline: 32px; }
  .common__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 559px) {
  .common__actions .btn { width: 100%; }
  .btn--large { font-size: 19px; padding-inline: 20px; }
}

/* Pied de page */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 20px var(--gutter) 32px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-mute);
  font-size: 15px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--ink-soft);
}
@media (min-width: 720px) { .site-footer { padding-inline: 32px; } }

/* Page « Les classes » (v2/classes/) : remplace la GoatPedia */
.hub__main { max-width: 1180px; margin: 0 auto; padding: 40px var(--gutter) 56px; display: grid; gap: 44px; outline: none; }
.hub__head { display: grid; gap: 10px; justify-items: start; }
.hub__head h1 {
  display: block;
  font-size: clamp(44px, 9vw, 84px);
  text-align: left;
}
.hub__intro { max-width: 60ch; font-family: var(--serif); font-size: clamp(18px, 2.2vw, 22px); line-height: 1.45; color: var(--ink-soft); }
.hub__section { display: grid; gap: 16px; }
.hub__section h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(26px, 3.6vw, 34px); color: var(--heading); }
.hub__note { color: var(--ink-mute); font-size: 15px; }
.hub-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.hub-card {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
}
.hub-card:hover { box-shadow: 0 0 0 1px var(--accent-ring), 0 14px 36px var(--accent-glow); }
.hub-card__art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hub-card__body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; min-width: 0; }
.hub-card__name { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 900; font-size: 28px; line-height: 1.1; color: var(--heading); }
.hub-card__name img { width: 40px; height: 40px; filter: var(--icon-filter); }
.hub-card__intro { color: var(--ink-soft); font-size: 16px; line-height: 1.5; }
.hub-card__ways { display: flex; flex-wrap: wrap; gap: 6px; }
.hub-card__ways span { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--promise); }
.hub-card__more { margin-top: auto; align-self: flex-start; font-family: var(--serif); font-weight: 700; color: var(--heading); border-bottom: 1px solid var(--accent); }
.hub-card__more::after { content: " →"; }
.hub__locked { margin-top: 0; }
@media (min-width: 720px) { .hub__main { padding-inline: 32px; } }
@media (min-width: 900px) { .hub__locked { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
.hub .site-header > .btn { margin-left: auto; }

/* Arbre de progression (refonte) */
.tree { max-width: 1180px; margin: 24px auto 0; padding: 48px var(--gutter) 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; scroll-margin-top: 64px; }
/* Un titre d'un seul mot long (« Fortschrittsbaum » à 320 px) se coupe au lieu d'élargir la page. */
.tree h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(34px, 5vw, 48px); line-height: 1.05; color: var(--heading); overflow-wrap: break-word; hyphens: auto; }
.tree h3 { font-family: var(--serif); font-weight: 800; font-size: 24px; color: var(--heading); }
.tree h4 { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--heading); }
.tree__head { display: grid; gap: 14px; }
.tree__lead { max-width: 62ch; font-family: var(--serif); font-size: clamp(18px, 2vw, 21px); color: var(--ink-soft); }
.tree__rules { margin: 0; padding-left: 20px; display: grid; gap: 6px; max-width: 72ch; color: var(--ink-soft); }
.tree__rules strong { color: var(--ink); }
.tree__budget { display: grid; gap: 8px; }
.tree__budget-title { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.tree__budget dl { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tree__budget dl div { display: grid; gap: 2px; min-width: 76px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; text-align: center; }
.tree__budget dt { font-size: 13px; color: var(--ink-mute); }
.tree__budget dd { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 20px; color: var(--heading); font-variant-numeric: tabular-nums; }

.tnodes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tnode { display: grid; gap: 4px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line-soft); border-left: 4px solid var(--line); border-radius: 10px; min-width: 0; }
.tnode__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tnode__lvl { flex: none; padding: 1px 8px; font-size: 13px; font-weight: 700; color: var(--accent); border: 1px solid var(--line); border-radius: 999px; font-variant-numeric: tabular-nums; }
.tnode__name { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--heading); min-width: 0; }
.tnode__cost { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--promise); white-space: nowrap; }
.tnode__kind { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); }
.tnode__effect { color: var(--ink-soft); font-size: 15px; line-height: 1.45; }
.tnode__req { color: var(--ink-mute); font-size: 14px; line-height: 1.4; }
/* Choix exclusif : la carte nomme l'autre option ; dans la fiche, elle se souligne une fois prise. */
.tnode__choice { padding-left: 10px; border-left: 3px solid var(--promise); color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.tnode__rival { font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--heading); }
.tnode__rival.is-acquired { box-shadow: inset 0 -2px 0 var(--accent); }
.tnode--keystone, .tnode--capstone { border-left-color: var(--accent); }
.tnode--discipline, .tnode--foundation { border-left-color: var(--promise); }
.tnode--talent { border-left-color: var(--accent-deep); }

.tree__start { display: grid; gap: 14px; }
.tnodes--start { grid-template-columns: minmax(0, 1fr); }
.tnodes--socle { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

.tree__ways { display: grid; gap: 28px; }
.tree__way { display: grid; gap: 14px; align-content: start; min-width: 0; }
.tree__way h3 a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.tree__numeral { font-size: 16px; color: var(--accent); }

.tmastery { display: grid; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.tmastery__ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tmastery__rank { display: grid; gap: 6px; }
.tmastery__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-weight: 800; font-size: 14px; color: var(--ink); }
.tmastery__head .tnode__cost { margin-left: 0; }
.tmastery__opts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tmastery__opts li { display: grid; gap: 2px; padding: 8px 10px; background: var(--panel-2); border-radius: 8px; font-size: 14px; line-height: 1.4; color: var(--ink-soft); min-width: 0; }
.tmastery__opts strong { font-family: var(--serif); font-size: 15px; color: var(--heading); }

.tree__bridges { display: grid; gap: 12px; }
.tree__bridges > p { max-width: 70ch; color: var(--ink-soft); }
.tbridges { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.tbridge { display: grid; gap: 6px; align-content: start; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.tbridge__ways { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

@media (max-width: 479px) {
  .tmastery__opts { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 720px) { .tree { padding-inline: 32px; } }
@media (min-width: 1100px) {
  .tree__ways { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .tmastery__opts { grid-template-columns: minmax(0, 1fr); }
}
.tmastery > summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; min-height: 44px; cursor: pointer; list-style: none; }
.tmastery > summary::-webkit-details-marker { display: none; }
.tmastery > summary h4::before { content: "▸ "; color: var(--accent); }
.tmastery[open] > summary h4::before { content: "▾ "; }
.tmastery__count { font-size: 13px; font-weight: 700; color: var(--ink-mute); }
.tree__way > summary { display: flex; align-items: center; min-height: 44px; list-style: none; cursor: pointer; }
.tree__way > summary::-webkit-details-marker { display: none; }
.tree__way > summary h3::after { content: " ▾"; color: var(--accent); font-size: 16px; }
.tree__way:not([open]) > summary h3::after { content: " ▸"; }
.tree__way:not([open]) { padding: 4px 12px; border: 1px solid var(--line); border-radius: 12px; }
@media (min-width: 720px) { .tree__way[open] > summary h3::after { content: none; } }

/* Arbre interactif : racine en haut, branches qui s’allument quand on débloque */
.tsim { display: grid; gap: 16px; }
.tsim__lead { max-width: 64ch; color: var(--ink-soft); }
/* Niveau 1 : l'arbre n'est pas encore ouvert (app.js l'affiche à ce niveau seulement). */
.tsim__notice { max-width: 72ch; padding: 8px 12px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--panel); color: var(--ink-soft); }
.tsim__notice strong { color: var(--ink); }
.tsim__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.tsim__level { display: inline-flex; align-items: center; gap: 6px; }
.tsim__step { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--heading); font-size: 22px; font-weight: 800; cursor: pointer; }
.tsim__step:hover { border-color: var(--accent); }
.tsim__level-label { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--heading); min-width: 104px; text-align: center; }
.tsim__level-label output { font-variant-numeric: tabular-nums; color: var(--accent); }
.tsim__points { color: var(--ink-soft); }
.tsim__points strong { font-family: var(--serif); font-size: 20px; color: var(--heading); font-variant-numeric: tabular-nums; }
.tsim__legend { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-mute); }
.tsim__legend li::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 50%; vertical-align: -1px; border: 2px solid var(--line); }
.tsim__legend .is-acquired::before { background: var(--accent); border-color: var(--accent); }
.tsim__legend .is-available::before { border-color: var(--promise); }
.tsim__legend .is-locked::before { background: var(--panel-2); opacity: 0.6; }

.tsim__body { display: grid; gap: 16px; align-items: start; }
.tsim__scroll { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line-soft); -webkit-overflow-scrolling: touch; }
.tsim__canvas {
  position: relative;
  width: 100%;
  min-width: 1400px;
  background:
    radial-gradient(ellipse 60% 18% at 50% 0%, var(--accent-glow), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 100%, var(--accent-tint), transparent 70%),
    var(--panel-3);
}
.tsim__edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tsim-edge { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; opacity: 0.75; }
.tsim-edge--trunk { stroke: var(--accent-deep); stroke-width: 16; opacity: 0.55; }
.tsim-edge--branch { stroke: var(--accent-deep); stroke-width: 10; opacity: 0.5; }
.tsim-edge--limb { stroke-width: 5; }
.tsim-edge--twig { stroke-width: 4; }
.tsim-edge--cross { stroke-width: 3; opacity: 0.55; }
.tsim-edge--alt { stroke-width: 2.5; stroke-dasharray: 8 7; opacity: 0.5; }
.tsim-edge.is-on { stroke: var(--accent); opacity: 1; filter: drop-shadow(0 0 6px var(--accent-glow-strong)); }

.tsim-node {
  position: absolute;
  width: 144px;
  transform: translate(-50%, calc(var(--size) / -2));
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0; border: 0; background: none; color: inherit; cursor: pointer; font: inherit;
}
.tsim-node__medal {
  position: relative; display: grid; place-items: center;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--panel-2);
  color: var(--accent);
  box-shadow: 0 6px 18px var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.tsim-node__medal img { width: calc(100% - 6px); height: calc(100% - 6px); border-radius: 50%; object-fit: cover; }
.tsim-node__medal svg { width: 52%; height: 52%; fill: currentColor; }
.tsim-node__cost {
  position: absolute; top: -6px; right: -6px;
  min-width: 24px; height: 24px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 12px; background: var(--bg); border: 2px solid var(--line);
  font-size: 13px; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums;
}
.tsim-node__mastery { position: absolute; bottom: -4px; left: -4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); color: var(--accent); font-size: 13px; }
.tsim-node__name {
  max-width: 144px; padding: 3px 8px; border-radius: 8px;
  background: var(--header-bg);
  font-family: var(--serif); font-weight: 700; font-size: 15px; line-height: 1.15; text-align: center; color: var(--heading);
}
.tsim-node__lvl { font-size: 13px; color: var(--ink-mute); background: var(--header-bg); padding: 0 6px; border-radius: 999px; }
.tsim-node--foundation .tsim-node__name { font-size: 15px; }

.tsim-node.is-locked .tsim-node__medal { opacity: 0.62; }
.tsim-node.is-locked .tsim-node__medal img { filter: grayscale(0.85) brightness(0.75); }
.tsim-node.is-locked .tsim-node__name { opacity: 0.75; }
.tsim-node.is-available .tsim-node__medal { border-color: var(--promise); box-shadow: 0 0 0 4px var(--accent-tint), 0 6px 18px var(--shadow); }
.tsim-node.is-acquired .tsim-node__medal { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint), 0 0 22px var(--accent-glow-strong); }
.tsim-node.is-acquired .tsim-node__cost { border-color: var(--accent); }
.tsim-node.is-selected .tsim-node__medal { outline: 3px solid var(--focus); outline-offset: 4px; }
.tsim-node:focus-visible { outline: none; }
.tsim-node:focus-visible .tsim-node__medal { outline: 3px solid var(--focus); outline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .tsim-node.is-available .tsim-node__medal { animation: tsim-pulse 2.2s ease-in-out infinite; }
  @keyframes tsim-pulse { 50% { box-shadow: 0 0 0 7px var(--accent-tint), 0 0 16px var(--accent-glow); } }
  .tsim-node:hover .tsim-node__medal { transform: scale(1.06); }
  .tsim-node__medal { transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
}

.tsim__panel {
  position: sticky; bottom: 0; z-index: 15;
  display: grid; gap: 10px;
  max-height: 46vh; overflow-y: auto;
  padding: 14px 16px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--accent);
  box-shadow: 0 -8px 30px var(--shadow);
}
.tsim__hint { color: var(--ink-mute); }
.tsim__panel .tnode { border: 0; padding: 0; background: none; }
.tsim__panel-state { font-size: 14px; font-weight: 700; color: var(--promise); }
.tsim__panel-state.is-locked { color: var(--ink-mute); }
/* Texte long (talent qui se décide au lancement, langue plus longue) : les boutons restent au bas de la fiche. */
.tsim__panel-actions { display: flex; flex-wrap: wrap; gap: 8px; position: sticky; bottom: -14px; padding: 8px 0 10px; margin: -8px 0 -10px; background: var(--panel); }
.tsim__panel-actions .btn { min-height: 44px; }
.tsim__ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tsim__rank { display: grid; gap: 6px; }
.tsim__rank-head { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-mute); }
.tsim__opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tsim__opt { display: grid; gap: 2px; text-align: left; padding: 8px 10px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft); font: inherit; font-size: 14px; line-height: 1.35; cursor: pointer; }
.tsim__opt strong { font-family: var(--serif); color: var(--heading); }
.tsim__opt.is-acquired { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tsim__opt.is-available { border-color: var(--promise); }
.tsim__opt.is-locked { opacity: 0.6; cursor: not-allowed; }
.tsim__close { justify-self: end; }

.tree-list { border-top: 1px solid var(--line-soft); padding-top: 12px; display: grid; gap: 24px; }
.tree-list > summary { min-height: 44px; display: flex; align-items: center; font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--heading); cursor: pointer; }
.tree-list[open] { gap: 28px; }

@media (min-width: 1100px) { .tsim__panel { max-height: 40vh; } .tsim__opts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 479px) { .tsim__opts { grid-template-columns: minmax(0, 1fr); } .tsim__legend { margin-left: 0; } }

/* Les textes communs commencent par le nom en gras : dans l'arbre, le titre du nœud le porte déjà. */
.tnode__effect[data-i18n-html^="common."] > strong:first-child { display: none; }
@media (max-width: 559px) {
  .ways-nav { gap: 6px; padding-inline: 12px; }
  .ways-nav a { font-size: 14px; padding: 4px 4px; }
}

/* Nœuds en préparation : dessinés et essayables, pas encore dans le jeu */
.tsim-node.is-planned .tsim-node__medal { border-style: dashed; }
.tsim-node__planned,
.tnode__planned {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--promise); border: 1px dashed var(--accent); border-radius: 999px;
  padding: 1px 7px; background: var(--header-bg);
}
.tnode__planned { justify-self: start; width: max-content; }
.tsim__panel-planned { font-size: 14px; color: var(--ink-soft); border-left: 3px dashed var(--accent); padding-left: 10px; }

/* Aperçu caché des autres arbres (v2/arbres-goa100/) */
.preview__tabs { list-style: none; }
.preview__tab { text-decoration: none; color: inherit; }
.preview__tab[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.preview__tab[data-class] { box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--class-accent, transparent) 70%, transparent); }
.preview__tab[data-class][aria-current="true"] { box-shadow: inset 0 -3px 0 var(--class-accent, var(--accent)), 0 0 0 2px var(--accent-tint); }
/* Chaque arbre porte le thème complet de sa classe : fond, textes, voies et ciel. */
.preview__tree { margin-top: 0; }
.preview__tree[data-theme] { background: var(--bg); color: var(--ink); border-radius: var(--radius); border: 1px solid var(--line); }
.preview__tree[hidden] { display: none; }

/* ---- Arbre : bois, sève, couleurs de voie, paliers ---- */
.tsim-node, .tsim-edge, .tsim-wood, .tsim-lane { --lane: var(--accent); }
[data-slot="way1"], [data-lane="way1"] { --lane: var(--lane-1); }
[data-slot="way2"], [data-lane="way2"] { --lane: var(--lane-2); }
[data-slot="way3"], [data-lane="way3"] { --lane: var(--lane-3); }

.tsim-wood { fill: var(--wood); stroke: var(--wood-edge); stroke-width: 1.5; opacity: 0.9; }
.tsim-sap { fill: none; stroke: var(--lane); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 0 100; opacity: 0.9; filter: drop-shadow(0 0 8px var(--lane)); transition: stroke-dasharray 500ms ease; }
.tsim-sap[data-sap="way1"] { stroke: var(--lane-1); filter: drop-shadow(0 0 8px var(--lane-1)); }
.tsim-sap[data-sap="way2"] { stroke: var(--lane-2); filter: drop-shadow(0 0 8px var(--lane-2)); }
.tsim-sap[data-sap="way3"] { stroke: var(--lane-3); filter: drop-shadow(0 0 8px var(--lane-3)); }
.tsim-canopy { transition: opacity 500ms ease; }
.tsim-canopy[data-canopy="way1"] { opacity: var(--glow-way1, 0.15); }
.tsim-canopy[data-canopy="way2"] { opacity: var(--glow-way2, 0.15); }
.tsim-canopy[data-canopy="way3"] { opacity: var(--glow-way3, 0.15); }
.tsim-edge--trunk { stroke-width: 10; opacity: 0.45; }
.tsim-edge--branch { stroke-width: 6; opacity: 0.4; }
.tsim-edge.is-on { stroke: var(--lane); filter: drop-shadow(0 0 6px var(--lane)); }

.tsim-node__medal { border-width: 4px; background: radial-gradient(circle at 35% 30%, var(--panel), var(--panel-2) 70%); }
.tsim-node.is-acquired .tsim-node__medal { border-color: var(--lane); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lane) 28%, transparent), 0 0 28px color-mix(in srgb, var(--lane) 60%, transparent); }
.tsim-node.is-acquired .tsim-node__cost { border-color: var(--lane); }
.tsim-node.is-acquired .tsim-node__name { box-shadow: inset 0 -2px 0 var(--lane); }
.tsim-node--tier .tsim-node__medal {
  border-radius: 28%; transform: rotate(45deg);
  border: 5px solid transparent;
  /* anneau de progression : points investis dans la voie / points exigés */
  background:
    linear-gradient(var(--panel-2), var(--panel-2)) padding-box,
    conic-gradient(from -45deg, var(--lane) calc(var(--progress, 0) * 360deg), color-mix(in srgb, var(--lane) 22%, var(--line)) 0) border-box;
}
.tsim-node--tier.is-locked .tsim-node__medal { opacity: 0.85; }
.tsim-node--tier .tsim-node__medal > * { transform: rotate(-45deg); }
.tsim-node__tier {
  display: grid; place-items: center; width: 74%; height: 74%; border-radius: 22%;
  background: var(--panel-3); color: var(--lane);
  font-family: var(--serif); font-weight: 800; font-size: 26px; letter-spacing: 0.04em;
}
.tsim-node--tier .tsim-node__cost { transform: rotate(-45deg); top: -10px; right: auto; left: 50%; margin-left: -12px; }
.tsim-node--tier.is-acquired .tsim-node__tier { background: var(--lane); color: var(--bg); }

.tsim__lanes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tsim-lane {
  display: grid; gap: 6px; padding: 10px 12px; border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--lane) 16%, var(--panel)), var(--panel));
  border: 1px solid color-mix(in srgb, var(--lane) 45%, var(--line));
}
.tsim-lane__name { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--heading); }
.tsim-lane__numeral { color: var(--lane); }
.tsim-lane__points { font-size: 13px; color: var(--ink-soft); }
.tsim-lane__points strong { font-family: var(--serif); font-size: 20px; color: var(--lane); font-variant-numeric: tabular-nums; }
.tsim-lane__tiers { display: flex; gap: 6px; }
.tsim-lane__pip {
  display: inline-flex; align-items: baseline; gap: 3px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-mute); font-family: var(--serif); font-weight: 700; font-size: 13px;
}
.tsim-lane__pip small { font-family: inherit; font-weight: 600; font-size: 11px; opacity: 0.8; }
.tsim-lane__pip.is-reached { border-color: var(--lane); color: var(--heading); }
.tsim-lane__pip.is-acquired { background: var(--lane); border-color: var(--lane); color: var(--bg); }
.tsim-lane__bar { height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.tsim-lane__bar span { display: block; height: 100%; width: 0; background: var(--lane); border-radius: inherit; transition: width 400ms ease; }
@media (max-width: 719px) {
  .tsim__lanes { grid-template-columns: 1fr; }
  .tsim-lane { grid-template-columns: 1fr auto; align-items: center; }
  .tsim-lane__bar { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .tsim-sap, .tsim-canopy, .tsim-lane__bar span { transition: none; }
}

/* Nœuds mineurs : petits médaillons qui relient les grands nœuds */
.tsim-node--minor { width: 120px; }
.tsim-node--minor .tsim-node__name { font-size: 13px; padding: 2px 6px; }
.tsim-node--minor .tsim-node__medal { border-width: 3px; }
.tsim-node--minor .tsim-node__medal svg { width: 40%; height: 40%; }

/* L'arbre déborde de la colonne de texte pour garder presque sa taille réelle. */
.tsim__body { --tree-w: min(calc(100vw - 32px), 1500px); width: var(--tree-w); margin-inline: calc((100% - var(--tree-w)) / 2); }
.tsim__lanes, .tsim__bar { max-width: 1500px; }

/* ---- Constellation (style FF15) ---- */
.tsim__scroll[data-sim-viewport] {
  position: relative; height: min(84vh, 1000px); overflow: auto; cursor: grab; min-width: 0; width: 100%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 10%, var(--panel-3)), var(--panel-3) 70%);
  overscroll-behavior: contain;
  display: flex; /* margin: auto centre la constellation quand elle est plus petite que la fenêtre */
}
.tsim__scroll.is-dragging { cursor: grabbing; user-select: none; }
.tsim__canvas--star { min-width: 0; aspect-ratio: auto; background: none; margin: auto; flex: none; }
.tsim__stage { position: relative; min-width: 0; }
.tsim__zoom { position: absolute; top: 10px; left: 10px; z-index: 6; display: flex; gap: 6px; }
.tsim__zoom button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel);
  color: var(--heading); font-size: 20px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 12px var(--shadow);
}
.tsim__zoom button:hover { border-color: var(--accent); }
.tsim-sector { opacity: calc(0.18 + var(--glow, 0.15) * 0.6); transition: opacity 500ms ease; }
.tsim-sector[data-canopy="way1"] { --glow: var(--glow-way1, 0.15); }
.tsim-sector[data-canopy="way2"] { --glow: var(--glow-way2, 0.15); }
.tsim-sector[data-canopy="way3"] { --glow: var(--glow-way3, 0.15); }
.tsim-ring { fill: none; stroke: var(--line-soft); stroke-width: 1.2; stroke-dasharray: 2 10; opacity: 0.7; }
.tsim-axis { stroke: var(--line-soft); stroke-width: 1; opacity: 0.6; }
.tsim__canvas--star .tsim-edge { stroke-linecap: round; }
.tsim__canvas--star .tsim-edge--ray { stroke-width: 5; opacity: 0.55; }
.tsim__canvas--star .tsim-edge--limb, .tsim__canvas--star .tsim-edge--branch { stroke-width: 3.5; opacity: 0.6; }
.tsim__canvas--star .tsim-edge--twig { stroke-width: 2; opacity: 0.55; }
.tsim__canvas--star .tsim-edge--bridge { stroke-width: 3; stroke-dasharray: 10 8; opacity: 0.7; }
.tsim__canvas--star .tsim-edge--cross { stroke-width: 2.5; stroke-dasharray: 4 8; opacity: 0.55; }
/* Ponts entre spécialités : discrets, ils s'allument quand on sélectionne un de leurs nœuds ou quand les deux sont acquis. */
.tsim__canvas--star .tsim-edge--pass { stroke-width: 2; stroke-dasharray: 2 7; opacity: 0.4; }
.tsim__canvas--star .tsim-edge--pass.is-focus, .tsim__canvas--star .tsim-edge--bridge.is-focus { stroke: var(--lane); stroke-width: 3; opacity: 0.95; }
.tsim__canvas--star .tsim-edge.is-on { stroke: var(--lane); opacity: 1; filter: drop-shadow(0 0 7px var(--lane)); }
.tsim__canvas--star .tsim-node { transform: translate(-50%, calc(var(--size) / -2)); }
.tsim-node--foundation .tsim-node__medal img { width: 76%; height: 76%; object-fit: contain; border-radius: 0; filter: drop-shadow(0 0 12px var(--accent-glow-strong)); }
/* Petites étoiles : nom et niveau au survol, au focus ou une fois choisies */
.tsim-node--minor { width: 40px; }
.tsim-node--minor .tsim-node__medal { border-width: 2px; }
.tsim-node--minor .tsim-node__cost { display: none; }
.tsim-node.tsim-node--minor .tsim-node__name, .tsim-node.tsim-node--minor .tsim-node__lvl {
  position: absolute; top: calc(var(--size) + 4px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 160px;
  opacity: 0; pointer-events: none; transition: opacity 120ms ease; z-index: 3;
}
.tsim-node.tsim-node--minor .tsim-node__lvl { top: calc(var(--size) + 30px); }
.tsim-node.tsim-node--minor:hover .tsim-node__name, .tsim-node.tsim-node--minor:hover .tsim-node__lvl,
.tsim-node.tsim-node--minor:focus-visible .tsim-node__name, .tsim-node.tsim-node--minor:focus-visible .tsim-node__lvl,
.tsim-node.tsim-node--minor.is-selected .tsim-node__name, .tsim-node.tsim-node--minor.is-selected .tsim-node__lvl { opacity: 1; }
.tsim-node--minor.is-acquired .tsim-node__medal { background: radial-gradient(circle, var(--lane), color-mix(in srgb, var(--lane) 30%, var(--panel-2))); }
.tsim-node--minor.is-acquired .tsim-node__medal svg { fill: var(--bg); }

/* Moins de texte : un talent, une discipline ou un bonus encore verrouillés ne montrent que leur médaillon ; leur nom
   apparaît au survol, au focus ou à la sélection. Les actions, paliers, clés de voûte, expertises et
   passerelles gardent leur nom : ce sont les repères de chaque spécialité. */
.tsim__canvas--star .tsim-node--talent.is-locked .tsim-node__name, .tsim__canvas--star .tsim-node--talent.is-locked .tsim-node__lvl,
.tsim__canvas--star .tsim-node--discipline.is-locked .tsim-node__name, .tsim__canvas--star .tsim-node--discipline.is-locked .tsim-node__lvl,
.tsim__canvas--star .tsim-node--bonus.is-locked .tsim-node__name, .tsim__canvas--star .tsim-node--bonus.is-locked .tsim-node__lvl { opacity: 0; transition: opacity 120ms ease; }
.tsim__canvas--star .tsim-node--talent.is-locked:hover .tsim-node__name, .tsim__canvas--star .tsim-node--talent.is-locked:hover .tsim-node__lvl,
.tsim__canvas--star .tsim-node--talent.is-locked:focus-visible .tsim-node__name, .tsim__canvas--star .tsim-node--talent.is-locked:focus-visible .tsim-node__lvl,
.tsim__canvas--star .tsim-node--talent.is-locked.is-selected .tsim-node__name, .tsim__canvas--star .tsim-node--talent.is-locked.is-selected .tsim-node__lvl,
.tsim__canvas--star .tsim-node--discipline.is-locked:hover .tsim-node__name, .tsim__canvas--star .tsim-node--discipline.is-locked:hover .tsim-node__lvl,
.tsim__canvas--star .tsim-node--bonus.is-locked:hover .tsim-node__name, .tsim__canvas--star .tsim-node--bonus.is-locked:hover .tsim-node__lvl,
.tsim__canvas--star .tsim-node--discipline.is-locked:focus-visible .tsim-node__name, .tsim__canvas--star .tsim-node--discipline.is-locked:focus-visible .tsim-node__lvl,
.tsim__canvas--star .tsim-node--bonus.is-locked:focus-visible .tsim-node__name, .tsim__canvas--star .tsim-node--bonus.is-locked:focus-visible .tsim-node__lvl,
.tsim__canvas--star .tsim-node--discipline.is-locked.is-selected .tsim-node__name, .tsim__canvas--star .tsim-node--discipline.is-locked.is-selected .tsim-node__lvl,
.tsim__canvas--star .tsim-node--bonus.is-locked.is-selected .tsim-node__name, .tsim__canvas--star .tsim-node--bonus.is-locked.is-selected .tsim-node__lvl { opacity: 1; }

/* Choix exclusif : l'option écartée est barrée et garde son nom, rayé ; regarder une option entoure l'autre. */
.tsim-node.is-closed .tsim-node__medal::after { content: ""; position: absolute; left: 6%; right: 6%; top: calc(50% - 2px); height: 4px; border-radius: 2px; background: var(--ink); transform: rotate(-45deg); }
.tsim-node--tier.is-closed .tsim-node__medal::after { transform: rotate(-90deg); }
.tsim__canvas--star .tsim-node.is-closed.is-locked .tsim-node__name { opacity: 0.75; text-decoration: line-through; }
.tsim-node.is-rival .tsim-node__medal { outline: 2px dashed var(--promise); outline-offset: 4px; }
.tsim__canvas--star .tsim-node.is-rival.is-locked .tsim-node__name { opacity: 1; }

/* Voisins serrés : le nœud le plus haut passe devant (--z), si bien qu'un nom n'est jamais caché par le médaillon
   du dessous ; seuls les médaillons reçoivent le clic, pas la place d'un nom masqué. */
.tsim__canvas--star { isolation: isolate; } /* l'empilement reste dans le ciel, sous le zoom et la fiche */
.tsim__canvas--star .tsim-node { z-index: var(--z, auto); pointer-events: none; }
.tsim__canvas--star .tsim-node__medal, .tsim__canvas--star .tsim-node--minor { pointer-events: auto; }
.tsim__canvas--star .tsim-node:hover, .tsim__canvas--star .tsim-node:focus-visible, .tsim__canvas--star .tsim-node.is-selected { z-index: 9999; }

/* ---- Ciel de la constellation ---- */
.tsim__scroll[data-sim-viewport] { background: radial-gradient(circle at 50% 45%, var(--cosmos-mid), var(--cosmos-top) 75%); }
.tsim-star { fill: var(--star); opacity: 0.55; }
.tsim-figure { fill: none; stroke: var(--figure); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; opacity: 0.12; filter: drop-shadow(0 0 6px var(--figure)); }
.tsim-figure-star { fill: var(--figure); opacity: 0.3; filter: drop-shadow(0 0 6px var(--figure)); }
.tsim-sector { opacity: calc(0.08 + var(--glow, 0.15) * 0.45); }
.tsim-ring { opacity: 0.4; }
@media (prefers-reduced-motion: no-preference) {
  .tsim-star.is-twinkle { animation: tsim-twinkle 4.8s ease-in-out infinite; animation-delay: var(--d); }
  @keyframes tsim-twinkle { 50% { opacity: 0.12; } }
}

/* Langues de droite à gauche (he, ar) : <html dir="rtl"> est posé par i18n.js.
   Surcharges étroites ; le français et les autres langues gardent leurs règles. La géométrie absolue
   des arbres (viewport, canevas, nœuds, liens) reste localement LTR : seuls les textes sont lus en RTL. */
[dir="rtl"] .site-nav, [dir="rtl"] .class-picker, [dir="rtl"] .hub .site-header > .btn { margin-left: 0; margin-right: auto; }
[dir="rtl"] .site-header > .btn { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .lang--header { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .class-picker__panel { right: auto; left: 32px; }
[dir="rtl"] .beat, [dir="rtl"] .tnode { border-left: 1px solid var(--line-soft); border-right: 4px solid var(--accent); }
[dir="rtl"] .beat--cost { border-right-color: var(--cost); }
[dir="rtl"] .tnode { border-right-color: var(--line); }
[dir="rtl"] .tnode--keystone, [dir="rtl"] .tnode--capstone { border-right-color: var(--accent); }
[dir="rtl"] .tnode--discipline, [dir="rtl"] .tnode--foundation { border-right-color: var(--promise); }
[dir="rtl"] .tnode--talent { border-right-color: var(--accent-deep); }
[dir="rtl"] .tnode__cost { margin-left: 0; margin-right: auto; }
[dir="rtl"] .tmastery__head .tnode__cost { margin-right: 0; }
[dir="rtl"] .tnode__choice { padding-left: 0; padding-right: 10px; border-left: 0; border-right: 3px solid var(--promise); }
[dir="rtl"] .tsim__notice { border-left: 0; border-right: 3px solid var(--accent); border-radius: 10px 0 0 10px; }
[dir="rtl"] .tsim__panel-planned { border-left: 0; border-right: 3px dashed var(--accent); padding-left: 0; padding-right: 10px; }
[dir="rtl"] .tree__rules { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .lvl { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .tsim__legend li::before { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .hub__head { justify-items: start; }
[dir="rtl"] .hub__head h1, [dir="rtl"] .tsim__opt { text-align: right; }
[dir="rtl"] .tsim__scroll[data-sim-viewport], [dir="rtl"] .tsim__canvas, [dir="rtl"] .tsim__stage { direction: ltr; }
[dir="rtl"] .tsim-node__name, [dir="rtl"] .tsim-node__lvl, [dir="rtl"] .tsim__zoom { direction: rtl; unicode-bidi: plaintext; }
[dir="rtl"] .tsim__zoom { direction: ltr; }
