/*
 * Gamster UI v2 — "arcade / blocky" look shared by gamster.org, the forums,
 * the store and chatlog. Needs Google Fonts: Pixelify Sans (500-700) and
 * Montserrat (500-800). Everything is scoped under .gx- class names.
 *
 * Building blocks:
 *   .gx-px      pixel-notched corners (clip-path), use on any block
 *   .gx-btn     bevelled Minecraft-style button (+ --red / --gold / --purple / --discord / --stone)
 *   .gx-slot    inventory-slot style panel
 */

:root {
    --gx-bg: #17191d;
    --gx-bg-2: #1e2126;
    --gx-panel: #26292f;
    --gx-panel-2: #2d3037;
    --gx-line: #0d0e10;
    --gx-text: #f4f4f5;
    --gx-text-2: #c3c7cc;
    --gx-muted: #8b919a;

    --gx-red: #ed2f2f;
    --gx-red-dark: #9c1717;
    --gx-gold: #ffb21c;
    --gx-gold-2: #ff7a00;
    --gx-gold-dark: #a34a00;
    --gx-purple: #6a2bd1;
    --gx-purple-dark: #3c1680;
    --gx-discord: #5865f2;
    --gx-discord-dark: #343ea8;
    --gx-online: #4ee36b;

    --gx-pixel: "Pixelify Sans", "Montserrat", system-ui, sans-serif;
    --gx-font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
    --gx-n: 4px;            /* pixel notch size */
    --gx-max: 1160px;
    --gx-nav-h: 68px;
}

/* ---------- Base ---------- */

.gx-page {
    margin: 0; background: var(--gx-bg); color: var(--gx-text-2);
    /* footer stays at the bottom on tall screens with short pages */
    min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
    font: 500 15px/1.6 var(--gx-font); -webkit-font-smoothing: antialiased;
}
.gx-page *, .gx-page *::before, .gx-page *::after { box-sizing: border-box; }
.gx-page img { max-width: 100%; display: block; }
.gx-page a { color: inherit; text-decoration: none; }
.gx-page h1, .gx-page h2, .gx-page h3 { margin: 0; color: var(--gx-text); font-family: var(--gx-pixel); font-weight: 700; line-height: 1.1; }
.gx-page > main { flex: 1 0 auto; }
.gx-page > .gx-footer { flex-shrink: 0; }
.gx-container { width: 100%; max-width: var(--gx-max); margin: 0 auto; padding: 0 20px; }
.gx-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--gx-red); color: #fff; padding: 8px 14px; }
.gx-skip:focus { left: 8px; }
:where(.gx-page) :focus-visible { outline: 3px solid var(--gx-gold); outline-offset: 3px; }

/* Pixel-notched corners: one "pixel" cut from every corner. */
.gx-px {
    clip-path: polygon(
        0 var(--gx-n), var(--gx-n) var(--gx-n), var(--gx-n) 0,
        calc(100% - var(--gx-n)) 0, calc(100% - var(--gx-n)) var(--gx-n), 100% var(--gx-n),
        100% calc(100% - var(--gx-n)), calc(100% - var(--gx-n)) calc(100% - var(--gx-n)), calc(100% - var(--gx-n)) 100%,
        var(--gx-n) 100%, var(--gx-n) calc(100% - var(--gx-n)), 0 calc(100% - var(--gx-n))
    );
}

/* ---------- Buttons ---------- */

