/* Additions to the original Stripe and PayPal pages. Native shop styling stays in place. */
#gem-shop-items {
    width: 100%;
    max-width: 1120px;
    margin: 10px auto 12px;
    border: 1px solid rgba(var(--aoy-palette-border-rgb, 123, 200, 251), .18);
    border-radius: var(--aoy-radius-base, 6px);
    background: rgba(10,10,10,.82);
    box-shadow: 0 14px 34px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.04);
}
#gem-shop-items > details { display: block; width: 100%; height: auto !important; }
#gem-shop-items summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    list-style: none;
    color: rgb(var(--aoy-palette-text-rgb, 234, 246, 255));
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
#gem-shop-items summary::-webkit-details-marker { display: none; }
#gem-shop-items .tier-reward-title-icon { margin-right: 6px; color: #ffd85c; }
#gem-shop-items .tier-reward-summary-meta { color: rgb(var(--aoy-palette-muted-rgb, 184, 201, 216)); font-size: 12px; white-space: nowrap; }
#gem-shop-items .tier-reward-chevron { display: inline-block; margin-left: 7px; color: rgb(var(--aoy-palette-accent-rgb, 158, 207, 255)); }
#gem-shop-items details[open] .tier-reward-chevron { transform: rotate(180deg); }
#gem-shop-items .tier-reward-content { padding: 0 18px 18px; }
#gem-shop-items .tier-reward-subtitle { color: rgb(var(--aoy-palette-muted-rgb, 184, 201, 216)); font-size: 13px; margin: 3px 0 12px; }
#gem-shop-items .gem-search { display: flex; align-items: center; gap: 14px; margin: 14px 0 0; width: 100%; }
#gem-shop-items .gem-search > span { font-size: 12px; white-space: nowrap; }
#gem-shop-items .gem-search input { width: 100%; min-width: 0; margin: 0; padding: 9px 12px; border: 1px solid rgba(var(--aoy-palette-border-rgb, 123, 200, 251), .3); border-radius: 4px; background: rgba(5,5,5,.88); color: rgb(var(--aoy-palette-text-rgb, 234, 246, 255)); font: inherit; font-size: 13px; }
#gem-shop-items .gem-search-result { color: rgb(var(--aoy-palette-muted-rgb, 184, 201, 216)); font-size: 12px; margin: 6px 0 12px; }
#gem-shop-items .gem-reward-scroll { max-height: 460px; width: 100%; overflow: auto !important; border: 1px solid rgba(var(--aoy-palette-border-rgb, 123, 200, 251), .2); border-radius: 4px; }
#gem-shop-items table { width: 100%; margin: 0; border-collapse: collapse; table-layout: fixed; color: rgb(var(--aoy-palette-text-rgb, 234, 246, 255)); }
#gem-shop-items th { padding: 12px 10px; background: #181818; color: rgb(var(--aoy-palette-accent-rgb, 143, 220, 255)); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
#gem-shop-items thead th { position: sticky; top: 0; z-index: 1; }
#gem-shop-items thead th:last-child { width: 140px; text-align: center; }
#gem-shop-items td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
#gem-shop-items td:last-child { text-align: center; white-space: nowrap; }
#gem-shop-items .gem-reward-category th { background: #242424; text-align: left; }
#gem-shop-items .gem-reward-price { display: inline-flex; align-items: center; justify-content: center; gap: 4px; vertical-align: middle; }
#gem-shop-items .gem-point-icon { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; flex: 0 0 auto; }
#gem-shop-items .shop-item-tooltip-source { display: none; }
#gem-shop-items .gem-reward-item { display: inline-flex; align-items: center; gap: 12px; color: inherit; }
#gem-shop-items .gem-reward-item img { flex: 0 0 28px; object-fit: contain; image-rendering: pixelated; }
#gem-shop-items .gem-reward-item span { overflow-wrap: anywhere; }
#gem-shop-items .gem-reward-guide { margin: 12px 0 0; text-align: right; font-size: 12px; }
#gem-shop-items [hidden] { display: none !important; }
.shop-checkout-review { margin: -24px auto 12px; text-align: center; }
.shop-checkout-review[hidden] { display: none !important; }
@media (min-width: 992px) {
    .shop-checkout-review { margin-bottom: 82px; }
}
[data-shop-package].is-selected input[type="image"] { outline: 2px solid rgb(var(--aoy-palette-accent-rgb, 123, 200, 251)); outline-offset: 4px; border-radius: 3px; }

