@font-face { font-family: "Norse"; src: url("fonts/Norse.otf") format("opentype"); font-weight: 400; }
@font-face { font-family: "Norse"; src: url("fonts/Norsebold.otf") format("opentype"); font-weight: 700; }
@font-face { font-family: "Averia"; src: url("fonts/AveriaSerifLibre-Regular.ttf") format("truetype"); font-weight: 400; }
@font-face { font-family: "Averia"; src: url("fonts/AveriaSerifLibre-Bold.ttf") format("truetype"); font-weight: 700; }

:root {
  --bg: #1b1510;
  --panel: #2f2519;
  --panel-hi: #42331f;
  --border: #5a4631;
  --gold: #e8b45a;
  --text: #eadcc0;
  --muted: #9a8669;
  --regen: #8fcf5a;
  --vie: #e5533d;
  --energie: #f7b733;
  --magie: #5ab0f0;
  --title: "Norse", Georgia, serif;
  --body: "Averia", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input { font: inherit; color: inherit; }

/* En-tête */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.brand h1 { margin: 0; font: 700 30px var(--title); color: var(--gold); letter-spacing: 1px; }
.tagline { font-style: italic; color: var(--muted); font-size: 14px; }
/* Version du jeu des données, sous le titre : on voit tout de suite si le site suit le dernier patch */
.patch { flex-basis: 100%; margin-top: -2px; font-size: 13px; color: var(--muted); }
.patch b { color: var(--gold); font-weight: 700; }
.langs { display: flex; gap: 6px; }
.lang {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 4px 12px;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}
.lang.active { background: var(--gold); color: #1b1510; border-color: var(--gold); }

/* Onglets */
.main-tabs, .sub-tabs {
  display: flex;
  gap: 18px;
  padding: 0 16px;
  flex-wrap: wrap;
}
.main-tabs { margin-top: 12px; }
.tab {
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  font: 400 20px var(--title);
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.sub-tabs { margin-top: 4px; }
.subtab {
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.subtab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* Contenu */
main { padding: 16px; flex: 1; }
.top-hint { margin: 10px 16px 0; min-height: 1em; }
.foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1.5; }
.loading { color: var(--muted); font-style: italic; }
.hint { color: var(--muted); font-style: italic; font-size: 13px; margin: 8px 0 14px; }
.label { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin: 14px 0 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}
.chip:hover { border-color: var(--gold); }
.chip.on { border-color: var(--gold); color: var(--gold); background: var(--panel-hi); }
.chip img { width: 22px; height: 22px; vertical-align: middle; }

.search {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 8px 12px;
  width: min(360px, 100%);
  margin: 12px 0;
}

.section-title {
  font: 700 22px var(--title);
  color: var(--gold);
  margin: 22px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.section-title small { font: italic 14px var(--body); color: var(--muted); }

.btn {
  background: var(--panel-hi);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 700;
}
.btn:hover { background: var(--gold); color: #1b1510; }
.btn.ghost { border-color: var(--border); color: var(--muted); background: var(--panel); }
.btn.ghost:hover { background: var(--panel-hi); color: var(--text); }

/* Cartes de combo */
.combo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  padding: 12px;
  text-align: center;
  position: relative;
}
.card .add {
  position: absolute;
  top: 4px; right: 8px;
  color: var(--gold);
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 18px;
}
.card img.ico { width: 48px; height: 48px; image-rendering: pixelated; }
.card .name { font-weight: 700; margin: 6px 0 4px; font-size: 16px; }
.card .stats { display: flex; justify-content: center; gap: 10px; font-weight: 700; font-size: 14px; }
.card .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.totals {
  background: var(--panel-hi);
  border: 1px solid var(--border);
  padding: 12px;
  display: grid;
  gap: 6px;
  align-content: center;
}
.totals div { font: 700 28px var(--title); line-height: 1.1; }
.totals span { font: 400 12px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-left: 8px; }

.meal {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 14px;
}
.meal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.meal-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }

/* Tableaux */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  margin-bottom: 8px;
}
.table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 7px 8px; border-bottom: 1px solid #3a2e1e; vertical-align: middle; }
.table tr:hover td { background: var(--panel-hi); }
.table tr.group td {
  font: 700 18px var(--title);
  color: var(--gold);
  background: var(--bg);
  padding: 14px 8px 6px;
  border-bottom: 1px solid var(--border);
}
/* Bestiaire, onglet Boss : invocations sous leur invocateur (fond léger, bordure dorée, flèche) */
.table tr.summon td { background: rgba(232, 180, 90, .05); }
.table tr.summon:hover td { background: var(--panel-hi); }
.table tr.summon td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.summon-arrow { color: var(--gold); font-weight: 700; font-size: 16px; margin-right: 5px; }
.summon-origin { color: var(--muted); font-size: 12px; font-style: italic; display: inline-block; }
/* Cœur et éclair dessinés : 20 px pour avoir le même poids visuel que l'icône d'eitr */
.sym { width: 20px; height: 20px; vertical-align: -5px; }
/* Cœur du jeu (32 px) : même taille visuelle que l'éclair */
.sym.health { width: 18px; height: 18px; vertical-align: -4px; image-rendering: pixelated; }
/* L'icône d'eitr du jeu est verte et a une marge transparente : plus petite, teintée en bleu */
.sym.eitr { width: 16px; height: 16px; vertical-align: -3px; image-rendering: pixelated; filter: hue-rotate(75deg) saturate(1.4) brightness(1.1); }
.table th { white-space: nowrap; }
/* En-tête de tableau qui reste visible en descendant dans la liste */
.table { border-collapse: separate; border-spacing: 0; }
.table thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); box-shadow: inset 0 -1px 0 var(--border); }
/* Icônes dans les titres de colonnes : alignées sur le texte */
.table thead th { line-height: 1.4; }
.table thead .sym { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th.sortable.on { color: var(--gold); }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table td.atk, .table th.atk { padding-left: 32px; }  /* bestiaire : écart entre les PV et les attaques */
.table td.atk, .table td.atk-val, .table td.atk-type, .table td.atk-range, .table td.res { white-space: nowrap; }  /* bestiaire : une ligne par dégât, alignées d'une colonne à l'autre */
.table td.atk-val { padding-right: 4px; }
.table td.atk-type { padding-left: 4px; }
.table td.atk, .table td.atk-val, .table td.atk-type, .table td.atk-range { width: 1%; }  /* bestiaire : colonnes d'attaque à la largeur de leur texte le plus long */
.table td.ico-cell { width: 44px; }
@media (min-width: 900px) { .table td.wrap { min-width: 230px; } }  /* une info par ligne : pas coupée en deux sur grand écran */
.table img { width: 32px; height: 32px; image-rendering: pixelated; display: block; }
.table .plus { color: var(--gold); font-weight: 700; cursor: pointer; background: none; border: none; font-size: 18px; }
.vie { color: var(--vie); }
.energie { color: var(--energie); }
.magie { color: var(--magie); }
.regen { color: var(--regen); }
.muted { color: var(--muted); }
.em { color: var(--gold); font-weight: 700; }

/* Liste de courses */
.cart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.cart-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.cart-row img { width: 32px; height: 32px; image-rendering: pixelated; }
.cart-row .qty { display: flex; align-items: center; gap: 6px; }
.qty button {
  background: var(--panel-hi);
  border: 1px solid var(--border);
  width: 28px; height: 28px;
  cursor: pointer;
  font-weight: 700;
}
.qty button:hover { border-color: var(--gold); color: var(--gold); }
.qty b { min-width: 28px; text-align: center; }
.qty button:disabled { opacity: .35; cursor: default; }
.qty button:disabled:hover { border-color: var(--border); color: inherit; }
.cart-row .qty.lvl { margin-top: 4px; font-size: .9em; }
.cart-row .qty.lvl button { width: 24px; height: 24px; }
.mat-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 5px 8px;
  border-bottom: 1px solid #3a2e1e;
}
.mat-row img { width: 28px; height: 28px; image-rendering: pixelated; }
.mat-row .n { color: var(--gold); font-weight: 700; }
/* Matériaux des listes : case « récupéré » et quantité restante modifiable */
.got-row { grid-template-columns: 20px 32px 1fr auto; cursor: pointer; }
.got-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.got-row.done { opacity: .6; }
.got-row.done > span:not(.n) { text-decoration: line-through; }
.got-n {
  width: 4.5em; padding: 2px 4px;
  background: var(--panel-hi); color: var(--gold); font: inherit; font-weight: 700; text-align: right;
  border: 1px solid var(--border); border-radius: 4px;
}

