.market-page { max-width: 1420px; margin: 86px auto 70px; padding: 24px; }
.market-hero { max-width: 820px; margin: 0 auto 58px; text-align: center; }
.market-hero > span, .market-section-heading span { display: inline-block; padding: 5px 10px; background: #25252d; color: white; font-size: .72rem; font-weight: 950; letter-spacing: .12em; transform: rotate(-1deg); }
.market-hero h1 { margin: 18px 0 10px; font-size: clamp(3rem, 8vw, 6rem); line-height: .9; }
.market-hero p { font-weight: 700; }
.market-hero > small { display: block; margin-top: 12px; color: #625c6d; font-weight: 700; }
.market-wallet { width: fit-content; margin: 25px auto 0; display: flex; align-items: center; gap: 14px; padding: 13px 20px; border: 3px solid #25252d; border-radius: 12px; background: white; box-shadow: 6px 6px 0 #25252d; }
.market-wallet div { display: grid; }
.market-wallet strong { font-size: 1.8rem; line-height: 1; }
.market-wallet span { font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.market-credit-cta { margin-left: 3px; }
.market-credit-cta button { padding: 7px 10px; border: 2px solid #25252d; border-radius: 7px; background: #ffd166; box-shadow: 3px 3px 0 #25252d; color: #25252d; font-size: .68rem; font-weight: 900; white-space: nowrap; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.market-credit-cta button:hover { box-shadow: 1px 1px 0 #25252d; transform: translate(2px, 2px); }
.market-credit-cta button:focus-visible { outline: 3px solid #ff5d8f; outline-offset: 3px; }
.market-section { margin-top: 54px; }
.market-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 24px; border-bottom: 4px solid #25252d; padding-bottom: 14px; }
.market-section-heading h2 { margin: 9px 0 0; font-size: clamp(1.8rem, 4vw, 3rem); }
.market-section-heading p { max-width: 440px; margin: 0; font-weight: 650; }
.market-section-heading a, .market-offer-copy a { color: #25252d; font-weight: 900; }
.booster-market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 26px; }
.market-booster { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 22px; align-items: center; padding: 22px; border: 3px solid #25252d; border-radius: 15px; background: #fff; box-shadow: 7px 7px 0 #25252d; }
.market-pack-art { aspect-ratio: 2 / 3; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 16px 10px; border: 4px solid #25252d; border-radius: 14px; background: linear-gradient(145deg, hsl(var(--pack-hue) 80% 72%), #ffd166); box-shadow: 5px 5px 0 #25252d; text-align: center; }
.market-pack-art span, .market-pack-art small { font-size: .6rem; font-weight: 1000; letter-spacing: .11em; }
.market-pack-art b { padding: 8px; border: 3px solid #25252d; background: white; overflow-wrap: anywhere; transform: rotate(-2deg); }
.market-booster .market-offer-copy { min-width: 0; }
.market-rarity-menu { position: relative; z-index: 2; width: min(100%, 220px); margin: 8px 0 12px; font-size: .78rem; }
.market-rarity-menu summary { display: inline-flex; align-items: center; gap: 7px; border: 2px solid #25252d; border-radius: 7px; padding: 5px 8px; background: #f4eaff; color: #633590; font-weight: 850; list-style: none; cursor: pointer; }
.market-rarity-menu summary::-webkit-details-marker { display: none; }
.market-rarity-menu summary::after { content: '▾'; transition: transform .12s ease; }
.market-rarity-menu[open] summary::after { transform: rotate(180deg); }
.market-rarity-menu summary:focus-visible { outline: 3px solid #ff5d8f; outline-offset: 3px; }
.market-rarity-menu ul { display: grid; gap: 4px; margin: 7px 0 0; padding: 8px 10px; border: 2px solid #25252d; border-radius: 7px; background: #fff9e9; box-shadow: 3px 3px 0 #25252d; list-style: none; }
.market-rarity-menu li { display: flex; justify-content: space-between; gap: 16px; }
.market-custom-info { position: relative; z-index: 2; width: fit-content; max-width: 100%; }
.market-shop-updates { margin: 0 0 20px; }
.market-shop-updates ul { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.market-shop-updates li { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: .82rem; scroll-margin-top: 130px; }
.market-shop-updates a { color: inherit; font-weight: 750; overflow-wrap: anywhere; }
.market-announcement-unread { padding: 2px 5px; border-radius: 4px; background: #f4eaff; color: #633590; font-size: .7rem; font-weight: 750; }
.market-shop-updates button { margin-top: 10px; border: 0; padding: 4px 0; background: transparent; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.market-booster[id] { scroll-margin-top: 130px; }
.market-custom-info[open] { z-index: 3; }
.market-custom-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 3px 7px; border: 1px solid currentColor; border-radius: 5px; background: #f4eaff; color: #633590; font-size: .7rem; font-weight: 750; list-style: none; cursor: help; }
.market-custom-badge::-webkit-details-marker { display: none; }
.market-custom-badge:focus-visible { outline: 3px solid #8854d0; outline-offset: 3px; }
.market-offer-copy .market-custom-help { position: absolute; top: 100%; right: 0; width: min(290px, calc(100vw - 80px)); box-sizing: border-box; margin: 0; padding: 12px 14px; border: 2px solid #25252d; border-radius: 8px; background: #fff; box-shadow: 4px 4px 0 #25252d; color: #25252d; font-size: .82rem; line-height: 1.5; }
.market-booster { position: relative; }
.market-offer-copy .market-set-link { color: inherit; font-weight: inherit; text-decoration: none; }
.market-set-link::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }
.market-set-link:focus-visible { outline: none; }
.market-set-link:focus-visible::after { outline: 3px solid #ff5d8f; outline-offset: 4px; }
.market-booster .market-offer-copy button { position: relative; z-index: 1; }
.market-offer-copy h3 { margin: 0 0 8px; font-size: 1.35rem; overflow-wrap: anywhere; }
.market-offer-copy p { font-size: .82rem; line-height: 1.4; }
.market-offer-copy button { border: 3px solid #25252d; border-radius: 8px; padding: 10px 13px; background: #9bf6ff; box-shadow: 4px 4px 0 #25252d; color: #25252d; font-weight: 900; cursor: pointer; }
.market-booster .market-offer-copy button { width: 100%; }
.market-offer-copy button:disabled { opacity: .55; cursor: wait; }
.card-market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 42px 28px; align-items: start; scroll-margin-top: 120px; }
.market-card-offer .trading-card { width: 100%; }
.market-card-offer { width: 85%; zoom: .85; justify-self: center; }
.market-card-offer .market-offer-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 17px 5px 0; }
.market-card-offer .market-offer-copy p { margin: 0; }
.market-empty { grid-column: 1 / -1; padding: 28px; border: 3px dashed #8c8794; border-radius: 12px; text-align: center; font-weight: 800; }
.market-history { display: grid; gap: 12px; }
.market-transaction { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 15px 18px; border: 3px solid #25252d; border-radius: 10px; background: #fff; box-shadow: 4px 4px 0 #25252d; }
.market-transaction-kind { padding: 5px 8px; border: 2px solid #25252d; border-radius: 6px; background: #9bf6ff; font-size: .68rem; font-weight: 1000; }
.market-transaction-kind.is-sale { background: #b9fbc0; }
.market-transaction div { display: grid; gap: 3px; min-width: 0; }
.market-transaction a { color: #25252d; font-weight: 950; overflow-wrap: anywhere; }
.market-transaction small { color: #625c6d; font-weight: 700; text-transform: capitalize; }
.market-transaction > strong { white-space: nowrap; }
.market-item-shelves { display: grid; gap: 26px; }
.market-item-category { display: grid; gap: 12px; }
.market-item-category > h3 { font-size: .78rem; font-weight: 1000; letter-spacing: .18em; text-transform: uppercase; color: #625c6d; }
.market-item.is-locked { opacity: .75; }
.market-item.is-locked h3 { font-size: 1.6rem; }
.wallet-balances { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.wallet-balances > div { display: grid; gap: 2px; padding: 12px 16px; border: 3px solid #25252d; border-radius: 10px; background: #fff; box-shadow: 4px 4px 0 #25252d; }
.wallet-balances span { color: #625c6d; font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.wallet-balances strong { font-size: 1.4rem; font-weight: 1000; }
.wallet-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.wallet-filters label { display: grid; gap: 4px; font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.wallet-filters select { padding: 8px 10px; border: 3px solid #25252d; border-radius: 8px; background: #fff; font: inherit; font-weight: 800; }
#walletHistoryMore { margin-top: 12px; padding: 10px 16px; border: 3px solid #25252d; border-radius: 8px; background: #ffd6a5; font: inherit; font-weight: 1000; cursor: pointer; box-shadow: 4px 4px 0 #25252d; }
#walletHistoryMore:disabled { cursor: progress; opacity: .6; }
@media (max-width: 700px) { .wallet-balances > div { flex: 1 1 100%; } .market-page { padding: 14px; } .market-section-heading { align-items: start; flex-direction: column; } .market-booster { grid-template-columns: 115px 1fr; padding: 15px; } .market-wallet { max-width: 100%; } }
@media (max-width: 520px) { .market-transaction { grid-template-columns: auto 1fr; } .market-transaction > strong { grid-column: 2; } }
.market-page [hidden] { display: none !important; }
.market-tabs { display: flex; gap: 12px; margin: 24px 0; }
.market-tabs button { border: 3px solid #25252d; padding: 12px 20px; background: white; font-weight: 900; cursor: pointer; }
.market-tabs button[aria-selected="true"] { background: #ffe76b; box-shadow: 4px 4px 0 #25252d; }
.market-item { position: relative; overflow: hidden; padding: 26px; border: 3px solid #25252d; background: #fff9e9; box-shadow: 6px 6px 0 #25252d; }
.market-sale-ribbon { position: absolute; top: 14px; right: -30px; width: 120px; padding: 5px 0; transform: rotate(35deg); background: #ff5d75; color: #25252d; text-align: center; font-size: .8rem; font-weight: 950; letter-spacing: .08em; }
.market-regular-price { display: block; margin: 0 0 8px; color: #67616b; font-weight: 750; }
.market-item h3 { font-size: 1.8rem; margin: 0 0 12px; }
.market-item button { padding: 12px 18px; border: 2px solid #25252d; background: #ffe76b; font-weight: 900; cursor: pointer; }
.market-item button:disabled { cursor: default; opacity: .65; }
.market-cart { position: sticky; top: 108px; z-index: 20; margin: 0 0 28px; border: 3px solid #25252d; border-radius: 12px; background: #fff9e9; box-shadow: 5px 5px 0 #25252d; }
.market-cart summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; cursor: pointer; font-weight: 850; list-style: none; }
.market-cart summary::-webkit-details-marker { display: none; }
.market-cart summary::after { content: '+'; font-size: 1.4rem; }
.market-cart[open] summary::after { content: '−'; }
.market-cart summary > span { margin-left: auto; }
.market-cart summary strong { display: flex; align-items: center; gap: 10px; }
#cartCount { min-width: 28px; padding: 3px 7px; border: 2px solid #25252d; border-radius: 6px; background: #ffe76b; text-align: center; font-size: .8rem; }
.market-cart-body { padding: 0 20px 16px; }
#cartLines { max-height: 40vh; overflow-y: auto; overscroll-behavior: contain; }
.market-cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 14px 0; border-top: 2px solid #ded9cd; }
.market-cart-line strong, .market-cart-line small { display: block; overflow-wrap: anywhere; }
.market-cart-line small { margin-top: 4px; color: #625c6d; }
.market-cart-line .market-cart-problem { color: #a32340; font-weight: 800; }
.market-cart-quantity { display: flex; align-items: center; gap: 8px; }
.market-cart-quantity input { width: 62px; padding: 8px 4px; border: 2px solid #25252d; border-radius: 5px; background: white; color: #25252d; text-align: center; font: inherit; font-weight: 800; }
.market-cart button { padding: 9px 12px; border: 2px solid #25252d; border-radius: 6px; background: #9bf6ff; color: #25252d; font-weight: 900; cursor: pointer; }
.market-cart .market-cart-remove, .market-cart .market-cart-clear { background: transparent; }
.market-cart-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 16px; border-top: 2px solid #25252d; }
.market-cart #checkoutCart { background: #ffe76b; box-shadow: 3px 3px 0 #25252d; }
.market-cart button:disabled { opacity: .5; cursor: default; }
.market-cart :focus-visible { outline: 3px solid #ff5d8f; outline-offset: 3px; }
#cartStatus:empty { display: none; }
#cartStatus { margin: 14px 0 0; font-weight: 700; }
.market-cart-empty { padding: 6px 0 18px; color: #625c6d; }
.market-cart-receipt { padding: 18px 20px; border: 3px solid #25252d; border-radius: 10px; background: #b9fbc0; }
.market-cart-receipt p { margin: 0 0 10px; font-weight: 800; }
.market-cart-receipt a { display: inline-block; margin: 4px 18px 4px 0; color: #25252d; font-weight: 850; }
.market-purchase-warning { width: min(460px, calc(100% - 32px)); padding: 24px; border: 3px solid #25252d; border-radius: 14px; background: #fff9e9; color: #25252d; box-shadow: 8px 8px 0 #25252d; }
.market-purchase-warning::backdrop { background: rgb(37 37 45 / .58); }
.market-purchase-warning h2 { margin: 0 0 10px; font-size: 1.65rem; }
.market-purchase-warning p { margin: 0; line-height: 1.5; font-weight: 700; }
.market-purchase-warning-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.market-purchase-warning button { padding: 10px 14px; border: 2px solid #25252d; border-radius: 7px; background: white; color: #25252d; font-weight: 900; cursor: pointer; }
.market-purchase-warning [data-warning-confirm] { background: #ffe76b; box-shadow: 3px 3px 0 #25252d; }
.market-purchase-warning :focus-visible { outline: 3px solid #ff5d8f; outline-offset: 3px; }
.market-offer-copy button:disabled { cursor: default; }
@media (max-width: 999px) { .market-cart { top: 104px; } }
@media (max-width: 600px) {
    .market-cart summary { padding: 12px; }
    .market-cart-body { padding: 0 12px 12px; }
    .market-cart-line { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
    .market-cart-quantity { grid-column: 1; grid-row: 2; }
    .market-cart-remove { grid-column: 2; grid-row: 2; }
    .market-cart-footer { flex-wrap: nowrap; }
    .market-cart-footer #checkoutCart { flex: 1; padding: 10px 8px; font-size: .82rem; white-space: nowrap; }
    .market-cart-footer .market-cart-clear { padding: 6px; border: 0; box-shadow: none; font-size: .75rem; }
}