html[data-aoy-color-scheme] body.aoy-inner-page #section-main:is(#section-main) .downloads-page .shop-gem-balance {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 194px;
    max-width: 100%;
    margin: 8px 0 12px;
    padding: 8px 14px 8px 10px;
    border: 1px solid var(--aoy-action-border, #3199ba);
    border-radius: 10px;
    background: var(--aoy-action-fill, linear-gradient(135deg, #8de3fb, #40b9df));
    color: var(--aoy-action-ink, #082e40) !important;
    font-family: var(--aoy-title-font);
    text-align: left;
    box-shadow: 0 6px 22px -9px #40b9df66, inset 0 1px 0 #ffffff8a;
    cursor: default;
    box-sizing: border-box;
}
html[data-aoy-color-scheme] body.aoy-inner-page #section-main:is(#section-main) .shop-gem-balance :is(span, strong) { color: inherit !important; -webkit-text-fill-color: currentColor !important; text-shadow: none !important; }
.shop-gem-balance-emblem { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border: 1px solid #ffffff66; border-radius: 8px; background: #ffffff2e; box-shadow: inset 0 1px 0 #ffffff52; }
.shop-gem-balance-emblem img { display: block; width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 3px 4px #10495d38); }
html body #section-main .shop-gem-balance-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
html body #section-main .shop-gem-balance-label { font-size: 9px; font-weight: 800; line-height: 1.2; letter-spacing: .1em; opacity: .8; }
html body #section-main .shop-gem-balance-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: 11px; font-weight: 700; line-height: 1.15; }
.shop-gem-balance-value strong { font-size: 22px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* Native top-layer dialogs stay centered even inside animated shop panels. */
html body .shop-flow-dialog {
    --shop-accent-rgb: var(--aoy-palette-accent-rgb, 123, 200, 251);
    --shop-surface-rgb: 10, 10, 10;
    --shop-surface-opacity: .82;
    --shop-ink: rgb(var(--aoy-palette-text-rgb, 234, 246, 255));
    --shop-muted: rgb(var(--aoy-palette-muted-rgb, 184, 201, 216));
    position: fixed;
    inset: 0;
    width: min(820px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    height: fit-content;
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 1px solid rgba(var(--shop-accent-rgb), .5);
    border-radius: 12px;
    background: rgba(var(--shop-surface-rgb), var(--shop-surface-opacity));
    color: var(--shop-ink);
    box-shadow: 0 26px 80px #0009, inset 0 1px 0 #ffffff12;
    text-align: center;
    box-sizing: border-box;
}
html[data-aoy-color-scheme="light"] body .shop-flow-dialog {
    --shop-accent-rgb: var(--aoy-palette-accent-rgb, 23, 111, 159);
    --shop-surface-rgb: var(--aoy-palette-surface-rgb, 244, 249, 254);
    --shop-surface-opacity: .94;
    --shop-ink: var(--aoy-light-text, #16263a);
    --shop-muted: rgb(var(--aoy-palette-muted-rgb, 82, 103, 122));
    background: var(--aoy-light-panel-gradient, linear-gradient(180deg, rgba(244, 249, 254, .94), rgba(224, 239, 249, .86)));
}
.shop-flow-dialog:not([open]) { display: none !important; }
.shop-flow-dialog::backdrop { background: #030a16b8; backdrop-filter: blur(7px); }
body:has(.shop-flow-dialog[open]) { overflow: hidden; }
.shop-flow-dialog .shop-flow-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: rgb(var(--shop-accent-rgb));
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}
html body .shop-flow-dialog h3 {
    width: 100% !important;
    margin: 16px auto 12px;
    padding: 0;
    box-sizing: border-box;
    background: none;
    color: inherit;
    -webkit-text-fill-color: currentColor;
    font-family: var(--aoy-title-font);
    font-size: clamp(21px, 3vw, 27px);
    line-height: 1.25;
    text-align: center;
    outline: none;
}
.shop-flow-dialog h3::after, .shop-flow-dialog h3::before { display: none !important; }
.shop-flow-dialog p { margin: 0; color: var(--shop-muted); font-size: 14px; line-height: 1.65; }
html body .shop-flow-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--shop-ink);
    cursor: pointer;
    overflow: hidden;
    contain: layout paint;
    transform: none !important;
    transition: none;
}
html body .shop-flow-close img { transition: transform 320ms ease; }
html body .shop-flow-close:is(:hover, :focus-visible) img { transform: scale(1.3) rotate(360deg); }
html body .shop-flow-close:focus-visible { outline: 2px solid rgb(var(--shop-accent-rgb)) !important; outline-offset: -2px; }
.shop-flow-dialog button:focus-visible { outline: 2px solid rgb(var(--shop-accent-rgb)); outline-offset: 3px; }
html body .shop-delivery-picker { width: min(560px, calc(100vw - 32px)); overflow: hidden; }
.shop-delivery-picker[open] { display: flex; flex-direction: column; }
.shop-delivery-picker-header { position: relative; flex: 0 0 auto; padding: 28px 42px 20px; }
.shop-delivery-picker-gems { display: block; width: 60px; height: 60px; margin: 0 auto 12px; object-fit: contain; filter: drop-shadow(0 5px 12px rgba(var(--shop-accent-rgb), .25)); }
html body #shop-delivery-picker .shop-delivery-menu {
    position: static !important;
    display: grid !important;
    gap: 6px;
    min-height: 0;
    max-height: 52dvh;
    margin: 0 14px 14px;
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 8px;
    background: transparent !important;
    box-shadow: none;
    transform: none !important;
    opacity: 1;
    visibility: visible;
}
html body #shop-delivery-picker .shop-delivery-option { position: relative; justify-content: center; gap: 10px; min-height: 60px; margin: 0; padding: 10px 42px; border: 1px solid rgba(var(--aoy-palette-border-rgb, 123, 200, 251), .18); text-align: center; }
html body #shop-delivery-picker .shop-delivery-option-copy { min-width: 0; }
html body #shop-delivery-picker .shop-delivery-option-check { position: absolute; right: 16px; }
html body #shop-delivery-picker .shop-delivery-option:is(:hover, :focus-visible, .is-active) { border-color: rgb(var(--shop-accent-rgb)); background: rgba(var(--shop-accent-rgb), .12) !important; }
html body #shop-delivery-picker .shop-delivery-option-name { color: var(--shop-ink); overflow-wrap: anywhere; }
.shop-checkout-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.shop-checkout-art { position: relative; grid-area: 1 / 2; min-height: 460px; overflow: hidden; }
.shop-checkout-cover { position: absolute; top: 0; left: 50%; width: auto; min-width: 106%; max-width: none; height: 100%; object-fit: cover; transform: translateX(-52.4%); }
/* The artwork's slogan center is 52.4% across its source image. Align that
   point with the logo so both remain centered together at every crop size. */
.shop-checkout-logo { position: absolute; z-index: 1; top: calc(50% - 158px); left: 50%; width: 112px; height: 112px; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 6px 12px #0008); }
.shop-checkout-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(var(--shop-surface-rgb), var(--shop-surface-opacity)), transparent 30%), linear-gradient(0deg, rgba(var(--shop-surface-rgb), .25), transparent 50%); }
.shop-checkout-content { grid-area: 1 / 1; align-self: center; min-width: 0; padding: 40px 30px 30px; }
.shop-checkout-account { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; padding: 14px 36px; border: 1px solid rgba(var(--shop-accent-rgb), .4); border-radius: 8px; background: rgba(var(--shop-accent-rgb), .08); text-align: center; }
.shop-checkout-account > i { color: rgb(var(--shop-accent-rgb)); font-size: 21px; }
.shop-checkout-account > i:last-child { position: absolute; right: 14px; font-size: 16px; }
.shop-checkout-account > span { min-width: 0; }
.shop-checkout-account strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.shop-checkout-account small { display: block; margin-top: 3px; color: var(--shop-muted); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.shop-checkout-change, .shop-checkout-back { padding: 8px 4px; border: 0; background: transparent; color: rgb(var(--shop-accent-rgb)); font: inherit; font-size: 12px; cursor: pointer; text-underline-offset: 4px; }
.shop-checkout-change:hover, .shop-checkout-back:hover { text-decoration: underline; }
.shop-checkout-package { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 10px 0 22px; padding: 16px 0; border-block: 1px solid rgba(var(--aoy-palette-border-rgb, 123, 200, 251), .23); font-size: 13px; }
.shop-checkout-package i { margin-right: 4px; color: rgb(var(--shop-accent-rgb)); }
.shop-checkout-package strong, .shop-checkout-price { font-size: 20px; font-weight: 800; }
.shop-checkout-price small { font-size: 10px; color: var(--shop-muted); }
.shop-checkout-content form { margin: 0; }
.shop-checkout-back { display: block; margin: 10px auto 0; color: var(--shop-muted); }
@media (max-width: 600px) {
    .shop-checkout-layout { grid-template-columns: 1fr; }
    .shop-checkout-art { grid-area: 1 / 1; min-height: 200px; height: 26dvh; max-height: 220px; }
    .shop-checkout-logo { top: 12px; width: 64px; height: 64px; }
    .shop-checkout-art::after { background: linear-gradient(0deg, rgba(var(--shop-surface-rgb), var(--shop-surface-opacity)), transparent 65%); }
    .shop-checkout-content { grid-area: 2 / 1; padding: 12px 24px 24px; }
    .shop-delivery-picker-header { padding: 26px 36px 16px; }
    .shop-delivery-picker-gems { width: 52px; height: 52px; margin-bottom: 10px; }
}
.shop-guest-message { margin: 12px 0 4px; font-size: 12px; }
#gem-shop-items :is(summary, input, a):focus-visible,
.shop-checkout-confirmation button:focus-visible { outline: 2px solid rgb(var(--aoy-palette-border-rgb, 123, 200, 251)); outline-offset: 3px; }

/* Recover the new dropdown's height from the existing account panel's spacing. */
.downloads-page .stripe-intro-copy { padding-top: 32px; padding-bottom: 6px; }
.downloads-page .shop-gem-balance { margin: 6px 0 4px; padding: 6px 14px; }
.downloads-page .shop-delivery-panel { margin-top: 2px; padding: 8px 14px 6px; }
.downloads-page .shop-delivery-header { margin-bottom: 4px; }
html body .downloads-page .shop-delivery-header { flex-direction: column; justify-content: center; gap: 8px; }
html body .downloads-page .shop-delivery-select { position: relative; justify-content: center; padding: 4px 40px; text-align: center; }
html body .downloads-page .shop-delivery-select-copy { flex: 0 1 auto; }
html body .downloads-page .shop-delivery-select-chevron { position: absolute; right: 16px; }
html body .shop-delivery-avatar { display: block; flex: 0 0 48px; width: 48px; height: 48px; border: 0; border-radius: 0; background: transparent; object-fit: contain; image-rendering: pixelated; }
.downloads-page .shop-delivery-field label { margin-bottom: 2px; }
.downloads-page .shop-delivery-note { margin-bottom: 4px; }
.downloads-page .shop-delivery-select-wrap,
.downloads-page .shop-delivery-select { min-height: 44px; }
.downloads-page .shop-delivery-panel > br { display: none; }
#gem-shop-items + #purchase-tier-progress { margin-top: 10px; }
html:not([data-aoy-color-scheme="light"]) body:not(.aoy-light-theme) #section-main :is(.stripe-intro-copy, .shop-delivery-panel, .shop-delivery-current, .shop-delivery-select-wrap, .shop-delivery-select, .shop-delivery-menu, #gem-shop-items, #purchase-tier-progress) {
    background: rgba(10,10,10,.82) !important;
}
html:not([data-aoy-color-scheme="light"]) body:not(.aoy-light-theme) #purchase-tier-progress .tier-table th {
    background: #181818;
}
html[data-aoy-color-scheme="light"] body.aoy-inner-page #section-main #gem-shop-items .gem-search input,
body.aoy-light-theme #section-main #gem-shop-items .gem-search input {
    background: rgb(var(--aoy-palette-panel-rgb, 244, 248, 252)) !important;
    color: rgb(var(--aoy-palette-text-rgb, 36, 56, 74)) !important;
    -webkit-text-fill-color: rgb(var(--aoy-palette-text-rgb, 36, 56, 74)) !important;
    border-color: rgb(var(--aoy-palette-border-rgb, 130, 155, 176)) !important;
    color-scheme: light;
}
html[data-aoy-color-scheme="light"] body.aoy-inner-page #section-main #gem-shop-items .gem-search input::placeholder,
body.aoy-light-theme #section-main #gem-shop-items .gem-search input::placeholder {
    color: rgb(var(--aoy-palette-muted-rgb, 82, 103, 122)) !important;
    -webkit-text-fill-color: rgb(var(--aoy-palette-muted-rgb, 82, 103, 122)) !important;
    opacity: 1;
}
html[data-aoy-color-scheme="light"] #gem-shop-items .gem-search-result { color: rgb(var(--aoy-palette-muted-rgb, 51, 65, 85)) !important; }
@media(max-width:600px) {
    html body .shop-delivery-avatar { flex-basis: 44px; width: 44px; height: 44px; }
    #gem-shop-items summary { padding: 12px; font-size: 14px; }
    #gem-shop-items .tier-reward-content { padding: 0 12px 12px; }
    #gem-shop-items .tier-reward-summary-meta { font-size: 10px; }
    #gem-shop-items .gem-search { display: block; }
    #gem-shop-items .gem-search > span { display: block; margin-bottom: 6px; }
    #gem-shop-items thead th:last-child { width: 90px; }
    #gem-shop-items td { padding: 8px; font-size: 12px; }
    #gem-shop-items .gem-reward-item { gap: 7px; }
}
@media(prefers-reduced-motion:reduce) {
    #gem-shop-items * { animation: none !important; transition: none !important; }
    html body .shop-flow-close img { transition: none; }
}