.empty {
  background: var(--panel-hi);
  border: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

.placeholder { color: var(--muted); padding: 40px 0; text-align: center; font-style: italic; }

.toast { color: var(--gold); font-weight: 700; font-size: 13px; }

.foot-actions { margin-top: 8px; display: flex; gap: 16px; flex-wrap: wrap; }
.linkbtn { background: none; border: none; padding: 0; cursor: pointer; color: var(--gold); text-decoration: underline; font: inherit; }
.toast-msg {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--panel-hi);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 8px 16px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  width: max-content;  /* sinon left: 50% le limite à la moitié de l'écran */
  max-width: calc(100vw - 32px);
}
.toast-msg[hidden] { display: none; }
.toast-msg.pop { animation: toast-pop .45s ease-out; }
.toast-msg.bad { border-color: var(--vie); color: var(--vie); }
@keyframes toast-pop {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(.9); }
  55% { opacity: 1; transform: translate(-50%, 0) scale(1.05); box-shadow: 0 0 0 6px rgba(232, 180, 90, .35), 0 6px 18px rgba(0, 0, 0, .5); }
  100% { transform: translate(-50%, 0) scale(1); }
}
/* Ajout depuis un onglet : icône, nom, puis la liste qui le reçoit et son compteur */
.toast-add { display: flex; align-items: center; gap: 8px; text-align: left; }
.toast-add img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.toast-add span { margin-left: 4px; }
.toast-add small { display: block; color: var(--text); font-weight: 400; font-size: 12px; margin-top: 2px; }

