/* ==========================================================================
   Tide — blue Tebex theme
   One font, one radius scale, one spacing scale, one hover rule.
   ========================================================================== */

:root {
    /* colourway: Blue-Blue (default). Other colourways below override these. */
    --bg: #050b22;
    --bg-rgb: 5, 11, 34;
    --surface: #0a1638;
    --surface-2: #0f1f4a;
    --surface-3: #15295e;
    --surface-hover: #1c3375;
    --card-top-rgb: 22, 44, 110;
    --card-bottom-rgb: 10, 22, 56;

    --accent: #2f6bff;
    --accent-rgb: 47, 107, 255;
    --accent-2: #4da3ff;
    --accent-2-rgb: 77, 163, 255;
    --accent-3: #22d3ee;
    --accent-3-rgb: 34, 211, 238;
    --on-accent: #fff;
    --tint: #2563ff;
    --tint-opacity: 0.3;

    --text: #eef3ff;
    --muted: #9db0e0;
    --faint: #6a80b8;
    --danger: #f87171;
    --success: #4ade80;
    --success-rgb: 74, 222, 128;

    /* derived from the colourway, no need to override */
    --border: rgba(var(--accent-2-rgb), 0.16);
    --border-strong: rgba(var(--accent-2-rgb), 0.42);
    --accent-soft: rgba(var(--accent-rgb), 0.2);
    /* hover glow switched off; to bring it back: 0 12px 38px -10px rgba(var(--accent-rgb), 0.75) */
    --glow: none;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 18px;

    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 24px;
    --s6: 32px;
    --s7: 48px;

    --container: 1180px;
    --header-h: 72px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --speed: 180ms;

    --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- colourways (picked with the "Colourway" setting, set on <html data-colourway>) ---------- */

/* Dark-*: neutral dark surfaces, coloured accent */
:root[data-colourway^="dark-"] {
    --bg: #0b0d12;
    --bg-rgb: 11, 13, 18;
    --surface: #12151c;
    --surface-2: #181c25;
    --surface-3: #1f2430;
    --surface-hover: #282e3c;
    --card-top-rgb: 32, 37, 49;
    --card-bottom-rgb: 18, 21, 28;
    --text: #f1f3f6;
    --muted: #a0a8b6;
    --faint: #6b7385;
    --tint-opacity: 0.16;
}

:root[data-colourway="dark-yellow"] {
    --accent: #f5b731; --accent-rgb: 245, 183, 49;
    --accent-2: #ffca52; --accent-2-rgb: 255, 202, 82;
    --accent-3: #ff8a3d; --accent-3-rgb: 255, 138, 61;
    --on-accent: #2b1d00; --tint: #f5b731;
}

:root[data-colourway="dark-red"] {
    --accent: #e8484c; --accent-rgb: 232, 72, 76;
    --accent-2: #f87175; --accent-2-rgb: 248, 113, 117;
    --accent-3: #ff8a5c; --accent-3-rgb: 255, 138, 92;
    --tint: #e8484c;
}

:root[data-colourway="dark-orange"] {
    --accent: #f06a28; --accent-rgb: 240, 106, 40;
    --accent-2: #ff8c4d; --accent-2-rgb: 255, 140, 77;
    --accent-3: #fbbf24; --accent-3-rgb: 251, 191, 36;
    --tint: #f06a28;
}

:root[data-colourway="dark-green"] {
    --accent: #22c55e; --accent-rgb: 34, 197, 94;
    --accent-2: #4ade80; --accent-2-rgb: 74, 222, 128;
    --accent-3: #2dd4bf; --accent-3-rgb: 45, 212, 191;
    --on-accent: #052e16; --tint: #22c55e;
}

:root[data-colourway="dark-blue"] {
    --accent: #2f80ed; --accent-rgb: 47, 128, 237;
    --accent-2: #62b8ff; --accent-2-rgb: 98, 184, 255;
    --accent-3: #22d3ee; --accent-3-rgb: 34, 211, 238;
    --tint: #2f80ed;
}

:root[data-colourway="dark-purple"] {
    --accent: #a855f7; --accent-rgb: 168, 85, 247;
    --accent-2: #c084fc; --accent-2-rgb: 192, 132, 252;
    --accent-3: #f472b6; --accent-3-rgb: 244, 114, 182;
    --tint: #a855f7;
}

:root[data-colourway="dark-pink"] {
    --accent: #ec4899; --accent-rgb: 236, 72, 153;
    --accent-2: #f472b6; --accent-2-rgb: 244, 114, 182;
    --accent-3: #c084fc; --accent-3-rgb: 192, 132, 252;
    --tint: #ec4899;
}

/* Purple-Red: purple surfaces, red accent */
:root[data-colourway="purple-red"] {
    --bg: #12071a;
    --bg-rgb: 18, 7, 26;
    --surface: #1c0c26;
    --surface-2: #251134;
    --surface-3: #301744;
    --surface-hover: #3d1d57;
    --card-top-rgb: 56, 22, 76;
    --card-bottom-rgb: 28, 11, 40;
    --accent: #e82848; --accent-rgb: 232, 40, 72;
    --accent-2: #ff5c76; --accent-2-rgb: 255, 92, 118;
    --accent-3: #c084fc; --accent-3-rgb: 192, 132, 252;
    --tint: #7c3aed;
    --text: #fbf0ff;
    --muted: #c4a8d4;
    --faint: #8a6c9c;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ---------- page background: dimmed wallpaper that fades into the page, plus particles ---------- */

.app-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 760px;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    /* fade to transparent (not to a solid colour) so the glow underneath carries on without a seam */
    -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}

.app-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    opacity: 0.75;
    filter: saturate(1.4);
}

