/* ============================================================
   Collection screen — "Forged Lantern". Loaded after ui-pvp.css: reuses the
   tab row (.pveHead/.pveTabs/.pveTab, .active styled in ui-pve.css), the
   labelled field (.fld) and — for the detail view — the Battle inspector's own
   chips, attack rows, spell cards and press-and-hold popups (ui-battle.css).
   Cursors: never a bare value (CLAUDE.md §4). No backdrop-filter (scroll
   performance, CLAUDE.md §7).
   ============================================================ */

/* ---------- head ---------- */
.pveHead.collHead{ display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 12px 24px; }
.collHead .pveTab{ white-space: nowrap; }

/* ---------- filters ---------- */
.collFilters{ display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 18px; align-items: center; }
.collFilters .searchBox{ position: relative; flex: 1 1 260px; min-width: 220px; }
.collFilters .searchBox .i{
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px;
  stroke: var(--c-dim); fill: none; stroke-width: 1.8; stroke-linecap: round; pointer-events: none;
}
.collFilters .searchBox input{
  width: 100%; min-height: 44px; padding: 0 14px 0 42px; border-radius: 14px; border: 1px solid var(--c-line);
  background: var(--c-surface); color: var(--c-text); font: 500 1rem var(--f-body);
}
.collFilters .searchBox input:focus{ outline: none; border-color: var(--accent-hi); }
.collFilters .fld{ flex: 0 0 170px; }

