:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    --store-display-font: Inter, ui-sans-serif, system-ui, sans-serif;
    background: #0b1020;
    color: #eef2ff;
}

* { box-sizing: border-box; }
/* The hidden attribute must always win. Without this, any class that sets display
   (.button, grids, flex rows) silently keeps a "hidden" element on screen. */
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: #0b1020; }
a { color: #a5b4fc; }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 6vw; border-bottom: 1px solid #29324d; background: rgba(11, 16, 32, .9); }
.brand { color: #fff; font-size: 1.25rem; font-weight: 800; text-decoration: none; }
nav { display: flex; gap: 1rem; align-items: center; }
nav form { margin: 0; }
.account { color: #cbd5e1; }
.link-button { padding: 0; border: 0; background: none; color: #a5b4fc; cursor: pointer; }
.page-shell { width: min(72rem, 88vw); margin: 0 auto; padding: 5rem 0; }
.hero { max-width: 48rem; }
.eyebrow { color: #818cf8; font-weight: 800; letter-spacing: .14em; }
h1 { margin: .25rem 0 1rem; font-size: clamp(2.5rem, 7vw, 5rem); line-height: 1; }
.hero > p:last-child { color: #cbd5e1; font-size: 1.15rem; line-height: 1.7; }
.panel, .auth-card { margin-top: 3rem; padding: 2rem; border: 1px solid #334155; border-radius: 1rem; background: rgba(15, 23, 42, .82); }
.auth-card { max-width: 34rem; margin-inline: auto; }
.auth-card h1 { font-size: 2.25rem; }
.auth-card label { display: block; margin-bottom: .35rem; font-weight: 700; }
.auth-card input, .auth-card select { width: 100%; padding: .75rem; border: 1px solid #475569; border-radius: .5rem; background: #111827; color: #fff; }
.auth-card button[type="submit"] { padding: .75rem 1.2rem; border: 0; border-radius: .5rem; background: #6366f1; color: #fff; font-weight: 800; cursor: pointer; }
.helptext { color: #94a3b8; font-size: .875rem; }
.errorlist { color: #fca5a5; }

@media (max-width: 48rem) {
    .site-header, nav { align-items: flex-start; }
    .site-header { gap: 1rem; }
    nav { flex-wrap: wrap; justify-content: flex-end; }
}

/* Auth forms: field stacking + inline AJAX success/error feedback. */
.auth-card label:not(:first-of-type) { margin-top: 1rem; }
.form-message { margin-bottom: 1.5rem; padding: .75rem 1rem; border-radius: .5rem; font-weight: 700; }
.form-message--error { background: rgba(248, 113, 113, .12); color: #fca5a5; border: 1px solid rgba(248, 113, 113, .35); }
.form-message--success { background: rgba(74, 222, 128, .12); color: #86efac; border: 1px solid rgba(74, 222, 128, .35); }
.form-message p { margin: 0; }
.form-message p + p { margin-top: .35rem; }
.auth-card button[type="submit"]:disabled,
.link-button:disabled { opacity: .6; cursor: not-allowed; }

/* Shared buttons for AJAX pages. */
.button { display: inline-block; padding: .7rem 1.1rem; border: 0; border-radius: .5rem; background: #6366f1; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.button:hover { background: #4f46e5; }
a.button { text-decoration: none; }
.button:disabled { opacity: .6; cursor: not-allowed; }
.button--small { padding: .4rem .75rem; font-size: .875rem; }
.button--ghost { background: transparent; border: 1px solid #475569; color: #e2e8f0; }
.button--ghost:hover { background: #1e293b; }
.button--danger { background: transparent; border: 1px solid rgba(248, 113, 113, .5); color: #fca5a5; }
.button--danger:hover { background: rgba(248, 113, 113, .12); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Developer game management page. */
.dev-page__header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.dev-page__header h1 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 3rem); }
.dev-form-panel { margin-top: 2rem; }
.dev-form-panel h2 { margin-top: 0; }
.dev-form { max-width: 40rem; }
.dev-form label { display: block; margin: 1rem 0 .35rem; font-weight: 700; }
.dev-form input[type="text"], .dev-form input[type="number"], .dev-form textarea { width: 100%; padding: .75rem; border: 1px solid #475569; border-radius: .5rem; background: #111827; color: #fff; font: inherit; }
.dev-form input[type="file"] { color: #cbd5e1; }
.dev-form .helptext { margin: .35rem 0 0; }
.dev-form fieldset { margin: 1rem 0 0; padding: 0; border: 0; }
.dev-form legend { padding: 0; font-weight: 700; }
.category-options { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .5rem; }
.dev-form label.checkbox, .category-options .checkbox { display: inline-flex; gap: .4rem; align-items: center; margin: 0; font-weight: 400; }
.dev-form > label.checkbox { margin-top: 1.25rem; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; }
.dev-list { margin-top: 2rem; }
.dev-list__status { color: #cbd5e1; }
.games-table { width: 100%; border-collapse: collapse; }
.games-table th { padding: .75rem; border-bottom: 1px solid #334155; color: #94a3b8; font-size: .8rem; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.games-table td { padding: .75rem; border-bottom: 1px solid #1e293b; vertical-align: middle; }
.game-cell { display: flex; gap: .75rem; align-items: center; }
.game-cell__cover { width: 4rem; height: 3rem; border-radius: .35rem; object-fit: cover; background: #1e293b; }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge--live { background: rgba(74, 222, 128, .12); color: #86efac; }
.badge--draft { background: rgba(148, 163, 184, .15); color: #cbd5e1; }
.row-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

/* Small screens: each table row becomes a card. */
@media (max-width: 48rem) {
    .games-table thead { display: none; }
    .games-table, .games-table tbody, .games-table tr, .games-table td { display: block; width: 100%; }
    .games-table tr { margin-bottom: 1rem; padding: .75rem; border: 1px solid #334155; border-radius: .75rem; background: rgba(15, 23, 42, .82); }
    .games-table td { padding: .35rem 0; border: 0; }
    .row-actions { justify-content: flex-start; }
}

/* Currency picker in the header (currency.js fills the options). */
#currency-picker { padding: .3rem .5rem; border: 1px solid #475569; border-radius: .5rem; background: #111827; color: #eef2ff; font: inherit; cursor: pointer; }
#currency-picker:disabled { opacity: .6; cursor: not-allowed; }
[data-price] { font-variant-numeric: tabular-nums; }

/* "My library" page. */
.library-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.library-count { margin: -.5rem 0 0; color: #94a3b8; }
.library-status { color: #cbd5e1; }
.library-status--error { color: #fca5a5; }
.library-empty { max-width: 32rem; }
.library-empty h2 { margin-top: 0; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.25rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.library-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid #334155; border-radius: 1rem; background: rgba(15, 23, 42, .82); }
.library-card__cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #1e293b; }
.library-card__cover--empty { display: grid; place-items: center; color: #64748b; font-size: 2.5rem; font-weight: 800; }
.library-card__body { display: flex; flex: 1; flex-direction: column; gap: .4rem; padding: 1rem 1.1rem 1.2rem; }
.library-card__title { margin: 0; font-size: 1.15rem; }
.library-card__meta { margin: 0; color: #94a3b8; font-size: .875rem; }
.library-card__tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0; padding: 0; list-style: none; }
.library-card__tags li { padding: .15rem .55rem; border-radius: 999px; background: rgba(99, 102, 241, .15); color: #c7d2fe; font-size: .75rem; }
.library-card__download { align-self: flex-start; margin-top: auto; }

/* Cart page. */
.cart-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.5rem; align-items: start; margin-top: 2rem; }
/* display: grid would otherwise override the hidden attribute (empty cart, after checkout). */
.cart-layout[hidden] { display: none; }
.cart-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.cart-item { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto auto; gap: 1rem; align-items: center; padding: .75rem; border: 1px solid #334155; border-radius: 1rem; background: rgba(15, 23, 42, .82); }
.cart-item__cover { width: 7rem; aspect-ratio: 16 / 9; border-radius: .5rem; object-fit: cover; background: #1e293b; }
.cart-item__cover--empty { display: grid; place-items: center; color: #64748b; font-size: 1.5rem; font-weight: 800; }
.cart-item__title { color: #eef2ff; font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
.cart-item__title:hover { text-decoration: underline; }
.cart-item__meta { margin: .25rem 0 0; color: #94a3b8; font-size: .875rem; }
.cart-item__price { font-weight: 800; white-space: nowrap; }
.cart-item__was { margin-right: .4rem; color: #94a3b8; font-weight: 400; }
.cart-item__sale { color: #86efac; }
.cart-sale-note { margin: -.5rem 0 0; color: #86efac; font-size: .875rem; font-weight: 700; }
.cart-summary { margin-top: 0; padding: 1.5rem; }
.cart-summary h2 { margin-top: 0; }
.cart-summary__row { display: flex; justify-content: space-between; gap: 1rem; font-size: 1.15rem; font-weight: 800; }
.cart-summary__checkout { width: 100%; margin-top: .5rem; }
/* My orders page (rows reuse the cart's cover, title and price styles). */
.orders-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.orders-list { display: grid; gap: .75rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.orders-list[hidden] { display: none; }
.order-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; gap: 1rem; align-items: start; padding: .75rem; border: 1px solid #334155; border-radius: 1rem; background: rgba(15, 23, 42, .82); }
.order-row__body { min-width: 0; }
.order-row__note:empty { display: none; }
.order-row__note { margin: .4rem 0 0; color: #86efac; font-size: .875rem; }
.order-row__side { display: flex; flex-direction: column; align-items: flex-end; gap: .45rem; }
.order-badge { padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.order-badge--done { background: rgba(74, 222, 128, .15); color: #86efac; }
.order-badge--pending { background: rgba(250, 204, 21, .15); color: #fde68a; }
.order-badge--failed { background: rgba(248, 113, 113, .15); color: #fca5a5; }
.order-badge--refunded { background: rgba(148, 163, 184, .18); color: #cbd5e1; }
.order-refund { display: grid; gap: .4rem; margin-top: .75rem; max-width: 28rem; }
.order-refund label { font-size: .875rem; font-weight: 700; }
.order-refund textarea { width: 100%; padding: .5rem; border: 1px solid #475569; border-radius: .5rem; background: #111827; color: #fff; font: inherit; }
.order-refund__error { margin: 0; color: #fca5a5; font-size: .875rem; }
.order-refund__actions { display: flex; gap: .5rem; }

@media (max-width: 48rem) {
    .order-row { grid-template-columns: 5rem minmax(0, 1fr); }
    .order-row__side { grid-column: 2; align-items: flex-start; }
    .cart-layout { grid-template-columns: 1fr; }
    .cart-item { grid-template-columns: 5rem minmax(0, 1fr); }
    .cart-item__cover { width: 5rem; }
    .cart-item__price, .cart-item .button { grid-column: 2; justify-self: start; }
}

/* Game Store Styles */
.page-shell.store-shell {
    width: min(110rem, 98vw);
    padding: 3.5rem 0 5rem;
}
.page-shell.game-detail-shell {
    width: min(110rem, 96vw);
    padding: 3rem 0 5rem;
}
.store-page {
    --store-purple: #818cf8;
    --store-lilac: #c4b5fd;
    --store-ink: #0b0b12;
    --store-panel: #15131f;
    --store-muted: #b9b5c9;
    font-size: 1.25rem;
}
.game-detail-page { font-size: 1.25rem; }
.store-intro {
    margin: 0 0 2.5rem;
    text-align: left;
}
.store-intro .eyebrow,
.spotlight-copy .eyebrow,
.shelf-heading .eyebrow {
    margin: 0 0 .8rem;
    color: var(--store-lilac);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.5;
    text-transform: uppercase;
}
.store-title {
    margin: 0;
    color: #fff;
    font-family: var(--store-display-font);
    font-size: clamp(2.75rem, 5vw, 4rem);
    line-height: 1.35;
    text-align: left;
}
.store-lede {
    margin: .85rem 0 .4rem;
    color: #e5e2ef;
    font-size: 1.25rem;
    line-height: 1.6;
}
.store-count,
.collection-count {
    color: var(--store-muted);
    font-size: 1.25rem;
    line-height: 1.5;
}
.store-count { margin: 0; }
.category-button-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: min(100%, calc(100vw - 2rem));
    max-width: 100%;
    min-width: 0;
    gap: .65rem;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 1.6rem auto 0;
    padding: .5rem .35rem;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}
.category-button-row::-webkit-scrollbar { display: none; }
.category-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 3rem;
    padding: .7rem 1rem;
    border: 3px solid #c4b5fd;
    border-radius: 999px;
    background: #6366f1;
    box-shadow: 0 5px 0 #312e81, 0 0 0 2px #171226;
    color: #fff;
    font-size: 1.3rem;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    image-rendering: pixelated;
    text-transform: uppercase;
    transition: filter .16s ease, transform .16s ease, box-shadow .16s ease;
}
.category-button:hover { transform: translateY(-2px); filter: brightness(1.16); }
.category-button[aria-pressed="true"] {
    background: #818cf8;
    box-shadow: 0 5px 0 #312e81, 0 0 0 2px #171226, inset 0 0 0 2px #e9d5ff;
}
.category-button:focus-visible,
.store-cta:focus-visible,
.text-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}
.category-button-icon { font-size: 1.3rem; line-height: 1; }
.store-spotlight {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    width: 100%;
    height: 21rem;
    overflow: hidden;
    border: 4px solid #818cf8;
    border-radius: 0;
    background: #241325;
    box-shadow: 8px 8px 0 #312e81;
}
.spotlight-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3.5rem);
}
.spotlight-copy h2 {
    margin: 0 0 .85rem;
    color: #fff;
    font-family: var(--store-display-font);
    font-size: 1.5rem;
    line-height: 1.8;
}
.spotlight-copy h2.spotlight-title--normal {
    font-family: var(--store-display-font);
    font-size: 2rem;
    line-height: 1.2;
}
.spotlight-copy > p:not(.eyebrow) {
    max-width: 34rem;
    margin: 0 0 1.5rem;
    color: #e1d9e7;
    line-height: 1.6;
}
.store-cta {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1.1rem;
    border: 3px solid #fff0ad;
    border-radius: 0;
    background: #f2c14e;
    box-shadow: 0 5px 0 #9a5b12;
    color: #241a12;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.7;
    text-decoration: none;
    text-transform: uppercase;
}
.store-cta-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
    transition: transform .16s ease;
}
.store-cta:hover { transform: translateY(-2px); background: #ffda70; }
.store-cta:hover .store-cta-icon { transform: translateX(3px); }
.spotlight-art {
    min-width: 0;
    height: 21rem;
    padding: .75rem;
    background: #7040a0;
    overflow: hidden;
}
.spotlight-art img {
    display: block;
    width: 100%;
    height: 150%;
    object-fit: contain;
    object-position: center;
    transform: scale(3);
    
}
.cover-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 10rem;
    place-items: center;
    background: #7040a0;
    color: rgba(255, 255, 255, .9);
    font-family: var(--store-display-font);
    font-size: 3rem;
}
.cover-placeholder[hidden] { display: none; }
.game-shelf { margin-top: 3.5rem; }
.shelf-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding-bottom: .9rem;
    border-bottom: 3px solid #6366f1;
}
.shelf-heading .eyebrow { margin-bottom: .35rem; }
.shelf-heading h2 {
    margin: 0;
    color: #fff;
    font-family: var(--store-display-font);
    font-size: 1.5rem;
    line-height: 1.8;
}
.text-link {
    flex: 0 0 auto;
    color: #f2c14e;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.8;
    text-decoration: none;
}
.text-link:hover { color: #ffda70; }
.game-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
.game-card {
    min-width: 0;
    overflow: hidden;
    border: 3px solid #51458a;
    border-radius: 0;
    background: var(--store-panel);
    box-shadow: 5px 5px 0 #312e81;
    transition: transform .18s ease, border-color .18s ease;
}
.game-card:hover {
    transform: translate(-2px, -2px);
    border-color: #c4b5fd;
}
.game-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}
.game-card-link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}
.game-card[hidden],
.store-spotlight[hidden] { display: none; }
.game-card-art {
    position: relative;
    aspect-ratio: 1.45;
    overflow: hidden;
    background: #453071
}
.game-card-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: scale(2.5);
}
.game-card-art .cover-placeholder { min-height: 100%; font-size: 2rem; }
.game-price {
    position: absolute;
    right: .65rem;
    bottom: .65rem;
    padding: .4rem .55rem;
    border: 2px solid #fff0ad;
    border-radius: 0;
    background: #f2c14e;
    box-shadow: 3px 3px 0 #9a5b12;
    color: #241a12;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.6;
}
.game-card-copy { padding: .9rem; }
.game-card-copy h3 {
    margin: 0 0 .45rem;
    color: #fff;
    font-family: var(--store-display-font);
    font-size: 1.65rem;
    line-height: 1.8;
}
.game-card-copy > p {
    display: -webkit-box;
    min-height: 2.8em;
    margin: 0;
    overflow: hidden;
    color: var(--store-muted);
    font-size: 1.25rem;
    line-height: 1.6;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: .75rem 0 0;
    padding: 0;
    list-style: none;
}
.game-tags li {
    padding: .25rem .45rem;
    border: 1px solid rgba(196, 181, 253, .2);
    border-radius: 0;
    color: #d1c9e5;
    font-size: 1.25rem;
    line-height: 1.7;
}
.game-card-prompt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .9rem;
    padding-top: .65rem;
    border-top: 1px solid rgba(196, 181, 253, .25);
    color: #c4b5fd;
    font-size: 1.25rem;
    font-weight: 800;
}
.game-card-prompt span { font-size: 1.35rem; line-height: 1; }
.game-detail-page {
    --detail-panel: #15131f;
    --detail-muted: #b9b5c9;
}
.game-detail-back {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: #c4b5fd;
    font-weight: 800;
    text-decoration: none;
}
.game-detail-back:hover { color: #fff; }
.game-detail-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(22rem, .8fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: center;
    padding: clamp(1rem, 3vw, 3rem);
    border: 3px solid #818cf8;
    background: var(--detail-panel);
    box-shadow: 8px 8px 0 #312e81;
}
.game-detail-art {
    display: grid;
    min-width: 0;
    min-height: 22rem;
    aspect-ratio: 1 / 1;
    place-items: center;
    overflow: hidden;
    background: #453071;
}
.game-detail-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
.game-detail-art .cover-placeholder { width: 100%; min-height: 22rem; }
.game-detail-copy { min-width: 0; }
.game-detail-copy > .eyebrow {
    margin: 0;
    color: #c4b5fd;
    font-size: 1.3rem;
    line-height: 1.8;
}
.game-detail-copy h1 {
    margin: .5rem 0 1rem;
    color: #fff;
    font-family: var(--store-display-font);
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.game-detail-price {
    margin: 0 0 1.25rem;
    color: #ffda70;
    font-size: 1.65rem;
    font-weight: 800;
}
.game-detail-description {
    margin: 0;
    color: #e1d9e7;
    font-size: 1.35rem;
    line-height: 1.8;
    white-space: pre-line;
}
.game-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}
.game-detail-tags li {
    padding: .3rem .55rem;
    border: 1px solid #8171c8;
    color: #e1d9e7;
}
.game-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.25rem;
}
.game-detail-action {
    min-height: 3.5rem;
    padding: 1rem 1.5rem;
    border: 3px solid #fff0ad;
    background: #f2c14e;
    color: #241a12;
    font: inherit;
    font-size: 1.35rem;
    font-weight: 800;
    cursor: pointer;
}
.game-detail-action--secondary {
    border-color: #c4b5fd;
    background: #312e81;
    color: #fff;
}
.game-detail-action:hover { filter: brightness(1.12); }
.game-detail-action:focus-visible,
.game-detail-back:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
.game-detail-demo-note {
    margin: .9rem 0 0;
    color: var(--detail-muted);
    font-size: 1.25rem;
    line-height: 1.6;
}
.game-detail-status:empty { display: none; }
.game-detail-status {
    color: #ffda70;
    font-weight: 700;
    line-height: 1.6;
}
.store-empty {
    margin: 1.5rem 0 0;
    color: var(--store-muted);
    text-align: center;
}
.store-empty--initial {
    padding: 5rem 1.5rem;
    border: 4px solid #818cf8;
    border-radius: 0;
    background: #241325;
    box-shadow: 8px 8px 0 #312e81;
}
.store-empty--initial > span { color: #f2c14e; font-size: 2rem; }
.store-empty--initial h2 {
    color: #fff;
    font-family: var(--store-display-font);
    font-size: 1.3rem;
    line-height: 1.8;
}
.store-empty--initial p { color: var(--store-muted); }

@media (max-width: 58rem) {
    .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .game-detail-card { grid-template-columns: minmax(0, 1fr) minmax(16rem, .9fr); }
}
@media (max-width: 42rem) {
    .page-shell.store-shell { 
    padding-top: 2.25rem;
}
    .store-title { font-size: clamp(2rem, 8vw, 2.75rem); }
    .store-spotlight { grid-template-columns: 1fr; }
    .spotlight-copy { order: 2; }
    .store-spotlight { height: auto; }
    .spotlight-art,
    .spotlight-art { height: 12rem; }
    .page-shell.game-detail-shell { padding-top: 2rem; }
    .game-detail-card { grid-template-columns: minmax(0, 1fr); }
    .game-detail-art { min-height: 0; aspect-ratio: 4 / 3; }
    .game-detail-copy h1 { font-size: clamp(1.8rem, 7vw, 2.5rem); }
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
    .game-card-copy { padding: .7rem; }
    .shelf-heading { align-items: flex-start; }
    .text-link { max-width: 8rem; text-align: right; }
}
@media (max-width: 22rem) {
    .game-grid { grid-template-columns: 1fr; }
}

/* Homepage */
.page-shell:has(.home-page) {
    width: 100%;
    max-width: none;
    padding: 0;
}
.home-page {
    --home-accent: #c4b5fd;
    --home-muted: #b7b3c7;
    --home-button-purple: #8b5cf6;
    font-family: var(--store-display-font);
    overflow: hidden;
}
.home-hero {
    position: relative;
    display: flex;
    min-height: min(48rem, calc(100vh - 4.5rem));
    align-items: center;
    padding: clamp(4rem, 9vw, 8rem) max(7vw, calc((100vw - 76rem) / 2));
    isolation: isolate;
    background: #111020;
}
.home-hero::after {
    position: absolute;
    z-index: 1;
    background: rgba(10, 9, 20, .28);
    content: "";
    inset: 0;
}
.home-hero__image {
    position: absolute;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    inset: 0;
}
.home-hero__content { position: relative; z-index: 2; width: min(100%, 47rem); }
.home-eyebrow,
.home-section-label {
    color: var(--home-accent);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.home-eyebrow { margin: 0 0 1.4rem; }
.home-hero h1 {
    margin: 0;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
    letter-spacing: -.065em;
    line-height: .98;
}
.home-hero h1 span,
.home-mission h2 em,
.home-difference__heading h2 em { color: var(--home-accent); font-style: normal; }
.home-hero__lede {
    max-width: 37rem;
    margin: 1.5rem 0 0;
    color: #e0ddeb;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    line-height: 1.7;
}
.home-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.home-button {
    display: inline-flex;
    min-height: 3.6rem;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .9rem 1.4rem;
    border: 3px solid #111827;
    border-radius: 1rem;
    box-shadow: 0 5px 0 #111827, inset 0 3px 0 rgba(255, 255, 255, .35);
    font-family: var(--store-display-font);
    font-size: .7rem;
    line-height: 1.8;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.home-button:hover { filter: brightness(1.12); transform: translateY(-2px); }
.home-button:active { box-shadow: 0 0 0 #111827, inset 0 3px 0 rgba(255, 255, 255, .25); transform: translateY(5px); }
.home-button--primary,
.home-button--secondary { background: var(--home-button-purple); color: #fff; }
.home-hero__note { margin: 1.25rem 0 0; color: #c9c5d6; font-size: .88rem; }
.home-scroll {
    position: absolute;
    z-index: 2;
    right: max(7vw, calc((100vw - 76rem) / 2));
    bottom: 2rem;
    color: #e3deef;
    font-size: .8rem;
    letter-spacing: .1em;
    text-decoration: none;
    text-transform: uppercase;
}
.home-scroll span { margin-right: .5rem; color: var(--home-accent); font-size: 1.2rem; }
.home-mission,
.home-difference,
.home-final-cta {
    width: min(100% - 3rem, 76rem);
    margin-inline: auto;
}
.home-mission {
    position: relative;
    display: grid;
    grid-template-columns: .8fr 1.5fr;
    gap: 3rem;
    padding-block: clamp(5rem, 10vw, 9rem);
    border-bottom: 1px solid rgba(196, 181, 253, .18);
}
.home-section-label { display: flex; gap: .8rem; align-items: center; }
.home-section-label span { color: #81769e; }
.home-mission__copy { max-width: 43rem; }
.home-mission h2,
.home-difference__heading h2 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4rem);
    letter-spacing: -.05em;
    line-height: 1.08;
}
.home-difference__heading > p {
    max-width: 39rem;
    color: var(--home-muted);
    font-size: 1.08rem;
    line-height: 1.8;
}
.home-mission__copy > p {
    max-width: 43rem;
    color: var(--home-muted);
    font-size: 1.08rem;
    line-height: 1.8;
}
.home-text-link {
    display: inline-flex;
    min-height: 3.2rem;
    align-items: center;
    gap: .7rem;
    margin-top: .5rem;
    padding: .65rem 1rem;
    border: 3px solid #111827;
    border-radius: 1rem;
    background: var(--home-button-purple);
    box-shadow: 0 5px 0 #111827, inset 0 3px 0 rgba(255, 255, 255, .35);
    color: #fff;
    font-family: var(--store-display-font);
    font-size: .62rem;
    line-height: 1.8;
    letter-spacing: .06em;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.home-text-link:hover { filter: brightness(1.12); transform: translateY(-2px); }
.home-text-link:active { box-shadow: 0 0 0 #111827, inset 0 3px 0 rgba(255, 255, 255, .25); transform: translateY(5px); }
.home-difference { padding-block: clamp(4rem, 8vw, 7rem); }
.home-difference__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-top: 2rem; }
.home-difference__heading > p { max-width: 23rem; margin-bottom: .4rem; }
.home-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 3rem; }
.home-feature {
    min-height: 15rem;
    padding: 1.6rem;
    border: 3px solid #51458a;
    border-radius: 0;
    background: #15131f;
    box-shadow: 5px 5px 0 #312e81;
}
.home-feature__icon { font-size: 1.8rem; }
.home-feature h3 { margin: 1.3rem 0 .6rem; font-size: 1.2rem; }
.home-feature p { margin: 0; color: var(--home-muted); line-height: 1.7; }
.home-final-cta {
    margin-bottom: 5rem;
    padding: clamp(2.5rem, 7vw, 5rem) 1.5rem;
    border: 4px solid #818cf8;
    border-radius: 0;
    background: #241325;
    box-shadow: 8px 8px 0 #312e81;
    text-align: center;
}
.home-final-cta .home-eyebrow { margin-bottom: 1rem; }
.home-final-cta h2 { margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.04em; }
.home-final-cta > p:not(.home-eyebrow) { margin: .8rem 0 1.5rem; color: var(--home-muted); line-height: 1.7; }
.home-welcome { width: min(100% - 3rem, 76rem); margin: -2rem auto 4rem; }

.buy-now-page { max-width: 76rem; margin-inline: auto; }
.buy-now-page > h1 { margin-bottom: .5rem; font-size: clamp(2rem, 5vw, 3.5rem); }
.buy-now-intro { color: #cbd5e1; font-size: 1.1rem; line-height: 1.7; }
.buy-now-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(18rem, .8fr); gap: 1.5rem; margin-top: 2rem; }
.buy-now-summary,
.buy-now-payment { margin: 0; border: 3px solid #51458a; border-radius: 0; background: #15131f; box-shadow: 5px 5px 0 #312e81; }
.buy-now-summary h2,
.buy-now-payment h2 { margin-top: 0; font-size: 1.35rem; }
.buy-now-summary h3 { margin: 0 0 .75rem; color: #fff; font-size: 1.5rem; }
.buy-now-summary #buy-now-description { color: #cbd5e1; line-height: 1.7; white-space: pre-line; }
.buy-now-total { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 0; padding-top: 1rem; border-top: 2px solid #51458a; color: #fff; font-size: 1.2rem; font-weight: 800; }
.buy-now-method { display: flex; align-items: center; gap: .8rem; padding: .9rem; border: 2px solid #51458a; background: #211d32; line-height: 1.6; }
.buy-now-method__mark { display: grid; width: 2.6rem; height: 2.6rem; place-items: center; background: #635bff; color: #fff; font-size: 1.4rem; font-weight: 900; }
.buy-now-method small { color: #cbd5e1; }
.buy-now-notice { padding: .8rem; border-left: 3px solid #f2c14e; background: rgba(242, 193, 78, .08); color: #e8dfc6; font-size: .95rem; line-height: 1.65; }
.buy-now-payment .button { width: 100%; min-height: 3.2rem; }
.buy-now-payment .button:disabled { opacity: .55; cursor: not-allowed; }
.buy-now-status--error { color: #fca5a5; }
.buy-now-result { margin-top: 1rem; }
.stripe-payment-element { min-height: 3rem; margin: 1rem 0; }
.cart-payment { margin-top: 1.5rem; }
.cart-payment__actions { display: flex; justify-content: flex-end; gap: .75rem; }
.cart-payment__actions .button { width: auto; }

@media (max-width: 48rem) {
    .home-hero { min-height: min(43rem, calc(100vh - 4rem)); padding: 4rem 1.5rem 6rem; }
    .home-hero::after { background: rgba(10, 9, 20, .42); }
    .home-scroll { right: 1.5rem; bottom: 1.3rem; }
    .home-mission { grid-template-columns: 1fr; gap: 2rem; }
    .home-difference__heading { display: block; }
    .home-difference__heading > p { margin-top: 1rem; }
    .home-feature-grid { grid-template-columns: 1fr; }
    .home-feature { min-height: 0; }
    .buy-now-layout { grid-template-columns: 1fr; }
}

.home-hero {
    position: relative;
    min-height: 350px;
    overflow: hidden;
}

.home-hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
}

.home-hero__content {
    position: relative;
    z-index: 2;
}

.pixel-btn {
  font-family: var(--store-display-font);

  font-size: 20px;
  padding: 16px 28px;

  border: 4px solid #111827;

  cursor: pointer;

  box-shadow:
    0 6px 0 #111827,
    6px 0 0 #111827,
    -6px 0 0 #111827;

  image-rendering: pixelated;

  text-transform: uppercase;
}

.pixel-btn:active {
  transform: translateY(6px);

  box-shadow:
    0 0 0 #111827,
    6px 0 0 #111827,
    -6px 0 0 #111827;
}

/* Settings page. */
.profile-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.profile-panel { max-width: 40rem; margin-top: 1.5rem; }
.profile-facts { display: grid; gap: .5rem; margin: 0 0 .5rem; }
.profile-facts div { display: flex; gap: 1rem; }
.profile-facts dt { min-width: 8rem; color: #94a3b8; }
.profile-facts dd { margin: 0; }
.profile-picture { display: flex; gap: 1rem; align-items: center; }
.profile-picture__preview { flex: none; width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; background: #1e293b; }
.profile-picture__preview--empty { display: grid; place-items: center; color: #c7d2fe; font-size: 1.75rem; font-weight: 800; }
.profile-page select { padding: .6rem .75rem; border: 1px solid #475569; border-radius: .5rem; background: #111827; color: #fff; font: inherit; }
.dev-form label[hidden] { display: none; }

/* Store-wide sale: full price struck through beside the sale price. */
.price__was { margin-right: .4rem; font-size: .8em; font-weight: 600; text-decoration: line-through; opacity: .65; }
.price__now { color: #86efac; }
.game-price.price--sale { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.game-price.price--sale .price__was { margin: 0; font-size: .7em; }
.game-price.price--sale .price__now { color: #14532d; }