/* blue tint so any wallpaper matches the theme */
.app-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--tint);
    mix-blend-mode: color;
    opacity: var(--tint-opacity);
}

/* soft vignette + darken behind the content; the mask above handles the actual fade-out */
.app-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(140% 100% at 50% 0%, transparent 60%, rgba(var(--bg-rgb), 0.6) 100%),
        linear-gradient(to bottom, rgba(var(--bg-rgb), 0.1) 0%, transparent 30%, rgba(var(--bg-rgb), 0.45) 75%);
}

/* soft coloured glow behind the content so the page below the wallpaper isn't flat */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background:
        radial-gradient(900px 600px at 0% 60%, rgba(var(--accent-rgb), 0.14), transparent 70%),
        radial-gradient(800px 600px at 100% 90%, rgba(var(--accent-3-rgb), 0.10), transparent 70%);
}

.particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--s5);
}

.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- shared card + hover rule ---------- */

.card {
    position: relative;
    background: linear-gradient(160deg, rgba(var(--card-top-rgb), 0.78), rgba(var(--card-bottom-rgb), 0.86));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

/* thicker border on hover: the inset ring adds a 2nd pixel inside the border, so nothing shifts */
.hover-lift:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--accent-2-rgb), 0.7);
    box-shadow: inset 0 0 0 1px rgba(var(--accent-2-rgb), 0.7);
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    height: 42px;
    padding: 0 var(--s4);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    /* no extra tracking: Poppins' open "c" before "k" already leaves a gap ("Chec kout") */
    letter-spacing: 0;
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--speed) var(--ease), background var(--speed) var(--ease), border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    color: var(--on-accent);
    box-shadow: 0 6px 18px -8px rgba(var(--accent-rgb), 0.8);
}

.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
    background: var(--surface-3);
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-hover); }

.btn-danger {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.35);
    color: var(--danger);
}

.btn-danger:hover { background: rgba(248, 113, 113, 0.24); }

.btn-block { width: 100%; }

.btn[disabled],
.btn.is-disabled { opacity: 0.5; pointer-events: none; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-3);
    color: var(--accent-2);
    font-size: 17px;
    transition: transform var(--speed) var(--ease), background var(--speed) var(--ease), color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

/* icons inside buttons: no inline line-box offset, and optical nudges for lopsided glyphs */
.btn i,
.icon-btn i,
.hero-btn i { display: block; line-height: 1; }
.icon-btn .fa-crown { font-size: 16px; transform: translateY(-1px); }
.icon-btn .fa-book { font-size: 16px; }
.icon-btn .fa-cart-shopping { transform: translateX(-1px); }
.hero-btn .fa-play { transform: translateX(1px); }

.icon-btn:hover {
    transform: translateY(-2px);
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: var(--glow);
}

.icon-btn.is-filled { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.icon-btn.is-filled:hover { background: var(--accent-2); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.input {
    width: 100%;
    height: 46px;
    padding: 0 var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ==========================================================================
   Header bar
   ========================================================================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    background: rgba(var(--bg-rgb), 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.topbar .container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 100%;
    gap: var(--s4);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.topbar-right { justify-content: flex-end; }

.user-chip,
.cart-chip {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 0 var(--s2);
    border-radius: var(--radius-sm);
}

.user-chip { margin-left: var(--s2); }

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    image-rendering: pixelated;
    transition: transform var(--speed) var(--ease);
}

.user-chip:hover .user-avatar { transform: rotate(-6deg) scale(1.05); }

.chip-text { display: flex; flex-direction: column; line-height: 1.25; }
.chip-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.chip-sub { font-size: 12px; color: var(--muted); transition: color var(--speed) var(--ease); }
.user-chip:hover .chip-sub,
.cart-chip:hover .chip-sub { color: var(--accent-2); }

.cart-chip { text-align: right; }
.cart-chip .chip-text { align-items: flex-end; }

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent-3);
    color: var(--bg);
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.icon-btn-wrap { position: relative; }

/* ---------- currency picker ---------- */

.currency-select { position: relative; }

.currency-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    height: 42px;
    padding: 0 var(--s4);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.currency-btn .fa-coins { color: var(--accent-2); }
.currency-btn .fa-chevron-down { font-size: 10px; color: var(--muted); transition: transform var(--speed) var(--ease); }
.currency-btn:hover,
.currency-select.is-open .currency-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.currency-select.is-open .fa-chevron-down { transform: rotate(180deg); }

.currency-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 60;
    width: 310px;
    max-width: calc(100vw - 32px);
    padding: var(--s4);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease), visibility var(--speed);
}

