/* Compétences : le grimoire de chaque classe. Cartes des classes, tiers ornés, cartes de compétences, tables par niveau. */

/* ---------- Icônes ---------- */
/* Icône du jeu dans sa case (.case-competence, web/src/site.css : cadre rond doré de 39 points, 78 sur la fiche). Sans icône du
   jeu (compétences propres au PTEU ou au LostTale) : un médaillon aux initiales dans la même case (pierre sombre, anneau d'or,
   disque bleu du jeu). */
.case-competence .medaillon { display: grid; place-items: center; width: var(--t); height: var(--t); border-radius: 3px; color: #f0d48a; font-family: var(--titre); font-weight: 700; font-size: 13px; letter-spacing: .5px;
  background: radial-gradient(circle closest-side, #1d4f86 0, #0b3363 52%, #041a36 68%, #8a6526 71%, #f0d48a 76%, #8a6526 81%, #24180c 85%, #120c07 100%);
  box-shadow: 0 0 0 1px var(--jeu-noir); }
.case-competence.grande .medaillon { font-size: 24px; }

/* ---------- Choix de la classe ---------- */
.classes-competences { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 980px; }
.classes-competences li { min-width: 0; }
.carte-classe { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--bord); border-radius: var(--rayon);
  background: rgba(255, 255, 255, .92); color: var(--texte); text-decoration: none; box-shadow: 0 2px 10px rgba(60, 35, 10, .06); }
