/* =====================================================================
   OVERWORLD — Marketplace edition
   A storefront skin built from the same vocabulary as minecraft.net and
   the Bedrock Marketplace: square corners everywhere, a chunky pixel
   display face, near-black surfaces stacked in steps rather than lit
   with shadows, bevelled block buttons, and a separate gold for money.

   Files that go with this: app.js (behaviour) and the Twig templates.
   Brand colours come from the template options via partials/head.html.
   ===================================================================== */

:root {
    color-scheme: dark;

    /* --- Brand. Overridden from the template options in head.html. --- */
    --grass:      #3c8527;   /* button fill */
    --grass-deep: #2a641c;   /* button lower edge, pressed state */
    --grass-hi:   #6cc349;   /* links and active states on dark */
    --grass-mid:  #52a535;
    --grass-pale: #a0e081;
    --diamond:    #4aedd9;   /* subscriptions, trials, keyboard focus */

    /* --- Marketplace gold: sale prices, totals, the cart badge. --- */
    --gold:       #ffc42b;
    --gold-hi:    #fff27a;
    --gold-deep:  #b57f00;
    --gold-ink:   #2b1d00;

    --redstone:      #ff605e;
    --redstone-deep: #a82f29;
    --lapis:         #1157be;

    /* --- Surfaces, darkest to lightest. Depth comes from these steps. --- */
    --black:   #000000;
    --canvas:  #171615;   /* page */
    --well:    #1d1e1e;   /* recessed: art wells, inputs, price strips */
    --panel:   #262423;   /* cards and panels */
    --panel-2: #313131;   /* bars: nav, headers, table heads */
    --panel-3: #3d3938;   /* raised, hover */
    --line:        #56514f;
    --line-soft:   rgba(255, 255, 255, .09);
    --line-strong: #898481;

    /* --- Text --- */
    --tx:   #ffffff;
    --tx-2: #d0c5c0;
    --tx-3: #aba09c;
    --tx-4: #898481;

    /* --- Names the earlier version of this template used --- */
    --bedrock: var(--canvas);
    --stone: var(--panel);
    --deepslate: var(--well);
    --andesite: var(--panel-3);
    --edge: var(--line);
    --ink: var(--tx);
    --ink-muted: var(--tx-2);
    --ink-faint: var(--tx-3);

    /* --- Type. Pixel face for display and money, Noto Sans for the rest. --- */
    --f-px: "Jersey 10", ui-monospace, "Courier New", monospace;
    --f-ui: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* --- Layout --- */
    --shell: 1320px;
    --gutter: 20px;
    --nav-h: 64px;
    --tabbar-h: 58px;
    --logo-h: 40px;

    /* --- Product images, set from the template options --- */
    --card-ratio: 4 / 3;
    --card-fit: contain;
    --card-pad: 14px;
    --card-render: pixelated;

}

@supports (color: color-mix(in srgb, red, blue)) {
    :root { --grass-mid: color-mix(in srgb, var(--grass), var(--grass-hi) 45%); }
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--tx);
    font: 400 15px/1.55 var(--f-ui);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

img, svg, canvas { max-width: 100%; }
img { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select, textarea { font: inherit; color: inherit; }
p { margin: 0; }
hr { margin: 0; }
[x-cloak] { display: none !important; }

::selection { background: var(--grass); color: #fff; }

:focus-visible { outline: 3px solid var(--diamond); outline-offset: 2px; }

/* Scrollbars are square, like everything else. */
* { scrollbar-width: thin; scrollbar-color: var(--line) var(--well); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--well); }
::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid var(--well); }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

/* ---------------------------------------------------------------------
   Typography. Headings use the pixel face at sizes that land on whole
   pixels of its grid (multiples of 10) so the letters stay crisp.
   --------------------------------------------------------------------- */
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.15; }

h1, h2, .px, .pixel {
    text-wrap: balance;
    font-family: var(--f-px);
    font-weight: 400;
    font-synthesis: none;
}
h1, h2, .px {
    letter-spacing: 0;
    -webkit-font-smoothing: none;
    font-smooth: never;
    text-shadow: .075em .075em 0 #3f3f3f;
}
h1 { font-size: 40px; line-height: .95; }
h2 { font-size: 30px; line-height: 1; }
h3 { font-size: 18px; }
h3.px { font-size: 30px; line-height: 1; font-weight: 400; }

@media (min-width: 700px) {
    h1 { font-size: 50px; }
    h2 { font-size: 40px; }
}

.lead { line-height: 1.65; }
.measure { max-width: 58ch; }

/* ---------------------------------------------------------------------
   Layout primitives
   --------------------------------------------------------------------- */
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-body { flex: 1; padding-block: 40px 0; }
.view--home .page-body { padding-top: 48px; }

.stack { display: flex; flex-direction: column; gap: 24px; }
.stack.is-loose { gap: 56px; }
.stack.is-tight { gap: 12px; }

.with-rail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (min-width: 1100px) {
    .with-rail { grid-template-columns: minmax(0, 1fr) 332px; }
}

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 800px) { .split { grid-template-columns: minmax(0, 1fr); } }

.narrow { max-width: 460px; margin-inline: auto; width: 100%; }
.narrow.is-wide { max-width: 660px; }

/* ---------------------------------------------------------------------
   Utilities. Small on purpose: the templates lean on these.
   --------------------------------------------------------------------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.grow { flex: 1 1 0; min-width: 0; }
.none { flex: none; }
.minw0 { min-width: 0; }
.rel { position: relative; }
.block { display: block; }
.auto-l { margin-left: auto; }

.g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g14 { gap: 14px; }
.g16 { gap: 16px; } .g20 { gap: 20px; }

.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }

.fs12 { font-size: 12px; } .fs13 { font-size: 13px; } .fs14 { font-size: 14px; }
.fs15 { font-size: 15px; } .fs16 { font-size: 16px; }
.w600 { font-weight: 600; } .w700 { font-weight: 700; }

.tc { text-align: center; }
.tr { text-align: right; }
.cap { text-transform: capitalize; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ink { color: var(--tx); }
.muted { color: var(--tx-2); }
.faint { color: var(--tx-3); }
.c-gold { color: var(--gold-hi); }
.c-diamond { color: var(--diamond); }
.c-grass { color: var(--grass-hi); }
.c-redstone { color: var(--redstone); }

.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sr-only:focus {
    position: fixed; top: 8px; left: 8px; z-index: 300; width: auto; height: auto; margin: 0;
    padding: 10px 16px; clip: auto; background: var(--gold); color: var(--gold-ink); font-weight: 800;
}

.hide-sm { }
@media (max-width: 699px) { .hide-sm { display: none !important; } }

.text-link { text-decoration: underline; text-underline-offset: 3px; color: var(--tx-2); }
.text-link:hover { color: #fff; }
.text-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.text-btn:hover { text-decoration: underline; }

.divider { border: 0; height: 2px; background: var(--line-soft); }

.prose { color: var(--tx-2); font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: #fff; margin: 1.6em 0 .55em; }
.prose h2 { font-size: 30px; }
.prose h3 { font: 700 18px/1.3 var(--f-ui); }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--grass-hi); }
.prose a { color: var(--grass-hi); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: #fff; }
.prose img { max-width: 100%; height: auto; }
.prose strong { color: #fff; }
.prose blockquote { margin: 1em 0; padding: .6em 1em; background: var(--well); border-left: 4px solid var(--grass); }
.prose code { padding: .1em .4em; background: var(--well); border: 1px solid var(--line); font-size: .9em; }
.prose pre { overflow: auto; padding: 14px; background: var(--well); border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--panel-2); color: #fff; }
.fs14.prose { font-size: 14px; line-height: 1.6; }

@keyframes shimmer { to { background-position: -200% 0; } }
.skel {
    background: linear-gradient(90deg, var(--well), var(--panel-3), var(--well));
    background-size: 200% 100%;
    animation: shimmer 1.4s steps(8) infinite;
}
.skel-line { height: 80px; }


/* ---------------------------------------------------------------------
   Image placeholder. Shown wherever a product or line has no picture. It is
   a Font Awesome glyph drawn from CSS, so the markup stays a bare
   <span class="ph"> and no image files are needed.
   --------------------------------------------------------------------- */
.ph {
    display: grid;
    place-items: center;
    width: 52%;
    max-width: 120px;
    aspect-ratio: 1;
    color: var(--tx-4);
    opacity: .5;
    container-type: inline-size;           /* lets the glyph size itself from this box */
}
.ph::before {
    content: "\f1b2";                     /* fa-cube */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: clamp(22px, 4vw, 48px);     /* fallback for browsers without container units */
    font-size: 58cqw;                      /* scales with the box, the way the old sprite did */
    line-height: 1;
}

/* ---------------------------------------------------------------------
   Buttons. Primary buttons are bevelled blocks: a lit top edge and a dark
   lower edge inside a black outline. They flip when pressed, the way the
   in-game buttons do. Secondary buttons are plain outlines.
   --------------------------------------------------------------------- */