.currency-select.is-open .currency-menu { opacity: 1; visibility: visible; transform: none; }

.currency-title { margin-bottom: var(--s3); font-size: 15px; font-weight: 700; }

.currency-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s2);
    max-height: 60vh;
    overflow-y: auto;
}

.currency-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 13px;
    cursor: pointer;
    transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}

.currency-option strong { font-weight: 700; }
.currency-option span { font-size: 12px; color: var(--muted); }
.currency-option:hover { border-color: var(--border-strong); }
.currency-option.is-active { border-color: var(--accent-2); background: var(--accent); color: var(--on-accent); }
.currency-option.is-active span { color: inherit; opacity: 0.85; }

.currency-note { margin-top: var(--s3); font-size: 12px; color: var(--muted); }

/* ---------- server selector ---------- */

.server-select { position: relative; }

.server-select-btn {
    display: flex;
    align-items: center;
    gap: var(--s3);
    height: 44px;
    min-width: 220px;
    padding: 0 6px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.server-select-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* no server picked yet: the button pulses so it's obvious where to start */
.server-unpicked .server-select-btn { border-color: var(--accent); animation: server-pulse 2s ease-in-out infinite; }
@keyframes server-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }

.server-select-btn img,
.server-card img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--surface-3);
    padding: 4px;
}

/* the swap icon gets the same width as the server icon so the label sits in the true centre */
.server-select-btn .label { flex: 1; text-align: center; }
.server-select-btn > i { flex: none; width: 32px; text-align: center; font-size: 12px; color: var(--muted); }

/* server popup */
.server-cards { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); }

.server-card {
    display: flex;
    align-items: center;
    gap: var(--s3);
    width: 100%;
    padding: var(--s3) var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.server-card img { width: 44px; height: 44px; }
.server-card span { flex: 1; }
.server-card > i { font-size: 12px; color: var(--muted); transition: transform var(--speed) var(--ease), color var(--speed) var(--ease); }
.server-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.server-card:hover > i { color: var(--accent-2); transform: translateX(3px); }
.server-card.is-active { border-color: var(--accent); background: var(--accent-soft); }

/* ==========================================================================
   Hero strip: play now / server icon / discord
   ========================================================================== */
/* no box: the logo sits on the wallpaper, buttons line up with the content edges */
.hero {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--s5);
    min-height: 190px;
    margin-top: var(--s5);
    padding: var(--s3) 0 var(--s5);
}

.hero-action {
    display: flex;
    align-items: center;
    gap: var(--s4);
    cursor: pointer;
    user-select: none;
}

.hero-action.is-left { justify-content: flex-start; text-align: left; }
.hero-action.is-right { justify-content: flex-end; text-align: right; }

.hero-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent-3), var(--accent));
    color: var(--on-accent);
    font-size: 22px;
    box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.55), 0 8px 20px -8px rgba(var(--accent-rgb), 0.8);
    transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), filter var(--speed) var(--ease);
}

.hero-btn.is-discord {
    color: #fff;
    background: linear-gradient(145deg, #7b8cff, #5865f2);
    box-shadow: 0 0 24px rgba(88, 101, 242, 0.6), 0 8px 20px -8px rgba(88, 101, 242, 0.8);
}

.hero-action:hover .hero-btn {
    transform: translateY(-3px) scale(1.05);
    filter: brightness(1.1);
}

.hero-text h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.hero-action.is-right .hero-text h3 { justify-content: flex-end; }

.hero-text p {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    transition: color var(--speed) var(--ease);
}

.hero-action:hover .hero-text p { color: var(--accent-2); }

.hero-text .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: #fff;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    line-height: 1;
    text-shadow: none;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.6);
}

.hero-action.is-right .hero-text .count { color: #5865f2; }

.server-icon {
    position: relative;
    display: grid;
    place-items: center;
}

.server-icon::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 380px;
    height: 380px;
    margin: -190px 0 0 -190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.42), rgba(var(--accent-3-rgb), 0.08) 45%, transparent 66%);
    animation: pulse 4s ease-in-out infinite;
    pointer-events: none;
}

