/* Foxy Docs : le thème du site Foxy (Web/public/site.css) : sombre, orange du renard. Mêmes couleurs, même en-tête.
   La couleur du camp de la page (--camp, classe du body) teinte l'en-tête de rôle et les cartes de pouvoir. */
:root {
  --bg: #120d0a; --bg-2: #1a1310; --card: #1f1714; --card-2: #271d18; --line: #3a2b23;
  --text: #f6ece4; --muted: #b9a497; --orange: #ff8a1f; --orange-2: #ffb13b; --orange-dark: #c95f07;
  --green: #4fd18b; --red: #ff6b5b; --yellow: #ffc24a; --blue: #6aa0ff; --purple: #b78cff; --pink: #ff8fbf;
  --radius: 14px; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; min-width: 0; scrollbar-width: thin; scrollbar-color: rgba(255, 138, 31, .35) transparent; }
html { scrollbar-color: var(--orange-dark) var(--bg-2); scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); min-height: 100vh;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(255, 138, 31, .16), transparent 60%), var(--bg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--orange-2); text-decoration: none; } a:hover { text-decoration: underline; }
a[aria-disabled] { pointer-events: none; opacity: .45; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--orange-2); outline-offset: 2px; }
code { font: 13.5px ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* En-tête : celui du site */
.top { position: sticky; top: 0; z-index: 10; min-height: 64px; display: flex; align-items: center; gap: 20px; padding: 8px 20px;
  background: rgba(18, 13, 10, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand span { color: var(--orange); margin-left: -6px; }
.logo { width: 36px; height: 36px; border-radius: 10px; }
.tabs { display: flex; gap: 4px; }
.tabs a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.tabs a:hover { color: var(--text); background: var(--card); text-decoration: none; }
.tabs a.on { color: var(--text); background: var(--card-2); box-shadow: inset 0 -2px 0 var(--orange); }
.back { margin-left: auto; padding: 8px 14px; border-radius: 12px; font-size: .9rem; font-weight: 700; white-space: nowrap; color: #2a1400;
  background: linear-gradient(180deg, var(--orange-2), var(--orange)); box-shadow: 0 6px 18px rgba(255, 138, 31, .3); }
.back:hover { text-decoration: none; background: linear-gradient(180deg, #ffc061, #ff9a38); }
.search { position: relative; width: min(280px, 36vw); }
.search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: 15px; padding: 0 14px; }
.search input::placeholder { color: var(--muted); }
.results { position: absolute; top: 46px; right: 0; width: min(420px, 92vw); max-height: 70vh; overflow-y: auto; padding: 6px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.results a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.results a:hover, .results a:focus { background: var(--card-2); text-decoration: none; }
.results small { display: block; color: var(--muted); font-size: 12.5px; }
.results p { margin: 10px 12px; color: var(--muted); }
.burger { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font-size: 18px; }

/* Mise en page : menu, page, sommaire */
.wrap { display: grid; grid-template-columns: 290px minmax(0, 1fr) 220px; max-width: 1480px; margin: 0 auto; }
.wrap.nonav { grid-template-columns: minmax(0, 1fr); } .wrap.nonav .side, .wrap.nonav .toc { display: none; }
.wrap.nonav main { max-width: 1120px; }
.side { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 22px 14px 40px; border-right: 1px solid var(--line); }
.side a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 5px 10px; border-radius: 10px; color: var(--text); font-size: 14.5px; }
.side a:hover { background: var(--card); text-decoration: none; }
.side a img { width: 22px; height: 22px; image-rendering: pixelated; flex: none; }
.side a.n1 { padding-left: 18px; } .side a.n2 { padding-left: 34px; }
.side a.grp { font-weight: 700; margin-top: 10px; }
.side a.on { background: var(--card-2); color: var(--orange-2); font-weight: 600; box-shadow: inset 2px 0 0 var(--orange); }
.side a.space { margin: 0 0 12px; padding: 8px 10px; font-size: 15px; font-weight: 800; }
.side a.space img { width: 32px; height: 32px; }
.side .sec { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 18px 10px 4px; }
main { padding: 34px clamp(20px, 4vw, 60px) 90px; max-width: 880px; width: 100%; justify-self: center; }
.toc { position: sticky; top: 64px; height: calc(100vh - 64px); padding: 40px 18px 20px 6px; }
.toc b { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.toc a { display: block; font-size: 13.5px; color: var(--muted); padding: 5px 0 5px 12px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--text); text-decoration: none; border-color: var(--orange); }

/* Texte */
.crumb { margin: 0 0 6px; font-size: 13.5px; font-weight: 700; color: var(--orange); }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; text-wrap: balance; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 26px; }
h2 { font-size: 1.35rem; line-height: 1.25; margin: 44px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); }
article > h2:first-child { border: 0; padding: 0; margin-top: 8px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
p, ul, ol { margin: 0 0 12px; } li { margin: 4px 0; }
article img { max-width: 100%; image-rendering: pixelated; }
figure { display: inline-block; margin: 6px 12px 6px 0; }
.dead { color: var(--muted); text-decoration: underline dotted; }

/* Couleurs des camps et mots colorés automatiquement */
.c-green, .c-red, .c-orange, .c-blue, .c-purple, .c-yellow { font-weight: 600; }
.c-green { color: var(--green); } .c-red { color: var(--red); } .c-orange { color: var(--orange); }
.c-blue { color: var(--blue); } .c-purple { color: var(--purple); } .c-yellow { color: var(--yellow); }
.t-effet { color: var(--purple); font-weight: 600; }
.t-duree { color: var(--blue); font-weight: 600; white-space: nowrap; }
.t-cd { color: var(--orange); font-weight: 600; white-space: nowrap; }
.t-cd::before { content: "⟳ "; font-weight: 700; }
.t-coeur { color: var(--pink); font-weight: 600; white-space: nowrap; }
.t-coeur::before { content: "♡ "; }
.t-coeur.perm { color: var(--red); } .t-coeur.perm::before { content: "❤ "; }
.t-item { color: var(--yellow); padding: 0 6px; border-radius: 6px; background: rgba(255, 194, 74, .1); }
.t-pouvoir { color: var(--camp); }

/* Couleur du camp de la page */
body { --camp: var(--orange); }
.camp-green { --camp: var(--green); } .camp-red { --camp: var(--red); } .camp-blue { --camp: var(--blue); }
.camp-purple { --camp: var(--purple); } .camp-yellow { --camp: var(--yellow); } .camp-orange { --camp: var(--orange); }

/* En-tête de rôle */
.hero { display: flex; gap: 22px; align-items: center; padding: 22px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid var(--line);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--camp) 10%, transparent), transparent 55%), linear-gradient(180deg, var(--card-2), var(--card));
  box-shadow: var(--shadow); }