.btn {
    --fill: var(--panel-3);
    --hi: rgba(255, 255, 255, .16);
    --lo: rgba(0, 0, 0, .34);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    background: var(--fill);
    color: #fff;
    border: 2px solid var(--black);
    box-shadow: inset 0 3px 0 var(--hi), inset 0 -4px 0 var(--lo);
    font: 800 14px/1 var(--f-ui);
    letter-spacing: .54px;
    text-transform: uppercase;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .38);
    white-space: nowrap;
    user-select: none;
    transition: background-color .08s, border-color .08s;
}
.btn:hover:not(:disabled) { --fill: #4a4544; }
.btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: inset 0 3px 0 var(--lo), inset 0 -1px 0 var(--hi);
}
.btn:disabled { opacity: .5; box-shadow: inset 0 3px 0 var(--hi), inset 0 -4px 0 var(--lo); }

.btn-grass {
    --fill: var(--grass);
    --hi: rgba(255, 255, 255, .27);
    --lo: var(--grass-deep);
}
.btn-grass:hover:not(:disabled) { --fill: var(--grass-mid); }

.btn-gold {
    --fill: var(--gold);
    --hi: rgba(255, 255, 255, .42);
    --lo: var(--gold-deep);
    color: var(--gold-ink);
    text-shadow: none;
}
.btn-gold:hover:not(:disabled) { --fill: var(--gold-hi); }

.btn-quiet {
    --fill: transparent;
    border-color: var(--line-strong);
    box-shadow: none;
    text-shadow: none;
}
.btn-quiet:hover:not(:disabled) { --fill: rgba(255, 255, 255, .07); border-color: #fff; }
.btn-quiet:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.btn-quiet:disabled { box-shadow: none; }

.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; gap: 6px; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-note {
    margin-left: 4px;
    padding: 3px 7px;
    background: rgba(0, 0, 0, .42);
    font: 700 11px/1 var(--f-ui);
    letter-spacing: 0;
    text-transform: none;
    text-shadow: none;
}
.btn-note b { font-weight: 800; }

/* Square icon button */
.ibtn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    background: var(--panel);
    color: #fff;
    border: 2px solid var(--black);
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .08), inset -2px -2px 0 rgba(0, 0, 0, .34);
    font-size: 15px;
}
.ibtn:hover { background: var(--panel-3); }
.ibtn:active { transform: translateY(1px); }
.ibtn-text { width: auto; padding: 0 12px; font: 800 12px/1 var(--f-ui); letter-spacing: .5px; }

/* ---------------------------------------------------------------------
   Form controls
   --------------------------------------------------------------------- */