/* Impulsion sur un bouton ＋ : anneau qui s'élargit et « +1 » qui s'envole */
.pulse-ring { position: fixed; z-index: 30; pointer-events: none; border-radius: 999px; animation: pulse-ring .7s ease-out forwards; }
.pulse-ring.bad { animation-name: pulse-ring-bad; }
@keyframes pulse-ring {
  from { box-shadow: 0 0 0 0 rgba(232, 180, 90, .9), inset 0 0 0 2px rgba(232, 180, 90, .9); }
  to { box-shadow: 0 0 0 18px rgba(232, 180, 90, 0), inset 0 0 0 2px rgba(232, 180, 90, 0); }
}
@keyframes pulse-ring-bad {
  from { box-shadow: 0 0 0 0 rgba(229, 83, 61, .9), inset 0 0 0 2px rgba(229, 83, 61, .9); }
  to { box-shadow: 0 0 0 18px rgba(229, 83, 61, 0), inset 0 0 0 2px rgba(229, 83, 61, 0); }
}
.fly {
  position: fixed;
  z-index: 31;
  pointer-events: none;
  font: 700 22px var(--title);
  color: var(--gold);
  text-shadow: 0 1px 3px #000, 0 0 10px rgba(232, 180, 90, .7);
  white-space: nowrap;
  animation: fly .9s ease-out forwards;
}
.fly.bad { color: var(--vie); text-shadow: 0 1px 3px #000, 0 0 10px rgba(229, 83, 61, .7); }
@keyframes fly {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, -110%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -320%) scale(1); }
}
/* Compteur d'onglet qui vient de changer */
.tab.bump, .subtab.bump { animation: tab-bump .9s ease-out; }
@keyframes tab-bump {
  0%, 35% { color: var(--gold); text-shadow: 0 0 10px rgba(232, 180, 90, .9); }
  100% { text-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fly, .pulse-ring { display: none; }
  .toast-msg.pop, .tab.bump, .subtab.bump { animation: none; }
}

/* Info-bulle au survol (recette, matériaux, stats) */
.tip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  max-width: 320px;
  background: var(--panel-hi);
  border: 1px solid var(--gold);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}
