/* guildle's styles, part 6 of 10 (card-pages.css). Face cards and their pages (stats, skills, equipment), and the deck with its tabs.
   The parts load in order (index.html) and later rules build on earlier ones. */

/* ================================================================ face cards and their pages
   A hero is shown by their FACE: all in their rarity's colour, with the class emblem, name and
   title (card.js cardHTML). Inspecting a card adds its PAGES behind it, reached by the tabs beside
   it: Stats, Skills, Equipment and Journal (card.js deckHTML, cardpages.js). The pages keep the
   old card's parchment, rim and header. */

/* ---------------------------------------------------------------- the face */
.card.face {
  display: grid; grid-template-rows: minmax(min-content, 1fr) auto minmax(min-content, 1fr); row-gap: 0;
  justify-items: center; text-align: center; padding: 7% 7% 7.5%; color: #fbf3df;
  border-color: color-mix(in srgb, var(--rc) 55%, #000);
  background:
    radial-gradient(ellipse at 50% 52%, color-mix(in srgb, var(--rc) 70%, #fff) 0%, transparent 58%),
    linear-gradient(160deg, color-mix(in srgb, var(--rc) 88%, #fff) 0%, var(--rc) 45%, color-mix(in srgb, var(--rc) 62%, #000) 100%);
}
.card.face::before {   /* the worn diamond lattice, pale on the colour */
  -webkit-mask-image: none; mask-image: none; opacity: 1;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .12) 0 1px, transparent 1px 30cqw),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .12) 0 1px, transparent 1px 30cqw),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 7.5cqw),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 7.5cqw);
}
.card.face::after {    /* an inner rule, like a printed border */
  content: ""; position: absolute; inset: 3.2cqw; border-radius: 2.2cqw; pointer-events: none; z-index: 0;
  border: .5cqw solid rgba(255, 246, 222, .5); box-shadow: inset 0 0 0 1.2cqw rgba(0, 0, 0, .06);
  background: none; animation: none; mix-blend-mode: normal;
}
.card.common.face { filter: saturate(.8) sepia(.12); }
.card.legendary.face {
  color: #3a2604; border-color: #5e410b;
  background:
    radial-gradient(ellipse at 50% 52%, #fff7d6 0%, transparent 58%),
    linear-gradient(135deg, #8a5d0c 0%, #e9c766 16%, #fff4c8 28%, #c8921c 44%, #f6dc85 60%, #fffbe6 68%, #b9881e 84%, #7a5410 100%);
}
.card.legendary.face::after { border-color: rgba(94, 65, 11, .55); }
.card.face > .sheen { display: none; }
.card.legendary.face > .sheen, .card.epic.face > .sheen {
  display: block; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .6) 45%, transparent 60%) no-repeat;
  background-size: 250% 100%; animation: sheen 4.5s ease-in-out infinite;
}
.card.face .f-num { position: absolute; top: 7.5%; left: 8%; font: 800 max(9px, 4cqw)/1 var(--sans); letter-spacing: .08em; opacity: .75; }
.card.face .f-lvl { position: absolute; top: 5.5%; right: 6.5%; width: 14cqw; aspect-ratio: 1; display: grid; place-items: center; }
.card.face .f-lvl b { position: relative; font: 800 max(11px, 6.4cqw)/1 var(--sans); }
.card.face .f-lvl svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(90deg) scaleX(-1); }
.card.face .f-lvl circle { fill: rgba(0, 0, 0, .14); stroke: rgba(255, 255, 255, .28); stroke-width: 2.4; }
.card.face .f-lvl circle.fill { fill: none; stroke: currentColor; stroke-linecap: round; }
.card.legendary.face .f-lvl circle { fill: rgba(255, 255, 255, .25); stroke: rgba(94, 65, 11, .25); }
.card.legendary.face .f-lvl circle.fill { stroke: #8a5d0c; }
.card.face .f-head { grid-row: 1; padding: 12cqw 2% 0; display: grid; gap: 1.2cqw; align-content: start; align-self: start; position: relative; z-index: 1; }
.card.face h3.c-name.f-name { margin: 0; font: 400 max(22px, 10cqw)/1.02 var(--display); color: inherit; text-shadow: 0 .4cqw 1.2cqw rgba(0, 0, 0, .3); text-wrap: balance; overflow-wrap: anywhere; white-space: normal; }
.card.face h3.c-name.f-name.long { font-size: max(20px, 8.4cqw); }
.card.legendary.face h3.c-name.f-name { text-shadow: 0 .3cqw 0 rgba(255, 246, 210, .7); }
.card.face .f-title { font: italic max(15px, 6.2cqw)/1.15 var(--serif); opacity: .95; text-wrap: balance; }
.card.face .f-title::before, .card.face .f-title::after { content: "\2014"; margin-inline: 2cqw; font-style: normal; opacity: .6; }
/* The emblem sits in the middle row; the rows above and below share the rest equally, so it's
   centred on the card, and a long name or title pushes it down rather than running into it. */
.card.face .f-emblem { grid-row: 2; width: 46%; aspect-ratio: 1; display: grid; place-items: center; margin: 3cqw 0; position: relative; z-index: 1; }
.card.face .f-emblem svg { width: 100%; height: 100%; color: #fbf3df; filter: drop-shadow(0 1.2cqw 1.6cqw rgba(0, 0, 0, .3)); }
.card.legendary.face .f-emblem svg { color: #fffaf0; filter: drop-shadow(0 .8cqw 0 rgba(122, 84, 16, .55)) drop-shadow(0 1.2cqw 2cqw rgba(94, 65, 11, .35)); }
.card.face .f-foot { grid-row: 3; align-self: end; display: grid; gap: 2cqw; justify-items: center; position: relative; z-index: 1; }
.card.face .f-sub { font: 700 max(10px, 3.8cqw)/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.card.face .f-rarity { font: 800 max(8px, 3.4cqw)/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; padding: 1.4cqw 3cqw; border-radius: 5px; background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .3); }
.card.legendary.face .f-rarity { background: rgba(255, 250, 230, .55); border-color: rgba(94, 65, 11, .45); }
.card.face.fallen { filter: grayscale(.85) brightness(.75); }

/* ---------------------------------------------------------------- the pages */
.card.page { display: grid; grid-template-rows: auto auto minmax(0, 1fr); row-gap: 0; padding: 6% 7% 5%; }
.card.page .c-head { padding-bottom: 0; }
.card.page .pg-tab { margin: 2.6cqw 0 2.4cqw; display: flex; align-items: center; gap: 2.4cqw; font: 800 max(9px, 3.4cqw)/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--rc); }
.card.legendary.page .pg-tab { color: #9a6a0e; }
.card.common.page .pg-tab { color: var(--ink-soft); }
.card.page .pg-tab::before, .card.page .pg-tab::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--rc) 45%, transparent); }
.card.page .pg-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 1cqw 1cqw; scrollbar-width: thin; color: var(--ink); }
.pg-none { margin: 0; font: italic max(13px, 4cqw)/1.3 var(--serif); color: var(--ink-soft); }

