/* Project Hoof — /calc/heroes/ — in-game HERO DETAIL screen re-creation.
   Three columns: roster rail · live 3D hero · info card. Skinned with the
   real extracted Call-of-Dragons UI sprites in /calc/assets/ui-heroes/.
   Identity (name/nickname/title) is real; combat stats show "—" where the
   datapack has no value (see heroes/MISSING.md). */

:root {
  --hud-nav-h: var(--nav-h, 72px);
  --hud-gold: #f2cc6a;
  --hud-gold-deep: #c9a24a;
  --hud-ink: #e8e2d2;
  --ui: '/calc/assets/ui-heroes';
}

body.heroes-page { overflow: hidden; }
body.heroes-page.subpage::before { z-index: 0; }

.heroes-screen {
  position: fixed;
  top: var(--hud-nav-h); left: 0; right: 0; bottom: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px 1fr 372px;
  gap: 0;
}

/* ============================ ROSTER RAIL ============================ */
.roster {
  display: flex; flex-direction: column; min-height: 0;
  /* translucent left rail floating over the scene (in-game style) */
  background: linear-gradient(90deg, rgba(10,8,5,.82), rgba(12,9,6,.66));
  border-right: 1px solid rgba(201,162,74,.35);
  box-shadow: inset -10px 0 28px -18px #000, 2px 0 16px rgba(0,0,0,.4);
  backdrop-filter: blur(2px);
}
.roster-head {
  flex: 0 0 auto; display: flex; align-items: baseline; gap: 10px;
  padding: 14px 16px 8px;
}
.roster-title {
  font-family:'Cinzel Decorative',serif; font-weight:900; font-size:1.2rem;
  letter-spacing:.06em; color:var(--hud-gold);
  text-transform:uppercase;
}
.roster-count { font-family:'Manrope',sans-serif; font-size:.78rem; color:#8593b0; }
.roster-tools { flex:0 0 auto; display:flex; align-items:center; gap:10px; padding:0 16px 10px; }
.roster-search {
  flex:1 1 auto; min-width:0;
  background: rgba(6,11,22,.85);
  border:1px solid rgba(201,162,74,.32); color:var(--hud-ink);
  padding:7px 10px; border-radius:8px;
  font-family:'EB Garamond',serif; font-size:.92rem; outline:0;
}
.roster-search:focus { border-color:var(--hud-gold); box-shadow:0 0 0 3px rgba(242,204,106,.16); }
.roster-filter {
  display:flex; align-items:center; gap:5px; flex:0 0 auto;
  font-family:'IM Fell English SC',serif; font-size:.74rem; color:#9fb0cf; cursor:pointer;
}
.roster-filter input { accent-color: var(--hud-gold-deep); }

.roster-list {
  flex:1 1 auto; min-height:0; overflow-y:auto; overflow-x:hidden;
  padding:6px 12px 18px;
  display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px;
  align-content:start;
  scrollbar-width: thin; scrollbar-color: rgba(201,162,74,.5) transparent;
}
.roster-list::-webkit-scrollbar { width:8px; }
.roster-list::-webkit-scrollbar-thumb { background:rgba(201,162,74,.45); border-radius:8px; }

.roster-slot {
  position:relative; cursor:pointer; border:0; background:none; padding:0;
  display:flex; flex-direction:column; align-items:center; gap:3px;
}
.roster-slot-frame {
  position:relative; width:100%; aspect-ratio:1/1;
  background:
    url('/calc/assets/ui-heroes/portrait-bg-blue.png') center/86% 86% no-repeat,
    url('/calc/assets/ui-heroes/roster-slot.png') center/100% 100% no-repeat;
  display:flex; align-items:center; justify-content:center;
}
.roster-slot-mono {
  font-family:'Cinzel',serif; font-weight:900; font-size:1.4rem;
  color:#f3e6c2; text-shadow:0 2px 4px rgba(0,0,0,.7);
}
.roster-slot-name {
  font-family:'EB Garamond',serif; font-size:.72rem; line-height:1.05;
  color:#cdbe9a; text-align:center; max-width:100%;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
/* rarity-tinted portrait background (datamined Rare 5/4/3) */
.roster-slot-frame.rar-5 { background:
    url('/calc/assets/ui-heroes/portrait-bg-orange.png') center/86% 86% no-repeat,
    url('/calc/assets/ui-heroes/roster-slot.png') center/100% 100% no-repeat; }
.roster-slot-frame.rar-4 { background:
    url('/calc/assets/ui-heroes/portrait-bg-purple.png') center/86% 86% no-repeat,
    url('/calc/assets/ui-heroes/roster-slot.png') center/100% 100% no-repeat; }
.roster-slot-frame.rar-3 { background:
    url('/calc/assets/ui-heroes/portrait-bg-blue.png') center/86% 86% no-repeat,
    url('/calc/assets/ui-heroes/roster-slot.png') center/100% 100% no-repeat; }

.roster-slot.is-selected .roster-slot-frame {
  background:
    url('/calc/assets/ui-heroes/portrait-bg-orange.png') center/86% 86% no-repeat,
    url('/calc/assets/ui-heroes/roster-slot-selected.png') center/108% 108% no-repeat;
  filter:drop-shadow(0 0 8px rgba(242,204,106,.6));
}
.roster-slot.is-selected .roster-slot-name { color:var(--hud-gold); font-weight:600; }
.roster-slot.no-model .roster-slot-frame { filter:grayscale(.7) brightness(.7); }
.roster-slot.no-model::after {
  content:''; position:absolute; top:4px; right:4px; width:14px; height:14px;
  background:url('/calc/assets/ui-heroes/roster-slot-locked.png') center/contain no-repeat;
  opacity:.0; /* hidden: not actually "locked", just no 3D — keep clean */
}
.roster-slot:hover .roster-slot-frame { filter:brightness(1.12); }
.roster-empty { grid-column:1/-1; padding:24px 8px; text-align:center; color:#7e8aa6;
  font-family:'EB Garamond',serif; font-style:italic; }

/* ============================ 3D STAGE ============================ */
.stage {
  position:relative; min-width:0; min-height:0; overflow:hidden;
  /* the real in-game hero-screen backdrop (extracted img_heroSystemBG1) */
  background: #0a1020 url('/calc/assets/ui-heroes/scene-ruins.png') center/cover no-repeat;
}
/* in-game vignette overlay so the hero pops against the scene */
.stage::after {
  content:''; position:absolute; inset:0; pointer-events:none; z-index:2;
  background:url('/calc/assets/ui-heroes/scene-vignette.png') center/100% 100% no-repeat,
    radial-gradient(ellipse 70% 60% at 50% 42%, transparent 55%, rgba(6,10,22,.5) 100%);
}
.hero-stage { position:absolute; inset:0; z-index:1; }
.hero-stage canvas { display:block; width:100%!important; height:100%!important; }
.stage-name {
  position:absolute; left:0; right:0; bottom:18px; text-align:center; z-index:3;
  font-family:'Cinzel Decorative',serif; font-weight:700; font-size:1.5rem;
  color:#f3e6c2; text-shadow:0 3px 10px rgba(0,0,0,.9), 0 0 4px rgba(0,0,0,.8);
  pointer-events:none;
}
.stage-loading, .stage-nomodel { z-index:3; }
.stage-loading {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
}
/* class display rules above beat the UA [hidden] rule — restore it explicitly */
.stage-loading[hidden], .stage-nomodel[hidden] { display:none; }
.stage-spinner {
  width:38px; height:38px; border-radius:50%;
  border:3px solid rgba(201,162,74,.25); border-top-color:var(--hud-gold);
  animation:spin 1s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }
.stage-nomodel {
  position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:14px; padding:24px; text-align:center;
}
.stage-nomodel-crest {
  width:120px; height:120px; opacity:.5;
  background:url('/calc/assets/ui-heroes/class-crest-build.png') center/contain no-repeat;
  filter:grayscale(.5);
}
.stage-nomodel p {
  font-family:'EB Garamond',serif; font-style:italic; font-size:1rem; color:#9fb0cf; max-width:280px;
}

/* ============================ INFO CARD ============================ */
.info {
  position:relative; display:flex; flex-direction:column; gap:12px; min-height:0;
  overflow-y:auto; padding:18px 18px 22px;
  /* floats over the scene like the in-game panel — just a soft scrim for legibility */
  background: linear-gradient(90deg, transparent, rgba(8,10,20,.55) 38%, rgba(8,10,20,.72));
  scrollbar-width: thin; scrollbar-color: rgba(201,162,74,.5) transparent;
}
.info::-webkit-scrollbar { width:8px; }
.info::-webkit-scrollbar-thumb { background:rgba(201,162,74,.45); border-radius:8px; }

.info-crests {
  position:absolute; top:14px; right:16px; display:flex; gap:6px; align-items:center;
}
.info-faction {
  width:42px; height:62px; display:inline-block;
  background:url('/calc/assets/ui-heroes/faction-crest-order.png') center/contain no-repeat;
  opacity:.9;
}
.info-class {
  width:54px; height:54px; display:inline-block;
  background:url('/calc/assets/ui-heroes/class-crest-mage.png') center/contain no-repeat;
}

.info-id { padding-right:64px; }
.info-nickname {
  font-family:'Spectral',serif; font-style:italic; font-weight:600; font-size:1rem;
  color:#cfa6e6; letter-spacing:.01em;
}
.info-name {
  margin:1px 0 0; font-family:'Cinzel Decorative',serif; font-weight:900;
  font-size:1.7rem; line-height:1.05; color:#f5ead0;
}
.info-title {
  margin-top:3px; font-family:'IM Fell English SC',serif; font-size:.82rem;
  letter-spacing:.04em; color:#a7936a;
}

.info-tags { display:flex; flex-wrap:wrap; gap:6px; }
.info-tag {
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 10px 4px 7px; border-radius:999px;
  background:rgba(40,30,16,.7); border:1px solid rgba(201,162,74,.35);
  font-family:'Manrope',sans-serif; font-size:.74rem; color:#e6d3a6;
}
.info-tag i {
  width:14px; height:14px; background-size:contain; background-repeat:no-repeat; background-position:center;
}
.info-tag.tag-rar-5 { background:rgba(120,70,20,.5); border-color:#f0a93a; color:#ffd98a; }
.info-tag.tag-rar-4 { background:rgba(70,40,110,.5); border-color:#b07fe0; color:#e3c9ff; }
.info-tag.tag-rar-3 { background:rgba(30,60,110,.5); border-color:#5f9fe0; color:#bfe0ff; }
.info-tag.tag-fac   { background:rgba(40,30,16,.7); border-color:rgba(201,162,74,.5); color:#f0d9a0; }
.info-tag.tag-cls   { background:rgba(24,40,52,.7); border-color:rgba(110,170,210,.5); color:#bfe0f5; }
.info-tag.tag-dmg   { background:rgba(48,24,40,.7); border-color:rgba(210,120,170,.5); color:#f3c2dd; }
.info-tag.tag-el          { border-width:1px; }
.info-tag.tag-el.el-fire    { background:rgba(90,30,15,.6);  border-color:#f0813b; color:#ffc79a; }
.info-tag.tag-el.el-ice     { background:rgba(20,50,75,.6);  border-color:#6fc0e0; color:#bfe9ff; }
.info-tag.tag-el.el-thunder { background:rgba(55,30,90,.6);  border-color:#b06fe0; color:#e0c9ff; }
.info-tag.tag-el.el-wind    { background:rgba(25,60,45,.6);  border-color:#7fd0a0; color:#c9f5dc; }
.info-tag.tag-el.el-poison  { background:rgba(35,60,20,.6);  border-color:#8fd060; color:#dcf5b0; }

/* stat rows (power / legion) */
.info-stat {
  display:flex; align-items:center; gap:9px;
  padding:9px 12px; border-radius:10px;
  background:rgba(8,12,22,.55); border:1px solid rgba(201,162,74,.18);
}
.info-stat-ic { width:24px; height:24px; flex:0 0 auto; background-size:contain; background-repeat:no-repeat; background-position:center; }
.info-ic-power  { background-image:url('/calc/assets/ui-heroes/talent-type-war.png'); }
.info-ic-legion { background-image:url('/calc/assets/ui-heroes/class-crest-cavalry.png'); }
.info-stat-label { font-family:'Cinzel',serif; font-weight:700; font-size:.86rem; color:#d6c590; }
.info-stat-value { margin-left:auto; font-family:'Cinzel',serif; font-weight:700; font-size:1.05rem; color:var(--hud-gold); font-variant-numeric:tabular-nums; }
.info-q {
  width:16px; height:16px; flex:0 0 auto; cursor:help;
  display:flex; align-items:center; justify-content:center;
  font-family:'Manrope',sans-serif; font-size:.66rem; font-weight:800; color:#1c1306;
  background:url('/calc/assets/ui-heroes/icon-info-q.png') center/contain no-repeat;
  text-indent:-9999px; /* sprite carries the "?" */
}

/* level */
.info-level {
  padding:10px 12px; border-radius:10px;
  background:rgba(8,12,22,.55); border:1px solid rgba(201,162,74,.18);
  display:flex; flex-direction:column; gap:7px;
}
.info-level-head { display:flex; align-items:center; justify-content:space-between; }
.info-level-num { font-family:'Cinzel',serif; color:var(--hud-gold); }
.info-level-num b { font-size:1.15rem; }
.info-level-max { color:#9a8a5e; font-size:.85rem; }
.xpbar {
  height:16px; border-radius:6px; overflow:hidden;
  background:rgba(0,0,0,.5) url('/calc/assets/ui-heroes/xpbar-bg.png') center/100% 100% no-repeat;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.5);
}
.xpbar-fill {
  height:100%;
  background:linear-gradient(90deg,#5fd0e0,#8ff0ff);
  box-shadow:0 0 8px rgba(120,220,255,.5) inset;
  transition:width .2s ease;
}
.hero-lvl-range { width:100%; accent-color:var(--hud-gold-deep); }

/* skills */
.info-skills { display:flex; flex-direction:column; gap:8px; }
.info-skills-head { font-family:'Cinzel',serif; font-weight:700; font-size:.86rem; color:var(--hud-gold-deep); }
.info-skills-row { display:flex; gap:8px; flex-wrap:wrap; }
.skill-slot {
  position:relative; width:60px; height:60px; cursor:pointer;
  background:url('/calc/assets/ui-heroes/skill-slot.png') center/100% 100% no-repeat;
  display:flex; align-items:center; justify-content:center;
}
.skill-slot-inner {
  width:64%; height:64%; border-radius:8px;
  background:rgba(10,16,30,.7) url('/calc/assets/ui-heroes/skill-locked.png') center/contain no-repeat;
}
.skill-slot.is-active .skill-slot-inner {
  background:rgba(40,30,60,.6) url('/calc/assets/ui-heroes/skill-icon-sample.png') center/contain no-repeat;
}
/* real datamined skill icon (assets/heroskills/) — inline background-image set in JS */
.skill-slot-inner.has-icon { background-color:rgba(12,18,32,.85); background-size:cover; }
.skill-slot-lv {
  position:absolute; bottom:-3px; right:-3px; min-width:18px; height:22px;
  padding:0 3px; display:flex; align-items:center; justify-content:center;
  font-family:'Cinzel',serif; font-weight:900; font-size:.7rem; color:#fff;
  background:rgba(20,14,8,.92); border:1px solid var(--hud-gold-deep); border-radius:6px;
  text-shadow:0 1px 1px #000;
}
.skill-slot.is-locked { opacity:.55; cursor:default; }

/* blue action buttons */
.info-actions { display:flex; gap:10px; margin-top:2px; }
.hero-btn-blue {
  position:relative; flex:1 1 0; cursor:pointer; border:0;
  padding:13px 10px;
  color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.6);
  font-family:'Cinzel',serif; font-weight:700; font-size:.95rem; letter-spacing:.03em;
  border-image:url('/calc/assets/ui-heroes/btn-blue.png') 18 30 22 30 fill / 9px 15px 11px 15px / 0 stretch;
  transition:transform .1s, filter .1s;
}
.hero-btn-blue:hover { filter:brightness(1.1); transform:translateY(-1px); }
.hero-btn-blue:active { transform:translateY(0); }
.hero-btn-badge {
  position:absolute; top:-6px; right:-6px; width:22px; height:22px;
  background:url('/calc/assets/ui-heroes/badge-notif.png') center/contain no-repeat;
}

.hero-use {
  margin-top:auto; cursor:pointer; border:0;
  padding:14px 16px; border-radius:11px;
  font-family:'Cinzel',serif; font-weight:900; font-size:1rem; letter-spacing:.03em; color:#1c1306;
  background:linear-gradient(180deg,#f6db95,var(--hud-gold-deep));
  box-shadow:0 4px 12px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.4);
  transition:transform .1s, filter .1s;
}
.hero-use:hover { filter:brightness(1.05); }
.hero-use:active { transform:translateY(1px); }

/* ============================ modal ============================ */
.hero-modal {
  position:fixed; inset:0; z-index:80;
  display:flex; align-items:center; justify-content:center; padding:20px;
  background:radial-gradient(120% 100% at 50% 50%, rgba(6,9,18,.55), rgba(4,6,12,.85));
  backdrop-filter:blur(3px);
}
.hero-modal[hidden] { display:none; }
.hero-modal-card {
  position:relative; width:min(540px,100%); max-height:88%; overflow-y:auto;
  background:linear-gradient(180deg, rgba(30,23,14,.98), rgba(15,11,7,.99));
  border:1px solid #b9933f; border-radius:16px; padding:20px;
  box-shadow:0 24px 70px -18px rgba(0,0,0,.85), inset 0 0 0 1px rgba(232,207,142,.2);
}
.hero-modal-close {
  position:absolute; top:10px; right:10px; width:30px; height:30px; cursor:pointer;
  border:0; border-radius:50%; color:#e8d6a8; font-size:1rem;
  background:rgba(0,0,0,.4); box-shadow:inset 0 0 0 1px rgba(201,162,74,.4);
}
.hero-modal-close:hover { color:#fff; background:rgba(120,40,30,.6); }
.hero-modal-title {
  margin:0 0 12px; font-family:'Cinzel Decorative',serif; font-weight:700; font-size:1.25rem;
  color:var(--hud-gold);
}
.hero-modal-body { font-family:'EB Garamond',serif; font-size:.95rem; color:#d8cba8; line-height:1.55; }
.hero-modal-body ul { margin:8px 0; padding-left:20px; }
.hero-modal-body .modal-note {
  margin-top:12px; padding:10px 12px; border-radius:8px;
  background:rgba(40,28,12,.6); border:1px solid rgba(230,170,90,.3);
  font-style:italic; font-size:.88rem; color:#e6c98a;
}
.modal-skill-grid { display:flex; flex-direction:column; gap:10px; margin:12px 0; }
.modal-skill-row { display:flex; align-items:flex-start; gap:12px; }
.modal-skill-ic {
  flex:0 0 auto; width:52px; height:52px; border-radius:10px; background:rgba(12,18,32,.85) center/cover no-repeat;
  border:1px solid rgba(201,162,74,.4); box-shadow:0 2px 8px rgba(0,0,0,.4);
}
.modal-skill-txt { flex:1 1 auto; min-width:0; }
.modal-skill-nm {
  font-family:'Cinzel',serif; font-weight:700; font-size:.92rem; color:var(--hud-gold);
  display:flex; align-items:center; gap:8px;
}
.modal-skill-dt {
  font-family:'Manrope',sans-serif; font-weight:700; font-size:.62rem; letter-spacing:.04em;
  padding:1px 6px; border-radius:999px; background:rgba(48,24,40,.7);
  border:1px solid rgba(210,120,170,.5); color:#f3c2dd;
}
.modal-skill-ds { font-family:'EB Garamond',serif; font-size:.9rem; line-height:1.4; color:#cdbe9a; margin-top:2px; white-space:pre-line; }
.modal-skill-lv {
  font-family:'Manrope',sans-serif; font-weight:700; font-size:.6rem; letter-spacing:.04em;
  padding:1px 6px; border-radius:999px; background:rgba(40,30,12,.7);
  border:1px solid rgba(201,162,74,.4); color:#e6c98a; margin-left:4px;
}

/* talent layout: core banner + 4 tree cards */
.talent-core {
  margin:12px 0; padding:12px 14px; border-radius:10px;
  background:linear-gradient(135deg, rgba(120,86,26,.5), rgba(40,28,12,.7));
  border:1px solid rgba(242,204,106,.55); box-shadow:0 4px 16px rgba(0,0,0,.4) inset;
}
.talent-core-badge {
  font-family:'Manrope',sans-serif; font-weight:800; font-size:.62rem; letter-spacing:.1em; text-transform:uppercase;
  color:#1a1206; background:var(--hud-gold); display:inline-block; padding:2px 8px; border-radius:999px; margin-bottom:6px;
}
.talent-core-nm { font-family:'Cinzel',serif; font-weight:900; font-size:1.05rem; color:var(--hud-gold); }
.talent-core-ds { font-family:'EB Garamond',serif; font-size:.92rem; line-height:1.45; color:#e6d3a6; margin-top:3px; }
/* ---- interactive talent tree ---- */
.talent-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:14px 0 10px; }
.talent-total { font-family:'Cinzel',serif; font-weight:700; font-size:.82rem; color:var(--hud-gold); flex:1 1 auto; }
.talent-reset {
  cursor:pointer; padding:5px 10px; border-radius:7px; background:rgba(60,20,20,.5);
  border:1px solid rgba(210,120,120,.4); color:#f0b8b8; font-family:'Manrope'; font-size:.72rem; font-weight:600;
}
.talent-reset:hover { background:rgba(80,24,24,.7); }

/* full-screen talent "page" (the winged tree needs the room) */
.hero-modal:has(.hero-modal-card.is-talents) { padding:0; }
.hero-modal-card.is-talents {
  width:100%; max-width:none; height:100%; max-height:100%;
  border-radius:0; border:0; padding:0;
  display:flex; flex-direction:column;
  background:radial-gradient(130% 90% at 50% 40%, rgba(16,26,46,.98), rgba(6,9,16,.99));
}
.hero-modal-card.is-talents .hero-modal-title { display:none; }
.hero-modal-card.is-talents .hero-modal-close { display:none; }
.hero-modal-card.is-talents .hero-modal-body { display:flex; flex-direction:column; flex:1 1 auto; min-height:0; }
.talent-bar {
  flex:0 0 auto; display:flex; align-items:center; gap:14px; padding:12px 18px;
  border-bottom:1px solid rgba(201,162,74,.25); background:rgba(8,12,22,.6);
}
.talent-back {
  cursor:pointer; padding:7px 14px; border-radius:8px; background:rgba(40,30,60,.6);
  border:1px solid rgba(201,162,74,.45); color:var(--hud-gold);
  font-family:'Cinzel',serif; font-weight:700; font-size:.82rem;
}
.talent-back:hover { background:rgba(60,46,90,.7); color:#fff; }
.talent-bar-title { font-family:'Cinzel Decorative',serif; font-weight:700; font-size:1.05rem; color:var(--hud-gold); flex:1 1 auto; }
.talent-layout { flex:1 1 auto; min-height:0; display:flex; gap:0; }
.talent-main { flex:1 1 auto; min-width:0; display:flex; align-items:center; justify-content:center; padding:10px; overflow:auto; }
.talent-aside {
  flex:0 0 300px; max-width:42%; overflow-y:auto; padding:14px 16px;
  border-left:1px solid rgba(201,162,74,.2); background:rgba(8,12,22,.45);
}
.hero-modal-card.is-talents .talent-stage { background:none; border:0; width:100%; height:100%; display:flex; align-items:center; justify-content:center; }
.hero-modal-card.is-talents .talent-wings { max-height:82vh; max-width:100%; }
@media (max-width:760px){
  .talent-layout { flex-direction:column; }
  .talent-aside { flex:0 0 auto; max-width:none; border-left:0; border-top:1px solid rgba(201,162,74,.2); }
  .hero-modal-card.is-talents .talent-wings { max-height:54vh; }
}

/* winged SVG talent graph (in-game style) */
.talent-stage {
  border-radius:10px; padding:6px; overflow:auto;
  background:radial-gradient(120% 90% at 50% 60%, rgba(20,32,54,.6), rgba(6,10,20,.85));
  border:1px solid rgba(120,140,180,.2);
}
.talent-wings { width:100%; height:auto; max-height:60vh; display:block; }
.twire { stroke:rgba(120,150,190,.35); stroke-width:2.5; }
.twire.on { stroke:rgba(242,204,106,.85); stroke-width:3; filter:drop-shadow(0 0 3px rgba(242,204,106,.6)); }
.thex { cursor:pointer; }
.thex polygon {
  fill:rgba(14,22,38,.92); stroke:rgba(120,160,210,.45); stroke-width:2; transition:.12s;
}
.thex-t { fill:#9fb0cf; font-family:'Manrope',sans-serif; font-weight:800; font-size:10px; pointer-events:none; }
.thex.is-locked { opacity:.45; cursor:not-allowed; }
.thex.is-locked polygon { stroke:rgba(110,125,150,.35); }
.thex.is-open polygon { stroke:#5fb6e6; filter:drop-shadow(0 0 4px rgba(95,182,230,.5)); }
.thex.is-open .thex-t { fill:#bfe3ff; }
.thex.is-on polygon { fill:rgba(90,68,26,.92); stroke:var(--hud-gold); filter:drop-shadow(0 0 5px rgba(242,204,106,.55)); }
.thex.is-on .thex-t { fill:#fff2cf; }
.thex.is-max polygon { stroke-width:3; filter:drop-shadow(0 0 8px rgba(242,204,106,.85)); }
.thex.is-excl { cursor:not-allowed; }
.thex.is-excl polygon { stroke:rgba(210,110,110,.45); stroke-dasharray:3 3; opacity:.6; }
.thex.is-excl .thex-t { fill:#c98; }
.thex.type-2 polygon { stroke-width:2.5; }        /* classic — exclusive choice */
.thex.type-3 polygon { stroke-dasharray:4 3; }   /* master — exclusive choice */
.thex.is-core polygon { fill:rgba(120,40,120,.5); stroke:#e0a0ff; filter:drop-shadow(0 0 7px rgba(210,130,255,.6)); }
.thex.is-core .thex-t { fill:#fbe6ff; font-size:15px; }
.thex:hover polygon { stroke:#fff; }

.talent-summary { margin-top:12px; padding:10px 12px; border-radius:9px; background:rgba(10,16,30,.6); border:1px solid rgba(201,162,74,.2); }
.talent-summary-head { font-family:'Cinzel',serif; font-weight:700; font-size:.8rem; color:var(--hud-gold-deep); margin-bottom:6px; }
.talent-summary-empty { font-family:'EB Garamond',serif; font-style:italic; font-size:.84rem; color:#8593b0; }
.talent-summary-row { display:flex; justify-content:space-between; gap:10px; padding:2px 0; font-family:'Manrope'; font-size:.8rem; }
.talent-summary-row span { color:#bfc8da; } .talent-summary-row b { color:#7fd0a0; }
@media (max-width:620px){ .tnode{ width:86px; } }

/* ===================== collection tabs (Heroes/Pets/Artifacts) ===================== */
.roster-tabs { flex:0 0 auto; display:flex; gap:4px; padding:0 16px 8px; }
.roster-tab {
  flex:1 1 0; padding:6px 4px; cursor:pointer;
  background:rgba(6,11,22,.6); border:1px solid rgba(201,162,74,.25); border-radius:7px;
  font-family:'Cinzel',serif; font-weight:700; font-size:.72rem; letter-spacing:.03em;
  color:#9fb0cf; transition:all .15s;
}
.roster-tab:hover { color:#e6d3a6; border-color:rgba(201,162,74,.45); }
.roster-tab.is-active {
  background:linear-gradient(180deg, rgba(90,66,26,.6), rgba(40,30,12,.7));
  border-color:var(--hud-gold-deep); color:var(--hud-gold);
}
/* roster slot icon (pets / artifacts) */
.roster-slot-icon {
  width:84%; height:84%; background-size:contain; background-repeat:no-repeat; background-position:center;
  filter:drop-shadow(0 2px 5px rgba(0,0,0,.6));
}

/* large centred icon in the stage for pets / artifacts */
.stage-icon {
  position:absolute; top:50%; left:50%; transform:translate(-50%,-54%);
  width:min(340px,46%); aspect-ratio:1/1;
  background-size:contain; background-repeat:no-repeat; background-position:center;
  filter:drop-shadow(0 14px 36px rgba(0,0,0,.6));
  z-index:2; pointer-events:none;
}

/* pets / artifacts stat readout in the info card */
.collection-stats { display:flex; flex-direction:column; gap:6px; margin-top:6px; }
.coll-note {
  margin:0 0 6px; font-family:'EB Garamond',serif; font-size:.86rem; line-height:1.45;
  color:#c8b88f; font-style:italic;
}
.coll-stat-head {
  margin-top:6px; font-family:'Cinzel',serif; font-weight:700; font-size:.82rem;
  color:var(--hud-gold-deep); border-bottom:1px solid rgba(201,162,74,.22); padding-bottom:3px;
}
.coll-stat {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:3px 2px; font-family:'Manrope',sans-serif; font-size:.86rem;
}
.coll-stat-l { color:#bfc8da; }
.coll-stat-v { color:#f3e6c2; font-weight:700; }

/* hero-only vs collection-item visibility toggles */
body.coll-hero #stage-icon { display:none; }
body.coll-hero #collection-stats { display:none; }
body.coll-item .hero-only { display:none !important; }
body.coll-item #hero-stage { visibility:hidden; }
body.coll-item .stage-loading, body.coll-item .stage-nomodel { display:none !important; }

/* ============================ responsive ============================ */
@media (max-width: 980px) {
  body.heroes-page { overflow:auto; }
  .heroes-screen {
    position:static; display:flex; flex-direction:column;
    min-height:calc(100vh - var(--hud-nav-h)); margin-top:var(--hud-nav-h);
  }
  .roster { order:1; border-right:0; border-bottom:1px solid rgba(201,162,74,.3); }
  .roster-list { grid-template-columns:repeat(auto-fill,minmax(76px,1fr)); max-height:230px; }
  .stage { order:2; height:46vh; min-height:300px; }
  .info { order:3; border-left:0; border-top:1px solid rgba(201,162,74,.3); }
  .hero-use { margin-top:14px; }
}
@media (max-width: 520px) {
  .info-name { font-size:1.4rem; }
  .roster-list { grid-template-columns:repeat(auto-fill,minmax(64px,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .stage-spinner { animation:none; }
}

/* Recommended War Pets (from the client's hero table) — links into /pets/ */
.info-petrec { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:6px 0 4px; }
.info-petrec-lab { flex:0 0 100%; font-family:'IM Fell English SC',serif; font-size:.74rem; letter-spacing:.12em; color:var(--hud-gold-deep); text-transform:uppercase; }
.info-petrec-pet { display:inline-flex; align-items:center; gap:5px; padding:3px 8px 3px 4px; border-radius:8px; border:1px solid rgba(201,162,74,.32); background:rgba(6,11,22,.6); color:var(--hud-ink); font-family:'EB Garamond',serif; font-size:.9rem; text-decoration:none; }
.info-petrec-pet img { width:22px; height:22px; border-radius:6px; }
.info-petrec-pet:hover { border-color:var(--hud-gold); color:var(--hud-gold); }
.info-petrec-occ { flex:0 0 100%; font-family:'Manrope',sans-serif; font-size:.72rem; color:#8593b0; }