.tip[hidden] { display: none; }
.tip .tt-title { display: block; font: 700 18px var(--title); color: var(--gold); margin-bottom: 4px; }
.tip .tt-row { display: block; margin-top: 2px; }
.tip-item { cursor: help; border-bottom: 1px dotted var(--muted); }
.tip .tt-label { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

/* Onglets façon classeurs en bois (remplacent le soulignement) */
.main-tabs, .sub-tabs { align-items: flex-end; gap: 6px; }
.main-tabs { border-bottom: 2px solid var(--gold); margin-top: 14px; padding-bottom: 0; }
.sub-tabs { border-bottom: 1px solid var(--border); padding-bottom: 0; margin-top: 8px; }
.tab, .subtab {
  position: relative;
  margin-bottom: -1px;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #2a2016, #201910);
  box-shadow: inset 0 1px 0 rgba(232, 180, 90, .08);
  padding: 8px 18px;
}
.tab { font: 400 18px var(--title); color: var(--muted); }
.subtab { font: 700 14px var(--body); color: var(--muted); padding: 6px 14px; border-radius: 8px 8px 0 0; }
.tab:hover, .subtab:hover { color: var(--text); border-color: var(--gold); }
.tab.active, .subtab.active {
  background: var(--panel-hi);
  color: var(--gold);
  border-color: var(--gold);
  border-bottom: 1px solid var(--panel-hi);
  box-shadow: inset 0 2px 0 var(--gold);
}
.tab.active { border-bottom-color: var(--panel-hi); }
.main-tabs .tab-right { margin-left: auto; }  /* marchands et bestiaire, groupés à droite */

/* Lignes verrouillées chez les marchands ou non disponibles */
.table tr.locked td:not(.ico-cell) { color: var(--muted); }
.table tr.locked img { filter: grayscale(1) opacity(.5); }
/* Bouton « ＋ » : même style partout (équipements, ateliers, constructions) */
.plus { background: none; border: none; color: var(--gold); font: 700 18px var(--body); cursor: pointer; padding: 0 6px; line-height: 1; }
.plus:hover { color: var(--text); }
.plus.locked, .table .plus.locked { opacity: .4; }  /* plat ou hydromel pas encore faisable (case « Limiter à mes ateliers ») */
/* Bestiaire : étoiles 1★ et 2★ à côté du nom du monstre */
.stars { margin-left: 8px; white-space: nowrap; }
.star { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 0 3px; }
.star.on { color: var(--gold); }
.star:hover { color: var(--text); }
.check-btn { background: none; border: none; color: var(--gold); font-size: 18px; cursor: pointer; padding: 0 6px; }
.ext-item { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; }
.ws-head { flex-wrap: wrap; }

/* Équipement, mes ateliers, constructions */
.row-controls { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px 24px; margin-top: 4px; }
.row-controls .search { margin: 0 0 4px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; margin-bottom: 8px; }
.owned-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-bottom: none; padding: 8px 10px; }
.owned-row img { width: 32px; height: 32px; image-rendering: pixelated; vertical-align: middle; }
.owned-body { background: var(--panel); border: 1px solid var(--border); border-top: none; padding: 8px 10px; margin-bottom: 8px; display: grid; gap: 6px; }
.owned-body .qty { display: flex; align-items: center; gap: 6px; }
.lock { color: var(--vie); font-weight: 700; }
.ws { background: var(--panel); border: 1px solid var(--border); padding: 10px; margin-bottom: 10px; }
.ws-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ws-head img { width: 32px; height: 32px; image-rendering: pixelated; }
.exts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.ext { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.ext img { width: 22px; height: 22px; image-rendering: pixelated; }
.ext.built { color: var(--gold); }
.ext:has(input:disabled) { opacity: 0.45; }
.comfort-total { font: 700 22px var(--title); color: var(--gold); margin: 14px 0 2px; }
.comfort-total b { font-size: 30px; }
.comfort-total .sep { color: var(--muted); margin: 0 4px; }
.hint.warn { color: var(--energie); }

/* Téléphone */
@media (max-width: 720px) {
  body { font-size: 14px; }
  .brand h1 { font-size: 24px; }
  .tab { font-size: 17px; }
  .main-tabs .tab-right { margin-left: 0; }  /* à la ligne : à la suite des autres, sans trou */
  .cart-grid { grid-template-columns: 1fr; }
  .table th.hide-sm, .table td.hide-sm { display: none; }
  main { padding: 16px; }
}

.atk-detail { border-bottom: 1px dotted var(--muted); cursor: help; }  /* bestiaire : précisions de l'attaque au survol */
.stars.fixed { color: var(--gold); cursor: help; }
.table .note { font-size: 12px; }

/* Liens directs : bouton lien d'une créature, créature ouverte par l'adresse */
.permalink { background: none; border: none; padding: 0 2px; margin-left: 4px; cursor: pointer; font-size: 11px; opacity: .35; filter: grayscale(1); }
.permalink:hover, .permalink:focus { opacity: 1; filter: none; }
.table tr.focus td { animation: focus-row 3s ease-out; box-shadow: inset 0 1px 0 var(--gold), inset 0 -1px 0 var(--gold); }
@keyframes focus-row { from { background: rgba(232, 180, 90, .35); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .table tr.focus td { animation: none; background: rgba(232, 180, 90, .15); } }

/* Recherche dans tout le site (en-tête) */
.gsearch { position: relative; flex: 1 1 260px; max-width: 420px; }
.gsearch .search { width: 100%; margin: 0; }
.gs-panel {
  position: absolute; z-index: 9; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 70vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--gold); box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}
.gs-panel[hidden] { display: none; }
.gs-cat { padding: 8px 10px 2px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.gs-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 10px;
  background: none; border: none; text-align: left; cursor: pointer;
}
.gs-item img, .gs-noicon { width: 24px; height: 24px; flex: none; }
.gs-item:hover, .gs-item.active { background: var(--panel-hi); }
.gs-item.active .gs-name { color: var(--gold); }
.gs-static { cursor: default; }
.gs-static:hover { background: none; }
.gs-name { flex: 1 1 auto; min-width: 0; }
.gs-where { flex: 0 1 auto; max-width: 50%; color: var(--muted); font-size: 12px; text-align: right; }
.gs-empty { padding: 10px; color: var(--muted); }
.card.focus { animation: focus-row 3s ease-out; outline: 1px solid var(--gold); }
@media (max-width: 720px) {
  .gsearch { order: 3; flex-basis: 100%; max-width: none; }
}

/* Petit « i » d'information (infoIcon) : à quoi sert un matériau, comment battre un monstre… */
.info-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 3px; border: 1px solid currentColor; border-radius: 50%;
  font: italic 700 10px/1 Georgia, serif; color: var(--muted); cursor: help; vertical-align: 1px;
  user-select: none; -webkit-user-select: none;
}
.info-i:hover, .info-i:focus { color: var(--gold); outline: none; }
.tip .tt-row .muted { font-size: 12px; }
.tip .tt-ico { width: 20px; height: 20px; vertical-align: -5px; }

