#weekly-event-shop {
    overflow: hidden;
    background: #00030b;
}

.ss-shop-viewport {
    width: 100%;
    height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #00030b;
}

.ss-shop-stage,
.ss-purchase-stage {
    position: relative;
    width: min(100vw, 150vh);
    aspect-ratio: 3 / 2;
    flex: 0 0 auto;
}

.ss-shop-artwork,
.ss-purchase-artwork {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.ss-shop-hotspot,
.ss-shop-tab,
.ss-shop-buy-hotspot,
.ss-purchase-hotspot {
    position: absolute;
    margin: 0;
    padding: 0;
    border: 0;
    appearance: none;
    background: transparent;
    color: transparent;
    cursor: pointer;
    touch-action: manipulation;
}

.ss-shop-hotspot:focus-visible,
.ss-shop-tab:focus-visible,
.ss-shop-buy-hotspot:focus-visible,
.ss-purchase-hotspot:focus-visible {
    outline: max(2px, .18vw) solid #fff;
    outline-offset: max(2px, .15vw);
    filter: drop-shadow(0 0 .45vw #00d9ff);
}

.ss-shop-back { left: 3%; top: 4.2%; width: 12.4%; height: 6.8%; }
.ss-shop-token-balance {
    position: absolute;
    left: 85.4%;
    top: 4.3%;
    width: 11.4%;
    height: 6.4%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55em;
    color: #ffe23d;
    font: 700 clamp(12px, 1.65vw, 32px) 'Orbitron', sans-serif;
    text-shadow: 0 0 .45em rgba(255, 220, 0, .8);
}

.ss-shop-tabs,
.ss-shop-items { position: absolute; inset: 0; pointer-events: none; }
.ss-shop-tab,
.ss-shop-buy-hotspot {
    pointer-events: auto;
    /*
     * These hotspots use artwork-relative percentage dimensions. Override the
     * global 44px touch-target minimums so disabled/SOLD OUT covers stay inside
     * the baked BUY button instead of expanding beyond its artwork slot.
     */
    min-width: 0;
    min-height: 0;
}
.ss-shop-tab { top: 13.7%; height: 8.6%; }
.ss-shop-tab-featured { left: 3.5%; width: 29.2%; }
.ss-shop-tab-pilots { left: 33.6%; width: 30%; }
.ss-shop-tab-currency { left: 64.5%; width: 31.8%; }

/*
 * BUY is part of the supplied raster artwork, so disabled buttons receive a
 * real opaque child element instead of browser-dependent button pseudo
 * elements. The cover deliberately extends beyond the hotspot and has no
 * clipped corners, ensuring the baked blue button and label cannot leak out.
 */
.ss-shop-disabled-cover {
    position: absolute;
    inset: 5% 0 -5% 0;
    z-index: 2;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    border: max(1px, .09vw) solid #8b96a3;
    border-radius: .45vw;
    color: #d8dde3;
    background: linear-gradient(180deg, #66717d 0%, #444d57 48%, #303740 100%);
    box-shadow: inset 0 0 .55vw rgba(255, 255, 255, .18), 0 0 .35vw rgba(120, 132, 145, .45);
    font: 700 clamp(9px, 1.15vw, 22px) 'Orbitron', sans-serif;
    text-shadow: 0 1px 2px #1a1f25;
    pointer-events: none;
}

.ss-shop-buy-hotspot:disabled {
    /* Override main.css button:disabled opacity so the cover stays opaque. */
    opacity: 1;
    background: #020916;
    box-shadow: 0 0 0 max(1px, .08vw) #020916;
    cursor: not-allowed;
}
.ss-shop-buy-hotspot[data-state="sold-out"] .ss-shop-disabled-cover {
    font-size: clamp(7px, .72vw, 14px);
}

.ss-shop-limit {
    position: absolute;
    display: grid;
    place-items: center;
    color: #f4f6fb;
    background: #06101e;
    font: 400 clamp(8px, .95vw, 18px) 'Exo 2', sans-serif;
    pointer-events: none;
}

.ss-purchase-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .18s ease;
}

.ss-purchase-modal.active { opacity: 1; }
.ss-purchase-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 15, .72); }
.ss-purchase-stage { width: min(94vw, 141vh); z-index: 1; }
.ss-purchase-close { left: 86.1%; top: 4.1%; width: 8.5%; height: 7.1%; }
.ss-purchase-preview {
    position: absolute;
    left: 28%;
    top: 12.5%;
    width: 44%;
    height: 22.5%;
    display: grid;
    grid-template-columns: 26% 1fr;
    grid-template-rows: 1fr 1fr;
    align-items: center;
    gap: 0 4%;
    color: #f8fbff;
    text-align: left;
    font-family: 'Exo 2', sans-serif;
}