.server-icon img {
    position: relative;
    width: 440px;
    max-height: 240px;
    object-fit: contain;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.55));
    animation: float 6s ease-in-out infinite;
    transition: scale 300ms var(--ease);
}
.server-icon:hover img { scale: 1.05; }

/* ==========================================================================
   Sections
   ========================================================================== */

main { padding-bottom: var(--s7); }

.section { margin-top: var(--s6); }

.section-head {
    margin-bottom: var(--s5);
    text-align: center;
}

.section-head h2 {
    font-size: 26px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.section-head p { margin-top: var(--s1); color: var(--muted); font-size: 14px; }

.section-head .accent-line {
    width: 56px;
    height: 4px;
    margin: var(--s3) auto 0;
    border-radius: 999px;
    background: var(--accent);
}

/* ---------- category tiles ---------- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s5);
}

.category-tile {
    display: flex;
    align-items: center;
    min-height: 180px;
    padding: var(--s6);
    overflow: hidden;
}

.category-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(400px 200px at 85% 50%, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-3-rgb), 0.06) 50%, transparent 72%);
    pointer-events: none;
    transition: opacity var(--speed) var(--ease);
    opacity: 0.6;
}

.category-tile:hover::after { opacity: 1; }

.category-tile .text { position: relative; z-index: 1; flex: 1; }

.category-tile h3 {
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.category-tile p {
    margin-top: var(--s1);
    color: var(--muted);
    font-size: 14px;
    transition: color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.category-tile:hover p { color: var(--accent-2); transform: translateX(4px); }

.category-tile img {
    position: relative;
    z-index: 1;
    width: 140px;
    height: 140px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45));
    transition: transform 300ms var(--ease);
}

.category-tile:hover img { transform: scale(1.08) rotate(-5deg); }

/* set by scripts.js on the last visible tile when the visible count is odd */
.category-tile.is-full { grid-column: 1 / -1; }

[data-server].is-hidden { display: none !important; }

/* ---------- homepage text ---------- */

.store-text {
    padding: var(--s6);
    color: var(--muted);
    text-align: center;
}

.store-text h1, .store-text h2, .store-text h3 { color: var(--text); margin-bottom: var(--s2); }
.store-text p + p { margin-top: var(--s3); }

/* ---------- patron page: tier banner + skin grid ---------- */

.patron-tier.is-netherite { --tier: #e8264f; --tier-rgb: 232, 38, 79; }
.patron-tier.is-emerald { --tier: #1fcf57; --tier-rgb: 31, 207, 87; }
.patron-tier.is-diamond { --tier: #1fb6e0; --tier-rgb: 31, 182, 224; }

.patron-banner {
    padding: var(--s4) var(--s5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    background: var(--tier);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 12px 30px -16px rgba(var(--tier-rgb), 0.9);
}

.patron-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s5);
    margin-top: var(--s5);
}

.patron-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s3);
    padding: var(--s5) var(--s4);
    text-align: center;
}

.patron-card img {
    width: 104px;
    height: 104px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45));
}

.patron-card span { max-width: 100%; overflow-wrap: anywhere; font-size: 18px; font-weight: 700; }
.patron-card.hover-lift:hover { border-color: rgba(var(--tier-rgb), 0.8); box-shadow: inset 0 0 0 1px rgba(var(--tier-rgb), 0.8); }

/* ---------- information / privacy notices ---------- */

.notices { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s5); }
.notice-card { padding: var(--s5) var(--s6); }
.notice-card h3 { display: flex; align-items: center; gap: var(--s2); font-size: 17px; font-weight: 700; }
.notice-card h3 i { color: var(--accent-2); }
.notice-card p { margin-top: var(--s2); color: var(--muted); font-size: 14px; }

/* ==========================================================================
   Modules (sidebar modules rendered as a grid)
   ========================================================================== */

/* flex so a module left alone on its row stretches to full width */
.modules {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s5);
}

.modules > .module { flex: 1 1 calc(50% - var(--s5)); min-width: 0; }

.module {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s4);
    padding: var(--s6) var(--s5);
    text-align: center;
}

.module::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 50%;
    width: 72px;
    height: 4px;
    border-radius: 0 0 6px 6px;
    background: var(--accent);
    transform: translateX(-50%);
}

.module-title { font-size: 20px; font-weight: 700; }
.modules > .module.is-wide { flex-basis: 100%; }

/* goal */
.goal-bar {
    position: relative;
    width: 100%;
    height: 44px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.goal-fill {
    position: relative;
    height: 100%;
    width: 0;
    min-width: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--s3);
    border-radius: 9px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    font-size: 15px;
    font-weight: 700;
    transition: width 1.2s var(--ease);
    overflow: hidden;
}

