/* Game District shop: the item browser in the Sets-browser style (hub-itembrowser.js, #hubItemBrowser in index.php,
 * cards from HubShop.card). Loaded after hub-shop.css / hub-setbrowser.css / hub-showcase.css and before hub-90s.css and
 * hub-mobile.css, so the phone sheet rules there still apply; the phone rules for this view are at the end of this file. */

/* ---------------------------------------------------------------- the market: one column, a toolbar card over the grid */
.dashboard-shop-market.hub-ib { display: block; }
.hub-ib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px 16px 0; border-radius: 20px 20px 0 0; background: var(--surface); border: 1px solid var(--line-2); border-bottom: 0; }
.hub-ib-head h3 { font-family: var(--font-display); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.1; margin: 2px 0 4px; }
.hub-ib-head p { color: var(--muted); font-size: .9rem; max-width: 62ch; margin: 0; }
.hub-ib .dashboard-shop-rail.hub-ib-toolbar {
    position: static; top: auto; max-height: none; overflow: visible; margin: 0 0 14px; padding: 12px 16px 16px;
    border-radius: 0 0 20px 20px; border: 1px solid var(--line-2); border-top: 0; background: var(--surface); box-shadow: var(--shadow-sm);
}
.hub-ib .dashboard-shop-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; }
.hub-ib .dashboard-shop-filters > .hub-ib-depts, .hub-ib .dashboard-shop-filters > .hub-ib-slots, .hub-ib .dashboard-shop-filters > .hub-ib-own,
.hub-ib .dashboard-shop-filters > .hub-ib-more, .hub-ib .dashboard-shop-filters > #hubFilterDone { grid-column: 1 / -1; }

/* search, sort, "On my avatar", "More filters" */
.hub-ib-search { position: relative; display: block; min-width: 0; }
.hub-ib-search > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hub-ib-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 1; }
body.hub-page .hub-ib-search #dashboardShopSearch { width: 100%; min-height: 42px; padding-left: 38px; }
.hub-ib .dashboard-shop-sort-menu summary { min-height: 42px; padding: 6px 14px; white-space: nowrap; }
.hub-ib .dashboard-shop-sort-options { left: auto; right: 0; min-width: 210px; }
.hub-ib-tool { 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; white-space: nowrap; }
.hub-ib-tool:hover, .hub-ib-tool[aria-expanded="true"] { border-color: var(--gold); }
.hub-ib-tool:focus-visible { outline: 3px solid var(--focus, var(--gold)); outline-offset: 2px; }
.hub-ib-wearbtn[aria-pressed="true"] { background: color-mix(in srgb, var(--teal, var(--cyan)) 22%, var(--surface-2)); border-color: var(--teal, var(--cyan)); }
.hub-ib-wearbtn[aria-pressed="true"] i { color: var(--teal, var(--cyan)); }
.hub-ib-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-ib-morebtn b:empty { display: none; }

