/* ═══════════════════════════════════════════
   CHARTE TRYKVALON — polices, couleurs, composants de base
   Tirée du logo (plaque de pierre, lettres turquoise→bleu liserées de violet)
   et de la miniature (portails magenta, labyrinthe
   orange→vert→violet de la Crise des Âmes).
═══════════════════════════════════════════ */

@font-face{font-family:'Shera';src:url(polices/shera.woff2) format('woff2');font-display:swap;unicode-range:U+0000-002F,U+003A-10FFFF}
/* Les chiffres de Shera se lisent mal (le 6 ressemble à un G) : dans les titres, ils viennent de Neo Sans (22/11) */
@font-face{font-family:'Shera';src:url(polices/neo-sans.woff2) format('woff2');font-display:swap;unicode-range:U+0030-0039}
@font-face{font-family:'BankGothic';src:url(polices/bankgothic-md.woff2) format('woff2');font-weight:500;font-display:swap}
@font-face{font-family:'BankGothic';src:url(polices/bankgothic-light.woff2) format('woff2');font-weight:300;font-display:swap}
@font-face{font-family:'Neo Sans';src:url(polices/neo-sans.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Damntyx';src:url(polices/damntyx.woff2) format('woff2');font-display:block}
@font-face{font-family:'Antique';src:url(polices/antique.woff2) format('woff2');font-display:block}
@font-face{font-family:'Sec Saber';src:url(polices/sec-saber.woff2) format('woff2');font-display:block}
@font-face{font-family:'Avatar Airbender';src:url(polices/avatar.woff2) format('woff2');font-display:swap}

:root{
  /* ── Fonds : le mur de l'archive (direction du 12/11 : DIRECTION-GRAPHIQUE.md) ── */
  --ardoise:     #2a292f;   /* fond du mur, avec grain */
  --nuit:        #1d1c21;   /* « fosse » : bandeau, pied, creux gravés, champs */
  --nuit-2:      #232227;
  --pierre-f:    #323137;   /* surface d'une plaque */
  --pierre:      #57555a;   /* plaque du logo, joints */
  --pierre-c:    #6a686d;
  --ligne:       #3e3d44;
  --ligne-c:     #57555a;

  /* ── Texte : craie sur ardoise ── */
  --texte:       #e8e3d8;
  --texte-d:     #bdb7ab;
  --texte-f:     #9a958b;

  /* ── Tableau de la guilde : seulement les avis de mission ── */
  --parchemin:   #dccfae;
  --parchemin-f: #c9b98f;
  --encre:       #2b2218;
  --sceau:       #8a2f24;   /* encre du tampon de rang */

  /* Grain de pierre : un bruit fin et une marbrure large */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"),
           url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 -.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");

  /* ── Signature du logo ── */
  --turquoise:   #00d8a8;
  --cyan:        #18a8b8;
  --bleu:        #1878c0;
  --indigo:      #4860a8;
  --violet:      #7a4ad0;   /* liseré des lettres */
  --grad-logo:   linear-gradient(100deg,#00d8a8 0%,#18a8b8 35%,#1878c0 70%,#4860a8 100%);

  /* ── Tokusatsu : portails et pouvoirs ── */
  --portail:     #e040e0;
  --portail-lueur: 0 0 6px #fff, 0 0 18px #e040e0, 0 0 42px #7a4ad0;

  /* ── Crise des Âmes : le labyrinthe de la miniature (à réserver aux grands moments) ── */
  --grad-crise:  linear-gradient(120deg,#e08020 0%,#a0c020 40%,#e040a0 70%,#6020a0 100%);

  /* ── Médiéval : or patiné (héritage du formulaire), avec parcimonie ── */
  --or:          #d4a94e;
  --or-d:        #9c7a35;

  /* ── États ── */
  --ok:          #3ccf8e;
  --alerte:      #e0a040;
  --danger:      #e0505a;

  /* ── Typographie : un rôle = une police ── */
  --f-titre:   'Shera','Cinzel',serif;                 /* titres, noms propres, nom du site */
  --f-hud:     'BankGothic','Michroma',sans-serif;     /* étiquettes, menus, boutons, chiffres */
  --f-texte:   'Crimson Pro',Georgia,serif;            /* lore et textes longs */
  --f-ui:      'Neo Sans','Segoe UI',sans-serif;       /* interface, formulaires, textes courts */
  --f-damntyx: 'Damntyx';                              /* écriture Damntyx (magie) */
  --f-antique: 'Antique';                              /* écriture antique (ruines, artefacts) */
  --f-henshin: 'Sec Saber';                            /* codes de transformation, sceaux tokusatsu */
  --f-ere:     var(--f-titre);                          /* noms d'ères — Avatar Airbender n'a pas les accents (é, ō) */

  /* ── Échelle (ratio 1,25) ── */
  --t-xs:.8rem; --t-s:.9rem; --t-m:1.0625rem; --t-l:1.33rem; --t-xl:1.66rem; --t-2xl:2.07rem; --t-3xl:2.6rem; --t-4xl:3.6rem;

  /* ── Espacements (base 4) ── */
  --e1:4px; --e2:8px; --e3:12px; --e4:16px; --e5:24px; --e6:32px; --e7:48px; --e8:72px;

  /* ── Formes : la plaque aux coins entaillés ── */
  --rayon: 6px;
  --entaille: polygon(14px 0,calc(100% - 14px) 0,100% 14px,100% calc(100% - 14px),calc(100% - 14px) 100%,14px 100%,0 calc(100% - 14px),0 14px);
  --coupe-hud: polygon(10px 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%,0 10px);

  --ombre: 0 10px 30px rgba(0,0,0,.45);
  /* Médiéval (12/11) : pierre de taille appareillée et fleuron des séparateurs */
  --appareil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='120'%3E%3Crect x='0' y='0' width='120' height='60' fill='rgba%280%2C0%2C0%2C0.1%29'/%3E%3Crect x='120' y='0' width='120' height='60' fill='rgba%280%2C0%2C0%2C0.03%29'/%3E%3Crect x='-60' y='60' width='120' height='60' fill='rgba%280%2C0%2C0%2C0.06%29'/%3E%3Crect x='60' y='60' width='120' height='60' fill='rgba%280%2C0%2C0%2C0%29'/%3E%3Crect x='180' y='60' width='120' height='60' fill='rgba%280%2C0%2C0%2C0.08%29'/%3E%3Cpath d='M0 0.5H240M0 60.5H240M0.5 0V60M120.5 0V60M60.5 60V120M180.5 60V120' stroke='rgba%280%2C0%2C0%2C.4%29' stroke-width='3' fill='none'/%3E%3Cpath d='M0 2.5H240M0 62.5H240M2.5 0V60M122.5 0V60M62.5 60V120M182.5 60V120' stroke='rgba%28255%2C255%2C255%2C.045%29' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  --fleuron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='18'%3E%3Cg fill='none' stroke='%239a958b' stroke-width='1.2'%3E%3Cpath d='M4 9H62M98 9H156'/%3E%3Cpath d='M62 9c6-7 12-7 14 0M98 9c-6 7-12 7-14 0'/%3E%3C/g%3E%3Cpath d='M80 2l7 7-7 7-7-7z' fill='%23d4a94e'/%3E%3C/svg%3E");
  --f-lettrine: 'Cinzel Decorative','Crimson Pro',serif;   /* lettrines seulement */
  --duree: 220ms;
  --courbe: cubic-bezier(.2,.8,.2,1);
}

/* Couleurs des éléments (8 éléments de regles.json) */
[data-element="Feu"]     {--el:#ff6a2a}
[data-element="Eau"]     {--el:#2f9bff}
[data-element="Terre"]   {--el:#b5823c}
[data-element="Air"]     {--el:#a8e6e0}
[data-element="Lumière"] {--el:#ffe27a}
[data-element="Ténèbres"]{--el:#8a5cff}
[data-element="Foudre"]  {--el:#ffd400}
[data-element="Énergie"] {--el:#00d8a8}

/* ── Base ── */
*,*::before,*::after{box-sizing:border-box}
html{color-scheme:dark}
body{margin:0;background:var(--grain),var(--appareil),var(--ardoise);color:var(--texte);font:400 1.1rem/1.6 var(--f-texte);-webkit-font-smoothing:antialiased}
h1,h2,h3{font-family:var(--f-titre);font-weight:400;line-height:1.15;margin:0 0 var(--e4);letter-spacing:.01em}
h1{font-size:clamp(var(--t-2xl),6vw,var(--t-4xl))}
h2{font-size:clamp(var(--t-xl),4vw,var(--t-3xl))}
h3{font-size:var(--t-xl)}
.lore{font-family:var(--f-texte);font-size:1.15rem;line-height:1.7;max-width:68ch}
a{color:var(--turquoise);text-underline-offset:3px}
:focus-visible{outline:2px solid var(--turquoise);outline-offset:3px}

/* ── Composants ── */
.titre-logo{background:var(--grad-logo);-webkit-background-clip:text;background-clip:text;color:transparent;
  -webkit-text-stroke:1px var(--violet);paint-order:stroke fill}
/* Libellé : italique de lecture, comme une mention en marge d'un registre (plus de capitales espacées) */
.etiquette{font-family:var(--f-texte);font-style:italic;font-size:1rem;letter-spacing:0;color:var(--texte-d)}

/* La plaque : carte de pierre aux coins entaillés, comme le logo */
.plaque{position:relative;background:var(--pierre-f);clip-path:var(--entaille);padding:var(--e5)}
.plaque::before{content:'';position:absolute;inset:0;clip-path:var(--entaille);padding:1px;
  background:linear-gradient(160deg,var(--pierre-c),var(--ligne));-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}

/* Bouton HUD : coin coupé, texte BankGothic */
.btn{display:inline-block;text-decoration:none;font-family:var(--f-ui);font-size:1rem;letter-spacing:0;cursor:pointer;
  border:0;padding:11px 20px;clip-path:var(--coupe-hud);color:var(--nuit);background:var(--turquoise);
  transition:background var(--duree) var(--courbe)}
.btn:hover{background:#4dedc6}
.btn.secondaire{background:transparent;color:var(--texte);box-shadow:inset 0 0 0 1px var(--pierre-c)}
.btn.secondaire:hover{box-shadow:inset 0 0 0 1px var(--turquoise);color:var(--turquoise)}

/* Portail : médaillon lumineux magenta (lieux, pouvoirs, liens importants) */
/* Médaillon : cerclé de pierre. La lueur magenta (.lueur) reste rare : accueil et Crise des Âmes. */
.portail{aspect-ratio:1;border-radius:50%;overflow:hidden;background:var(--nuit);box-shadow:0 0 0 3px var(--nuit),0 0 0 4px var(--pierre)}
.portail.lueur{box-shadow:var(--portail-lueur);outline:2px solid #ffd6f7;outline-offset:-2px}
.portail img{width:100%;height:100%;object-fit:cover;display:block}

/* Pastille (tag) : type de race, faction, rang… */
/* Rattachement (type, rang, faction…) : du texte, pas une pilule */
.pastille{display:inline;font-family:var(--f-texte);font-style:italic;font-size:1rem;color:var(--texte-d)}
.pastille+.pastille::before{content:", ";font-style:normal}

@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