.goal-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: shine 2.8s linear infinite;
}

.goal-fill.is-striped {
    background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.10) 0 10px, transparent 10px 20px), linear-gradient(90deg, var(--accent), var(--accent-2));
}

.goal-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s4);
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
}

.goal-meta i { color: var(--accent-2); margin-right: 6px; }

/* payments */
/* flex so a short last row (e.g. 5 payments, 3 per row on phones) stays centred */
.payments {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s4);
    width: 100%;
}

.payment { display: flex; flex: 0 0 calc((100% - 4 * var(--s4)) / 5); flex-direction: column; align-items: center; gap: var(--s2); min-width: 0; }

.payment img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    background: var(--surface-3);
    image-rendering: pixelated;
    transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.payment:hover img { transform: translateY(-3px); box-shadow: var(--glow); }

.payment .name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--muted);
}

.payment .what { font-size: 11px; color: var(--accent-2); }

/* top donator */
.topdonator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s5);
}

.topdonator img {
    height: 150px;
    image-rendering: pixelated;
    animation: float 6s ease-in-out infinite;
}

.topdonator .name { font-size: 18px; font-weight: 600; }
.topdonator .amount { margin-top: var(--s1); font-size: 13px; color: var(--accent-2); }

/* gift card + forms */
.inline-form { display: flex; gap: var(--s3); width: 100%; }
.inline-form .btn { height: 46px; padding: 0 var(--s5); }

.notice {
    width: 100%;
    padding: var(--s3) var(--s4);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-2);
    font-size: 13px;
}

.notice.is-error { background: rgba(248, 113, 113, 0.1); color: var(--danger); }

/* featured package (module) */
.featured {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--s5);
    text-align: left;
}

.featured img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    image-rendering: pixelated;
    transition: transform 300ms var(--ease);
}

.featured:hover img { transform: scale(1.08) rotate(-5deg); }
.featured .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.featured .info h3 { font-size: 18px; font-weight: 700; }
.featured .price { font-size: 14px; color: var(--muted); }
.featured .price strong { color: var(--text); }

/* server status */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--faint);
    margin-right: 6px;
}

.status-dot.is-online { background: var(--success); box-shadow: 0 0 0 4px rgba(var(--success-rgb), 0.15); }

/* ==========================================================================
   Category page
   ========================================================================== */

.page-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s3);
    margin-top: var(--s6);
    padding: var(--s6);
    text-align: center;
}

.page-head h1 { font-size: 32px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.page-head .desc { max-width: 640px; color: var(--muted); font-size: 14px; }
.page-head .actions { display: flex; gap: var(--s3); flex-wrap: wrap; justify-content: center; margin-top: var(--s2); }
/* no visible button (e.g. no Compare): drop the row so the header doesn't keep an empty gap */
.page-head .actions:not(:has(> :not([hidden]))) { display: none; }

.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color var(--speed) var(--ease);
}

.breadcrumb:hover { color: var(--accent-2); }

/* package grid */
/* flex + fixed basis so a short last row stays centred */
.package-grid {
    --cols: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s5);
    margin-top: var(--s5);
}

.package-grid > .pkg { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--s5)) / var(--cols)); min-width: 0; }
.package-grid.is-list { --cols: 1; }

.pkg {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--s5);
    text-align: center;
}

/* sale tag sits over the card's top-right corner */
.sale-tag {
    position: absolute;
    top: -12px;
    right: var(--s4);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 0 20px;
    border-radius: 999px;
    background: linear-gradient(145deg, #fbbf24, #f97316);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(124, 45, 18, 0.5);
    box-shadow: 0 8px 20px -8px rgba(249, 115, 22, 0.9);
}

.sale-tag.is-current {
    background: linear-gradient(145deg, var(--accent-2), var(--accent));
    text-shadow: none;
    box-shadow: 0 8px 20px -8px rgba(var(--accent-rgb), 0.9);
}

.pkg-media {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 150px;
    margin: var(--s4) 0 var(--s3);
}

.pkg-media img {
    max-width: 130px;
    max-height: 130px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45));
    transition: transform 300ms var(--ease);
}

.pkg:hover .pkg-media img { transform: scale(1.08) rotate(-4deg); }

/* duration tag on the top right of a timed package's icon */
.time-tag {
    position: absolute;
    top: 6px;
    left: calc(50% + 30px);
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--accent-3), var(--accent));
    color: var(--on-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 6px 16px -6px rgba(var(--accent-3-rgb), 0.9);
}

.pkg-name { font-size: 17px; font-weight: 700; }

.pkg-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--s2);
    margin-top: var(--s1);
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-2);
}

.pkg-price del { font-size: 13px; color: var(--faint); font-weight: 500; }