/* departments (big chips), the kinds inside one, the owned/new/affordable chips */
.hub-ib .hub-ib-depts { display: flex; flex-wrap: wrap; gap: 5px; }
.hub-ib .hub-ib-depts .hub-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; font-size: .82rem; min-height: 36px; }
.hub-ib .hub-ib-depts .hub-chip-n, .hub-ib-slots .hub-chip-n { opacity: .72; font-size: .74rem; }
.hub-ib-slots { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.hub-ib-slots[hidden] { display: none !important; }
.hub-ib-slots .hub-chip { padding: 4px 10px; font-size: .78rem; }
.hub-ib .hub-ib-own { display: flex; flex-wrap: wrap; gap: 6px; }

/* More filters: games | categories | rarity, price, theme | collections */
.hub-ib-more { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); align-items: start; }
.hub-ib-more.is-open { display: grid; }
.hub-ib-more .dashboard-shop-category-block { min-width: 0; align-content: start; }
.hub-ib-more .dashboard-shop-category-list { max-height: 230px; }
.hub-ib-more .dashboard-shop-category-list--compact { max-height: none; }
.hub-ib-more .dashboard-shop-filter { display: grid; gap: 4px; font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hub-ib-more .dashboard-shop-filter select { min-height: 40px; width: 100%; text-transform: none; letter-spacing: 0; }
#hubIbPrice .hub-chip { padding: 4px 10px; font-size: .78rem; }

/* ---------------------------------------------------------------- the grid and the cards (like .hub-sb-card) */
.hub-ib .dashboard-shop-display-head { align-items: baseline; }
.hub-ib .hub-shop-count { color: var(--gold); font-weight: 900; font-variant-numeric: tabular-nums; }
.hub-ib .dashboard-shop-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.hub-ib-card { border-radius: 18px; grid-template-rows: auto 1fr auto; content-visibility: auto; contain-intrinsic-size: auto 360px; }
.hub-ib-card:hover, .hub-ib-card:focus-within { transform: translateY(-2px); }
.hub-ib-card > .hub-item-stage { aspect-ratio: 1 / 1; padding: 12px; }
.hub-ib-card > .hub-item-stage > * { pointer-events: none; }
.hub-ib-card .hub-item-art { transition: opacity .18s ease; }
.hub-ib-card .hub-item-state { left: auto; right: 10px; top: 10px; text-transform: uppercase; letter-spacing: .05em; font-size: .66rem; }
.hub-ib-card .hub-item-state.is-new { background: var(--magenta, var(--pink)); box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.hub-ib-card .hub-item-eye { top: auto; bottom: 12px; right: 10px; transform: translateY(4px); }
.hub-ib-ribbon { position: absolute; left: 10px; bottom: 12px; z-index: 2; max-width: calc(100% - 20px); padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 900; background: rgba(10, 6, 28, .78); color: #f6efe0; border: 1px solid rgba(255, 255, 255, .16); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-ib-card:hover .hub-ib-ribbon, .hub-ib-card > .hub-item-stage:focus-visible .hub-ib-ribbon { opacity: 0; }
/* the piece worn on your avatar: a still picture over the art, shown when the card is in the worn view
   (worn = "On my avatar" xor the try-on button, and a mouse hover shows the other one) */
.hub-ib-worn { position: absolute; inset: 0; z-index: 1; display: block; opacity: 0; transition: opacity .18s ease; background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--rar, var(--gold)) 26%, transparent), transparent 70%), linear-gradient(180deg, var(--surface-2), var(--surface)); }
.hub-ib-worn img, .hub-ib-worn svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.hub-ib-card.is-worn-ready.is-worn:not(.is-peek) .hub-ib-worn, .hub-ib-card.is-worn-ready.is-peek:not(.is-worn) .hub-ib-worn { opacity: 1; }
.hub-ib-card.is-worn-ready.is-worn:not(.is-peek) .hub-item-art, .hub-ib-card.is-worn-ready.is-peek:not(.is-worn) .hub-item-art { opacity: 0; }
.hub-ib-try {
    position: absolute; left: 10px; top: 10px; z-index: 3; width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0;
    border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(10, 6, 28, .74); color: #f6efe0; font-size: 1rem; cursor: pointer;
}
.hub-ib-try:hover, .hub-ib-try:focus-visible { border-color: var(--gold); color: var(--gold); }
.hub-ib-try:focus-visible { outline: 3px solid var(--focus, var(--gold)); outline-offset: 2px; }
.hub-ib-try[aria-pressed="true"] { background: var(--teal, var(--cyan)); color: #04211f; border-color: transparent; }
.hub-ib-card .hub-item-body { padding: 10px 14px 4px; cursor: pointer; }
.hub-ib-card .hub-item-foot { cursor: pointer; }
.hub-ib-card .hub-item-chips { justify-content: space-between; flex-wrap: nowrap; min-width: 0; }
.hub-ib-card .hub-chip-game { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hub-ib-card .hub-item-name { font-family: var(--font-display); font-weight: 400; font-size: 1.04rem; line-height: 1.15; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hub-ib-card .hub-item-type { display: block; color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-ib-card .hub-item-foot { padding: 8px 14px 14px; }
/* the storefront rows keep their wide pictures */
.hub-ib-card.hub-item--compact > .hub-item-stage { aspect-ratio: 16 / 11; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1100px) {
    .hub-ib-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .hub-ib .dashboard-shop-filters { grid-template-columns: minmax(0, 1fr) auto auto; }
    .hub-ib .dashboard-shop-filters > .hub-ib-search { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- phones: a slim sticky bar (search, Filters, departments);
   everything else is in the Filters sheet of hub-mobile.js (html.hub-filters-open) */
.hub-phone .hub-ib-head { padding: 0 0 6px; background: none; border: 0; border-radius: 0; }
.hub-phone .hub-ib-head p { display: none; }
.hub-phone .hub-ib-head h3 { font-size: 1.15rem; }
.hub-phone .hub-ib .dashboard-shop-rail.hub-ib-toolbar { position: sticky; top: var(--top-h); z-index: 55; margin: 0 -12px 8px; padding: 8px 12px; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); box-shadow: none; background: color-mix(in srgb, var(--bg) 94%, transparent); }
.hub-phone .hub-ib .dashboard-shop-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-phone .hub-ib .dashboard-shop-filters > .hub-ib-search { flex: 1 1 0; min-width: 0; }
body.hub-page.hub-phone .hub-ib-search #dashboardShopSearch, .hub-phone body.hub-page .hub-ib-search #dashboardShopSearch { min-height: 46px; }
.hub-phone .hub-ib .hub-ib-depts { flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; overscroll-behavior-x: contain; }
.hub-phone .hub-ib .hub-ib-depts::-webkit-scrollbar { display: none; }
.hub-phone .hub-ib .hub-ib-depts .hub-chip { flex: 0 0 auto; min-height: 42px; }
.hub-phone:not(.hub-filters-open) .hub-ib .dashboard-shop-filters > .hub-ib-own,
.hub-phone:not(.hub-filters-open) .hub-ib .dashboard-shop-filters > .hub-ib-more { display: none; }
/* the department's kinds stay in the bar as one swipe row */
/* (hub-mobile.css hides every other bar child with an id-level :not() chain, hence !important) */
.hub-phone:not(.hub-filters-open) .hub-ib .dashboard-shop-filters > .hub-ib-slots:not([hidden]) { display: flex !important; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; border: 0; border-radius: 0; background: none; }
.hub-phone .hub-ib-slots::-webkit-scrollbar { display: none; }
.hub-phone:not(.hub-filters-open) .hub-ib-slots .hub-chip { flex: 0 0 auto; min-height: 40px; }
/* the sheet */
.hub-phone.hub-filters-open .hub-ib .dashboard-shop-rail.hub-ib-toolbar { position: fixed; top: auto; z-index: 150; max-height: 82dvh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 22px 14px calc(14px + var(--safe-b, 0px)); border-radius: 24px 24px 0 0; border: 1px solid var(--line-2); border-bottom: 0; background: var(--surface); box-shadow: var(--shadow); }
.hub-phone.hub-filters-open .hub-ib .dashboard-shop-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hub-phone.hub-filters-open .hub-ib .hub-ib-depts { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
.hub-phone.hub-filters-open .hub-ib-morebtn { display: none; }
.hub-phone.hub-filters-open .hub-ib-more { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0; border: 0; background: none; }
.hub-phone.hub-filters-open .hub-ib-wearbtn { justify-content: center; min-height: 46px; }
.hub-phone.hub-filters-open .hub-ib-search > span { position: static; width: auto; height: auto; clip: auto; }
.hub-phone.hub-filters-open .hub-ib-search > i { top: auto; bottom: 14px; transform: none; }
/* cards: two columns, a smaller body */
.hub-phone .hub-ib .dashboard-shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hub-phone .hub-ib-card { border-radius: 14px; contain-intrinsic-size: auto 300px; }
.hub-phone .hub-ib-card > .hub-item-stage { padding: 8px; }
.hub-phone .hub-ib-card .hub-item-body { padding: 8px 10px 2px; gap: 3px; }
.hub-phone .hub-ib-card .hub-item-name { font-size: .92rem; }
.hub-phone .hub-ib-card .hub-item-foot { padding: 6px 10px 10px; }
.hub-phone .hub-ib-card .hub-item-eye { display: none; }
.hub-phone .hub-ib-ribbon { left: 6px; bottom: 8px; font-size: .64rem; padding: 2px 7px; }
.hub-phone .hub-ib-card .hub-item-state { right: 6px; top: 6px; font-size: .6rem; padding: 2px 7px; }
.hub-phone .hub-ib-try { left: 6px; top: 6px; width: 40px; height: 40px; min-height: 40px; }
/* landscape phones: search | Filters | departments in one row, three cards a row */
.hub-land:not(.hub-filters-open) .hub-ib .dashboard-shop-filters { flex-wrap: nowrap; }
.hub-land:not(.hub-filters-open) .hub-ib .dashboard-shop-filters > .hub-ib-search { flex: 0 0 210px; }
.hub-land:not(.hub-filters-open) .hub-ib .hub-ib-depts { flex: 1 1 0; min-width: 0; order: 3; margin: 0 -12px 0 0; padding: 0 12px 0 0; }
.hub-land:not(.hub-filters-open) .hub-ib .dashboard-shop-filters > .hub-ib-slots:not([hidden]) { display: none !important; }
.hub-land .hub-ib .dashboard-shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hub-land .hub-ib-head { display: none; }

/* ---------------------------------------------------------------- motion, lite */
body[data-motion="reduced"] .hub-ib-card, html[data-lite="1"] .hub-ib-card,
body[data-motion="reduced"] .hub-ib-worn, html[data-lite="1"] .hub-ib-worn,
body[data-motion="reduced"] .hub-ib-card .hub-item-art, html[data-lite="1"] .hub-ib-card .hub-item-art { transition: none; }
body[data-motion="reduced"] .hub-ib-card:hover, html[data-lite="1"] .hub-ib-card:hover { transform: none; }
@media (prefers-reduced-motion: reduce) {
    body[data-motion="auto"] .hub-ib-card, body[data-motion="auto"] .hub-ib-worn, body[data-motion="auto"] .hub-ib-card .hub-item-art { transition: none; }
    body[data-motion="auto"] .hub-ib-card:hover { transform: none; }
}
html[data-lite="1"] .hub-phone .hub-ib .dashboard-shop-rail.hub-ib-toolbar, html[data-lite="1"].hub-phone .hub-ib .dashboard-shop-rail.hub-ib-toolbar { background: var(--bg); }
html[data-lite="1"].hub-phone.hub-filters-open .hub-ib .dashboard-shop-rail.hub-ib-toolbar { background: var(--surface); }