.input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    background: var(--well);
    color: #fff;
    border: 1px solid var(--line-strong);
    font: 400 15px/1.2 var(--f-ui);
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}
.input::placeholder { color: var(--tx-4); }
.input:hover { border-color: #b4aca8; }
.input:focus { border-color: #fff; }
.input:focus-visible { outline: 2px solid var(--diamond); outline-offset: 0; }
select.input {
    padding-right: 38px;
    background-image:
        linear-gradient(45deg, transparent 50%, #fff 50%),
        linear-gradient(135deg, #fff 50%, transparent 50%);
    background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    cursor: pointer;
}
.input.is-auto { width: auto; min-width: 176px; }
.input.is-qty { width: 76px; text-align: center; }
.input.is-code { text-align: center; letter-spacing: .08em; }

.opt-group { display: flex; flex-direction: column; gap: 8px; }
.opt-label { font: 800 12px/1.2 var(--f-ui); letter-spacing: .7px; text-transform: uppercase; color: var(--tx-2); }

.kbd {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    background: var(--panel-3);
    color: var(--tx-2);
    border: 1px solid var(--line);
    font: 700 11px/1.3 var(--f-ui);
    text-align: center;
}

.qty { display: inline-flex; align-items: stretch; border: 2px solid var(--black); background: var(--well); }
.qty.is-start { align-self: flex-start; }
.qty button { width: 36px; min-height: 36px; display: grid; place-items: center; background: var(--panel-3); }
.qty button:hover:not(:disabled) { background: var(--grass); }
.qty button:disabled { opacity: .4; }
.qty span { min-width: 42px; display: grid; place-items: center; font: 400 22px/1 var(--f-px); }

/* ---------------------------------------------------------------------
   Tags, product tags and filter chips
   --------------------------------------------------------------------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 3px 8px;
    background: var(--panel-3);
    color: var(--tx-2);
    font: 800 11px/1.2 var(--f-ui);
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
}
.tag-sale, .tag-gold { background: var(--gold); color: var(--gold-ink); }
.tag-gold { box-shadow: inset 0 -3px 0 var(--gold-deep); }
.tag-sub { background: #0d3a3a; color: var(--diamond); box-shadow: inset 0 0 0 1px rgba(74, 237, 217, .45); }
.tag-new, .state-active, .state-delivered { background: #1f3f15; color: var(--grass-pale); }
.tag-out, .state-expired, .state-removed, .state-failed, .state-refunded { background: #4a1f1e; color: #ff9b99; }
.state-pending { background: #4a3a10; color: var(--gold-hi); }

.pill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pill-row.center { justify-content: center; }

.ptags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ptag {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 7px;
    background: var(--well);
    color: var(--tx-3);
    border: 1px solid var(--line);
    font: 700 11px/1.3 var(--f-ui);
    letter-spacing: .3px;
    white-space: nowrap;
}
a.ptag:hover { color: #fff; border-color: var(--grass-hi); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 14px;
    background: var(--panel);
    color: var(--tx-2);
    border: 2px solid var(--black);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .06), inset 0 -3px 0 rgba(0, 0, 0, .38);
    font: 700 13px/1 var(--f-ui);
    white-space: nowrap;
}
.chip:hover { background: var(--panel-3); color: #fff; }
.chip.is-on {
    background: var(--grass);
    color: #fff;
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .24), inset 0 -4px 0 var(--grass-deep);
    text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}

/* ---------------------------------------------------------------------
   Category tabs. A single dark rail of icon + label tabs. The tab for the
   category being viewed is filled with the accent colour; the others get a
   soft lift on hover. Shown above the content on every browsing page and on
   product pages. Named .cattab (not .tab) because .tab is the mobile bottom
   bar. On wide screens a strip with more tabs than fit wraps onto a second row
   rather than hiding any; on phones it collapses into one "Shop categories"
   bar that expands downward into a two-column grid (no swiping needed).
   --------------------------------------------------------------------- */
.cattabs {
    position: relative;
    max-width: 100%;
    background: #111;
    border: 2px solid var(--black);
    box-shadow: 0 0 0 1px var(--line-soft);
}
.cattabs-track {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 4px;
    padding: 4px;
}

.cattab {
    position: relative;
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 18px;
    color: var(--tx-3);
    background: transparent;
    font: 700 14px/1 var(--f-ui);
    white-space: nowrap;
    transition: background-color .12s, color .12s, box-shadow .12s;
}
.cattab i { font-size: 15px; width: 1.1em; text-align: center; flex: none; }
.cattab-img { width: 18px; height: 18px; object-fit: contain; flex: none; }

.cattab:hover,
.cattab:focus-visible { background: var(--panel); color: #fff; }

.cattab.is-active {
    background: var(--grass);
    color: #fff;
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .22), inset 0 -3px 0 var(--grass-deep);
    text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
}
.cattab.is-active:hover { background: var(--grass); }

/* Toggle bar: phones only, and only once Alpine has switched on .is-js. */
.cattabs-toggle { display: none; }

@media (max-width: 899px) {
    .cattabs.is-js .cattabs-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-height: 48px;
        padding: 0 16px;
        color: #fff;
        background: transparent;
        text-align: left;
        cursor: pointer;
    }
    .cattabs-toggle:hover,
    .cattabs-toggle:focus-visible { background: var(--panel); }
    .cattabs-toggle-txt { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .cattabs-toggle-txt > i { font-size: 15px; color: var(--tx-3); flex: none; }
    .cattabs-toggle-k {
        font: 800 11px/1 var(--f-ui);
        letter-spacing: .6px;
        text-transform: uppercase;
        color: var(--tx-3);
        flex: none;
    }
    .cattabs-toggle-v {
        font: 800 14px/1 var(--f-ui);
        color: #fff;
        padding: 6px 10px;
        background: var(--grass);
        box-shadow: inset 0 -3px 0 var(--grass-deep);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    .cattabs-chev { flex: none; font-size: 14px; color: var(--tx-3); transition: transform .18s; }
    .cattabs.is-open .cattabs-chev { transform: rotate(180deg); color: #fff; }

    /* Collapsed until opened (only when JS is running; otherwise it stays open). */
    .cattabs.is-js:not(.is-open) .cattabs-track { display: none; }
    .cattabs.is-js.is-open .cattabs-track { border-top: 2px solid var(--black); }

    .cattabs-track {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        padding: 4px;
    }
    .cattab {
        min-height: 46px;
        padding: 0 12px;
        font-size: 13px;
        justify-content: flex-start;
        white-space: normal;
        text-align: left;
        line-height: 1.15;
    }
    .cattab:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 340px) {
    .cattabs-toggle-k { display: none; }
}

.seg { display: inline-flex; border: 2px solid var(--black); background: var(--panel); }
.seg button { width: 40px; min-height: 38px; display: grid; place-items: center; color: var(--tx-3); }
.seg button:hover { background: var(--panel-3); color: #fff; }
.seg button.is-on { background: var(--grass); color: #fff; box-shadow: inset 0 -3px 0 var(--grass-deep); }

/* ---------------------------------------------------------------------
   Panels
   --------------------------------------------------------------------- */
.panel {
    background: var(--panel);
    border: 2px solid var(--black);
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .045);
}
.panel-pad { padding: 24px; }
.sunken { background: var(--well); border: 1px solid var(--line); }
.note { padding: 12px 14px; }
.note-diamond { color: var(--diamond); border-color: rgba(74, 237, 217, .45); }
.note-panel { display: flex; align-items: flex-start; gap: 12px; padding: 16px; }
.note-panel > i { margin-top: 3px; }

/* ---------------------------------------------------------------------
   Billing day callout. The one thing a subscriber needs to see at a
   glance is when the next charge lands, so it gets a calendar tile, a
   big date and a gold edge (gold = money in this skin).
   Status changes the colour, not the layout:
     (default)  gold      next billing date
     .is-ending redstone  cancelled, runs out on this date
     .is-late   redstone  last payment failed
     .is-pending diamond  waiting on first payment
     .is-ended  grey      cancelled and finished
   .is-compact is the smaller version used on product pages.
   --------------------------------------------------------------------- */
.billday {
    --bd: var(--gold);
    --bd-deep: var(--gold-deep);
    --bd-ink: var(--gold-ink);
    --bd-tx: var(--gold-hi);
    --bd-wash: rgba(255, 196, 43, .13);
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 12px 14px;
    background: linear-gradient(90deg, var(--bd-wash), transparent 70%), var(--well);
    border: 1px solid var(--bd-deep);
    border-left: 6px solid var(--bd);
}
.billday.is-ending, .billday.is-late {
    --bd: var(--redstone);
    --bd-deep: var(--redstone-deep);
    --bd-ink: #2b0a09;
    --bd-tx: #ff9b99;
    --bd-wash: rgba(255, 96, 94, .13);
}
.billday.is-pending {
    --bd: var(--diamond);
    --bd-deep: rgba(74, 237, 217, .45);
    --bd-ink: #04211f;
    --bd-tx: var(--diamond);
    --bd-wash: rgba(74, 237, 217, .10);
}
.billday.is-ended {
    --bd: var(--line-strong);
    --bd-deep: var(--line);
    --bd-ink: var(--black);
    --bd-tx: var(--tx-3);
    --bd-wash: transparent;
}

.billday-cal {
    flex: none;
    width: 68px;
    display: flex;
    flex-direction: column;
    text-align: center;
    background: var(--black);
    border: 2px solid var(--bd-deep);
}
.billday-cal .m {
    padding: 4px 0;
    background: var(--bd);
    color: var(--bd-ink);
    font: 800 11px/1 var(--f-ui);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.billday-cal .d { padding: 6px 0 2px; color: var(--bd-tx); font: 400 38px/1 var(--f-px); }
.billday-cal .y { padding-bottom: 5px; color: var(--tx-3); font: 700 10px/1 var(--f-ui); letter-spacing: .5px; }

.billday-ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    background: var(--black);
    border: 2px solid var(--bd-deep);
    color: var(--bd-tx);
    font-size: 20px;
}

.billday-body { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; }
.billday-k { color: var(--bd-tx); font: 800 11px/1.2 var(--f-ui); letter-spacing: .6px; text-transform: uppercase; }
.billday-v { color: var(--tx); font: 400 32px/1.05 var(--f-px); overflow-wrap: anywhere; }
.billday-s { color: var(--tx-2); font-size: 13px; line-height: 1.45; }

.billday.is-compact { gap: 12px; padding: 10px 12px; }
.billday.is-compact .billday-v { font-size: 26px; }

@media (max-width: 640px) {
    .billday-cal { width: 58px; }
    .billday-cal .d { font-size: 32px; }
    .billday-v { font-size: 28px; }
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 56px 24px;
}
.empty p { max-width: 46ch; color: var(--tx-3); }
.empty.is-tight { padding: 36px 12px; }
.empty-icon {
    width: 88px;
    height: 88px;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    background: var(--well);
    border: 2px solid;
    border-color: var(--black) var(--line) var(--line) var(--black);   /* inventory slot: inverted bevel */
    font-size: 30px;
    color: var(--tx-3);
}
.empty-icon.is-success {
    background: var(--grass);
    color: #fff;
    border-color: var(--black);
    box-shadow: inset 0 4px 0 rgba(255, 255, 255, .28), inset 0 -6px 0 var(--grass-deep);
}

/* Section header: pixel title, quiet subtitle, small link on the right */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sec-head.is-flush { margin-bottom: 0; }
.sec-head p { margin-top: 8px; color: var(--tx-3); font-size: 15px; }
.sec-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    padding-bottom: 4px;
    color: var(--grass-hi);
    font: 800 12px/1 var(--f-ui);
    letter-spacing: .96px;
    text-transform: uppercase;
}
.sec-link:hover { color: #fff; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--tx-3); }
.crumbs i { font-size: 9px; color: var(--tx-4); }
.crumbs a:hover { color: #fff; text-decoration: underline; }

/* Dropdown menu */
.menu {
    position: absolute;
    top: calc(100% + 8px);
    z-index: 70;
    min-width: 200px;
    padding: 4px;
    background: var(--panel);
    border: 2px solid var(--black);
    box-shadow: 0 0 0 1px var(--line), 6px 6px 0 rgba(0, 0, 0, .45);
}
.menu-left { left: 0; }
.menu-right { right: 0; }
.menu-narrow { min-width: 110px; }
.menu-item { display: block; padding: 10px 12px; font: 700 13px/1.2 var(--f-ui); color: var(--tx-2); }
.menu-item:hover { background: var(--grass); color: #fff; }

/* Inline alert (gift-card module). The toast shares the look. */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--black);
    border: 2px solid var(--line);
    font-size: 14px;
}
.alert i { margin-top: 3px; }
.alert.err { border-color: var(--redstone-deep); }
.alert.err i { color: var(--redstone); }
.alert.ok { border-color: var(--grass-deep); }
.alert.ok i { color: var(--grass-hi); }
.alert .msg { flex: 1; }


/* ---------------------------------------------------------------------
   Top bar. Flat charcoal with a black lower edge, like minecraft.net.
   --------------------------------------------------------------------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--panel-2);
    border-bottom: 4px solid var(--black);
}
.nav.is-stuck { box-shadow: 0 6px 0 rgba(0, 0, 0, .28); }
.nav-in { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }

.nav-logo { display: inline-flex; align-items: center; flex: none; }
.nav-logo img { height: var(--logo-h); width: auto; }
.wordmark { font-size: 30px; line-height: 1; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; white-space: nowrap; }

.nav-links { display: flex; align-items: stretch; align-self: stretch; gap: 2px; min-width: 0; }
.nav-links > .rel { display: flex; }
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    color: #fff;
    font: 700 12px/1 var(--f-ui);
    letter-spacing: .96px;
    text-transform: uppercase;
    white-space: nowrap;
}
.nav-link:hover { color: var(--grass-hi); }
.nav-link.is-active { color: var(--grass-hi); }
.nav-link.is-active::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 4px;
    background: var(--grass-hi);
}

.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }

.searchbtn {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    min-width: 236px;
    padding: 0 10px 0 14px;
    background: var(--well);
    color: var(--tx-3);
    border: 1px solid var(--line-strong);
    font: 400 14px/1 var(--f-ui);
}
.searchbtn:hover { color: #fff; border-color: #fff; }
.searchbtn span { flex: 1; text-align: left; }

.cart-count {
    position: absolute;
    top: -7px;
    right: -7px;
    z-index: 2;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    background: var(--gold);
    color: var(--gold-ink);
    border: 2px solid var(--black);
    font: 800 11px/1 var(--f-ui);
}
@keyframes bump { 40% { transform: scale(1.45); } }
.cart-count.bump { animation: bump .32s steps(4); }

.acct {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px 0 3px;
    background: var(--panel);
    border: 2px solid var(--black);
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .08), inset -2px -2px 0 rgba(0, 0, 0, .34);
    font: 700 13px/1 var(--f-ui);
}
.acct:hover { background: var(--panel-3); }
.acct-face { width: 32px; height: 32px; flex: none; image-rendering: pixelated; background: var(--well); object-fit: cover; }
.acct-face.is-xl { width: 72px; height: 72px; border: 2px solid var(--black); }
.acct-face-empty { display: grid; place-items: center; color: var(--tx-3); }
.acct-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1199px) {
    .searchbtn { min-width: 0; width: 40px; padding: 0; justify-content: center; }
    .searchbtn span, .searchbtn kbd { display: none; }
}
@media (max-width: 1099px) { .acct-name { display: none; } .acct { padding-right: 3px; } }

/* Phones: the bar becomes two rows. Logo and tools on top, categories in a
   scrolling strip beneath. Search lives in the tab bar. */
@media (max-width: 899px) {
    .nav-in { flex-wrap: wrap; height: auto; gap: 0 12px; padding-block: 0; }
    .nav-logo { min-height: 54px; }
    .searchbtn { display: none; }
    .nav-tools { min-height: 54px; }
    .nav-links {
        order: 3;
        width: calc(100% + var(--gutter) * 2);
        margin-inline: calc(var(--gutter) * -1);
        padding-inline: calc(var(--gutter) - 14px);
        min-height: 44px;
        overflow-x: auto;
        background: var(--well);
        border-top: 2px solid var(--black);
        scrollbar-width: none;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-links > .rel { display: none; }
}

/* ---------------------------------------------------------------------
   Mobile tab bar
   --------------------------------------------------------------------- */
.tabbar {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 65;
    background: var(--black);
    border-top: 4px solid var(--panel-2);
    padding-bottom: env(safe-area-inset-bottom);
}
.tab {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: var(--tabbar-h);
    color: var(--tx-3);
    font: 700 10px/1 var(--f-ui);
    letter-spacing: .6px;
    text-transform: uppercase;
}
.tab i { font-size: 18px; }
.tab.is-active { color: var(--grass-hi); }
.tab.is-active::before {
    content: "";
    position: absolute;
    top: -4px; left: 20%; right: 20%;
    height: 4px;
    background: var(--grass-hi);
}
.tab .cart-count { top: 4px; right: calc(50% - 30px); }
@media (max-width: 899px) {
    .tabbar { display: flex; }
    body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: 64px 96px;
    background: linear-gradient(180deg, #0a1016 0%, #0f1c25 40%, #1a3a3c 82%, #1d4a3f 100%);
    border-bottom: 4px solid var(--black);
}
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-photo {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover;
    object-position: var(--hero-position);
    opacity: var(--hero-opacity);
}
.hero-bg::after {            /* keeps the copy readable over any image */
    content: "";
    position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .1) 60%, transparent 100%),
        linear-gradient(0deg, rgba(23, 22, 21, .85) 0%, transparent 34%);
}

.hero-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
.hero-in.has-skin { grid-template-columns: minmax(0, 1fr) 300px; }

.hero-title {
    width: fit-content;
    max-width: min(20ch, 100%);
    font-size: 50px;
    line-height: .9;
    color: #fff;
    text-shadow: .07em .07em 0 #3f3f3f;
    overflow-wrap: anywhere;
    margin-bottom: 18px;
}
@media (min-width: 700px) { .hero-title { font-size: 70px; } }
@media (min-width: 1100px) { .hero-title { font-size: 90px; } }

/* One deliberate moment on load: the title types in, a block at a time. */
@keyframes type-in {
    from { clip-path: inset(-.2em 100% -.2em 0); }
    to   { clip-path: inset(-.2em -.2em -.2em 0); }
}
.hero-title { animation: type-in .7s steps(12) both; }

.hero-sub {
    max-width: 52ch;
    margin-bottom: 26px;
    color: var(--tx-2);
    font-size: 18px;
    line-height: 1.55;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .55);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }

/* --- The server, drawn as a row from the in-game multiplayer list --- */
.srv {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 580px;
    padding: 8px 8px 8px 8px;
    background: rgba(0, 0, 0, .74);
    border: 2px solid var(--black);
    box-shadow: 0 0 0 2px transparent;
    text-align: left;
    transition: border-color .08s, box-shadow .08s;
}
.srv:hover, .srv:focus-visible { box-shadow: 0 0 0 2px #fff; }
.srv:focus-visible { outline-offset: 4px; }
.srv-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex: none;
    background: var(--well);
    image-rendering: pixelated;
}
.srv-icon::before {           /* shown until the server's own icon loads over it */
    content: "\f233";           /* fa-server */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 26px;
    color: var(--tx-4);
}
.srv-icon img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; background: var(--well); }
.srv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.srv-name { font: 400 26px/1 var(--f-px); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-motd {
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
    font: 400 13px/1.35 var(--f-ui); color: var(--tx-3);
}
.srv.is-off .srv-name { color: var(--tx-3); }
.srv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-right: 4px; }
.srv-count { font: 400 24px/1 var(--f-px); color: var(--tx-3); white-space: nowrap; }
.srv-count b { font-weight: 400; color: #fff; }
.srv-count i { font-style: normal; margin: 0 2px; color: var(--tx-4); }

/* five signal bars, as in the server list */
.srv-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.srv-bars i { display: block; width: 4px; background: var(--line); }
.srv-bars i:nth-child(1) { height: 4px; }
.srv-bars i:nth-child(2) { height: 7px; }
.srv-bars i:nth-child(3) { height: 10px; }
.srv-bars i:nth-child(4) { height: 13px; }
.srv-bars i:nth-child(5) { height: 16px; }
.srv-bars.online i { background: #00ff0a; }
.srv-bars.offline i { background: #4a2624; }
.srv-bars.offline i:nth-child(1) { background: var(--redstone); }
@keyframes bar-tick { 50% { background: var(--tx-3); } }
.srv-bars.loading i { animation: bar-tick 1s steps(2) infinite; }
.srv-bars.loading i:nth-child(2) { animation-delay: .12s; }
.srv-bars.loading i:nth-child(3) { animation-delay: .24s; }
.srv-bars.loading i:nth-child(4) { animation-delay: .36s; }
.srv-bars.loading i:nth-child(5) { animation-delay: .48s; }

.srv-copy {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    background: var(--grass);
    border: 2px solid var(--black);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .27), inset 0 -4px 0 var(--grass-deep);
    font: 800 12px/1 var(--f-ui);
    letter-spacing: .54px;
    text-transform: uppercase;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .38);
}
.srv:hover .srv-copy { background: var(--grass-mid); }
.srv.copied .srv-copy { background: var(--gold); color: var(--gold-ink); text-shadow: none; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .42), inset 0 -4px 0 var(--gold-deep); }

/* --- Social squares --- */
.social-row, .socials { display: flex; flex-wrap: wrap; gap: 8px; }
.social-row { margin-top: 20px; }
.social-chip, .social {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .58);
    color: #fff;
    border: 2px solid var(--black);
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .08), inset -2px -2px 0 rgba(0, 0, 0, .34);
    font-size: 17px;
}
.social-chip, .social { background: var(--panel-3); }
[data-brand="youtube"]   { background: #c4302b; }
[data-brand="x"]         { background: #000 }
[data-brand="tiktok"]    { background: linear-gradient(135deg, #25F4EE 0%, #010101 50%, #FE2C55 100%); }
[data-brand="instagram"] { background: #b4308c; }
[data-brand="twitch"]    { background: #6441a5; }
[data-brand="facebook"]  { background: #1877f2; }
[data-brand="discord"]   { background: #5865f2; }
.social-chip:hover, .social:hover { box-shadow: 0 0 0 2px #fff; }
[data-brand="youtube"]:hover   { box-shadow: 0 0 0 2px #fff; }
[data-brand="x"]:hover         { box-shadow: 0 0 0 2px #fff; }
[data-brand="tiktok"]:hover    { box-shadow: 0 0 0 2px #fff; }
[data-brand="instagram"]:hover { box-shadow: 0 0 0 2px #fff; }
[data-brand="twitch"]:hover    { box-shadow: 0 0 0 2px #fff; }
[data-brand="facebook"]:hover  { box-shadow: 0 0 0 2px #fff; }
[data-brand="discord"]:hover   { box-shadow: 0 0 0 2px #fff; }

/* --- Skin stage --- */
.stage { position: relative; width: 300px; justify-self: end; padding-top: 30px; }
.skinbox { position: relative; height: 300px; display: grid; place-items: center; }
.skinbox canvas { display: block; cursor: grab; touch-action: pan-y; }
.skinbox canvas:active { cursor: grabbing; }
.skinbox .fallback { height: 270px; width: auto; image-rendering: pixelated; }
.skinbox .hint {
    position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
    color: var(--tx-3); font: 700 10px/1 var(--f-ui); letter-spacing: .8px; text-transform: uppercase;
    white-space: nowrap; pointer-events: none;
}
.nametag {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, .62);
    color: #fff; font: 700 13px/1.3 var(--f-ui); white-space: nowrap;
}
.nametag i { color: var(--gold); }

@media (max-width: 899px) {
    .hero { padding-block: 40px 72px; }
    .hero-in.has-skin { grid-template-columns: minmax(0, 1fr); }
    .stage { left: -25px; }
}
@media (max-width: 560px) {
    .srv { gap: 8px; padding: 6px; }
    .srv-icon { width: 44px; height: 44px; }
    .srv-name { font-size: 20px; }
    .srv-side { padding-right: 0; }
    .srv-count { font-size: 20px; }
    .srv-bars { display: none; }
    .srv-copy span { display: none; }
    .srv-copy { padding: 0 13px; height: 44px; }
    .hero-cta .btn { flex: 1 1 100%; }
    .hero-bg .scene .moon, .hero-bg .scene .clouds { display: none; }
}

/* ---------------------------------------------------------------------
   Footer. A flat near-black surface with an accent line along the top.
   --------------------------------------------------------------------- */
.foot {
    position: relative;
    margin-top: 112px;
    color: var(--tx-2);
    background-color: var(--black);
    border-top: 4px solid var(--grass);
}
.foot > .shell { padding-block: 56px 32px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.foot h4 { margin-bottom: 14px; color: var(--grass-hi); font: 800 12px/1 var(--f-ui); letter-spacing: .96px; text-transform: uppercase; }
.foot nav { display: flex; flex-direction: column; gap: 9px; }
.foot nav a { font-size: 14px; color: var(--tx-2); }
.foot nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot .nav-logo img { height: 34px; }
.foot-bar {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
    margin-top: 44px; padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, .1);
    font-size: 13px; color: var(--tx-3);
}
.foot-bar a:hover { color: #fff; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 10px; font-size: 26px; color: var(--tx-3); }

.ipcopy { display: inline-flex; align-items: stretch; height: 44px; align-self: flex-start; background: rgba(0, 0, 0, .62); border: 2px solid #ffffff75; }
.ipcopy:hover { box-shadow: 0 0 0 2px #fff; }
.ipcopy .addr { display: grid; align-items: center; padding: 0 14px; font: 400 24px/1 var(--f-px); color: #fff; }
.ipcopy .act {
    width: 42px; display: grid; place-items: center;
    background: var(--grass);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .27), inset 0 -4px 0 var(--grass-deep);
}
.ipcopy.copied .act { background: var(--gold); color: var(--gold-ink); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .42), inset 0 -4px 0 var(--gold-deep); }

@media (max-width: 980px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } .foot { margin-top: 96px; } }


/* ---------------------------------------------------------------------
   Category tiles. Each is a solid block of material colour with a pixel
   item resting on it, the way minecraft.net shows its game tiles.
   --------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; }

.tile {
    display: flex;
    flex-direction: column;
    background: var(--well);
    border: 2px solid var(--black);
    transition: transform .12s steps(3), box-shadow .12s steps(3);
}
.tile:hover, .tile:focus-visible { transform: translateY(-4px); box-shadow: 0 8px 0 rgba(0, 0, 0, .45); }

.tile-art {
    position: relative;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    aspect-ratio: 1;
    overflow: hidden;
    background-color: var(--tint, var(--grass));
    box-shadow: inset 4px 4px 0 rgba(255, 255, 255, .16), inset -4px -4px 0 rgba(0, 0, 0, .3);
}
.tile-art::after {            /* soft light from the top left */
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .22), transparent 62%);
}
.tile-art > * { position: relative; z-index: 1; }
.tile-art img { width: 70%; height: 70%; object-fit: contain; image-rendering: var(--card-render); filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .38)); }
.tile-fa { font-size: 56px; color: #fff; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .38)); }
.tile-count {
    position: absolute !important;
    top: 10px; left: 10px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, .58);
    font: 800 10px/1.2 var(--f-ui);
    letter-spacing: .5px;
    text-transform: uppercase;
}
@keyframes bob { to { transform: translateY(-8px); } }
.tile:hover .tile-fa, .tile:focus-visible .tile-fa { animation: bob .6s steps(3) infinite alternate; }

.tile-foot {
    display: flex; flex-direction: column; gap: 4px;
    min-height: 74px;
    padding: 12px 14px 14px;
    background: var(--well);
    border-top: 2px solid var(--black);
}
.tile-foot strong { font: 700 16px/1.25 var(--f-ui); }
.tile:hover .tile-foot strong { color: var(--grass-hi); }
.tile-foot small {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    color: var(--tx-3); font-size: 12px; line-height: 1.4;
}

/* ---------------------------------------------------------------------
   Product cards, laid out like the Marketplace: art bleeding to the
   edges, a name and its tags, then a darker strip along the bottom
   that holds the price and the buy button.
   --------------------------------------------------------------------- */
.grid-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 16px; }

.pcard {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 2px solid var(--black);
    transition: transform .12s steps(3), box-shadow .12s steps(3);
}
.pcard:hover { transform: translateY(-4px); box-shadow: 0 8px 0 rgba(0, 0, 0, .42); }
.pcard.on-sale::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0; z-index: 5;
    height: 4px;
    background: var(--gold);
}

.pcard.on-sale .pcard-art {
    background-image: radial-gradient(circle at 50% 56%, rgba(255, 196, 43, .3), transparent 64%);
}
.pcard-art {
    position: relative;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    aspect-ratio: var(--card-ratio);
    overflow: hidden;
    background-color: var(--well);
    background-image: radial-gradient(circle at 50% 46%, rgba(255, 255, 255, .075), transparent 62%);
    border-bottom: 2px solid var(--black);
}


.pcard-art > img {
    width: 100%; height: 100%;
    padding: var(--card-pad);
    object-fit: var(--card-fit);
    image-rendering: var(--card-render);
    transition: transform .12s steps(3);
}
.pcard:hover .pcard-art > img, .pcard:hover .pcard-art > .ph { transform: translateY(-4px); }
.pcard.is-out .pcard-art > img, .pcard.is-out .pcard-art > .ph { filter: grayscale(1); opacity: .5; }

.pcard-hit { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; background: transparent; }
.pcard-hit:focus-visible { outline-offset: -5px; }
a.pcard-art { cursor: pointer; }

.pcard-flags { position: absolute; top: 10px; left: 10px; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; }
.pcard-fav {
    position: absolute; top: 8px; right: 8px; z-index: 3;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    background: rgba(0, 0, 0, .62);
    color: var(--tx-3);
    border: 2px solid var(--black);
    opacity: 0;
    transition: opacity .1s;
}
.pcard:hover .pcard-fav, .pcard-fav:focus-visible, .pcard-fav.is-on { opacity: 1; }
.pcard-fav:hover { color: #fff; }
.pcard-fav.is-on { color: var(--gold); }
@media (hover: none) { .pcard-fav { opacity: 1; } }

.pcard-peek {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
    padding: 8px;
    background: rgba(0, 0, 0, .74);
    text-align: center;
    font: 800 11px/1 var(--f-ui); letter-spacing: .8px; text-transform: uppercase;
    transform: translateY(100%);
    transition: transform .12s steps(2);
    pointer-events: none;
}
.pcard:hover .pcard-peek { transform: none; }
@media (hover: none) { .pcard-peek { display: none; } }

.pcard-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.pcard-name {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font: 700 15px/1.3 var(--f-ui);
    color: #fff;
}
.pcard-name:hover { color: var(--grass-hi); }
.pcard-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.timer { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-hi); font: 700 12px/1.2 var(--f-ui); }
.timer i { font-size: 11px; }

.pcard-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px;
    background: var(--well);
    border-top: 2px solid var(--black);
}
.pcard-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.price-now { font: 400 30px/1 var(--f-px); color: #fff; white-space: nowrap; }
.on-sale .price-now { color: #ffc42b; }
.price-free { font: 400 30px/1 var(--f-px); color: var(--diamond); }
.price-was { font: 500 13px/1 var(--f-ui); color: var(--tx-4); text-decoration: line-through; }
.price-was.is-lg { font-size: 18px; }
.price-per { font: 700 11px/1 var(--f-ui); letter-spacing: .5px; text-transform: uppercase; color: var(--tx-3); }
.pcard-price.is-big .price-now, .pcard-price.is-big .price-free { font-size: 50px; }
.pcard-price.is-big .price-was { font-size: 18px; }

.pcard.is-bare { background: transparent; border: 0; border-top: 2px solid var(--black); }
.pcard.is-bare:hover { transform: none; box-shadow: none; }
.pcard.is-bare .pcard-art { aspect-ratio: 16 / 10; }

/* --- list layout --- */
.grid-products.as-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.as-list .pcard { display: grid; grid-template-columns: 148px minmax(0, 1fr) auto; }
.as-list .pcard:hover { transform: translateX(4px); box-shadow: -4px 0 0 rgba(0, 0, 0, .42); }
.as-list .pcard-art { aspect-ratio: auto; min-height: 112px; border-bottom: 0; border-right: 2px solid var(--black); }
.as-list .pcard-body { justify-content: center; }
.as-list .pcard-foot { flex-direction: column; justify-content: center; align-items: flex-end; min-width: 170px; border-top: 0; border-left: 2px solid var(--black); }
.as-list .pcard-peek { display: none; }
@media (max-width: 640px) {
    .as-list .pcard { grid-template-columns: 96px minmax(0, 1fr); }
    .as-list .pcard-foot { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; border-left: 0; border-top: 2px solid var(--black); }
}

/* ---------------------------------------------------------------------
   Featured banner: the Marketplace's big promo slot.
   --------------------------------------------------------------------- */
.spot {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    overflow: hidden;
    background: var(--panel);
    border: 2px solid var(--black);
}
.spot.on-sale::before { content: ""; position: absolute; top: 0; left: 0; right: 0; z-index: 5; height: 6px; background: var(--gold); }
.spot-art {
    position: relative;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    min-height: 340px;
    overflow: hidden;
    background-color: var(--well);
    background-image: radial-gradient(circle at 50% 56%, color-mix(in srgb, var(--grass) 42%, transparent), transparent 64%);
    border-right: 2px solid var(--black);
}
.spot.on-sale .spot-art {
    background-image: radial-gradient(circle at 50% 56%, rgba(255, 196, 43, .3), transparent 64%);
}
.spot-art > img { width: 78%; max-height: 300px; object-fit: contain; image-rendering: var(--card-render); filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .4)); }
.spot-art > .ph { width: 40%; max-width: 160px; }
.spot.is-out .spot-art > img { filter: grayscale(1); opacity: .5; }
.spot-body { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; padding: 34px 36px; min-width: 0; }
.spot h3.spot-name { font-size: 50px; line-height: .92; overflow-wrap: anywhere; }
.spot-name a:hover { color: var(--grass-hi); }
.spot-desc {
    max-width: 54ch; color: var(--tx-2); font-size: 15px; line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.spot-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.spot-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
@media (max-width: 860px) {
    .spot { grid-template-columns: minmax(0, 1fr); }
    .spot-art { min-height: 240px; border-right: 0; border-bottom: 2px solid var(--black); }
    .spot-body { padding: 24px 20px; }
    .spot-actions { width: 100%; }
    .spot-actions .btn { flex: 1 1 auto; }
    .spot h3.spot-name { font-size: 40px; }
    .pcard-price.is-big .price-now { font-size: 40px; }
}

/* ---------------------------------------------------------------------
   Listing toolbar
   --------------------------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.field { position: relative; flex: 1 1 240px; max-width: 360px; display: block; }
.field > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tx-4); font-size: 13px; pointer-events: none; }
.field .input { padding-left: 38px; }
.count-note { margin: 0; color: var(--tx-3); font-size: 13px; }
.toolbar .seg { margin-left: auto; }
@media (max-width: 640px) { .toolbar .seg { margin-left: 0; } .field { max-width: none; flex-basis: 100%; } }

/* Trust strip */
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.trust.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trust-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 16px;
    background: var(--panel);
    border: 2px solid var(--black);
}
.trust-item > i {
    flex: none; width: 40px; height: 40px; display: grid; place-items: center;
    background: var(--grass);
    border: 2px solid var(--black);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .27), inset 0 -3px 0 var(--grass-deep);
    font-size: 16px;
}
.trust-item .t { font: 700 14px/1.3 var(--f-ui); }
.trust-item .d { margin-top: 3px; color: var(--tx-3); font-size: 13px; line-height: 1.45; }
@media (max-width: 560px) { .trust.is-compact { grid-template-columns: minmax(0, 1fr); } }

/* Rank comparison. Each column carries its own colour through --rank, set inline
   from the admin editor, so one set of rules styles every tier. */
.cmp-scroll {
    overflow-x: auto;
    background: var(--panel);
    border: 2px solid var(--black);
    -webkit-overflow-scrolling: touch;
    /* Keeps the wide table's overhang from stretching the whole page sideways on phones */
    contain: paint;
}
.cmp-scroll:focus-visible { outline: 3px solid var(--diamond); outline-offset: 2px; }

/* On category pages the section sits in a tight 24px stack straight under the product
   grid. Give it the same breathing room a home page section gets. */
.stack:not(.is-loose) > .cmp { margin-top: 28px; }

.cmp-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.cmp-table.cols-1 { min-width: 0; }
.cmp-table.cols-2 { min-width: 520px; }
.cmp-table.cols-5 { min-width: 860px; }
.cmp-table th, .cmp-table td { padding: 0; text-align: center; vertical-align: middle; }

/* First column is wider than the rank columns and stays put while scrolling sideways */
.cmp-table thead th:first-child,
.cmp-table tbody th[scope="row"],
.cmp-table tfoot th { width: 26%; min-width: 180px; }
.cmp-table tbody th[scope="row"],
.cmp-table thead .cmp-corner,
.cmp-table tfoot th {
    position: sticky; left: 0; z-index: 2;
    background: var(--panel); text-align: left;
}
.cmp-table thead .cmp-corner { background: var(--panel-2); }

/* ---- Rank header ---- */
.cmp-table thead th { background: var(--panel-2); border-bottom: 4px solid var(--black); }
.cmp-corner-in {
    display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 100%;
    font: 800 12px/1 var(--f-ui); letter-spacing: .7px; text-transform: uppercase; color: var(--tx-3);
}
.cmp-col {
    position: relative;
    padding: 22px 12px 18px !important;
    border-top: 4px solid var(--rank, var(--grass));
    vertical-align: top !important;
}
.cmp-col > * { display: block; }
.cmp-col.is-out { opacity: .7; }

.cmp-art {
    position: relative;
    width: 72px; height: 72px; margin: 0 auto 12px;
    display: grid; place-items: center;
    background: var(--well);
    border: 2px solid var(--black);
    box-shadow: inset 0 3px 0 rgba(255,255,255,.07), inset 0 -3px 0 rgba(0,0,0,.35), 0 0 0 2px color-mix(in srgb, var(--rank) 55%, transparent);
    overflow: hidden;
}
.cmp-art img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    background: var(--well);
    object-fit: var(--card-fit, contain);
    image-rendering: var(--card-render, pixelated);
    padding: 6px; box-sizing: border-box;
}
.cmp-art-icon { font-size: 30px; color: var(--rank); text-shadow: 0 2px 0 rgba(0,0,0,.4); }

.cmp-name { font: 400 28px/1.05 var(--f-px); color: var(--rank); word-break: break-word; }
.cmp-name a { color: inherit; }
.cmp-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmp-tagline { margin-top: 6px; color: var(--tx-3); font: 600 12px/1.35 var(--f-ui); }

.cmp-price { margin-top: 10px; display: flex !important; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 8px; }
.cmp-price .price-now { font: 800 16px/1 var(--f-ui); color: #fff; }
.cmp-price .price-was { font: 600 12px/1 var(--f-ui); color: var(--tx-4); text-decoration: line-through; }
.cmp-price .price-per { font: 600 12px/1 var(--f-ui); color: var(--tx-3); }
.cmp-price .price-free { font: 800 16px/1 var(--f-ui); color: var(--grass-hi); }
.cmp-sale { margin: 8px auto 0; width: fit-content; }

/* Best-value ribbon, sits on the top edge of the column */
.cmp-ribbon {
    position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
    display: inline-flex !important; align-items: center; gap: 6px;
    padding: 4px 10px 5px;
    background: var(--gold); color: var(--gold-ink);
    box-shadow: inset 0 -3px 0 var(--gold-deep);
    border: 2px solid var(--black); border-top: 0;
    font: 800 11px/1 var(--f-ui); letter-spacing: .6px; text-transform: uppercase; white-space: nowrap;
}
.cmp-col.is-best { padding-top: 34px !important; }
.cmp-col.is-best, .cmp-cell.is-best, .cmp-foot.is-best {
    background: color-mix(in srgb, var(--rank) 9%, var(--panel-2));
}
.cmp-cell.is-best { background: color-mix(in srgb, var(--rank) 7%, var(--panel)); }
.cmp-foot.is-best { background: color-mix(in srgb, var(--rank) 7%, var(--panel)); }

/* Compact header: no art, tighter */
.cmp-table.is-compact .cmp-art { display: none; }
.cmp-table.is-compact .cmp-col { padding: 14px 10px 12px !important; }
.cmp-table.is-compact .cmp-col.is-best { padding-top: 32px !important; }
.cmp-table.is-compact .cmp-name { font-size: 24px; }

/* ---- Body ---- */
.cmp-table tbody th, .cmp-table tbody td { border-bottom: 1px solid var(--line-soft); }
.cmp-table tbody tr:not(.cmp-group):hover th,
.cmp-table tbody tr:not(.cmp-group):hover td { background-color: rgba(255,255,255,.035); }
.cmp-table tbody tr:not(.cmp-group):hover th[scope="row"] { background: var(--panel-3); }

.cmp-perk { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.cmp-perk-ico {
    flex: none; width: 32px; height: 32px;
    display: grid; place-items: center;
    background: var(--well); border: 2px solid var(--black);
    box-shadow: inset 0 2px 0 rgba(255,255,255,.07);
    color: var(--grass-hi); font-size: 14px;
}
.cmp-perk-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cmp-perk-label { font: 700 14px/1.25 var(--f-ui); color: var(--tx); }
.cmp-perk-hint { font: 500 12px/1.35 var(--f-ui); color: var(--tx-3); }

.cmp-cell { padding: 13px 10px !important; }
.cmp-val { font: 700 14px/1.3 var(--f-ui); color: var(--tx); }
.cmp-table .yes { color: var(--grass-hi); font-size: 16px; }
.cmp-table .no  { color: var(--tx-4); font-size: 13px; }

/* Section heading rows */
.cmp-group th {
    position: static !important;
    padding: 9px 16px !important;
    background: var(--well) !important;
    border-bottom: 1px solid var(--line-soft);
    text-align: left !important;
    font: 800 11px/1 var(--f-ui); letter-spacing: .8px; text-transform: uppercase; color: var(--tx-3);
}

/* ---- Footer buttons ---- */
.cmp-table tfoot th, .cmp-table tfoot td {
    background: var(--panel-2); border-top: 4px solid var(--black);
}
.cmp-foot { padding: 16px 10px !important; }
.cmp-foot .btn { width: 100%; max-width: 180px; }
.cmp-more { display: block; margin-top: 8px; color: var(--tx-3); font: 700 12px/1 var(--f-ui); }
.cmp-more:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 640px) {
    /* Narrower perk column and rank columns so two ranks are visible at once */
    .cmp-table, .cmp-table.cols-2, .cmp-table.cols-5 { min-width: 0; width: max-content; }
    .cmp-table thead th:first-child,
    .cmp-table tbody th[scope="row"],
    .cmp-table tfoot th { width: 120px; min-width: 120px; max-width: 120px; }
    .cmp-col, .cmp-cell, .cmp-foot { width: 118px; min-width: 118px; }
    .cmp-corner-in { padding: 0 10px; }
    .cmp-corner-in i { display: none; }
    .cmp-perk { padding: 10px 8px; gap: 7px; }
    .cmp-perk-ico { width: 24px; height: 24px; font-size: 11px; }
    .cmp-perk-label { font-size: 13px; }
    .cmp-perk-hint { display: none; }
    .cmp-col { padding: 18px 6px 14px !important; }
    .cmp-col.is-best { padding-top: 30px !important; }
    .cmp-art { width: 52px; height: 52px; margin-bottom: 8px; }
    .cmp-art-icon { font-size: 24px; }
    .cmp-name { font-size: 22px; }
    .cmp-tagline { display: none; }
    .cmp-price .price-now, .cmp-price .price-free { font-size: 14px; }
    .cmp-foot { padding: 12px 6px !important; }
    .cmp-foot .btn { padding: 0 8px; }
    .cmp-ribbon { font-size: 10px; padding: 3px 7px 4px; }
}
@media print {
    .cmp-scroll { overflow: visible; border: 1px solid #000; }
    .cmp-foot, .cmp-table tfoot { display: none; }
}

/* ---------------------------------------------------------------------
   Phones: tiles and cards sit two to a row so the shop stays scannable
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tile-foot { min-height: 0; padding: 10px 10px 12px; }
    .tile-foot strong { font-size: 14px; }
    .tile-foot small { display: none; }
    .tile-count { top: 6px; left: 6px; padding: 2px 6px; font-size: 9px; }
    .tile-fa { font-size: 40px; }

    .grid-products:not(.as-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .grid-products:not(.as-list) .pcard-body { padding: 10px 10px 8px; gap: 6px; }
    .grid-products:not(.as-list) .pcard-name { font-size: 14px; }
    .grid-products:not(.as-list) .pcard-foot { padding: 8px; gap: 6px; }
    .grid-products:not(.as-list) .pcard-flags { top: 6px; left: 6px; }
    .grid-products:not(.as-list) .pcard-fav { top: 6px; right: 6px; width: 28px; height: 28px; }
}
@media (max-width: 400px) {
    .pcard-foot .btn .lbl { display: none; }
    .pcard-foot .btn { padding: 0; width: 36px; }
}


/* ---------------------------------------------------------------------
   Product page
   --------------------------------------------------------------------- */
.pdp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    grid-template-areas: "art buy" "more buy";
    gap: 28px 32px;
    align-items: start;
}
.pdp > .pdp-art { grid-area: art; }
.pdp > .buybox { grid-area: buy; position: sticky; top: calc(var(--nav-h) + 24px); }
.pdp > .pdp-more { grid-area: more; }
.pdp-more { gap: 24px; }

.pdp-art {
    position: relative;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: var(--well);
    background-image: radial-gradient(circle at 50% 50%, color-mix(in srgb, #fff 10%, transparent), transparent 64%);
    border: 2px solid var(--black);
}
.pdp-art.on-sale { background-image: radial-gradient(circle at 50% 50%, rgba(255, 196, 43, .26), transparent 64%); }
.pdp-art.on-sale::before { content: ""; position: absolute; top: 0; left: 0; right: 0; z-index: 2; height: 6px; background: var(--gold); }
.pdp-art > img { width: 100%; height: 100%; padding: 8%; object-fit: contain; image-rendering: var(--card-render); filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .35)); }
.pdp-art > .ph { width: 32%; max-width: 200px; }
.pdp-art.is-square { aspect-ratio: 1; }
.pdp-art.is-out > img, .pdp-art.is-out > .ph { filter: grayscale(1); opacity: .5; }

.buybox {
    display: flex; flex-direction: column; gap: 18px;
    padding: 24px;
    background: var(--panel);
    border: 2px solid var(--black);
}
.buybox.on-sale { box-shadow: inset 0 6px 0 var(--gold); padding-top: 30px; }
.name-tags { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.headline { font-size: 50px; line-height: .92; overflow-wrap: anywhere; }
.price-line { align-items: baseline; }
.big-price { font: 400 60px/1 var(--f-px); color: #fff; }
.big-price.is-sale { color: #ffc42b; }
.big-price.c-diamond { color: var(--diamond); }

.deliver { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--well); border: 1px solid var(--line); }
.deliver img { width: 40px; height: 40px; flex: none; image-rendering: pixelated; border: 2px solid var(--black); }
.deliver .who { font: 700 14px/1.2 var(--f-ui); }
.deliver .hint { margin-top: 2px; color: var(--tx-3); font-size: 12px; }
.deliver-out { color: var(--tx-3); padding: 6px; }
.deliver-out:hover { color: #fff; }
.deliver.is-compact { max-width: 340px; width: 100%; }

.buybar { display: none; }

/* Modal reuses the product layout, without the page-level grid areas */
.pdp.is-modal { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: none; gap: 24px; }
.pdp.is-modal .price-line { align-items: baseline; }
.pdp.is-modal .big-price { font-size: 50px; }

@media (max-width: 980px) {
    .pdp { grid-template-columns: minmax(0, 1fr); grid-template-areas: "art" "buy" "more"; gap: 24px; }
    .pdp > .buybox { position: static; }
    .headline { font-size: 40px; }
    .big-price { font-size: 50px; }
}
@media (max-width: 899px) {
    .buybar {
        display: flex; align-items: center; gap: 12px;
        position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 64;
        padding: 10px 16px;
        background: var(--black);
        border-top: 2px solid var(--line);
    }
    .buybar .price-now { font-size: 30px; }
    .view--products .page-body, [class*="view--products-"] .page-body { padding-bottom: 76px; }
}
@media (max-width: 640px) {
    .pdp.is-modal { grid-template-columns: minmax(0, 1fr); }
    .pdp.is-modal .pdp-art { aspect-ratio: 16 / 10; }
}

/* ---------------------------------------------------------------------
   Cart. Every line is an inventory slot with a stack count in the corner.
   --------------------------------------------------------------------- */
.cart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.cart-summary { position: sticky; top: calc(var(--nav-h) + 24px); }
.cart-line { padding: 14px; }
.line-total { min-width: 96px; }
@media (max-width: 980px) { .cart-grid { grid-template-columns: minmax(0, 1fr); } .cart-summary { position: static; } }

.line-art {
    position: relative;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    flex: none;
    width: 64px; height: 64px;
    background: var(--well);
    border: 2px solid;
    border-color: var(--black) var(--line) var(--line) var(--black);
}
.line-art.is-lg { width: 80px; height: 80px; }
.line-art img { width: 100%; height: 100%; padding: 6px; object-fit: contain; image-rendering: var(--card-render); }
.line-art .ph { width: 56%; }
.slot-n {
    position: absolute; right: 3px; bottom: 0;
    font: 400 22px/1 var(--f-px);
    color: #fff;
    text-shadow: 2px 2px 0 #3f3f3f;
}

.line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
}
.line-main { min-width: 0; }
.line-name { font: 700 14px/1.3 var(--f-ui); }
.line-name:hover { color: var(--grass-hi); }
.line-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.line-x { align-self: start; width: 28px; height: 28px; display: grid; place-items: center; color: var(--tx-4); }
.line-x:hover { color: var(--redstone); }

.total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.total-row .k { color: var(--tx-2); }
.total-row.grand .k { font: 800 13px/1 var(--f-ui); letter-spacing: .7px; text-transform: uppercase; }
.total-row.grand .v { font: 400 40px/1 var(--f-px); color: var(--gold-hi); }

.inv-dates { min-width: 210px; }
@media (max-width: 640px) { .inv-dates { min-width: 0; width: 100%; } }

/* ---------------------------------------------------------------------
   Overlays
   --------------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .74); }
.pop-from { opacity: 0; transform: translateY(12px); }

.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
    display: flex; flex-direction: column;
    width: min(440px, 100vw);
    background: var(--panel);
    border-left: 4px solid var(--black);
    box-shadow: -8px 0 0 rgba(0, 0, 0, .35);
}
.slide-from { transform: translateX(100%); }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--panel-2); border-bottom: 4px solid var(--black); }
.drawer-head h3 { font-size: 30px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 18px; }
.drawer-body .line:last-child { border-bottom: 0; }
.drawer-foot { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); background: var(--well); border-top: 4px solid var(--black); }
@media (max-width: 640px) {
    .drawer { top: auto; left: 0; width: 100%; max-height: 90vh; max-height: 90dvh; border-left: 0; border-top: 4px solid var(--black); box-shadow: 0 -8px 0 rgba(0, 0, 0, .35); }
    .slide-from { transform: translateY(100%); }
}

.modal-wrap { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.modal {
    pointer-events: auto;
    display: flex; flex-direction: column;
    width: min(900px, 100%);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    background: var(--panel);
    border: 4px solid var(--black);
    box-shadow: 0 0 0 2px var(--line), 10px 10px 0 rgba(0, 0, 0, .45);
}
.modal-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 20px; background: var(--panel-2); border-bottom: 4px solid var(--black); }
.head-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.head-title h3 { font-size: 30px; line-height: 1; }
.modal-body { display: flex; flex-direction: column; gap: 20px; padding: 20px; overflow-y: auto; }
.modal-desc { padding: 20px; background: var(--well); border: 1px solid var(--line); font-size: 15px; }
@media (max-width: 640px) {
    .modal-wrap { align-items: end; padding: 0; }
    .modal { max-height: 92vh; max-height: 92dvh; border-width: 4px 0 0 0; box-shadow: 0 -8px 0 rgba(0, 0, 0, .35); }
    .modal-body { padding: 16px; }
}

.palette-wrap { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; pointer-events: none; }
.palette {
    pointer-events: auto;
    display: flex; flex-direction: column;
    width: min(660px, 100%);
    max-height: 70vh;
    max-height: 70dvh;
    background: var(--panel);
    border: 4px solid var(--black);
    box-shadow: 0 0 0 2px var(--line), 10px 10px 0 rgba(0, 0, 0, .45);
}
.palette-in { display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 14px; background: var(--well); border-bottom: 4px solid var(--black); }
.palette-in:focus-within { box-shadow: inset 0 -4px 0 var(--grass-hi); }
.palette-in input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: #fff; font: 400 16px/1 var(--f-ui); }
.palette-in input::placeholder { color: var(--tx-4); }
.palette-list { flex: 1; overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 6px; color: var(--tx-4); font: 800 11px/1 var(--f-ui); letter-spacing: .8px; text-transform: uppercase; }
.presult { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 2px solid transparent; }
.presult.is-cursor { background: var(--panel-3); border-color: #fff; }
.presult-art {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; flex: none;
    width: 44px; height: 44px;
    background: var(--well);
    border: 2px solid; border-color: var(--black) var(--line) var(--line) var(--black);
    color: var(--tx-3);
}
.presult-art img { width: 100%; height: 100%; padding: 4px; object-fit: contain; image-rendering: pixelated; }
.presult-art .ph { width: 60%; }
.presult-name { font: 700 14px/1.3 var(--f-ui); }
.presult-sub { color: var(--tx-3); font-size: 12px; }
.presult-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.palette-foot { display: flex; align-items: center; gap: 16px; padding: 10px 14px; background: var(--well); border-top: 4px solid var(--black); color: var(--tx-3); font-size: 12px; }
@media (max-width: 640px) { .palette-wrap { padding-top: 8px; } .palette { max-height: 82vh; max-height: 82dvh; } .palette-foot { display: none; } }

/* Toasts, dressed like the in-game advancement pop-ups. */
.toasts {
    position: fixed; top: calc(var(--nav-h) + 16px); right: 16px; z-index: 120;
    display: flex; flex-direction: column; gap: 10px;
    width: min(350px, calc(100vw - 32px));
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 10px 10px 10px;
    background: var(--black);
    border: 2px solid var(--line-strong);
    outline: 2px solid var(--black);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, .4);
    pointer-events: auto;
}
.toast-icon {
    flex: none; display: grid; place-items: center;
    width: 38px; height: 38px;
    background: var(--grass);
    border: 2px solid var(--black);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, .27), inset 0 -3px 0 rgba(0, 0, 0, .3);
    font-size: 15px;
}
.toast.err .toast-icon { background: var(--redstone-deep); }
.toast.warn .toast-icon { background: var(--gold); color: var(--gold-ink); }
.toast.info .toast-icon { background: var(--lapis); }
.toast .msg { flex: 1; margin: 0; font: 600 14px/1.4 var(--f-ui); }
.toast-x { flex: none; width: 26px; height: 26px; display: grid; place-items: center; color: var(--tx-4); font-size: 12px; }
.toast-x:hover { color: #fff; }
@media (max-width: 899px) { .toasts { top: auto; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); right: 16px; left: 16px; width: auto; } }

/* ---------------------------------------------------------------------
   Sidebar modules
   --------------------------------------------------------------------- */
.mod { padding: 18px; background: var(--panel); border: 2px solid var(--black); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .045); }
.mod.is-flush { padding: 0; }
.mod-pad { padding: 18px 18px 0; }
.mod-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font: 400 26px/1 var(--f-px); text-shadow: 2px 2px 0 #3f3f3f; }
.mod-title.is-flush { margin-bottom: 0; }
.mod-title i {
    flex: none; width: 24px; height: 24px; display: grid; place-items: center;
    background: var(--well); border: 1px solid var(--line);
    color: var(--grass-hi); font-size: 12px; text-shadow: none;
}

/* Goal bar: a dark trough cut into twenty segments, filled in green. */
.meter { position: relative; height: 18px; background: #0b0c0c; border: 2px solid var(--black); box-shadow: 0 0 0 2px var(--line-soft); overflow: hidden; }
.meter > span {
    display: block; height: 100%;
    background: linear-gradient(180deg, var(--grass-pale) 0 22%, var(--grass-hi) 22% 62%, var(--grass) 62%);
}
.meter.striped > span {
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .16) 0 8px, transparent 8px 16px),
        linear-gradient(180deg, var(--grass-pale) 0 22%, var(--grass-hi) 22% 62%, var(--grass) 62%);
}
.meter::after {
    content: ""; position: absolute; inset: 0;
    /*background: repeating-linear-gradient(90deg, transparent 0, transparent calc(5% - 2px), rgba(0, 0, 0, .7) calc(5% - 2px), rgba(0, 0, 0, .7) 5%);*/
}
.meter-pct { font: 400 26px/1 var(--f-px); color: var(--grass-hi); }

.podium {
    display: grid; grid-template-columns: 30px 40px minmax(0, 1fr); align-items: center; gap: 10px;
    padding: 8px 10px;
    background: var(--well); border: 1px solid var(--line);
}
.podium .pos { font: 400 22px/1 var(--f-px); color: var(--tx-3); text-align: center; }
.podium .face { width: 40px; height: 40px; image-rendering: pixelated; border: 2px solid var(--black); }
.podium.rank-1 { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--well)); }
.podium.rank-1 .pos { color: var(--gold); font-size: 18px; }

.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.face { width: 100%; aspect-ratio: 1; image-rendering: pixelated; background: var(--well); border: 2px solid var(--black); }

/* ---------------------------------------------------------------------
   Motion: everything above is short and stepped. Anyone who has asked
   their system for less motion gets none of it.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .nav, .tabbar, .foot, .toasts, .buybar, .drawer, .modal-wrap, .palette-wrap, .scrim { display: none !important; }
    body { background: #fff; color: #000; }
}