.pkg-actions {
    display: flex;
    gap: var(--s2);
    width: 100%;
    margin-top: auto;
    padding-top: var(--s4);
}

.pkg-actions .btn-primary,
.pkg-actions .btn-danger { flex: 1; }
.pkg-actions .btn-ghost { width: 42px; padding: 0; }
.pkg-actions .btn-ghost i { font-size: 15px; }

/* amount selector (crate keys) */
.amounts {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--s2);
    width: 100%;
    margin-top: var(--s4);
}

.amount {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 56px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: pointer;
    transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.amount strong { font-size: 17px; font-weight: 800; line-height: 1; }
/* block so the empty label still takes its 12px: the number sits at the same height on every chip */
.amount span { display: block; min-height: 12px; font-size: 10px; font-weight: 600; line-height: 12px; color: var(--accent-3); letter-spacing: 0.04em; }
.amount:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.amount.is-active { border-color: var(--accent); background: var(--accent-soft); }

/* ==========================================================================
   Package page
   ========================================================================== */

.package-view {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: var(--s5);
    margin-top: var(--s6);
}

.package-view .media {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s4);
    padding: var(--s6);
    text-align: center;
}

.package-view .media img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    image-rendering: pixelated;
    animation: float 6s ease-in-out infinite;
}

.package-view .pkg-price { font-size: 24px; font-weight: 800; }
.package-view .pkg-price del { font-size: 15px; }

.package-view .body { padding: var(--s6); }
.package-view .body h1 { font-size: 28px; font-weight: 800; }

.rich { margin-top: var(--s4); color: var(--muted); font-size: 14px; }
.rich ul { margin: var(--s3) 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.rich li { position: relative; padding-left: 26px; }
.rich li::before {
    content: "\f00c";
    position: absolute;
    left: 0;
    top: 1px;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 12px;
    color: var(--accent-2);
}
.rich a { color: var(--accent-2); }
.rich img { border-radius: var(--radius-sm); margin: var(--s3) auto; }

/* ==========================================================================
   Basket / login / generic form pages
   ========================================================================== */

.narrow { max-width: 560px; margin: var(--s6) auto 0; }
.narrow.is-wide { max-width: 760px; }

.panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s4);
    padding: var(--s6);
    text-align: center;
}

.panel h1 { font-size: 26px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.panel .lead { color: var(--muted); font-size: 14px; }
.panel form { width: 100%; display: flex; flex-direction: column; gap: var(--s3); }

.login-preview {
    width: 96px;
    height: 96px;
    border-radius: var(--radius);
    background: var(--surface-3);
    image-rendering: pixelated;
    animation: float 6s ease-in-out infinite;
}

.edition-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s2);
    width: 100%;
}

.edition-switch label { cursor: pointer; }
.edition-switch input { display: none; }
.edition-switch span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    transition: border-color var(--speed) var(--ease), color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.edition-switch input:checked + span { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

.basket-list { display: flex; flex-direction: column; gap: var(--s3); width: 100%; }

.basket-row {
    display: flex;
    align-items: center;
    gap: var(--s4);
    padding: var(--s3) var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    text-align: left;
    transition: border-color var(--speed) var(--ease);
}

.panel form.basket-row { flex-direction: row; gap: var(--s4); }
.basket-row:hover { border-color: var(--border-strong); }
.basket-row img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.basket-row .name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.basket-row .name:hover { color: var(--accent-2); }
.basket-row .price { font-weight: 600; color: var(--accent-2); white-space: nowrap; }
.basket-row .remove {
    flex: none;
    width: 34px;
    height: 34px;
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.12);
    color: var(--danger);
    font-size: 14px;
}

.basket-row .remove:hover { background: var(--danger); color: #fff; }

/* quantity stepper: one pill holding  -  1  +  */
.qty-field {
    display: inline-flex;
    flex: none;
    align-items: center;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
}

.qty-btn {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--accent-2);
    font-size: 11px;
    cursor: pointer;
    transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}

.qty-btn i { display: block; line-height: 1; }
.qty-btn:hover { background: var(--accent); color: var(--on-accent); }
.qty-btn[disabled] { opacity: 0.4; pointer-events: none; }

