/* ============================================================
   css/db-heroes.css — Base de données > Héros
   (database/heroes/*.html, générées par tools/build_hero_pages.mjs)

   .hb : l'écran de compétences du jeu. Sur ordinateur, les compétences de
   conquête sont empilées à gauche du héros, celles d'expédition à droite,
   reliées au portrait par un filet. Sous 980 px, tout s'empile.
   ============================================================ */

.hb-mythic { --rar: #a4561a; }
.hb-epic   { --rar: #7a3fb5; }
.hb-rare   { --rar: #2f5fae; }
[data-theme="dark"] .hb-mythic { --rar: #e39a4f; }
[data-theme="dark"] .hb-epic   { --rar: #b88ae6; }
[data-theme="dark"] .hb-rare   { --rar: #7fa8ea; }

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

/* ---- Écran de compétences ---- */
.hb {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  margin: 8px 0 12px;
  padding: 30px 28px 34px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(ellipse 38% 70% at 50% 45%, color-mix(in srgb, var(--rar) 16%, transparent), transparent 75%),
    var(--bg-panel);
  box-shadow: 0 1px 0 var(--border), 0 14px 34px -22px var(--shadow);
}

.hb-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hb-col-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 2px;
  font-family: 'Karla', 'Segoe UI', system-ui, sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
}
.hb-col-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.hb-left .hb-col-title { flex-direction: row-reverse; }

.hb-skill {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-dark) 45%, var(--bg-panel));
  transition: border-color .15s;
}
.hb-skill:hover { border-color: color-mix(in srgb, var(--rar) 55%, var(--border)); }
.hb-left .hb-skill { flex-direction: row-reverse; text-align: right; }

/* Filet entre chaque compétence et le portrait (largeur = gap de la grille) */
.hb-skill::after {
  content: ''; position: absolute; top: 50%; width: 36px; height: 1px;
}
.hb-left .hb-skill::after  { left: 100%; background: linear-gradient(90deg, var(--border), color-mix(in srgb, var(--rar) 60%, transparent)); }
.hb-right .hb-skill::after { right: 100%; background: linear-gradient(270deg, var(--border), color-mix(in srgb, var(--rar) 60%, transparent)); }

.hb-ico {
  width: 62px; height: 62px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 14px; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--rar) 45%, #fff8e8), color-mix(in srgb, var(--rar) 85%, #000));
  box-shadow: 0 0 0 2px var(--bg-panel), 0 0 0 3.5px color-mix(in srgb, var(--rar) 75%, transparent), 0 4px 10px var(--shadow);
}
.hb-ico-img { width: 100%; height: 100%; object-fit: cover; }
.hb-ico-glyph { width: 30px; height: 30px; color: #fff8e8; opacity: .92; }

.hb-txt { min-width: 0; }
.hb-page .hb-name { margin: 0; font-family: 'EB Garamond', Georgia, serif; font-weight: 600; font-size: 20px; line-height: 1.15; color: var(--text-light); }
.hb-eff { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--text-muted); }
.hb-v { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Héros au centre ---- */
.hb-center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; align-self: center; }
.hb-frame {
  width: 250px; height: 270px; padding: 5px; box-sizing: border-box;
  border-radius: 125px 125px 18px 18px;
  background: linear-gradient(180deg, var(--rar), color-mix(in srgb, var(--rar) 25%, var(--bg-panel)));
  box-shadow: 0 16px 30px -18px var(--shadow);
}
.hb-art-wrap {
  display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 120px 120px 14px 14px; overflow: hidden;
  background: var(--control-bg);
}
.hb-art { width: 100%; height: 100%; object-fit: cover; }
/* Les portraits carrés portent un liseré blanc incrusté : on le rogne. */
.hb-art:not(.hb-art-full) { transform: scale(1.3); transform-origin: 50% 45%; }
.hb-art-full { object-fit: contain; object-position: 50% 100%; }
.hb-initial { font-family: 'EB Garamond', Georgia, serif; font-size: 96px; color: var(--rar); }

.hb-plate {
  margin-top: 4px; padding: 2px 24px;
  font-family: 'EB Garamond', Georgia, serif; font-size: 30px; font-weight: 600; line-height: 1.1;
  color: var(--text-light);
  border-bottom: 1px solid color-mix(in srgb, var(--rar) 55%, var(--border));
}
.hb-tags { font-size: 13px; color: var(--text-muted); }
.hb-rarity { color: var(--rar); font-weight: 700; }
.hb-dot { margin: 0 6px; opacity: .6; }

.hb-levels { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; }
.hb-lv-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.hb-lv-btns { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; background: var(--control-bg); padding: 3px; gap: 2px; }
.hb-lv-btns button {
  width: 34px; height: 30px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-light);
  font: 700 14px 'Karla', 'Segoe UI', system-ui, sans-serif; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: background .15s, color .15s;
}
.hb-lv-btns button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hb-lv-btns button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.hb-lv-btns button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Sections sous l'écran ---- */
.hb-sub { font-size: 20px; margin: 18px 0 8px; color: var(--text-light); }
.hb-page .hb-table { max-height: none; }
/* style.css ramène les tables de .db-section à leur contenu (Experts) ; ici elles remplissent le cadre. */
body.has-app-header .hb-page .db-section .hb-table table.db-table { width: 100%; margin-bottom: 0; }
.hb-table table.db-table td.c-lbl { white-space: normal; min-width: 150px; }
.hb-table table.db-table th.num { text-align: right; }
.hb-page .db-source a,
.hb-page .db-intro a { color: var(--accent); }
.hb-page .m-block-desc.hb-eff { margin-top: 3px; font-size: 13px; }
.hb-widget-head .db-intro { margin: 0; }
.hb-widget-ico { width: 56px; height: 56px; }

/* ---- Autres fiches, groupées (même type, même rareté, même génération, autres) ---- */
.hb-related { display: grid; gap: 14px; margin-top: 28px; border-top: 1px solid var(--border); padding-top: 18px; }
.hb-rel-title { font-size: 16px; margin: 0 0 8px; color: var(--text-muted); }
.hb-rel-group .db-switch { margin: 0; }

/* ---- Sommaire ---- */
.hb-card { border-left: 3px solid var(--rar); }
.hb-card-img { border-radius: 10px; filter: none; }
.hb-card-initial { filter: none; display: grid; place-items: center; border-radius: 10px; background: var(--control-bg); font-family: 'EB Garamond', Georgia, serif; font-size: 40px; color: var(--rar); }
.hb-card-soon { opacity: .7; cursor: default; }
.hb-card-soon:hover { transform: none; border-color: var(--border); border-left-color: var(--rar); }

/* ---- Écrans étroits : tout s'empile, héros en tête ---- */
@media (max-width: 980px) {
  .hb { grid-template-columns: 1fr; gap: 26px; padding: 22px 16px; }
  .hb-center { order: -1; }
  .hb-left .hb-skill { flex-direction: row; text-align: left; }
  .hb-left .hb-col-title { flex-direction: row; }
  .hb-skill::after { display: none; }
}
@media (max-width: 520px) {
  .hb-frame { width: 200px; height: 216px; }
  .hb-ico { width: 52px; height: 52px; }
}