.gx-btn {
    --c: var(--gx-panel-2); --d: var(--gx-line); --t: var(--gx-text);
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 50px; padding: 0 22px 6px; border: 0; cursor: pointer;
    background: var(--c); color: var(--t);
    font: 700 18px/1 var(--gx-pixel); letter-spacing: .02em; text-transform: uppercase;
    box-shadow:
        inset 0 -6px 0 var(--d),
        inset 0 3px 0 rgba(255, 255, 255, .28),
        inset 3px 0 0 rgba(255, 255, 255, .12),
        inset -3px 0 0 rgba(0, 0, 0, .18);
    transition: filter .12s, transform .08s;
}
.gx-page a.gx-btn { color: var(--t); }
.gx-btn:hover { filter: brightness(1.12); }
.gx-btn:active { transform: translateY(3px); padding-bottom: 3px; box-shadow: inset 0 -3px 0 var(--d), inset 0 3px 0 rgba(255, 255, 255, .18); }
.gx-btn--red { --c: var(--gx-red); --d: var(--gx-red-dark); --t: #fff; }
.gx-btn--gold { --c: linear-gradient(180deg, var(--gx-gold) 0%, var(--gx-gold-2) 100%); --d: var(--gx-gold-dark); --t: #2a1300; background: var(--c); }
.gx-btn--purple { --c: var(--gx-purple); --d: var(--gx-purple-dark); --t: #fff; }
.gx-btn--discord { --c: var(--gx-discord); --d: var(--gx-discord-dark); --t: #fff; }
.gx-btn--stone { --c: #3a3e46; --d: #1b1d21; --t: var(--gx-text); }
.gx-btn--sm { min-height: 40px; padding: 0 14px 5px; font-size: 15px; box-shadow: inset 0 -5px 0 var(--d), inset 0 2px 0 rgba(255,255,255,.25), inset 2px 0 0 rgba(255,255,255,.1), inset -2px 0 0 rgba(0,0,0,.18); }
.gx-btn--icon { width: 42px; min-height: 42px; padding: 0 0 5px; }

/* ---------- Inventory slot panel ---------- */

.gx-slot {
    background: var(--gx-panel);
    box-shadow:
        inset 0 0 0 3px var(--gx-line),
        inset 6px 6px 0 0 rgba(0, 0, 0, .28),
        inset -6px -6px 0 0 rgba(255, 255, 255, .05);
}

/* ---------- Status dot ---------- */

.gx-dot { width: 10px; height: 10px; background: var(--gx-online); flex-shrink: 0; box-shadow: 0 0 0 3px rgba(78, 227, 107, .22); animation: gx-blink 1.6s steps(2, jump-none) infinite; }
.gx-dot.is-offline { background: var(--gx-muted); box-shadow: none; animation: none; }
@keyframes gx-blink { 50% { box-shadow: 0 0 0 5px rgba(78, 227, 107, .08); } }

/* ---------- Top bar ---------- */

.gx-nav {
    position: sticky; top: 0; z-index: 50; height: var(--gx-nav-h);
    background: var(--gx-bg-2);
    box-shadow: 0 3px 0 var(--gx-line), 0 6px 0 rgba(0, 0, 0, .25);
}
.gx-nav .gx-container { height: 100%; display: flex; align-items: center; gap: 22px; }
.gx-brand img { height: 48px; width: auto; image-rendering: auto; }
.gx-links { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.gx-links a {
    display: block; padding: 8px 12px 9px;
    font: 600 17px/1 var(--gx-pixel); letter-spacing: .03em; text-transform: uppercase; color: var(--gx-text-2);
}
.gx-links a:hover { color: var(--gx-gold); }
.gx-links a[aria-current="page"] {
    color: #fff; background: var(--gx-red);
    box-shadow: inset 0 -4px 0 var(--gx-red-dark), inset 0 2px 0 rgba(255, 255, 255, .25);
}
.gx-nav-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.gx-play .gx-play-count { display: inline-flex; align-items: center; gap: 8px; padding-left: 12px; margin-left: 2px; border-left: 3px solid rgba(0, 0, 0, .25); font-size: 15px; }
.gx-play .gx-dot { width: 8px; height: 8px; }
.gx-burger { display: none; }

@media (max-width: 960px) {
    .gx-burger { display: inline-flex; }
    .gx-links {
        position: absolute; top: calc(var(--gx-nav-h) + 3px); left: 0; right: 0;
        display: none; flex-direction: column; align-items: stretch; gap: 4px;
        padding: 12px 16px 18px; background: var(--gx-bg-2); box-shadow: 0 3px 0 var(--gx-line);
    }
    .gx-nav.is-open .gx-links { display: flex; }
    .gx-links a { padding: 13px 14px 14px; font-size: 19px; }
}
@media (max-width: 520px) {
    .gx-play .gx-play-count { display: none; }
}

/* ---------- Section heading ---------- */

.gx-title { display: flex; align-items: center; gap: 14px; font-size: clamp(24px, 3vw, 32px); text-transform: uppercase; letter-spacing: .02em; }
.gx-title::before { content: ""; width: 14px; height: 14px; background: var(--gx-red); box-shadow: 5px 5px 0 var(--gx-red-dark); flex-shrink: 0; }

/* ---------- Footer ---------- */

.gx-footer { position: relative; margin-top: 0; background: var(--gx-bg-2); box-shadow: 0 -3px 0 var(--gx-line); font-family: var(--gx-font); }
.gx-footer-top { display: flex; flex-wrap: wrap; gap: 36px 56px; align-items: flex-start; padding: 44px 0 32px; }
.gx-footer-brand { display: flex; gap: 16px; align-items: center; margin-right: auto; }
.gx-footer-brand img { height: 58px; width: auto; }
.gx-footer-brand b { display: block; color: var(--gx-text); font: 700 20px/1.1 var(--gx-pixel); text-transform: uppercase; }
.gx-footer-brand span { font-size: 13.5px; color: var(--gx-muted); }
.gx-footer h3 { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--gx-gold); margin: 0 0 12px; }
.gx-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.gx-footer ul a { font-size: 14px; font-weight: 600; color: var(--gx-text-2); }
.gx-footer ul a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--gx-red); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.gx-socials { display: flex; gap: 8px; }
.gx-footer-bottom { display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; padding: 16px 0 22px; border-top: 3px solid var(--gx-line); font-size: 12.5px; color: var(--gx-muted); }
.gx-footer-bottom p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
    .gx-page *, .gx-page *::before, .gx-page *::after { animation: none !important; transition: none !important; }
}

/* ---------- Page head (compact hero used by forums, chatlog, store…) ----------
 * <section class="gx-head">
 *   <div class="gx-head-bg"><img …></div>
 *   <div class="gx-container gx-head-inner">
 *     <a class="gx-head-logo"><img></a>
 *     <div class="gx-head-text"><div class="gx-head-title">Forums</div><p>…</p></div>
 *     <div class="gx-head-actions">…buttons…</div>
 *   </div>
 * </section>
 */
.gx-head { position: relative; isolation: isolate; overflow: hidden; padding: 40px 0 44px; font-family: var(--gx-font); color: var(--gx-text-2); }
.gx-head-bg { position: absolute; inset: 0; z-index: -3; }
.gx-head-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.gx-head::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background: radial-gradient(ellipse 50% 70% at 50% 30%, rgba(255, 122, 0, .12), transparent 70%),
                linear-gradient(180deg, rgba(23, 25, 29, .78) 0%, rgba(23, 25, 29, .9) 65%, var(--gx-bg) 100%);
}
.gx-head::after {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
    background-image: linear-gradient(rgba(0,0,0,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.35) 1px, transparent 1px);
    background-size: 6px 6px;
}
.gx-head-inner { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.gx-head-logo img { width: 104px; height: auto; display: block; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); }
.gx-head-text { flex: 1 1 260px; min-width: 0; }
.gx-head-title { margin: 0; color: var(--gx-text); font-family: var(--gx-pixel); font-weight: 700; font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: .03em; text-transform: uppercase; }
.gx-head-text p { margin: 6px 0 0; color: var(--gx-text-2); font-size: 15px; line-height: 1.5; }
.gx-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-left: auto; }

/* compact IP pill for page heads: one line, never changes size (copied state = colour + icon only) */
.gx-ipmini { min-height: 40px; padding: 0 0 5px; gap: 0; align-items: stretch; }
.gx-ipmini .gx-ipmini-main { display: flex; align-items: center; gap: 9px; padding: 0 12px 0 9px; }
.gx-ipmini .gx-ipmini-play { position: relative; display: grid; place-items: center; width: 22px; height: 22px; background: rgba(42, 19, 0, .9); color: var(--gx-gold); }
.gx-ipmini .gx-ipmini-play svg { display: block; }
.gx-ipmini .gx-ipmini-ok { display: none !important; }
.gx-ipmini .gx-ipmini-addr { font-size: 16px; line-height: 1; text-transform: none; letter-spacing: .01em; white-space: nowrap; }
.gx-ipmini .gx-ipmini-count { display: flex; align-items: center; gap: 7px; padding: 0 12px; background: rgba(42, 19, 0, .88); color: #fff; font-size: 14px; line-height: 1; white-space: nowrap; }
.gx-ipmini .gx-ipmini-count .gx-dot { width: 8px; height: 8px; }
.gx-ipmini.is-copied { background: linear-gradient(180deg, #6ff58a 0%, #2fbf52 100%); --d: #1c7a33; }
.gx-ipmini.is-copied .gx-ipmini-play { color: #6ff58a; }
.gx-ipmini.is-copied .gx-ipmini-go { display: none !important; }
.gx-ipmini.is-copied .gx-ipmini-ok { display: block !important; }

@media (max-width: 720px) {
    .gx-head { padding: 28px 0 32px; }
    .gx-head-logo img { width: 64px; }
    .gx-head-inner { gap: 14px 16px; }
    .gx-head-text { flex: 1 1 0; }
    .gx-head-title { font-size: 32px; }
    .gx-head-text p { font-size: 13.5px; }
    .gx-head-actions { width: 100%; justify-content: flex-start; flex-wrap: nowrap; gap: 8px; }
    .gx-head-actions > * { flex: 0 1 auto; min-width: 0; }
    .gx-hide-sm { display: none; }
    .gx-ipmini .gx-ipmini-addr { font-size: 14px; }
    .gx-ipmini .gx-ipmini-main { gap: 7px; padding: 0 9px 0 7px; }
    .gx-ipmini .gx-ipmini-count { padding: 0 9px; font-size: 13px; }
    .gx-head-actions .gx-btn--sm { padding-left: 11px; padding-right: 11px; gap: 7px; }
}

/* buttons that are links keep their own colour on any page */
a.gx-btn, a.gx-btn:hover, a.gx-btn:focus { color: var(--t); text-decoration: none; }