.qty-input {
    width: 30px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* checkout agreements */
.agreements { display: flex; flex-direction: column; gap: var(--s2); width: 100%; text-align: left; }

.agreement {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    transition: border-color var(--speed) var(--ease);
}

.agreement:hover { border-color: var(--border-strong); }
.agreement input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.agreement strong { color: var(--text); }
.agreement a { color: var(--accent-2); font-weight: 600; }
.agreement a i { font-size: 10px; }
.agreements .notice i { margin-right: 6px; }

/* cart upgrade suggestions (scripts.js): bigger pack side by side, or the next rank up */
/* --upsell-styles tells scripts.js these styles are loaded (an older style.css on Tebex would show the box unstyled) */
.upsells { --upsell-styles: 1; display: flex; flex-direction: column; gap: var(--s3); width: 100%; text-align: left; }

.upsell {
    display: flex;
    flex-direction: column;
    gap: var(--s3);
    padding: var(--s4);
    border: 1px solid rgba(var(--accent-2-rgb), 0.55);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.upsell-head b { display: block; font-size: 15px; font-weight: 700; color: var(--accent-3); }
/* > span only: the price inside the title is a span too and must stay inline */
.upsell-head > span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

/* the arrow gets its own column, with the same space on both sides, centred on the packs' height */
/* minmax(0, 1fr): both packs exactly the same width, whatever their text, so the arrow stays in the middle */
.upsell-compare { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--s5); }

.upsell-compare > i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 13px;
    line-height: 1;
}

.upsell-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--s3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    text-align: center;
}

.upsell-side img { width: 44px; height: 44px; margin-bottom: var(--s1); object-fit: contain; image-rendering: pixelated; }
.upsell-side b { font-size: 18px; font-weight: 800; line-height: 1.2; }
.upsell-side .p { font-size: 13px; color: var(--muted); }
.upsell-side em { font-size: 11px; font-style: normal; color: var(--faint); }
.upsell-side.is-from { opacity: 0.7; }
.upsell-side.is-to { border-color: var(--accent-2); background: rgba(var(--accent-rgb), 0.12); }
.upsell-side.is-cheaper em { color: var(--success); }

.upsell-save {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    padding: var(--s2) var(--s3);
    border: 1px solid rgba(var(--success-rgb), 0.3);
    border-radius: var(--radius-sm);
    background: rgba(var(--success-rgb), 0.08);
    font-size: 13px;
}

.upsell-save i,
.upsell-save b { color: var(--success); }

.upsell-rank-head { display: flex; align-items: center; gap: var(--s3); }
.upsell-rank-head img { flex: none; width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.upsell-rank-head b { display: block; font-size: 15px; font-weight: 700; }
.upsell-rank-head div > span { font-size: 13px; color: var(--muted); }

.upsell-ladder {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s2);
    padding: var(--s2) var(--s3);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.upsell-ladder span { padding: 2px 8px; border-radius: 6px; background: var(--surface-3); }
.upsell-ladder .to { background: var(--accent); color: var(--on-accent); }
.upsell-ladder i { font-size: 12px; color: var(--muted); }

.upsell-perks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--s3); margin: 0; padding: 0; list-style: none; font-size: 13px; }
.upsell-perks li { display: flex; align-items: flex-start; gap: var(--s2); }
.upsell-perks i { margin-top: 4px; font-size: 11px; color: var(--accent-2); }
.upsell-perks .more { color: var(--muted); }

.basket-total {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding-top: var(--s4);
    border-top: 1px solid var(--border);
    font-size: 16px;
    font-weight: 700;
}

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
select.input { appearance: none; cursor: pointer; }

/* ==========================================================================
   Compare modal
   ========================================================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: var(--s5);
    background: rgba(var(--bg-rgb), 0.78);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--speed) var(--ease), visibility var(--speed);
}

.modal.is-open { opacity: 1; visibility: visible; }

.modal-box {
    width: 100%;
    max-width: 980px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px) scale(0.98);
    transition: transform 240ms var(--ease);
}

.modal.is-open .modal-box { transform: none; }
.modal-box.is-small { max-width: 440px; }

.gift-form { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); text-align: center; font-size: 14px; }
.gift-form strong { color: var(--text); }

.modal-head {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--s5);
    border-bottom: 1px solid var(--border);
}

.modal-head h2 { font-size: 20px; font-weight: 700; }
.modal-head .icon-btn { position: absolute; right: var(--s4); width: 36px; height: 36px; }

.modal-body { overflow: auto; }

.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.compare-table th,
.compare-table td {
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.compare-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-2);
    vertical-align: bottom;
}

.compare-table thead .cmp-media { position: relative; width: 56px; margin: 0 auto var(--s2); }
.compare-table thead img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; }
.compare-table thead th { padding-top: var(--s5); }
.compare-table thead .time-tag { top: -10px; left: auto; right: -16px; padding: 2px 6px; font-size: 9px; }
.compare-table thead .name { font-size: 13px; font-weight: 700; }
.compare-table thead .price { font-size: 12px; font-weight: 600; color: var(--accent-2); }
.compare-table td:first-child,
.compare-table th:first-child { text-align: left; color: var(--muted); min-width: 200px; }
.compare-table tbody tr { transition: background var(--speed) var(--ease); }
.compare-table tbody tr:hover { background: rgba(var(--accent-rgb), 0.1); }
.compare-table .yes { color: var(--accent-2); font-weight: 600; }
.compare-table .no { color: var(--faint); }
.compare-table tfoot td { border-bottom: 0; padding-top: var(--s4); padding-bottom: var(--s4); }
.compare-table tfoot .btn { height: 36px; padding: 0 var(--s3); font-size: 12px; }

/* ==========================================================================
   Footer + toast
   ========================================================================== */

