/* =====================================================================================================
   herosheet.css - W126: THE FOUR-TAB HERO SHEET (STATS / INFO / TALENTS / STORY; goons and villains get STATS / STORY).
   public/js/sheet.js keeps three attributes on #detailCard: data-sheet4 (hero | leader | goon | villain), data-sheet-tab (stats | info | talents | story |
   an extra tab's id) and data-sheet-sub (story | action, the mini tab inside STORY). What shows is decided HERE. The card keeps its one scroll; nothing in this
   file is fixed to the window, so on a wide screen the sheet stays in the 460 px play column (widescreen.css).
   Colours and type are the sheet's own (ceremony.css .ccTab / .ccTile, the LEVEL UP block's hlv* chips); this file adds the new blocks (hs*).
   ===================================================================================================== */

/* ------------------------------------------------------------------ what each tab shows */
#detailCard[data-sheet4] #detailBio, #detailCard[data-sheet4] #detailLore { display: none; }
#detailCard[data-sheet4][data-sheet-tab="story"]:not([data-sheet-sub="action"]) #detailBio,
#detailCard[data-sheet4][data-sheet-tab="story"]:not([data-sheet-sub="action"]) #detailLore { display: block; }
#detailCard[data-sheet4]:not([data-sheet-tab="stats"]) :is(#detailStats, #detailAbil, #detailLv, #detailLvTable) { display: none; }
#detailCard[data-sheet4][data-sheet-tab="stats"] #detailTabBody { display: none; }
#detailCard[data-sheet4]:not([data-sheet-tab="story"]) #detailClaim { display: none; }
#detailCard[data-sheet4] .detStarNote { display: none; }              /* the rarity sentence lives on INFO now */
#detailTabBody:empty, #detailSub[hidden], #detailLvTable[hidden] { display: none; }
#detailStats[hidden], #detailTabBody[hidden] { display: none; }
#detailCard[data-sheet4] #detailBio { margin-bottom: 8px; }
#detailCard[data-sheet4] #detailLore { margin-bottom: 8px; }

/* ------------------------------------------------------------------ the bars: four tabs, then the mini tabs under STORY */
#detailCard[data-sheet4] #detailTabs { gap: 4px; margin: 6px 0 8px; }
#detailCard[data-sheet4] #detailTabs .ccTab { padding: 5px 2px; font-size: 15px; letter-spacing: .6px; max-width: 96px; min-width: 0; }
#detailCard[data-sheet4="goon"] #detailTabs .ccTab, #detailCard[data-sheet4="villain"] #detailTabs .ccTab { max-width: 116px; font-size: 16px; }
#detailCard[data-sheet4] #detailTabs .ccTab:focus-visible, #detailSub .ccTab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ccSubTabs { margin: 0 0 8px; gap: 6px; }
#detailSub .ccTab { min-height: 36px; font-size: 14px; max-width: 128px; padding: 3px 8px; border-radius: 9px; }   /* W340 E-022: 36 + the 4 px band above and below = a 44 px touch area (was 32 = 40) */

/* ------------------------------------------------------------------ STATS */
#detailStats { margin: 4px 0 8px; }
.ccHear { display: flex; justify-content: center; margin: 0 0 8px; }
.ccHearBtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 5px 20px; font-size: 17px; }   /* W340 E-022: 44 (was 40) */
.ccHearBtn .ci { width: 22px; height: 22px; flex: 0 0 22px; }
#detailCard[data-sheet4] #detailAbil { margin: 6px 0 8px; }
/* W426: LARGE includes the ability and mechanic, not only the stat tiles beside them. */
html[data-text="large"] #detailCard[data-sheet4] #detailAbil { font-size: 15px; }
#detailCard[data-sheet4] #detailLv { margin: 8px 0; }