a.carte-classe:hover, a.carte-classe:focus-visible { border-color: var(--or); box-shadow: 0 4px 16px rgba(60, 35, 10, .14); }
.medaillon-classe { display: block; width: 100%; height: 132px; flex: none; background: #000; }
/* Portrait dans son cadre (.cadre-portrait.rogne, web/src/site.css) : posé dans la carte, à la hauteur voulue. */
.carte-classe .cadre-portrait { --h: 132px; flex: none; margin: 10px 10px 0; }
/* Portraits (180 x 400, emblème en haut) : cadrés sur le personnage, du visage aux genoux. */
.carte-classe .cadre-portrait img { opacity: .92; transition: opacity .15s; }
a.carte-classe:hover .cadre-portrait img, a.carte-classe:focus-visible .cadre-portrait img { opacity: 1; }
.medaillon-classe { display: grid; place-items: center; font-family: var(--titre); font-weight: 700; font-size: 38px; color: #f0d48a;
  background: radial-gradient(circle at 50% 46%, transparent 0 33px, #8a6526 34px 36px, transparent 37px),
    radial-gradient(circle at 50% 40%, #2a5f9c 0, #0b3363 50%, #031630 100%); }
.carte-classe .nom { padding: 8px 8px 0; font-family: var(--titre); font-weight: 700; font-size: 13px; line-height: 1.2; color: var(--brun); }
.carte-classe .nb { padding: 2px 8px 10px; font-size: 12px; line-height: 1.35; color: var(--doux); }
.carte-classe.sans-table { opacity: .72; }
/* Téléphone étroit (moins de 380 px) : trois cartes de 100 px ; le nom le plus long (« Mechanician », 93 px en 13 px) tient
   en entier à l'intérieur de la carte. */
@media (max-width: 379px) {
  .carte-classe .nom { padding: 8px 6px 0; font-size: 12px; }
  .carte-classe .nb { padding: 2px 6px 10px; }
}
/* Tablette : quatre cartes par ligne ; six, en 15 px, seulement quand le nom le plus long y tient (« Mechanician », 108 px :
   cartes de 117 px de texte à 1140 px, de 57 px seulement à 768 px en six colonnes). */
@media (min-width: 761px) {
  .classes-competences { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .carte-classe .cadre-portrait { --h: 170px; }
  .medaillon-classe { height: 170px; }
  .carte-classe .nom { padding: 8px 10px 0; }
  .carte-classe .nb { padding: 2px 10px 10px; }
}
@media (min-width: 1140px) {
  .classes-competences { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .carte-classe .nom { font-size: 15px; }
}

/* ---------- Une classe ---------- */
nav.classes { position: relative; margin: 0 0 12px; }
@media (max-width: 760px) {
  nav.classes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  nav.classes::-webkit-scrollbar { display: none; }
  nav.classes a { flex: none; white-space: nowrap; }
}
/* Le menu des serveurs ne sert qu'avec le script de la page ; sans lui, la page montre la table de référence. */
.choix-serveur { display: none; align-items: center; gap: 8px; margin: 0 0 6px; }
.js .choix-serveur { display: flex; }
.choix-serveur label { font-size: 14px; color: var(--doux); }
.choix-serveur select { min-width: 0; max-width: 100%; font: inherit; font-size: 15px; padding: 6px 10px; border: 1px solid var(--bord-champ); border-radius: 8px;
  background: #fffdf8; color: var(--texte); }

/* Ce qui change avec le serveur choisi (vue d'une table, nom, niveau exigé, niveaux d'un tier) : sans script, seule la valeur
   commune. */
:root:not(.js) .selon-serveur { display: none; }
/* L'arbre de la classe : une seule colonne flexible, titres des tiers et cartes à la suite ; l'en-tête de page range chaque
   élément (propriété order) dans l'arbre du serveur choisi, qui peut déplacer une compétence d'un tier à l'autre. */
.arbre { display: flex; flex-direction: column; max-width: 920px; }
.arbre > h2 { display: flex; align-items: center; gap: 12px; margin: 22px 0 10px; }
.arbre > h2::after { content: ''; order: 1; flex: 1; height: 1px; min-width: 16px; background: linear-gradient(90deg, var(--or), rgba(185, 130, 42, .08)); }
/* Niveaux du tier, après le filet : ceux de l'arbre commun ou, enveloppés, ceux du serveur choisi. */
.arbre > h2 > small, .arbre > h2 > [data-remplacee], .arbre > h2 > .selon-serveur { order: 2; }
.arbre > h2 small { font: 400 12px/1.2 var(--texte-police); color: var(--doux); white-space: nowrap; }
.classe-absente { margin: 18px 0 0; color: var(--doux); }

.sort { position: relative; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--carte); scroll-margin-top: 12px; }
.sort:target { border-color: var(--or); box-shadow: 0 0 0 2px rgba(185, 130, 42, .25); }
.sort-tete { display: grid; grid-template-columns: 45px minmax(0, 1fr); gap: 12px; align-items: start; }
/* Le nom laisse la place du bouton « Levels » à sa droite, et au moins sa hauteur : la ligne d'informations, longue pour
   une compétence propre à un serveur (« On PTEU and LostTale, in place of … »), passe toujours sous le bouton. */
.sort h3 { margin: 0; padding-right: 86px; min-height: 24px; font-family: var(--titre); font-size: 16px; line-height: 1.25; }
.sort.sans-niveaux h3 { padding-right: 0; min-height: 0; }
.sort h3 a { color: var(--bleu); text-decoration: none; }
.sort h3 a:hover, .sort h3 a:focus-visible { color: var(--brun); text-decoration: underline; }
.sort .meta { margin: 2px 0 0; font-size: 13px; color: var(--doux); }
.sort .effet { margin: 4px 0 0; font-size: 14px; line-height: 1.4; }
.marque-serveur { color: var(--brun); font-weight: 600; }
/* Ligne d'informations : chaque élément d'un bloc (« On PTEU and LostTale », « Wands and staffs ») ; la ligne passe à la
   ligne entre deux éléments. */
.meta .marque-serveur, .meta a { white-space: nowrap; }
.sort[data-propre] { background: #fffaf0; }

/* Ouvre la table niveau par niveau de la compétence, en haut à droite de sa carte. */
/* 24 px de haut (ligne de 18 px, 2 px de marge, 1 px de bord), la hauteur minimale du nom. */
details.niveaux > summary { position: absolute; top: 10px; right: 12px; display: flex; align-items: center; gap: 6px; padding: 2px 10px; list-style: none;
  border: 1px solid var(--bord); border-radius: 999px; background: #fffdf8; color: var(--bleu); font-size: 13px; line-height: 18px; cursor: pointer; user-select: none; }
details.niveaux > summary::-webkit-details-marker { display: none; }
details.niveaux > summary::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
details.niveaux > summary:hover { border-color: var(--or); }
details.niveaux[open] > summary { background: var(--bleu); border-color: var(--bleu); color: #fff; }
details.niveaux[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
details.niveaux > .vue { margin-top: 10px; }

/* ---------- Tables par niveau ---------- */
/* Serveur d'une table qui n'est pas celle du serveur choisi (compétence propre à un autre serveur). */
.etiquette { display: inline-block; margin: 0 0 6px; padding: 2px 10px; border-radius: 999px; background: #f3e7cf; color: var(--brun); font-size: 12px; font-weight: 600; }
/* Ce que dit un serveur de la compétence, au-dessus de sa table. */
.fait { margin: 0 0 8px; max-width: 72ch; font-size: 13px; color: var(--doux); }
.vue .defile { width: fit-content; max-width: 100%; }
.niv { width: auto; font-size: 13px; }
.niv th, .niv td { padding: 5px 10px; }
@media (max-width: 760px) { .niv th, .niv td { padding: 5px 6px; } }
/* Libellés équilibrés sur leurs lignes ; le générateur lie les deux derniers mots et l'unité (« da invocação », « (s) »). */
.niv thead th { min-width: 3.5em; max-width: 10em; white-space: normal; vertical-align: bottom; line-height: 1.2; text-wrap: balance; }
.niv thead th.num, .niv thead th:first-child { text-align: right; }
/* Le niveau reste visible quand la table défile en largeur. */
.niv thead th:first-child { position: sticky; left: 0; z-index: 2; }
.niv tbody th { position: sticky; left: 0; z-index: 1; background: var(--carte); color: var(--texte); font-weight: 700; text-align: right; }
.niv tbody tr:nth-child(even) th { background: #fbf6ec; }
.niv tbody tr:hover th { background: #f3e7cf; }
/* Valeur inconnue : discrète, mais lisible (contraste 5,5:1 sur blanc, 4,8:1 sur le fond des relevés). */
.niv .inconnu { color: var(--doux); font-style: italic; }
/* Niveau publié seul par le serveur (BPT), au-dessus de la table de référence, ou ligne de celle-ci qu'il publie aussi ;
   après les rayures (même précision : la dernière règle l'emporte, sur une ligne paire comme impaire). */
.niv tbody.releve tr, .niv tbody.releve tr th, .niv tbody tr.releve, .niv tbody tr.releve th { background: #fcefd0; }
.niv tbody.releve td, .niv tbody tr.releve td { font-weight: 600; }
.niv tr.groupe th { position: static; padding: 6px 10px 4px; background: var(--parchemin); color: var(--brun); font-size: 12px; font-weight: 600; text-align: left; }
.niv tr.groupe th span { position: sticky; left: 10px; }
@media (min-width: 761px) { .niv { font-size: 14px; } }

/* ---------- Une compétence ---------- */
.fil { margin: 0 0 10px; font-size: 14px; }
.fil a { text-decoration: none; }
.fil a::before { content: '\2039  '; }
.fil a:hover { text-decoration: underline; }
/* Le titre ne se coupe jamais entre deux lettres : son plus long mot et ses deux derniers mots liés tiennent à 360 px à
   côté de l'icône (« Cavaleiro Sanguinário », trop long pour être lié, passe à la ligne entier). */
.entete-sort { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 16px; align-items: center; margin: 0 0 14px; }
.entete-sort .titre-page { margin: 0 0 4px; }
.entete-sort .meta { margin: 0; font-size: 14px; color: var(--doux); }
.entete-sort .meta a { color: var(--bleu); }
.autres-noms { margin: 4px 0 0; font-size: 13px; color: var(--doux); }
/* Chaque nom reste avec son étiquette (« PTEU: Summon Hestian ») : la ligne passe à la ligne entre deux noms. */
.autre-nom { display: inline-block; max-width: 100%; }
/* Un nom coréen ne se coupe qu'aux espaces (sinon le navigateur coupe entre deux syllabes : « 임팩 / 트 »). */
.autres-noms [lang="ko"] { word-break: keep-all; }
.description { max-width: 72ch; margin: 0 0 6px; }
/* Plage chiffrée d'un texte (« 4-6 », « ×3/×4 ») : jamais coupée à son trait d'union ou à sa barre. */
.nobr { white-space: nowrap; }
.description + .fait { margin-top: 10px; }
.niveaux-sort h2 { margin-top: 22px; }

.comparaison .choix-stat { display: none; }
.js .comparaison .choix-stat { display: flex; }
.comparaison .choix-stat button { padding: 4px 10px; font-size: 13px; }
.js .comparaison .stat:not(.actif) { display: none; }
.comparaison .defile { width: fit-content; max-width: 100%; }
.stat-titre { margin: 14px 0 6px; font-size: 15px; color: var(--brun); }
.js .stat-titre:not(.toujours) { display: none; }
.comp thead th { text-align: right; }
/* Les noms de serveurs regroupés (« EPT, KR ») tiennent sur deux lignes au plus, pas une par mot. */
.comp thead th:not(:first-child) { min-width: 7em; }
@media (max-width: 760px) { .comp thead th:not(:first-child) { min-width: 5em; } }
.comp thead th.ref { background: var(--bleu-fonce); }
.comp td.ecart { background: #f9dfb5; }
.legende { margin: 6px 0 0; font-size: 12px; color: var(--doux); }
.legende::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; background: #f9dfb5; vertical-align: -1px; }

/* Voisines du tier tel que le serveur choisi le montre : une paire de liens par arbre, celle du serveur choisi seule visible. */
.voisines { display: flex; margin: 28px 0 0; padding-top: 14px; border-top: 1px solid var(--bord); }
.voisines > span { flex: 1 1 auto; min-width: 0; }
.voisines .paire { display: flex; justify-content: space-between; gap: 16px; }
.voisines a { font-family: var(--titre); font-weight: 700; text-decoration: none; text-wrap: balance; }
.voisines a:hover { text-decoration: underline; }
.voisines .prec::before { content: '\2039  '; }
.voisines .suiv { margin-left: auto; text-align: right; }
.voisines .suiv::after { content: '  \203A'; }