.footer {
    margin-top: var(--s7);
    padding: var(--s6) 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--faint);
}

.footer .links { display: flex; justify-content: center; gap: var(--s5); margin-bottom: var(--s3); flex-wrap: wrap; }
.footer a { color: var(--muted); transition: color var(--speed) var(--ease); }
.footer a:hover { color: var(--accent-2); }

.toast {
    position: fixed;
    bottom: var(--s5);
    left: 50%;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s5);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface-2);
    box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.8);
    font-size: 14px;
    font-weight: 500;
    transform: translate(-50%, 20px);
    opacity: 0;
    transition: opacity 240ms var(--ease), transform 240ms var(--ease);
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast i { color: var(--accent-2); }
.toast.is-error i { color: var(--danger); }

/* ==========================================================================
   Motion
   ========================================================================== */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 500ms var(--ease), transform 500ms var(--ease), border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease); }
.reveal.is-in.hover-lift:hover { transform: translateY(-4px); }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { opacity: 0.6; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1000px) {
    .chip-text { display: none; }
    .currency-btn { padding: 0 var(--s3); }
    .currency-btn .fa-coins { display: none; }
    .user-chip, .cart-chip { padding: 0; }
    .server-select-btn { min-width: 0; }
    .package-grid { --cols: 2; }
    .patron-grid { grid-template-columns: repeat(3, 1fr); }
    .package-view { grid-template-columns: 1fr; }
    .hero { grid-template-columns: 1fr 260px 1fr; }
    .server-icon img { width: 260px; }
    .hero-text h3 { font-size: 16px; }
}

@media (max-width: 760px) {
    :root { --header-h: auto; }
    .container { padding: 0 var(--s4); }
    .topbar .container { grid-template-columns: 1fr auto; padding-top: var(--s3); padding-bottom: var(--s3); row-gap: var(--s3); }
    .topbar-center { grid-column: 1 / -1; grid-row: 2; }
    /* a store with one server has no selector: drop the empty second row */
    .topbar-center:not(:has([data-server-select]:not([hidden]))) { display: none; }
    /* currency menu spans the top bar (below both rows) instead of hanging off the button */
    .topbar .container { position: relative; }
    .currency-select { position: static; }
    .currency-menu { top: calc(100% + 8px); left: var(--s4); right: var(--s4); width: auto; max-width: none; }
    .server-select-btn { width: 100%; }
    .hero { grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s3); min-height: 0; }
    .hero .server-icon { grid-column: 1 / -1; order: -1; }
    .server-icon img { width: 280px; }
    .server-icon::before { width: 300px; height: 300px; margin: -150px 0 0 -150px; }
    .hero-action { gap: 10px; }
    .hero-btn { width: 42px; height: 42px; font-size: 17px; }
    .hero-text h3 { font-size: 14px; gap: 5px; white-space: nowrap; }
    .hero-text .count { min-width: 30px; height: 18px; padding: 0 6px; font-size: 10px; }
    .hero-text p { font-size: 10px; letter-spacing: 0.1em; }
    .category-grid { grid-template-columns: 1fr; }
    .package-grid { --cols: 1; }
    .patron-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
    .patron-card img { width: 80px; height: 80px; }
    .patron-card span { font-size: 15px; }
    .modules > .module { flex-basis: 100%; }
    .category-tile { padding: var(--s5); min-height: 140px; }
    .category-tile img { width: 100px; height: 100px; }
    .payment { flex-basis: calc((100% - 2 * var(--s4)) / 3); }
    /* compare table: perk names stay in view while the ranks scroll sideways */
    .compare-table td:first-child,
    .compare-table th:first-child { position: sticky; left: 0; z-index: 2; min-width: 130px; max-width: 130px; background: var(--surface-2); }
    .compare-table thead th:first-child { z-index: 3; }
    .compare-table th, .compare-table td { padding: var(--s3); }
    .featured { flex-direction: column; text-align: center; }
    .featured .info { align-items: center; }
    .inline-form { flex-direction: column; }
    .panel form.basket-row { flex-wrap: wrap; gap: var(--s2) var(--s3); }
    .basket-row .name { flex-basis: calc(100% - 64px); }
    .basket-row .qty-field { margin-right: auto; }
    .upsell-perks { grid-template-columns: 1fr; }
    .upsell-compare { gap: var(--s3); }
}