.hero h1 { margin-bottom: 4px; } .hero .lead { margin: 0; font-size: 1.02rem; }
.avatar { width: 96px; height: 96px; flex: none; image-rendering: pixelated; padding: 12px; border-radius: 20px;
  background: color-mix(in srgb, var(--camp) 8%, var(--bg)); border: 1px solid color-mix(in srgb, var(--camp) 25%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; }
.chip { display: inline-flex; gap: 8px; align-items: baseline; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.chip i { font-style: normal; color: var(--muted); }

/* Pouvoirs */
.power { padding: 16px 18px 6px; margin: 0 0 12px; border-radius: var(--radius); background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line); }
.power h3 { display: flex; align-items: center; gap: 10px; }
.power h3::before { content: ""; width: 9px; height: 9px; border-radius: 3px; flex: none; background: var(--camp); }

/* Encadrés */
.hint { --h: var(--blue); padding: 12px 16px; border-radius: 12px; margin: 14px 0; background: color-mix(in srgb, var(--h) 7%, var(--bg)); border: 1px solid color-mix(in srgb, var(--h) 28%, transparent); }
.hint.warning { --h: var(--yellow); } .hint.danger { --h: var(--red); } .hint.success { --h: var(--green); }
.hint-t { font-weight: 700; color: var(--h); margin: 0 0 4px; font-size: 14px; }
.hint p:last-child { margin: 0; }

/* Tableaux */
table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 14px 0 20px; font-size: 15px; background: var(--card); }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--card-2); font-size: 13.5px; } tr:last-child td { border-bottom: 0; }
.al-right { text-align: right; } .al-center { text-align: center; }

/* Cartes */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 16px 0 24px; }
.cards.big { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
  background: linear-gradient(180deg, var(--card-2), var(--card)); transition: border-color .15s, transform .15s; }
.card:hover { text-decoration: none; border-color: var(--orange); transform: translateY(-2px); }
.card img { width: 40px; height: 40px; flex: none; image-rendering: pixelated; border-radius: 10px; }
.cards.big .card img { width: 52px; height: 52px; }
.card b { display: block; } .card small { color: var(--muted); font-size: 13px; line-height: 1.4; display: block; }

/* Icônes des modes (Tabler Icons) : comme les boutons du site, trait foncé sur dégradé orange */
/* Marges en px : un pourcentage se calcule sur la largeur du parent (la carte), pas sur l'icône, et l'écrasait */
img.ic-svg { image-rendering: auto; padding: 9px; border-radius: 12px; background: linear-gradient(180deg, var(--orange-2), var(--orange)); }
.cards.big .card img.ic-svg { padding: 12px; }
.side a.space img.ic-svg { padding: 6px; border-radius: 9px; }
.avatar.ic-svg { padding: 22px; border: 0; }

@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
@media (max-width: 1180px) { .wrap { grid-template-columns: 270px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 900px) {
  .wrap { grid-template-columns: minmax(0, 1fr); } .tabs { display: none; } .burger { display: block; }
  .side { position: fixed; z-index: 9; top: 64px; left: 0; width: min(300px, 86vw); background: var(--bg-2); transform: translateX(-100%); transition: transform .2s; }
  .nav-open .side { transform: none; }
}
@media (max-width: 600px) {
  .top { gap: 10px; padding: 8px 12px; flex-wrap: wrap; } .brand { font-size: 1rem; } .back { padding: 8px 10px; }
  .search { width: 100%; order: 5; }
  .hero { flex-direction: column; align-items: flex-start; } .avatar { width: 76px; height: 76px; } table { font-size: 13.5px; }
}