.ss-purchase-icon {
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    font-size: clamp(36px, 6vw, 110px);
    filter: drop-shadow(0 0 .3em #00c8ff);
}

.ss-purchase-preview strong { align-self: end; font: 700 clamp(14px, 2vw, 38px) 'Orbitron', sans-serif; }
.ss-purchase-preview > span:last-child { align-self: start; font-size: clamp(11px, 1.35vw, 26px); color: #bcd4e8; }
.ss-qty-minus { left: 24.2%; top: 40.7%; width: 6.2%; height: 9.1%; }
.ss-qty-plus { left: 77.5%; top: 40.7%; width: 6.2%; height: 9.1%; }
.ss-purchase-quantity {
    position: absolute;
    left: 33.3%;
    top: 40.9%;
    width: 41.7%;
    height: 8.7%;
    display: flex;
    align-items: center;
    gap: 4%;
}

.ss-purchase-quantity input { width: 82%; accent-color: #00cfff; cursor: pointer; }
.ss-purchase-quantity output { color: #fff; min-width: 14%; text-align: center; font: 700 clamp(14px, 2vw, 38px) 'Orbitron', sans-serif; }
.ss-purchase-value {
    position: absolute;
    left: 70.2%;
    width: 18.4%;
    height: 5.4%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    color: #ffe13d;
    font: 700 clamp(12px, 1.65vw, 32px) 'Orbitron', sans-serif;
}

.ss-purchase-cost { top: 57.3%; }
.ss-purchase-balance { top: 68.4%; }
.ss-purchase-confirm { left: 27.7%; top: 77.2%; width: 44.5%; height: 9.7%; }
.ss-purchase-cancel { left: 31.4%; top: 88.3%; width: 37.2%; height: 7.4%; }
.ss-purchase-confirm:disabled { cursor: wait; }

/* Landscape-phone artwork uses an independent 1844x853 coordinate system. */
#weekly-event-shop.ss-layout-phone .ss-shop-stage {
    width: min(100vw, 216.1782dvh);
    aspect-ratio: 1844 / 853;
}

#weekly-event-shop.ss-layout-phone .ss-shop-back {
    left: 2.8%;
    top: 3.6%;
    width: 10.8%;
    height: 8.2%;
}

#weekly-event-shop.ss-layout-phone .ss-shop-token-balance {
    left: 85.4%;
    top: 3.5%;
    width: 11.1%;
    height: 8.3%;
    font-size: clamp(11px, 1.45vw, 28px);
}

#weekly-event-shop.ss-layout-phone .ss-shop-tab {
    top: 13.5%;
    height: 9.1%;
}

#weekly-event-shop.ss-layout-phone .ss-shop-tab-featured { left: 2.8%; width: 31.5%; }
#weekly-event-shop.ss-layout-phone .ss-shop-tab-pilots { left: 34.3%; width: 31.2%; }
#weekly-event-shop.ss-layout-phone .ss-shop-tab-currency { left: 65.5%; width: 31.6%; }

#weekly-event-shop.ss-layout-phone .ss-shop-limit {
    font-size: clamp(7px, .68vw, 13px);
}

#shop-purchase-modal.ss-layout-phone .ss-purchase-stage {
    width: min(98vw, 211.8546dvh);
    aspect-ratio: 1844 / 853;
}

#shop-purchase-modal.ss-layout-phone .ss-purchase-close {
    left: 89.3%;
    top: 5.2%;
    width: 7.3%;
    height: 8.7%;
}

#shop-purchase-modal.ss-layout-phone .ss-purchase-preview {
    left: 6.1%;
    top: 18.4%;
    width: 32.4%;
    height: 49.8%;
    grid-template-columns: 1fr;
    grid-template-rows: 58% 14% 28%;
    gap: 0;
    text-align: center;
}

#shop-purchase-modal.ss-layout-phone .ss-purchase-icon {
    grid-row: 1;
    font-size: clamp(42px, 7vw, 126px);
}

#shop-purchase-modal.ss-layout-phone .ss-purchase-preview strong {
    grid-row: 2;
    align-self: center;
    font-size: clamp(12px, 1.45vw, 28px);
}

#shop-purchase-modal.ss-layout-phone .ss-purchase-preview > span:last-child {
    grid-row: 3;
    align-self: start;
    padding: 0 5%;
    font-size: clamp(9px, 1.05vw, 20px);
}

#shop-purchase-modal.ss-layout-phone .ss-qty-minus {
    left: 54.6%;
    top: 21.4%;
    width: 4.9%;
    height: 10.2%;
}

#shop-purchase-modal.ss-layout-phone .ss-qty-plus {
    left: 86%;
    top: 21.4%;
    width: 4.9%;
    height: 10.2%;
}

#shop-purchase-modal.ss-layout-phone .ss-purchase-quantity {
    left: 61.3%;
    top: 21.3%;
    width: 22.8%;
    height: 10.3%;
}

#shop-purchase-modal.ss-layout-phone .ss-purchase-quantity output {
    font-size: clamp(12px, 1.55vw, 30px);
}

#shop-purchase-modal.ss-layout-phone .ss-purchase-value {
    left: 74.5%;
    width: 18.1%;
    height: 9.7%;
    font-size: clamp(11px, 1.45vw, 28px);
}

#shop-purchase-modal.ss-layout-phone .ss-purchase-cost { top: 40%; }
#shop-purchase-modal.ss-layout-phone .ss-purchase-balance { top: 58.2%; }
#shop-purchase-modal.ss-layout-phone .ss-purchase-confirm { left: 10.2%; top: 78.5%; width: 42.8%; height: 11.6%; }
#shop-purchase-modal.ss-layout-phone .ss-purchase-cancel { left: 57.2%; top: 79.1%; width: 31.8%; height: 10.6%; }

@media (prefers-reduced-motion: reduce) {
    .ss-purchase-modal { transition: none; }
}