/* Stats */
.pg-abs { display: grid; gap: 2.8cqw; }
.pg-ab { display: grid; grid-template-columns: 10cqw 1fr 6.5cqw 7cqw; align-items: center; gap: 2.4cqw; font-variant-numeric: tabular-nums; }
.pg-ab .k { font: 800 max(11px, 4.2cqw)/1 var(--sans); letter-spacing: .06em; color: var(--ink-soft); }
.pg-ab.key1 .k, .pg-ab.key2 .k { color: var(--ink); }
.pg-ab.key1 .k { text-decoration: underline .5cqw; text-underline-offset: .8cqw; }
.pg-ab.key2 .k { text-decoration: underline dotted .5cqw; text-underline-offset: .8cqw; }
.pg-ab .bar { height: 3cqw; }
.pg-ab.key1 .bar span:first-child, .pg-ab.key2 .bar span:first-child { background: var(--ink); }
.pg-ab .bar .lboon { background: #4f7fb0 !important; }
.pg-ab .v { font: 800 max(13px, 5.2cqw)/1 var(--sans); text-align: right; }
.pg-ab.max .v { color: var(--rc); }
.pg-ab .m { font: 700 max(10px, 3.6cqw)/1 var(--sans); color: var(--ink-soft); text-align: right; }
.pg-legend { margin-top: 2.6cqw; display: flex; gap: 3cqw; flex-wrap: wrap; font: 600 max(9px, 2.8cqw)/1 var(--sans); color: var(--ink-soft); }
.pg-legend i { display: inline-block; width: 2.4cqw; height: 2.4cqw; border-radius: 1px; margin-right: 1cqw; vertical-align: -.3cqw; }
/* Hit points in a heart, armour class in a shield, then initiative and proficiency in a box; above the abilities. */
.pg-vitals { margin: .6cqw 0 3.6cqw; display: flex; justify-content: space-between; align-items: center; padding: 0 1cqw; }
.pg-vitals .vt { display: grid; justify-items: center; gap: 1.2cqw; }
.pg-vitals .vt.t-name:hover, .pg-mods .box.t-name:hover { text-decoration: none; }
.pg-vitals .sh { position: relative; width: 16cqw; height: 16cqw; display: grid; place-items: center; }
.pg-vitals .sh svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pg-vitals .hp svg { fill: #a8342a; }
.pg-vitals .ac .sh { width: 21cqw; height: 17cqw; }
.pg-vitals .ac svg { fill: var(--ink); }
.pg-vitals .sh b { position: relative; font: 800 max(14px, 5.6cqw)/1 var(--sans); font-variant-numeric: tabular-nums; }
.pg-vitals .hp b { color: #fff6ea; margin-top: -1.4cqw; }
.pg-vitals .ac b { color: #f3e9d6; margin-top: -1.2cqw; }
.pg-vitals .lb { font: 700 max(8px, 2.6cqw)/1 var(--sans); letter-spacing: .08em; white-space: nowrap; text-transform: uppercase; color: var(--ink-soft); }
.pg-mods { margin-top: 3.4cqw; display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; }
.pg-mods .box, .pg-power { border-radius: 5px; background: rgba(43, 33, 24, .06); border: 1px solid rgba(43, 33, 24, .14); padding: 1.8cqw 2.4cqw; display: flex; justify-content: space-between; align-items: center; gap: 1.5cqw; }
.pg-mods .box b, .pg-power b { font: 800 max(13px, 5cqw)/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); }
.pg-power { margin-top: 2.4cqw; }
.pg-mods .lb, .pg-power .lb { font: 700 max(8px, 2.6cqw)/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.pg-power.t-name:hover { text-decoration: none; }
.pg-xp { margin-top: 3.4cqw; display: grid; gap: 1.2cqw; }
.pg-xp > div { height: 2.2cqw; border-radius: 99px; background: rgba(43, 33, 24, .13); overflow: hidden; }
.pg-xp i { display: block; height: 100%; background: var(--rc); border-radius: inherit; }
.card.common .pg-xp i { background: #7d8078; }
.pg-xp > span { font: 700 max(9px, 3cqw)/1 var(--sans); color: var(--ink-soft); display: flex; justify-content: space-between; }

/* Skills */
.pg-sec { font: 800 max(9px, 3cqw)/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 2cqw; }
.pg-tags { display: flex; flex-wrap: wrap; gap: 1.6cqw; margin-bottom: 4cqw; }
.pg-tag { font: 700 max(11px, 3.5cqw)/1 var(--sans); padding: 1.6cqw 2.4cqw; border-radius: 5px; background: rgba(43, 33, 24, .07); border: 1px solid rgba(43, 33, 24, .18); color: var(--ink); cursor: help; }
.pg-tag.spec { border-color: rgba(138, 72, 194, .45); color: #5b2b85; background: rgba(138, 72, 194, .1); }
.pg-tag.role { border-color: color-mix(in srgb, var(--rc) 70%, transparent); background: color-mix(in srgb, var(--rc) 14%, transparent); }
.pg-tag.k-perk { border-color: #a8791e; background: rgba(240, 207, 142, .35); color: #6a4708; }
.pg-tag.k-perk.off { border-style: dashed; background: none; color: var(--ink-soft); }
.pg-feats { display: grid; gap: 2cqw; }
.pg-feat { display: grid; grid-template-columns: 8cqw 1fr; gap: 2.2cqw; align-items: start; }
.pg-feat .ic { width: 8cqw; aspect-ratio: 1; border-radius: 5px; display: grid; place-items: center; background: var(--rc); color: #fff; }
.card.legendary .pg-feat .ic { background: #b9881e; }
.card.common .pg-feat .ic { background: #7d8078; }
.pg-feat .ic svg { width: 58%; height: 58%; }
.pg-feat b { display: block; font: 800 max(12px, 3.9cqw)/1.15 var(--sans); }
.pg-feat b small { font-weight: 600; color: var(--ink-soft); }
.pg-feat p { margin: .6cqw 0 0; font: 400 max(11px, 3.3cqw)/1.3 var(--sans); color: var(--ink-soft); }
.pg-feat.next { opacity: .55; }
.pg-pick { display: inline-block; margin-top: .6cqw; padding: .2cqw 1.4cqw; border-radius: 5px; font: 700 max(9px, 2.6cqw)/1.4 var(--sans);
  letter-spacing: .02em; color: var(--ink-soft); background: color-mix(in srgb, var(--ink-soft) 12%, transparent); }
.pg-pick.scarce { color: #fff; background: #8a5bd6; }
.pg-feat.scarce .ic { box-shadow: 0 0 0 2px #8a5bd6; }
.pg-feat.next .ic { background: none; color: var(--ink-soft); border: 1px dashed rgba(43, 33, 24, .35); }

/* Equipment */
.pg-gear { display: grid; gap: 2.4cqw; }
.pg-item { display: grid; grid-template-columns: 12cqw 1fr auto; gap: 2.6cqw; align-items: center; padding: 2cqw; border-radius: 5px; background: rgba(43, 33, 24, .05); border: 1px solid rgba(43, 33, 24, .14); }
.pg-item .slot { width: 12cqw; aspect-ratio: 1; border-radius: 5px; display: grid; place-items: center; background: #3a2c1e; color: #f4ecda; }
.pg-item .slot svg { width: 62%; height: 62%; }
.pg-item b { display: block; font: 800 max(12px, 4cqw)/1.15 var(--sans); }
.pg-item span { display: block; font: 500 max(10px, 3.2cqw)/1.25 var(--sans); color: var(--ink-soft); }
.pg-item em { font: 800 max(13px, 4.6cqw)/1 var(--sans); font-style: normal; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-item em small { display: block; font: 700 max(8px, 2.6cqw)/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-top: .8cqw; }
.pg-derived { margin-top: 3.4cqw; padding: 2.6cqw 3cqw; border-radius: 5px; background: color-mix(in srgb, var(--rc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent); font: 500 max(11px, 3.2cqw)/1.4 var(--sans); color: var(--ink-soft); }
.pg-derived b { color: var(--ink); }

/* Journal: a notebook's red margin rule down the left */
.card.page[data-page="log"] .pg-body { position: relative; padding-left: 6cqw; }
.card.page[data-page="log"] .pg-body::before { content: ""; position: absolute; left: 2.4cqw; top: 0; bottom: 0; width: 1px; background: rgba(176, 48, 42, .35); }
.journal { display: grid; gap: 4.2cqw; }
.entry { display: grid; gap: .8cqw; }
.entry .when { display: flex; align-items: center; gap: 2cqw; margin-top: 1.4cqw; font: 700 max(11px, 3.2cqw)/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.entry .when::after { content: ""; flex: 1; height: 1px; background: rgba(43, 33, 24, .18); }
.entry p { margin: 0; font: italic max(15.5px, 5cqw)/1.42 var(--serif); color: #2e2418; }
.entry p .dot { display: inline-block; width: max(7px, 2.2cqw); aspect-ratio: 1; border-radius: 50%; background: var(--c, var(--ink-soft)); margin-right: 1.8cqw; vertical-align: .12em; }
.entry .facts { font: 700 max(11px, 3.2cqw)/1.35 var(--sans); color: var(--ink-soft); }
.entry .facts .gain { display: inline-block; font-weight: 800; padding: .5cqw 1.4cqw; border-radius: 5px; border: 1px solid transparent; margin: .4cqw 0; }
.entry .facts .gain.xp { color: #1f6a39; background: rgba(63, 143, 85, .12); border-color: rgba(63, 143, 85, .4); }
.entry .facts .gain.gold { color: #7a520a; background: rgba(210, 154, 18, .14); border-color: rgba(176, 128, 30, .45); }
.entry .facts .gain.lvl, .entry .facts .gain.new { color: #5b2b85; background: rgba(138, 72, 194, .12); border-color: rgba(138, 72, 194, .35); }
.entry .facts .gain.hp { color: #a8342a; background: rgba(176, 48, 42, .08); border-color: rgba(176, 48, 42, .35); }
.entry .facts .gain.loss { color: #a8342a; background: none; border: 0; padding: 0; }
.entry.win { --c: #3f8f55; } .entry.lose, .entry.down { --c: #b0302a; } .entry.hurt { --c: #d0503f; } .entry.up { --c: #8a48c2; } .entry.join { --c: var(--rc); } .entry.rest { --c: #7d8078; }
.journal-end { text-align: center; font: italic max(12px, 3.6cqw)/1 var(--serif); color: var(--ink-soft); opacity: .7; margin-top: 1cqw; }

/* ---------------------------------------------------------------- the deck and its tabs */
.cd-row { display: grid; grid-template-columns: auto auto; gap: 24px; align-items: start; justify-content: center; }
.deck { position: relative; width: min(380px, calc(100vw - 32px - 24px - 72px)); }
.deck > .card { position: absolute; inset: 0 auto auto 0; }
.deck > .card.top { position: relative; }
/* pages waiting behind peek out a little, so you can see there's more to the card */
.deck > .card:not(.top) { pointer-events: none; }   /* peek offsets are set by cardpages.js */
/* Each page is its own layer from the start, drawn once, so turning only moves layers around and
   nothing is redrawn mid-turn (phones stutter and flicker otherwise). The moving shine is left off
   inside an inspected deck: blended, animated layers are what made the pages show through. */
.deck > .card { will-change: transform; }
.deck { touch-action: pan-y; } /* sideways swipes turn pages instead of nudging the page */
.deck > .card.epic > .sheen, .deck > .card.legendary > .sheen { display: none !important; }
.deck > .card.page::after { animation: none !important; display: none; }
/* Closing: the pages behind vanish at once, and the tabs and notes with them. */
.deck.closing > .card:not(.top) { visibility: hidden; }
.card-detail:has(.deck.closing) .cd-tabs, .card-detail:has(.deck.closing) .cd-below { visibility: hidden; }
.cd-tabs { position: relative; z-index: 30; display: grid; gap: 10px; width: 72px; }
.cd-tabs .tab {
  all: unset; box-sizing: border-box; cursor: pointer; width: 72px; aspect-ratio: 1; border-radius: 10px;
  display: grid; place-items: center; align-content: center; gap: 4px;
  background: #f4ecda; color: var(--ink); border: 3px solid rgba(43, 33, 24, .25);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .35); transition: transform .18s ease, border-color .18s, background .18s;
}
.cd-tabs .tab svg { width: 28px; height: 28px; }
.cd-tabs .tab span { font: 800 .68rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
@media (hover: hover) { .cd-tabs .tab:hover { transform: translateX(3px); } }
.cd-tabs .tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.cd-tabs .tab[aria-selected="true"] { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 14%, #f4ecda); transform: translateX(-4px); }
.cd-tabs .tab[aria-selected="true"] span { color: var(--ink); }
.cd-tabs .tab.face-tab { background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), var(--rc); color: #fbf3df; }
.cd-tabs .tab.face-tab span { color: #fbf3df; }
.cd-tabs.legendary .tab.face-tab { background: linear-gradient(135deg, #b9881e, #f6dc85 50%, #b9881e); color: #3a2604; }
.cd-tabs.legendary .tab.face-tab span { color: #3a2604; }
.cd-tabs .tab.face-tab[aria-selected="true"] { border-color: #fbf3df; }
.cd-below { display: grid; gap: 8px; width: min(380px, 100%); justify-self: center; margin-top: 14px; }
.cd-below .card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-below .dice-toggle { margin-left: auto; }
.zoom-inner { width: min(500px, 100%); }
.card-detail { justify-items: center; }
@media (max-width: 480px) {
  .cd-row { gap: 16px; }
  .deck { width: min(380px, calc(100vw - 32px - 16px - 58px)); }
  .cd-tabs { width: 58px; gap: 8px; }
  .cd-tabs .tab { width: 58px; border-radius: 8px; border-width: 2px; }
  .cd-tabs .tab svg { width: 22px; height: 22px; }
  .cd-tabs .tab span { font-size: .6rem; }
}
/* Other players' parties, in the leaderboard: smaller decks side by side. */
.lb-sheet .cd-row { gap: 10px; }
.lb-sheet .deck { width: min(240px, calc(100vw - 80px - 58px)); }
.lb-sheet .cd-tabs { width: 52px; gap: 6px; }
.lb-sheet .cd-tabs .tab { width: 52px; border-width: 2px; border-radius: 8px; }
.lb-sheet .cd-tabs .tab svg { width: 20px; height: 20px; }
.lb-sheet .cd-tabs .tab span { font-size: .48rem; }
@media (prefers-reduced-motion: reduce) { .card.face > .sheen { animation: none !important; } }
/* each deck needs room for its tabs: as many columns as fit */
.lb-sheet #lbp-grid { grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); gap: 22px 14px; }
.lb-sheet #lbp-grid .cd-row { justify-content: start; }
.lb-sheet .slot > .pbadge { right: auto; left: 12px; }

/* ================================================================ Skills, Spellbook and Equipment (card.js) */
/* The page tabs: shorter, so the Spellbook fits. */
.cd-tabs { gap: 6px; }
.cd-tabs .tab { aspect-ratio: auto; height: 46px; gap: 3px; border-radius: 8px; }
.cd-tabs .tab svg { width: 19px; height: 19px; }
.cd-tabs .tab span { font-size: .6rem; }
@media (max-width: 480px) {
  .cd-tabs { gap: 5px; }
  .cd-tabs .tab { height: 40px; }
  .cd-tabs .tab svg { width: 16px; height: 16px; }
  .cd-tabs .tab span { font-size: .46rem; }
}
/* The spellbook. */
.sb-mods { grid-template-columns: repeat(3, 1fr); margin-bottom: 4cqw; }
.sb-mods .box .lb { font-size: max(7px, 2.2cqw); line-height: 1.1; }
.sb-mods .box { padding-inline: 2cqw; gap: 1.5cqw; }
.pg-feat.sb-spell { grid-template-columns: 8cqw 1fr auto; }
.pg-feat.sb-spell em { font: 800 max(12px, 3.9cqw)/1 var(--sans); font-style: normal; text-align: right; color: var(--ink); }
.pg-feat.sb-spell em small { display: block; margin-top: 2px; font: 800 max(8px, 2.3cqw)/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.pg-feats + .pg-sec, .sb-next + .pg-sec { margin-top: 4cqw; }
.sb-next { margin-bottom: 4cqw; }
/* Rolled picks: the ability or spell in its rarity's colour (no label). */
.pg-feat.rolled .ic { background: var(--roll) !important; box-shadow: none; }
.pg-feat.rolled > div > b { color: var(--roll); }
.pg-feat.r-uncommon { --roll: var(--r-uncommon); }
.pg-feat.r-rare { --roll: var(--r-rare); }
.pg-feat.r-epic { --roll: var(--r-epic); }
.pg-feat.r-legendary { --roll: #b8860b; }
.pg-feat.r-common { --roll: #686b64; }
/* Ability and spell pictures: the pixel art itself, framed; a rolled one's frame takes its rarity. */
.pg-feat .ic.pic { background: #1b120a !important; padding: 0; overflow: hidden; border-radius: 5px; box-shadow: 0 0 0 2px rgba(43, 33, 24, .35); }
.pg-feat .ic.pic img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.pg-feat.rolled .ic.pic { box-shadow: 0 0 0 2px var(--roll); }
.pg-feat.next .ic.pic { opacity: .5; filter: grayscale(.6); border: 0; }
/* Equipment: five slots; on your own heroes, tap one to change it (gear.js). */
.eq .eq-slot { box-sizing: border-box; width: 100%; font: inherit; color: inherit; text-align: left; }
button.eq-slot { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; }
.eq .pg-item.eq-slot { display: grid; grid-template-columns: 12cqw minmax(0, 1fr) auto; gap: 2.6cqw; align-items: center; padding: 2cqw; border-radius: 5px; background: rgba(43, 33, 24, .05); border: 1px solid rgba(43, 33, 24, .14); }
.eq.own .eq-slot:hover { filter: brightness(1.03); outline: 1px dashed rgba(107, 79, 42, .5); outline-offset: 1px; }
.eq .eq-slot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.eq .slot.eq-pic { background: #2b2118; display: grid; place-items: center; }
.eq .slot.eq-pic .inv-ic { width: 82%; height: 82%; }
.eq .slot.eq-pic.r-uncommon { box-shadow: 0 0 0 2px var(--r-uncommon); } .eq .slot.eq-pic.r-rare { box-shadow: 0 0 0 2px var(--r-rare); }
.eq .slot.eq-pic.r-epic { box-shadow: 0 0 0 2px var(--r-epic); } .eq .slot.eq-pic.r-legendary { box-shadow: 0 0 0 2px var(--r-legendary); }
.eq .slot.eq-empty { background: transparent !important; color: rgba(43, 33, 24, .35) !important; border: 2px dashed rgba(43, 33, 24, .3); box-sizing: border-box; }
.eq .eq-none { color: var(--ink-soft) !important; font-weight: 700; }
.eq .eq-held { opacity: .6; }
.eq .eq-sec { margin: 2cqw 0 1cqw; }
b.eq-r-uncommon { color: #2f7343; } b.eq-r-rare { color: #2d5aa0; } b.eq-r-epic { color: #7438a8; } b.eq-r-legendary { color: #a87908; }

/* ---- Refined UI (Nov 2026): on a wide screen the card's pages are labelled buttons you can read at a glance,
   and arrows either side of the open card step to the hero before or after it in your collection. */
@media (min-width: 900px) {
  .cd-tabs { width: 140px; gap: 8px; }
  .cd-tabs .tab { display: flex !important; align-items: center; flex-direction: row !important; justify-content: flex-start; gap: 10px; width: 140px; height: 46px; padding: 0 12px; }
  .cd-tabs .tab svg { width: 22px; height: 22px; flex: none; }
  .cd-tabs .tab span { font: 800 .85rem/1 var(--sans); letter-spacing: .04em; }
}
.zoom-step { position: fixed; z-index: 2; top: 50%; width: 52px; height: 52px; margin-top: -26px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--felt-line); background: rgba(var(--panel-rgb), .92); color: var(--text); cursor: pointer; }
.zoom-step:hover { color: var(--gold); border-color: var(--brass-dim); }
.zoom-step svg { width: 22px; height: 22px; }
.zoom-step.prev { left: max(16px, calc(50vw - 440px)); }
.zoom-step.next { right: max(16px, calc(50vw - 440px)); }
.zoom-step[hidden] { display: none; }
@media (max-width: 760px) { .zoom-step { top: auto; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); margin-top: 0; width: 46px; height: 46px; } } /* (above the bar of rooms at the foot of a phone) */

/* A hero's battle record, on their Stats page. */
.pg-rec-h { margin-top: 4cqw; }
.pg-recs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1cqw 5cqw; }
.pg-rec { display: flex; justify-content: space-between; gap: 2cqw; font: 600 max(10px, 3.3cqw)/1.35 var(--sans); color: var(--ink-soft); }
.pg-rec b { color: var(--ink); font-variant-numeric: tabular-nums; }
