/* Game District shop: the Sets view (hub-setbrowser.js) and the set page (#hubSetDetail). */

/* ---------------------------------------------------------------- the view switch (All goods | Sets) */
.hub-shop-viewbar { display: flex; align-items: center; justify-content: flex-start; margin: 2px 0 14px; }
.hub-shop-viewbar:empty { display: none; }
.hub-shop-views { padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); flex-wrap: nowrap; }
.hub-shop-views button { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; min-height: 40px; padding: 6px 16px; font-weight: 900; }
.hub-shop-views .hub-chip-n { opacity: .75; font-size: .76rem; }
/* the Sets view hides the storefront and the goods market; the showcase stays on top */
#dashboardShopPanel.is-sets-view #hubShopFront,
#dashboardShopPanel.is-sets-view .dashboard-shop-market { display: none !important; }
.hub-setbrowser[hidden] { display: none !important; }

/* ---------------------------------------------------------------- toolbar */
.hub-sb-toolbar { display: grid; gap: 12px; padding: 16px; margin-bottom: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.hub-sb-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hub-sb-head h3 { font-family: var(--font-display); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.1; margin: 2px 0 4px; }
.hub-sb-head p { color: var(--muted); font-size: .9rem; max-width: 62ch; }
.hub-sb-count { font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hub-sb-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.hub-sb-search { position: relative; display: block; min-width: 0; }
.hub-sb-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.hub-sb-search input, body.hub-page #hubSbSearch { width: 100%; min-height: 42px; padding-left: 38px; }
.hub-sb-morebtn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; }
.hub-sb-morebtn:hover, .hub-sb-morebtn[aria-expanded="true"] { border-color: var(--gold); }
.hub-sb-morebtn b { min-width: 1.4em; text-align: center; border-radius: 999px; background: var(--gold); color: var(--on-gold); font-size: .74rem; padding: 0 5px; }
.hub-sb-morebtn b:empty { display: none; }
.hub-sb-cols { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.hub-sb-chip { display: inline-flex; align-items: center; gap: 5px; }
.hub-sb-more { grid-column: 1 / -1; display: none; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; padding-top: 4px; }
.hub-sb-more.is-open { display: grid; }
.hub-sb-field { display: grid; gap: 4px; font-size: .78rem; font-weight: 800; color: var(--muted); min-width: 0; }
.hub-sb-field select { min-height: 40px; width: 100%; }
.hub-sb-own { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- grid + cards */
.hub-sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.hub-sb-card {
    --rar: var(--rar-common); position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: 18px; overflow: hidden;
    background: var(--surface); border: 1px solid color-mix(in srgb, var(--rar) 40%, var(--line-2)); box-shadow: var(--shadow-sm);
    content-visibility: auto; contain-intrinsic-size: auto 380px; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.hub-sb-card.dashboard-rarity--uncommon { --rar: var(--rar-uncommon); }
.hub-sb-card.dashboard-rarity--rare { --rar: var(--rar-rare); }
.hub-sb-card.dashboard-rarity--epic { --rar: var(--rar-epic); }
.hub-sb-card.dashboard-rarity--legendary { --rar: var(--rar-legendary); }
.hub-sb-card.dashboard-rarity--mythic { --rar: var(--rar-mythic); }
.hub-sb-card:hover { transform: translateY(-2px); box-shadow: 5px 5px 0 color-mix(in srgb, var(--rar) 55%, transparent); border-color: var(--rar); }
.hub-sb-card.is-complete { border-color: color-mix(in srgb, var(--green) 60%, var(--line-2)); }
.hub-sb-open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.hub-sb-open:focus-visible { outline: 3px solid var(--focus, var(--gold)); outline-offset: -3px; }
.hub-sb-art {
    display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: hidden;
    background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--sb-c, var(--rar)) 30%, transparent), transparent 70%), linear-gradient(180deg, var(--surface-2), var(--surface-3, var(--surface-2)));
}
.hub-sb-art > * { width: 100%; height: 100%; }
.hub-sb-ph { display: grid; place-items: center; font-size: 2.4rem; color: color-mix(in srgb, var(--sb-c, var(--muted)) 70%, transparent); }
.hub-sb-look { display: block; }
.hub-sb-look img, .hub-sb-look svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.hub-sb-mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; padding: 12px; box-sizing: border-box; }
.hub-sb-mosaic.is-n1, .hub-sb-mosaic.is-n2 { grid-template-rows: 1fr; }
.hub-sb-mosaic.is-n1 { grid-template-columns: 1fr; }
.hub-sb-mosaic.is-n2 { align-content: center; }
.hub-sb-mosaic.is-n2 > * { aspect-ratio: 1; }
.hub-sb-mosaic.is-n3 > :first-child { grid-row: span 2; }
.hub-sb-cell { display: grid; place-items: center; min-width: 0; min-height: 0; border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .14); }
.hub-sb-cell > * { width: 100%; height: 100%; max-width: 100%; max-height: 100%; }
.hub-sb-ribbon { position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 900; background: rgba(10, 6, 28, .78); color: #f6efe0; border: 1px solid rgba(255, 255, 255, .16); }
.hub-sb-badge { position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.hub-sb-badge.is-new { background: var(--magenta, #ff4fa3); color: #fff; box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.hub-sb-badge.is-done { background: var(--green); color: #08200f; }
.hub-sb-body { display: grid; align-content: start; gap: 6px; padding: 12px 14px 14px; min-width: 0; }
.hub-sb-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.hub-sb-col { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--sb-c, var(--muted)); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
:root[data-theme="day"] .hub-sb-col, :root[data-theme="contrast"] .hub-sb-col { color: var(--text); }
.hub-sb-name { font-family: var(--font-display); font-size: 1.06rem; line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
.hub-sb-bonus { color: var(--muted); font-size: .8rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hub-sb-dyn { display: grid; gap: 8px; margin-top: auto; padding-top: 4px; }
.hub-sb-prog { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.hub-sb-prog small { color: var(--muted); font-size: .74rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hub-sb-bar { display: block; height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.hub-sb-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal, var(--cyan)), var(--gold)); }
.hub-sb-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hub-sb-price { display: grid; gap: 1px; min-width: 0; }
.hub-sb-price small { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.hub-sb-price.is-done { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 900; font-size: .86rem; }
.hub-sb-dio { flex: 0 0 auto; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 1.05rem; }
.hub-sb-dio:hover, .hub-sb-dio:focus-visible { border-color: var(--gold); color: var(--gold); }
.hub-sb-empty { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 28px; }

/* ---------------------------------------------------------------- set page */
.hub-sd-modal { z-index: 195; }
.hub-sd { width: min(1120px, 100%); padding: 0; overflow: auto; overscroll-behavior: contain; }
.hub-sd-close { position: absolute; right: 12px; top: 12px; z-index: 3; }
.hub-sd-top { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 0; border-bottom: 1px solid var(--line); }
.hub-sd-art {
    position: relative; display: grid; place-items: center; min-height: 340px; padding: 16px;
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--sb-c, var(--gold)) 32%, transparent), transparent 70%), linear-gradient(180deg, var(--surface-2), var(--surface));
}
.hub-sd-stage { width: 100%; max-width: 340px; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; border-radius: 16px; }
.hub-sd-stage > *, .hub-sd-stage img, .hub-sd-stage svg { width: 100%; height: 100%; display: block; }
.hub-sd-stage.is-mosaic .hub-sb-mosaic { width: 100%; height: 100%; }
.hub-sd-tools { position: absolute; left: 10px; right: 10px; bottom: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hub-sd-tools:empty { display: none; }
.hub-sd-tools .hub-stage-btn { white-space: nowrap; }
.hub-sd-info { display: grid; align-content: start; gap: 10px; padding: 24px 64px 20px 24px; min-width: 0; }
.hub-sd-info h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.08; margin: 0; overflow-wrap: anywhere; }
.hub-sd-info .hub-item-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hub-sd-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.hub-sd-bonus { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.hub-sd-bonus strong { color: var(--text); margin-right: 4px; }
.hub-sd-list { padding: 16px 20px 22px; display: grid; gap: 10px; }
.hub-sd-subhead { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 0; }
.hub-sd-subhead span { padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: .72rem; }
.hub-sd-pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.hub-sd-piece {
    --rar: var(--rar-common); display: grid; grid-template-rows: auto auto auto auto; justify-items: center; gap: 4px; padding: 10px 8px; min-width: 0;
    border-radius: 14px; border: 1px solid color-mix(in srgb, var(--rar) 40%, var(--line-2)); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; text-align: center;
}
.hub-sd-piece.dashboard-rarity--uncommon { --rar: var(--rar-uncommon); }
.hub-sd-piece.dashboard-rarity--rare { --rar: var(--rar-rare); }
.hub-sd-piece.dashboard-rarity--epic { --rar: var(--rar-epic); }
.hub-sd-piece.dashboard-rarity--legendary { --rar: var(--rar-legendary); }
.hub-sd-piece.dashboard-rarity--mythic { --rar: var(--rar-mythic); }
.hub-sd-piece:hover, .hub-sd-piece:focus-visible { border-color: var(--rar); box-shadow: 3px 3px 0 color-mix(in srgb, var(--rar) 50%, transparent); }
.hub-sd-piece.is-owned { background: color-mix(in srgb, var(--green) 9%, var(--surface-2)); }
.hub-sd-piece-art { width: 84px; height: 84px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; }
.hub-sd-piece-name { font-weight: 800; font-size: .84rem; line-height: 1.2; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hub-sd-piece-meta { color: var(--muted); font-size: .72rem; }
.hub-sd-piece-own { color: var(--green); font-size: .76rem; font-weight: 900; }

/* ---------------------------------------------------------------- narrow screens and phones */
@media (max-width: 860px) {
    .hub-sd-top { grid-template-columns: 1fr; }
    .hub-sd-art { min-height: 0; padding: 14px 14px 64px; }
    .hub-sd-stage { max-width: 260px; }
    .hub-sd-info { padding: 16px; }
    .hub-sb-more { grid-template-columns: 1fr 1fr; }
    .hub-sb-own { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .hub-sb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
.hub-phone .hub-shop-viewbar { margin-bottom: 10px; }
.hub-phone .hub-shop-views { width: 100%; }
.hub-phone .hub-shop-views button { flex: 1 1 0; justify-content: center; min-height: 46px; padding: 6px 10px; }
.hub-phone .hub-sb-toolbar { padding: 12px; gap: 10px; border-radius: 16px; }
.hub-phone .hub-sb-head p { display: none; }
.hub-phone .hub-sb-search input, .hub-phone .hub-sb-morebtn { min-height: 46px; }
.hub-phone .hub-sb-morebtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hub-phone .hub-sb-cols { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px 4px; overscroll-behavior-x: contain; }
.hub-phone .hub-sb-cols::-webkit-scrollbar { display: none; }
.hub-phone .hub-sb-cols .hub-chip { flex: 0 0 auto; min-height: 40px; }
.hub-phone .hub-sb-more { grid-template-columns: 1fr 1fr; }
.hub-phone .hub-sb-own { grid-column: 1 / -1; }
.hub-phone .hub-sb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hub-phone .hub-sb-card { border-radius: 14px; contain-intrinsic-size: auto 300px; }
.hub-phone .hub-sb-body { padding: 8px 10px 10px; gap: 4px; }
.hub-phone .hub-sb-name { font-size: .92rem; }
.hub-phone .hub-sb-bonus { display: none; }
.hub-phone .hub-sb-prog small { font-size: .68rem; }
.hub-phone .hub-sb-dio { width: 40px; height: 40px; }
.hub-phone .hub-sb-ribbon { left: 6px; bottom: 6px; font-size: .68rem; padding: 2px 8px; }
.hub-phone .hub-sb-badge { right: 6px; top: 6px; font-size: .64rem; padding: 2px 7px; }
.hub-phone .hub-sd { padding: 0; }
.hub-phone .hub-sd-close { position: sticky; float: right; top: 10px; margin: 10px 10px -54px 0; background: rgba(10, 6, 28, .7); color: #fff; }
.hub-phone .hub-sd-pieces { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.hub-phone .hub-sd-piece-art { width: 72px; height: 72px; }
.hub-phone .hub-sd-list { padding: 12px 12px 18px; }
.hub-phone .hub-sd-sum { grid-template-columns: 1fr; gap: 8px; }

/* motion */
body[data-motion="reduced"] .hub-sb-card, html[data-lite="1"] .hub-sb-card { transition: none; }
body[data-motion="reduced"] .hub-sb-card:hover, html[data-lite="1"] .hub-sb-card:hover { transform: none; }
@media (prefers-reduced-motion: reduce) { body[data-motion="auto"] .hub-sb-card { transition: none; } body[data-motion="auto"] .hub-sb-card:hover { transform: none; } }
html[data-lite="1"] .hub-sb-card { box-shadow: none; }

/* the item window's set line gains "Open the set page" next to "Preview whole set": let the links wrap under the name */
.hub-preview-set:has(.hub-pv-setpage) { flex-wrap: wrap; row-gap: 4px; }
.hub-preview-set .hub-link.hub-pv-setpage { margin-left: 0; }
.hub-preview-set:has(.hub-pv-setpage) > span { flex: 1 1 160px; min-width: 0; }

/* pictures are painted lazily into the card's button; clicks must land on the button itself, or a picture swapped in between
 * mousedown and mouseup cancels the click (Firefox) */
.hub-sb-open > *, .hub-sb-open > * *, .hub-sd-piece > *, .hub-sd-piece > * * { pointer-events: none; }

/* phone cards are narrow: the collection label gets its own line instead of being cut ("VELKOLE...") */
.hub-phone .hub-sb-meta { flex-wrap: wrap; justify-content: flex-start; row-gap: 4px; }
.hub-phone .hub-sb-col { flex: 1 0 100%; }