/* ---------- grid + cards ---------- */
.cGrid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(clamp(150px, 11.5vw, 190px) / var(--ui-zoom, 1)), 1fr)); gap: 14px; }
button.cCard{
  position: relative; display: block; padding: 0; margin: 0; width: auto; aspect-ratio: 2 / 3; overflow: hidden; text-align: left;
  border: 1px solid var(--c-line); border-radius: 22px; background: #0b0e0c; box-shadow: var(--sh-1); color: var(--c-text);
  text-transform: none; letter-spacing: 0; font: inherit; cursor: var(--cur-click, pointer);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med), box-shadow var(--t-med);
}
button.cCard:hover{ background: #0b0e0c; transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--sh-2); color: var(--c-text); }
.cArt{ display: block; position: absolute; inset: 0; }
/* the card art frame (util/hero-art.js, its crop inside) fills the card */
.cArt .heroCardArt, .cBig .heroCardArt{ position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; transition: transform .5s var(--ease); }
.cArt .heroArtFallback, .cBig .heroArtFallback{ position: absolute; inset: 0; display: grid; place-items: center; font-size: 4rem; }
button.cCard:hover .cArt .heroCardArt{ transform: scale(1.05); }
button.cCard.locked .cArt .heroCardArt, .cBig.locked .heroCardArt{ filter: grayscale(.75) brightness(.6); }
.cCard .lv, .cBig .lv{
  position: absolute; left: 6px; top: 6px; min-width: 26px; height: 26px; padding: 0 6px; font-variant-numeric: tabular-nums; display: grid; place-items: center; border-radius: 999px;
  font: 700 .8rem var(--f-body); font-style: normal; background: hsl(var(--h) 20% 8% / .85); border: 1px solid var(--c-line); color: var(--c-text);
}
.cCard .lk, .cBig .lk{
  position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  font-style: normal; background: hsl(var(--h) 20% 8% / .85); border: 1px solid var(--c-line); color: var(--c-dim);
}
.cCard .lk .i, .cBig .lk .i{ width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cName{
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 2px; padding: 36px 12px 12px; text-align: center;
  background: linear-gradient(180deg, transparent, hsl(var(--h) 25% 4% / .88) 62%);
}
.cName b{ font: 700 1rem/1.15 var(--f-display); text-shadow: 0 2px 10px rgba(0,0,0,.8); overflow-wrap: anywhere; }
.cName small{ color: var(--c-dim); font: 500 .78rem var(--f-body); }

/* ---------- detail ---------- */
button.back{ margin: 6px 0 18px; min-height: 44px; }
button.back .i{ width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-right: 6px; vertical-align: -.2em; }
.cDetail{ display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: clamp(20px, 3vw, 48px); align-items: start; }
.cSide{ position: sticky; top: 96px; display: flex; flex-direction: column; gap: 14px; }
.cBig{
  position: relative; display: block; padding: 0; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 28px;
  border: 1px solid var(--c-line); box-shadow: var(--sh-2); background: #0b0e0c; text-transform: none; letter-spacing: 0;
}
button.cBig{ cursor: var(--cur-click, pointer); }
button.cBig:hover{ background: #0b0e0c; }
.cBig .lv{ left: 14px; top: 14px; height: 34px; min-width: 34px; font-size: .95rem; }
.cTags{ display: flex; gap: 8px; flex-wrap: wrap; }
.cTags .chip, .cList .chip{
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 999px; font: 600 .82rem var(--f-body); color: var(--c-text);
  background: hsl(var(--h) 20% 14% / .9); border: 1px solid var(--c-line);
}
.cMain{ display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cHead{ display: flex; gap: 18px; align-items: flex-start; border: 0; margin: 0; padding: 0; }
.cHead h2{ margin: 0 0 6px; font: 700 clamp(1.8rem, 3vw, 2.6rem)/1.05 var(--f-display); color: var(--c-text); }
.cHead p{ margin: 0; color: var(--c-dim); font: 500 1rem/1.5 var(--f-body); max-width: 70ch; }
.cPortrait{ display: none; flex: none; width: 88px; height: 88px; padding: 0; overflow: hidden; border-radius: 50%; border: 3px solid hsl(var(--h) 42% 56%); background: #111; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
button.cPortrait{ cursor: var(--cur-click, pointer); }
button.cPortrait:hover{ background: #111; }
.cPortrait .heroPortrait{ width: 100%; height: 100%; display: block; border-radius: 0; box-shadow: none; }
.tagsInline{ display: none; margin-top: 10px; }
.preview{ margin: 0; padding: 10px 14px; border-radius: 14px; border: 1px dashed var(--c-line); }
.cPanel{
  padding: 18px 20px; border-radius: 24px; border: 1px solid var(--c-line); box-shadow: var(--sh-1);
  background-image: var(--grain), var(--glass-bg); background-color: hsl(var(--h) 16% 8% / .82);
}
.cPanel h3{ margin: 0 0 12px; font: 700 .78rem var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-hi); }
.cPanel .lore{ margin: 0; font: italic 500 .98rem/1.6 var(--f-body); color: var(--c-dim); max-width: 75ch; }
.cPanel p{ margin: 0 0 12px; } .cPanel p:last-child{ margin-bottom: 0; }
.cPanel.soon{ color: var(--c-dim); }
.cPanel .inspSec{ margin: 0 0 10px; } .cPanel .inspSec:last-child{ margin: 0; }
.cPanel .inspSp{ display: flex; flex-wrap: wrap; gap: 8px; }
.cList{ display: flex; flex-wrap: wrap; gap: 8px; }
.buddies{ margin: 6px 0 0; padding-left: 20px; }

/* attack profile: the Battle inspector's rows as tiles */
.cPanel .attrBox{ display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; border: 0; padding: 0; background: none; }
.cPanel .attrRow{
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; padding: 10px 14px; border: 1px solid var(--c-line); border-radius: 16px;
  background: hsl(var(--h) 18% 12% / .8); font: 600 .72rem var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--c-dim);
}
.cPanel .attrRow b{ font: 700 1rem var(--f-display); letter-spacing: 0; text-transform: none; color: var(--c-text); text-align: left; }

.xp{ height: 10px; border-radius: 99px; background: hsl(var(--h) 16% 14%); overflow: hidden; margin-bottom: 8px; }
.xp i{ display: block; height: 100%; background: var(--accent); }

.stats{ display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.stats span{ padding: 10px 12px; border-radius: 16px; background: hsl(var(--h) 18% 12% / .8); border: 1px solid var(--c-line); min-width: 0; }
.stats small{ display: flex; align-items: center; gap: 6px; color: var(--c-dim); font: 600 .7rem var(--f-body); letter-spacing: .05em; text-transform: uppercase; }
.stats .si{ font-style: normal; font-size: .95rem; line-height: 1; flex: none; }
.stats .si .flask{ width: 1.05em; height: 1.05em; display: block; }
.stats b{ font: 700 1.3rem var(--f-display); color: var(--c-text); }

/* spells: the inspector's cards, three to a row */
.cSpells{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; padding: 8px 6px 6px; }
.cSpells .spellCard.inspCard{ height: auto; min-height: 76px; }
.cSpells .spellCard.inspCard .sc-title{ font-size: .98rem; gap: 8px; white-space: nowrap; line-height: 1.2; overflow: hidden; }
.cSpells .spellCard.inspCard .sc-body{ padding: 10px 14px; }
.cSpells .spellCard.inspCard:hover{ transform: translateY(-3px); }
.holdHint{ margin: 10px 0 0; font: 400 .76rem/1.45 var(--f-body); color: var(--c-dim); opacity: .8; }

/* progression */
.cMain > button.ghost{ align-self: flex-start; }
.prog{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pRow{ display: flex; gap: 14px; align-items: flex-start; padding: 10px 12px; border-radius: 18px; border: 1px solid var(--c-line); background: hsl(var(--h) 18% 12% / .6); }
.pRow.now{ border-color: hsl(var(--h) 45% 64% / .6); background: hsl(var(--h) 30% 92% / .08); }
.pLvl{ flex: 0 0 84px; display: flex; flex-direction: column; gap: 2px; font: 700 1.05rem var(--f-display); color: var(--accent-hi); padding-top: 5px; }
.pLvl em{ font: 600 .68rem var(--f-body); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--c-dim); }
.pCh{ display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.pNone{ color: var(--c-dim); padding-top: 6px; }
.pChip{
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--c-line);
  background: hsl(var(--h) 20% 14% / .9); font: 600 .86rem var(--f-body); color: var(--c-text);
}
.pChip small{ color: var(--c-dim); font: 600 .72rem var(--f-body); letter-spacing: .04em; text-transform: uppercase; }
.pChip i{ font-style: normal; color: var(--c-dim); } .pChip b{ color: var(--accent-hi); font-weight: 700; }
.pChip.unlock{ border-color: hsl(var(--h) 45% 64% / .5); color: var(--accent-hi); }
.pChip.base b{ color: var(--c-text); }

/* ---------- tablet portrait: 4 heroes per row ---------- */
@media (min-width: 601px) and (max-width: 900px){
  .cGrid{ grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .cName b{ font-size: .92rem; }
  .cPanel.attackPanel, .cPanel.spellsPanel, .cPanel.statsPanel{ background: none; border: 0; box-shadow: none; padding: 0; }
  .cPanel .attrBox{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cSpells{ padding: 8px 0 0; }
}
/* ---------- portrait devices: round portrait leads, tap = full-body art ---------- */
@media (max-width: 900px){
  .collFilters .searchBox{ flex: 1 1 100%; }
  .collFilters .fld{ flex: 1 1 calc(50% - 6px); min-width: 0; }
  .cGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cName b{ font-size: .88rem; }
  .cDetail{ grid-template-columns: 1fr; }
  .cSide{ display: none; }
  .cPortrait{ display: block; }
  .tagsInline{ display: flex; }
  .cHead h2{ font-size: 1.7rem; }
  .cSpells{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cSpells .spellCard.inspCard .sc-title{ font-size: .8rem; gap: 5px; }
}
@media (min-width: 601px) and (max-width: 900px){ .cGrid{ grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px){
  .cPanel.attackPanel, .cPanel.spellsPanel, .cPanel.statsPanel{ background: none; border: 0; box-shadow: none; padding: 0; }
  .cPanel .attrBox{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cPanel .attrRow{ padding: 9px 12px; }
  .cPanel.statsPanel .stats{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cPanel.statsPanel .stats span{ padding: 8px; border-radius: 14px; }
  .cPanel.statsPanel .stats small{ font-size: .6rem; gap: 4px; letter-spacing: .02em; align-items: flex-start; line-height: 1.15; overflow-wrap: anywhere; }
  .cPanel.statsPanel .stats .si{ font-size: .8rem; }
  .cPanel.statsPanel .stats b{ font-size: 1.1rem; }
  .cSpells{ gap: 14px 8px; padding: 8px 0 0; }
  .cSpells .spellCard.inspCard{ min-height: 68px; border-radius: 16px; }
  .cSpells .spellCard.inspCard .sc-body{ padding: 9px 8px; }
  .cSpells .spellCard.inspCard .sc-title{ font-size: .78rem; gap: 4px; padding-right: 6px; }
  .pRow{ flex-direction: column; gap: 6px; }
  .pLvl{ flex: none; flex-direction: row; align-items: baseline; gap: 8px; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce){ button.cCard, .cArt .heroCardArt, .cBig .heroCardArt{ transition: none; } }

/* the detail <header> inherits the global header rule (wrap, baseline): keep portrait + text on one row */
.cHead{ flex-wrap: nowrap; align-items: flex-start; }
.cHead > div{ min-width: 0; flex: 1 1 0; }
@media (max-width: 600px){
  .collHead .pveTabs{ max-width: 100%; }
  .collHead .pveTab{ padding: 0 12px; font-size: .88rem; }
}