/* Téléphone : chaque tableau défile de côté dans son cadre (groupTable), l'icône et le nom restent à gauche */
@media (max-width: 720px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 8px; }
  .table-wrap .table { margin-bottom: 0; }
  .table td, .table th { padding: 6px; }
  .table td.ico-cell, .table tr > th:first-child { width: 38px; min-width: 38px; max-width: 38px; padding: 4px 3px; }
  .table img { width: 28px; height: 28px; }
  .table tr > :first-child:not([colspan]), .table tr > :nth-child(2) { position: sticky; z-index: 1; background: var(--panel); }
  .table tr > :first-child:not([colspan]) { left: 0; }
  .table tr > :nth-child(2) { left: 38px; min-width: 110px; max-width: 42vw; box-shadow: inset -1px 0 0 var(--border); }
  /* En-tête : les deux cellules fixes passent devant les autres en-têtes collants (z-index 2) */
  .table thead tr > th:first-child:not([colspan]), .table thead tr > th:nth-child(2) { z-index: 3; background: var(--panel); }
  .table tr.group .group-title { position: sticky; left: 8px; }
  /* Cellules fixes opaques, même sur les lignes teintées (invocations) et au survol */
  .table tr.summon > :first-child:not([colspan]), .table tr.summon > :nth-child(2) { background: linear-gradient(rgba(232, 180, 90, .05), rgba(232, 180, 90, .05)), var(--panel); }
  .table tr:hover > :first-child:not([colspan]), .table tr:hover > :nth-child(2) { background: var(--panel-hi); }
}

/* Bulle fixe du « i » (openPin) : liste complète, défilement propre, croix pour fermer */
.pin-tip {
  position: fixed; z-index: 11; left: 50%; top: 15vh; transform: translateX(-50%);  /* sans « i » d'origine : centrée */
  width: min(380px, calc(100vw - 16px)); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--panel-hi); border: 1px solid var(--gold); box-shadow: 0 8px 24px rgba(0, 0, 0, .6);
  font-size: 13px; line-height: 1.45;
}
.pin-tip[hidden] { display: none; }
.pin-body { overflow-y: auto; padding: 10px 12px 12px; overscroll-behavior: contain; }
.pin-body .tt-title { display: block; font: 700 18px var(--title); color: var(--gold); margin: 0 34px 4px 0; }
.pin-body .tt-row { display: block; margin-top: 2px; }
.pin-body .tt-label { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.pin-body .tt-row .muted { font-size: 12px; }
.pin-close {
  position: absolute; top: 2px; right: 2px; width: 34px; height: 34px; z-index: 1;
  background: var(--panel-hi); border: none; color: var(--muted); font-size: 16px; cursor: pointer;
}
.pin-close:hover, .pin-close:focus-visible { color: var(--gold); }
@media (max-width: 720px) {
  /* Téléphone : en bas de l'écran, sur toute la largeur, croix plus grande */
  .pin-tip { left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; max-height: 70vh; transform: none !important; }
  .pin-close { width: 44px; height: 44px; font-size: 18px; }
  .pin-body .tt-title { margin-right: 44px; }
}