.hsSec { margin: 8px 0; padding: 8px 10px 9px; border-radius: 12px; background: #1a1333; box-shadow: inset 0 0 0 2px #3a2f6b; text-align: left; min-width: 0; }
.hsH { font-family: 'Bangers', cursive; font-weight: 400; font-size: 15px; letter-spacing: 1.2px; color: #ffd23f; line-height: 1.1; margin: 0 0 6px; }
.hsNote { margin-top: 6px; font-size: 11px; font-weight: 700; line-height: 1.4; color: #bdb4dd; overflow-wrap: anywhere; }
.hsBig { font-size: 12.5px; line-height: 1.45; color: #e3ddf5; font-weight: 700; }
.hsSoon { text-align: center; font-family: 'Bangers', cursive; font-size: 18px; letter-spacing: 1.2px; color: #8d84b4; }

/* WHAT EACH LEVEL GIVES */
.hsLvList { display: flex; flex-direction: column; gap: 3px; }
.hsLvRow { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "lv cost" "lv gain"; align-items: center; gap: 1px 8px; padding: 4px 8px; border-radius: 8px; background: #241b44; font-size: 11px; font-weight: 800; color: #d8d2ea; position: relative; }
.hsLvRow .lv { grid-area: lv; font-family: 'Bangers', cursive; font-weight: 400; font-size: 16px; letter-spacing: .8px; color: #ffd23f; }
.hsLvRow .cost { grid-area: cost; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; color: #fff8e7; }
.hsLvRow .cost .ci { width: 15px; height: 15px; flex: 0 0 15px; }
.hsLvRow .cost .ci + * { margin-left: 0; }
.hsLvRow .gain { grid-area: gain; min-width: 0; color: #74c0fc; line-height: 1.3; }
.hsLvRow .gain i { font-style: normal; color: #9be15d; }
.hsLvRow .tag { position: absolute; right: 6px; top: -6px; padding: 0 6px; border-radius: 999px; background: #ffd23f; color: #1b1430; font-style: normal; font-size: 9px; font-weight: 900; letter-spacing: .6px; line-height: 14px; }
.hsLvRow.done { opacity: .6; }
.hsLvRow.now { opacity: 1; box-shadow: inset 0 0 0 2px #6b5fa8; }
.hsLvRow.next { opacity: 1; box-shadow: inset 0 0 0 2px #ffd23f; background: #2d2352; }
.hsLvT[data-lm-progression] .hsLvRow.done { opacity: 1; }
.hsLvT[data-lm-progression] .hsLvRow .gain i { display: block; font-size: 11px; line-height: 1.35; }
.hsLevelPager { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 5px 0 8px; }
.hsLevelPageBtn { min-width: 66px; min-height: 44px; padding: 0 8px; font-size: 11px; font-weight: 900; }
.hsLevelPageRange { min-width: 0; color: #d8d2ea; font-size: 10px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.hsLvRow .cost[data-lm-cost-kind="account-quote-only"] { display: block; white-space: normal; color: #d8d0fa; font-size: 11px; line-height: 1.25; }
.hsLvRow .cost[data-lm-cost-kind="cap"] { color: #9be15d; font-weight: 900; }
.hsLeaderMasteryInfo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hsLeaderMasteryInfo .hsCell { min-height: 68px; padding: 5px 4px; overflow: visible; }
.hsLeaderMasteryInfo .hsCell .c { display: block; white-space: normal; font-size: 11px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 360px) { .hsLevelPageRange { font-size: 9px; } .hsLevelPageBtn { min-width: 58px; padding: 0 5px; } }

/* ------------------------------------------------------------------ INFO */
.hsRow { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px; align-items: start; padding: 5px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.hsRow:first-child { border-top: 0; padding-top: 0; }
.hsRow .k { padding-top: 3px; font-size: 9.5px; font-weight: 900; letter-spacing: .8px; color: #ff922b; }
.hsRow .vb { min-width: 0; }
.hsRow .v { display: block; min-width: 0; font-family: 'Bangers', cursive; font-weight: 400; font-size: 16px; letter-spacing: .8px; line-height: 1.15; color: #74c0fc; overflow-wrap: anywhere; }
.hsRow .s { display: block; margin-top: 2px; font-family: 'Nunito', system-ui, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0; line-height: 1.35; color: #d8d2ea; }
.hsRead { margin: 0 0 4px; }
.hsRT .n { font-size: 21px; }
.hsRank { text-align: center; margin: 6px 0 0; font-size: 11px; font-weight: 800; color: #d8d2ea; }
.hsRank .rp { display: inline-block; margin: 0 5px; }
.hsRank .rp i { font-style: normal; font-weight: 900; letter-spacing: .5px; color: #ff922b; margin-right: 4px; }
.hsRank .rp b { color: #74c0fc; font-weight: 900; }
.hsPick { margin: 9px 0 2px; }
.hsPick .pl { display: block; margin: 0 0 3px; font-size: 9.5px; font-weight: 900; letter-spacing: .8px; color: #ff922b; }
.hsPick .pc { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.hsPickLv .pc { gap: 8px; }
.hsPickRank .ccRankBtn { width: 29px; height: 31px; }
.hsPickPu .ccStepBtn { min-width: 44px; }
.hsStep { min-width: 40px; min-height: 36px; padding: 0 10px; font-size: 18px; line-height: 1; }
.hsStep:disabled { opacity: .4; }
.hsLvVal { min-width: 96px; text-align: center; font-family: 'Bangers', cursive; font-weight: 400; font-size: 18px; letter-spacing: .8px; color: #fff8e7; }
.hsGain { margin: 4px 0 0; font-size: 10.5px; font-weight: 700; line-height: 1.4; color: #bdb4dd; overflow-wrap: anywhere; }
.hsGain.hi { color: #9be15d; font-weight: 800; margin-top: 2px; }
.hsTbl { display: grid; gap: 4px; }
.hsT5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hsT4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hsCell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 42px; padding: 3px 1px 4px; border-radius: 8px; cursor: pointer;
  background: #241b44; color: #cfc7ee; border: 2px solid #3a3357; overflow: hidden; }
.hsCell .a { font-size: 8.5px; font-weight: 900; letter-spacing: .4px; color: #ff922b; white-space: nowrap; }
.hsCell .b { font-family: 'Bangers', cursive; font-weight: 400; font-size: 14px; letter-spacing: .5px; line-height: 1.1; color: #74c0fc; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hsCell .c .ci { width: 9px; height: 9px; vertical-align: -1px; margin-right: 1px; }
.hsCell .c { font-size: 8.5px; font-weight: 800; letter-spacing: .2px; color: #9d95bd; white-space: nowrap; }
.hsT4 .hsCell { border-bottom: 4px solid var(--rk, #3a3357); }
.hsCell.on { background: #2d2352; border-color: #ffd23f; }
.hsCell:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }

/* ------------------------------------------------------------------ TALENTS */
.hsSlots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 8px; }
.hsSlot { appearance: none; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 84px; padding: 8px 6px; border-radius: 12px;
  background: repeating-linear-gradient(135deg, #1f1840 0 8px, #241b48 8px 16px); border: 3px dashed #4a3f7c; color: #8d84b4; text-align: center; }
.hsSlot:active { transform: translateY(1px); }
.hsSlot:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.hsStatus.pulse { animation: hsPulse 420ms ease-out 1; }
html[data-anim="none"] .hsStatus.pulse { animation: none; }
@keyframes hsPulse { 0% { color: #ffd23f; } 100% { color: #e3ddf5; } }
.hsGrey { color: #8d84b4; text-align: center; }
.hsSlot .sl .ci { width: 26px; height: 26px; opacity: .8; }
.hsSlot .sn { font-family: 'Bangers', cursive; font-weight: 400; font-size: 16px; letter-spacing: 1px; color: #b6add8; }
.hsSlot .sc { padding: 1px 9px; border-radius: 999px; background: #3a2f6b; color: #ffd23f; font-size: 9.5px; font-weight: 900; letter-spacing: .8px; }
.hsSkill { padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.hsSkill:first-of-type { border-top: 0; }
.hsSkill .st { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hsSkill .sn { font-family: 'Bangers', cursive; font-weight: 400; font-size: 16px; letter-spacing: 1px; color: #74c0fc; }
.hsSkill .sp { color: #9be15d; letter-spacing: 4px; font-size: 13px; white-space: nowrap; }
.hsSkill .sp i { font-style: normal; color: #6b6a86; }
.hsSkill .sp i.on { color: #9be15d; }
.hsSkill .sd { margin-top: 2px; font-size: 11px; font-weight: 800; color: #d8d2ea; }
.hsFoot { margin-top: 8px; font-size: 11px; font-weight: 900; letter-spacing: .5px; color: #ffd23f; }

/* ------------------------------------------------------------------ STORY extras */
.hsTeam { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 5px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.hsTeam:first-of-type { border-top: 0; }
.hsTeam .tn { font-family: 'Bangers', cursive; font-weight: 400; font-size: 15px; letter-spacing: .8px; color: #ffd23f; }
.hsTeam .tw { font-size: 11px; font-weight: 800; color: #d8d2ea; min-width: 0; overflow-wrap: anywhere; }
.hsTeam:not(.got) .tn { color: #8d84b4; }
.hsTeam:not(.got) .tw { color: #9d95bd; }

/* ------------------------------------------------------------------ IN ACTION */
.hsActStage { position: relative; height: 164px; border-radius: 12px; overflow: hidden; border: 3px solid #1b1430; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06);
  background: radial-gradient(ellipse 60% 90% at 50% 0%, rgba(177, 151, 252, .3) 0%, transparent 72%), linear-gradient(180deg, #241a47 0%, #150f2c 70%, #0f0a20 100%); }
/* the sheet sizes every canvas in the card to its portrait box (96 px, 52 px on a short phone); this one fills its stage */
#detailOv #detailCard .hsActStage canvas.hsActCv { display: block; width: 100%; height: 100%; }
.hsActCap { margin-top: 6px; text-align: center; font-family: 'Bangers', cursive; font-weight: 400; font-size: 17px; letter-spacing: 1.1px; color: #ffd23f; min-height: 20px; overflow-wrap: anywhere; }
@media (max-height: 700px) { .hsActStage { height: 132px; } }

/* a held-still sheet under REDUCE MOTION (the tab change itself uses motion.css's own tokens) */
html[data-anim="none"] .hsCell, html[data-anim="none"] .hsLvRow { transition: none; }
