/* ============================================================
   LoKyo Stream Hub — app shell (vgen-inspired)
   Scoped to Wizard Duel for now; built to scale to a multi-game
   "Steam for streamers" launcher (left product menu + account).
   ============================================================ */

:root {
    /* base surfaces — very dark, faintly purple */
    --bg:        #0c0a14;
    --bg-side:   #100d1b;
    --surface:   #161222;
    --surface-2: #1d1830;
    --surface-3: #251f3a;
    --border:    rgba(255,255,255,0.07);
    --border-2:  rgba(255,255,255,0.12);

    /* text */
    --text:   #ECE7F7;
    --muted:  #9a90b8;
    --faint:  #6c6488;

    /* accent (swappable — see [data-accent]) */
    --accent:      #9146FF;
    --accent-soft: #b78bff;
    --accent-bg:   rgba(145,70,255,0.14);
    --accent-bd:   rgba(145,70,255,0.40);
    --accent-glow: rgba(145,70,255,0.35);

    --gold: #FFD46B;
    --good: #5ee0a0;
    --bad:  #ff6b6b;

    --r-lg: 20px;
    --r:    14px;
    --r-sm: 10px;
    --sb-w: 252px;

    --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --pixel: 'Jersey 10', var(--ui);
}

/* Accent presets (Settings → "design language") */
[data-accent="lime"]   { --accent:#b6ff3c; --accent-soft:#d3ff86; --accent-bg:rgba(182,255,60,0.14); --accent-bd:rgba(182,255,60,0.40); --accent-glow:rgba(182,255,60,0.30); }
[data-accent="frost"]  { --accent:#56b8ff; --accent-soft:#9bd6ff; --accent-bg:rgba(86,184,255,0.14); --accent-bd:rgba(86,184,255,0.40); --accent-glow:rgba(86,184,255,0.30); }
[data-accent="ember"]  { --accent:#ff6a4d; --accent-soft:#ff9c87; --accent-bg:rgba(255,106,77,0.14); --accent-bd:rgba(255,106,77,0.40); --accent-glow:rgba(255,106,77,0.30); }

* { margin: 0; padding: 0; box-sizing: border-box; }

body.app {
    font-family: var(--ui);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
body.app::before {            /* soft accent aura, top-left */
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(720px 480px at 12% -8%, var(--accent-glow), transparent 60%),
        radial-gradient(620px 520px at 100% 110%, rgba(86,120,255,0.10), transparent 60%);
    opacity: .9;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; color: var(--accent-soft); }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: var(--sb-w) 1fr;
    min-height: 100vh;
}

/* ---------- sidebar ---------- */
.sidebar {
    background: var(--bg-side);
    border-right: 1px solid var(--border);
    padding: 18px 14px;
    display: flex; flex-direction: column; gap: 16px;
    position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 4px 8px 2px; }
.brand .logo { height: 23px; width: auto; filter: brightness(0) invert(1); opacity: .96; }
.brand-sub  { font-size: .64rem; color: var(--faint); letter-spacing: 2.5px; text-transform: uppercase; }

/* product switcher → real multi-game menu */
.product { position: relative; }
.product-btn {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); padding: 9px 11px;
    color: var(--text); font-family: var(--ui);   /* <button> doesn't inherit page color */
    transition: border-color .15s, background .15s;
}
.product-btn:hover { border-color: var(--accent-bd); }
.game-icon { width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; object-fit: cover; background: var(--surface-2); image-rendering: pixelated; }
.product-info { flex: 1; min-width: 0; }
.product-title { font-size: .95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-meta  { font-size: .72rem; color: var(--faint); }
.product .chev { color: var(--faint); font-size: 1.05rem; transition: transform .2s; }
.product.open .chev { transform: rotate(180deg); }

.product-menu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
    background: var(--surface-2); border: 1px solid var(--border-2);
    border-radius: var(--r); padding: 6px; box-shadow: 0 18px 40px rgba(0,0,0,0.45);
    display: none;
}
.product.open .product-menu { display: block; }
.product-menu .pm-label { font-size: .62rem; letter-spacing: 1.6px; text-transform: uppercase; color: var(--faint); padding: 6px 8px 3px; }
.game-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); cursor: pointer; }
.game-item:hover { background: var(--surface-3); }
.game-item .game-icon { width: 34px; height: 34px; }
.game-item .gi-name { font-size: .92rem; font-weight: 600; color: var(--text); }
.game-item .gi-meta { font-size: .7rem; color: var(--muted); }
.tag { font-size: .62rem; padding: 1px 7px; border-radius: 999px; margin-left: auto; font-weight: 700; letter-spacing: .3px; }
.tag.owned { color: var(--good); background: rgba(94,224,160,0.14); }
.tag.store { color: var(--accent-soft); background: var(--accent-bg); }

/* nav */
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* thin, unobtrusive scrollbar so a long game menu never pushes the account/logout footer off-screen */
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.nav-group { font-size: .66rem; letter-spacing: 1.6px; text-transform: uppercase; color: var(--faint); padding: 12px 12px 5px; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: var(--r-sm);
    color: var(--muted); font-size: .95rem; font-weight: 500;
    transition: background .14s, color .14s; cursor: pointer; user-select: none;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; stroke: currentColor; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent-soft); }
.nav-item.active svg { stroke: var(--accent-soft); }
.nav-badge { margin-left: auto; font-size: .72rem; color: var(--faint); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }

.side-foot { margin-top: auto; }
.account-chip {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); padding: 9px 11px;
}
.account-chip .portrait { width: 34px; height: 34px; border-radius: 9px; }
.account-info { flex: 1; min-width: 0; }
.account-name { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-stat { font-size: .72rem; color: var(--good); display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.icon-btn {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
    background: transparent; border: 1px solid var(--border); color: var(--muted);
    display: grid; place-items: center;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; }

/* ---------- main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 30px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: rgba(12,10,20,0.72); backdrop-filter: blur(10px); z-index: 5;
}
.page-title { font-size: 1.45rem; font-weight: 700; letter-spacing: .2px; }
.page-sub { color: var(--faint); font-size: .85rem; margin-top: 1px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: 6px 13px; font-size: .82rem; color: var(--muted);
}
.pill .dot { width: 7px; height: 7px; }

.content { padding: 26px 30px 64px; max-width: 1080px; }
.page { display: none; }
.page.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- cards ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 18px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.28);
}
.card h2 { font-size: 1.12rem; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 9px; }
.card h2 svg { width: 18px; height: 18px; stroke: var(--accent-soft); }
.card .muted { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 2px 14px; }
.section-head h3 { font-size: 1rem; font-weight: 700; }

/* hero (overview) */
.hero {
    position: relative; overflow: hidden;
    border-radius: var(--r-lg); margin-bottom: 18px; padding: 26px 26px;
    background:
        radial-gradient(520px 300px at 88% -40%, var(--accent-glow), transparent 60%),
        linear-gradient(120deg, #1a1430, #120f22 70%);
    border: 1px solid var(--border);
    display: flex; align-items: center; gap: 20px;
}
.hero .portrait { width: 84px; height: 84px; border-radius: 16px; box-shadow: 0 8px 26px var(--accent-glow); flex-shrink: 0; }
.hero-body { flex: 1; min-width: 0; }
.hero-kicker { font-size: .72rem; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-soft); }
.hero-title { font-family: var(--pixel); font-size: 2.4rem; line-height: 1; margin: 4px 0 6px; letter-spacing: 1px; }
.hero-desc { color: var(--muted); font-size: .92rem; max-width: 520px; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); padding: 16px 18px;
}
.stat .n { font-family: var(--pixel); font-size: 2.1rem; line-height: 1; }
.stat .l { font-size: .8rem; color: var(--faint); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.stat .l svg { width: 14px; height: 14px; stroke: var(--accent-soft); }

/* forms */
label { display: block; font-size: .82rem; color: var(--muted); margin: 12px 0 5px; font-weight: 500; }
input[type=text], input[type=color], input[type=email], select, textarea {
    font-family: var(--ui); font-size: .98rem;
    padding: 11px 13px; border: 1px solid var(--border-2); border-radius: var(--r-sm);
    background: var(--bg); color: var(--text); width: 100%; transition: border-color .15s;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
input[type=text]:focus, input[type=email]:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-bd); }
input[type=color] { padding: 4px; height: 44px; width: 56px; cursor: pointer; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; }
.row .grow0 { flex: 0; }

.btn {
    font-size: .95rem; font-weight: 600;
    padding: 11px 20px; border: none; border-radius: var(--r-sm);
    color: #fff; background: var(--accent); white-space: nowrap;
    cursor: pointer; text-decoration: none; display: inline-block;
    box-shadow: 0 6px 18px var(--accent-glow); transition: transform .12s, filter .15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.gold { background: linear-gradient(135deg, var(--gold), #f0a23a); color: #3a2400; box-shadow: 0 6px 18px rgba(255,180,60,0.3); }
.btn.sm { padding: 8px 14px; font-size: .86rem; }

/* link box */
.link-box { display: flex; gap: 9px; align-items: stretch; }
.link-box input { font-size: .88rem; color: var(--accent-soft); font-family: ui-monospace, monospace; }

/* lists / leaderboard */
.lb { display: flex; flex-direction: column; gap: 5px; }
.lb-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: var(--r-sm);
    background: var(--bg); border: 1px solid var(--border); font-size: .96rem;
}
.lb-row:hover { border-color: var(--border-2); }
.lb-rank { width: 26px; text-align: center; font-family: var(--pixel); font-size: 1.2rem; color: var(--muted); }
.lb-rank.r1 { color: var(--gold); } .lb-rank.r2 { color: #cfd8e8; } .lb-rank.r3 { color: #e0a060; }
.lb-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.lb-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.lb-sub { color: var(--faint); font-size: .8rem; font-weight: 400; }
.lb-val { color: var(--gold); min-width: 72px; text-align: right; font-weight: 600; }
.lb-val2 { color: var(--muted); min-width: 64px; text-align: right; font-size: .85rem; }
.empty { color: var(--faint); font-style: italic; padding: 16px 2px; font-size: .9rem; }

/* tabs (leaderboard) */
.tabs { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.tab { padding: 7px 16px; border-radius: 999px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.tab.active { background: var(--accent); color: #fff; }

/* commands grid */
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cmd { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 15px 17px; }
.cmd-name { font-family: ui-monospace, monospace; color: var(--accent-soft); font-size: 1rem; font-weight: 600; }
.cmd-aka { color: var(--faint); font-size: .78rem; margin-left: 6px; }
.cmd-desc { color: var(--muted); font-size: .86rem; margin-top: 6px; line-height: 1.45; }

/* accent picker (settings) */
.swatches { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; }
.swatch i { width: 46px; height: 46px; border-radius: 13px; border: 2px solid transparent; display: block; }
.swatch span { font-size: .78rem; color: var(--muted); }
.swatch.active i { border-color: #fff; box-shadow: 0 0 0 3px var(--bg), 0 0 14px currentColor; }

/* portrait sprite (256x128 = 4col x 2row of 64px). set --col/--row inline */
.portrait {
    --s: 56px;
    width: var(--s); height: var(--s);
    background-image: url('../Wizard/64x64 Wizard Portraits.png');
    background-size: calc(var(--s) * 4) calc(var(--s) * 2);
    background-position: calc(var(--col, 0) * var(--s) * -1) calc(var(--row, 0) * var(--s) * -1);
    image-rendering: pixelated;
    border-radius: var(--r-sm);
}

/* connect gate */
.gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
    background: radial-gradient(900px 600px at 50% -10%, var(--accent-glow), transparent 60%), var(--bg); }
.gate-card { width: 100%; max-width: 420px; text-align: center; }
.gate-card .brand-mark { width: 54px; height: 54px; font-size: 2rem; border-radius: 15px; margin: 0 auto 14px; }
.gate-card h1 { font-family: var(--pixel); font-size: 2.2rem; letter-spacing: 1px; }
.gate-card p { color: var(--muted); margin: 6px 0 20px; }
.gate-card label { text-align: left; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px);
    background: var(--surface-3); color: #fff; padding: 12px 22px; border-radius: var(--r);
    border: 1px solid var(--accent-bd); box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 80; font-size: .92rem; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* secret link (overlay url — masked so it isn't seen on stream) */
.secret input { -webkit-text-security: disc; }
.secret.revealed input { -webkit-text-security: none; }
.eye-btn {
    flex: 0 0 auto; width: 44px; border-radius: var(--r-sm);
    background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted);
    display: grid; place-items: center;
}
.eye-btn:hover { color: var(--text); background: var(--surface-3); }
.eye-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.eye-btn .eye-off { display: none; }
.secret.revealed .eye-btn .eye-on { display: none; }
.secret.revealed .eye-btn .eye-off { display: block; }

/* nav: Wizard-Duel-specific management only for the native game (data-mode="full").
   Other games (store OR connected from another service) run in "lite" mode. */
.shell[data-mode="lite"] .nav-item.mgmt,
.shell[data-mode="lite"] #open-overlay { display: none; }

/* ---------- store / showcase (non-owned game overview) ---------- */
.store-hero {
    position: relative; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px;
    border: 1px solid var(--border); background: #0a0814;
}
.store-hero img.cover { width: 100%; display: block; }
.store-hero .cover-fade {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(8,6,18,0.55) 78%, rgba(8,6,18,0.95));
}
.store-cta {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 18px 22px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); margin-bottom: 18px;
}
.store-cta .sc-icon { width: 56px; height: 56px; border-radius: 13px; image-rendering: pixelated; flex-shrink: 0; }
.store-cta .sc-body { flex: 1; min-width: 180px; }
.store-cta .sc-title { font-family: var(--pixel); font-size: 1.7rem; line-height: 1; letter-spacing: .5px; }
.store-cta .sc-pitch { color: var(--muted); font-size: .9rem; margin-top: 6px; max-width: 560px; line-height: 1.5; }
.store-cta .sc-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.store-cta .sc-price { font-size: .82rem; color: var(--good); font-weight: 700; }

.race-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.race-card {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--r);
    padding: 14px 10px 12px; text-align: center; transition: border-color .15s, transform .15s;
}
.race-card:hover { border-color: var(--accent-bd); transform: translateY(-2px); }
.race-card img { width: 100%; height: 78px; object-fit: contain; image-rendering: pixelated; }
.race-card .rc-name { font-size: .86rem; font-weight: 600; margin-top: 8px; }
.race-card.owned { border-color: var(--accent-bd); }
.race-card.locked { opacity: .5; }
.rc-faction { font-size: .7rem; color: var(--faint); margin-top: 2px; }
.rc-btn {
    margin-top: 9px; width: 100%; font-size: .8rem; font-weight: 600;
    padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text);
}
.rc-btn:hover { background: var(--surface-3); }
.rc-btn.playing { background: var(--accent); border-color: var(--accent); color: #fff; }
.rc-buy { margin-top: 9px; display: block; font-size: .78rem; color: var(--accent-soft); font-weight: 600; }

/* buildings grid */
.bld-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.bld-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 11px 13px; }
.bld-card.locked { opacity: .45; }
.bld-name { font-size: .85rem; font-weight: 600; }
.bld-level { font-size: .74rem; color: var(--accent-soft); margin-top: 3px; }
.bld-card.locked .bld-level { color: var(--faint); }

/* faction sub-header inside SK dashboard */
.fac-hdr { font-size: .72rem; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 14px 2px 8px; }

/* ---------- Arcade hero slider (New Releases) ---------- */
.ax-slider { margin-bottom: 10px; }
.ax-label { font-size: .7rem; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent-soft); margin: 2px 2px 10px; }
.ax-frame {
    position: relative; border: 1px solid var(--border); border-radius: var(--r-lg);
    overflow: hidden; background: var(--surface); box-shadow: 0 16px 44px rgba(0,0,0,.35);
}
.ax-slides { display: flex; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.ax-slide { flex: 0 0 100%; min-width: 0; display: flex; align-items: stretch; aspect-ratio: 3.04 / 1; }
.ax-banner { width: 56%; flex-shrink: 0; height: 100%; object-fit: cover; object-position: center; display: block; border-right: 1px solid var(--border); background: #0b0814; }
/* full-bleed hero for ultrawide covers (e.g. Wizard Duel): scene fills the whole slide, text overlaid on a gradient */
.ax-slide.ax-hero { display: block; position: relative; overflow: hidden; background: #0b0814; }
.ax-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left bottom; display: block; }
.ax-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 24%, rgba(11,8,20,.45) 44%, rgba(11,8,20,.92) 62%); pointer-events: none; }
.ax-hero .ax-body { position: absolute; top: 0; right: 0; height: 100%; width: 50%; z-index: 2; }
.ax-body { flex: 1; min-width: 0; padding: 28px 34px; display: flex; flex-direction: column; justify-content: center; gap: 13px; }
.ax-tag { align-self: flex-start; font-size: .66rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--accent-soft); background: var(--accent-bg); border: 1px solid var(--accent-bd); border-radius: 999px; padding: 3px 11px; }
.ax-title { font-family: var(--pixel); font-size: 2.4rem; line-height: 1; letter-spacing: .5px; }
.ax-sub { color: var(--muted); font-size: .92rem; line-height: 1.5; max-width: 48ch; }
.ax-actions { display: flex; gap: 11px; flex-wrap: wrap; margin-top: 5px; }
.ax-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(16,10,30,.55); border: 1px solid var(--border-2); color: var(--text);
    font-size: 22px; line-height: 0; display: grid; place-items: center; cursor: pointer;
    z-index: 5; backdrop-filter: blur(4px); transition: background .15s, border-color .15s;
}
.ax-arrow:hover { background: var(--accent); border-color: var(--accent); }
.ax-arrow.prev { left: 12px; } .ax-arrow.next { right: 12px; }
.ax-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.ax-dots button { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--border-2); background: transparent; cursor: pointer; padding: 0; transition: background .15s, transform .15s; }
.ax-dots button.on { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }

/* ---------- Arcade home (all games storefront) ---------- */
.arcade-hero {
    text-align: center; padding: 10px 0 14px;
    border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.arcade-hero .ah-logo { height: 40px; filter: brightness(0) invert(1); opacity: .96; }
.ah-title { font-family: var(--pixel); font-size: 2.7rem; line-height: 1; margin-top: 10px; letter-spacing: 1px; }
.ah-sub { color: var(--muted); margin-top: 6px; font-size: .95rem; }
.ah-meta { color: var(--faint); font-size: .8rem; margin-top: 8px; }

.cat-head { display: flex; align-items: center; gap: 11px; margin: 24px 2px 13px; }
.cat-head .cat-ico { font-size: 1.15rem; }
.cat-head h3 { font-size: 1.05rem; font-weight: 700; }
.cat-head .cat-line { flex: 1; height: 1px; background: var(--border); }

.arcade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.arcade-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
    display: flex; flex-direction: column;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.arcade-card:hover { transform: translateY(-3px); border-color: var(--accent-bd); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.ac-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); }
.ac-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-badge {
    position: absolute; top: 10px; right: 10px;
    font-size: .62rem; font-weight: 700; letter-spacing: .4px;
    padding: 3px 9px; border-radius: 999px;
}
.ac-badge.owned { color: #05351f; background: rgba(94,224,160,.92); }
.ac-badge.store { color: #fff; background: rgba(16,10,30,.72); border: 1px solid rgba(255,255,255,.28); }
.ac-info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ac-name { font-size: 1.05rem; font-weight: 700; }
.ac-desc { font-size: .83rem; color: var(--muted); line-height: 1.45; flex: 1; }
.ac-cta { font-size: .82rem; color: var(--accent-soft); font-weight: 600; margin-top: 4px; }

/* product menu: "browse all" row */
.pm-browse {
    padding: 9px 10px; margin-top: 4px; border-top: 1px solid var(--border);
    color: var(--accent-soft); font-size: .85rem; font-weight: 600;
    text-align: center; cursor: pointer; border-radius: 0 0 10px 10px;
}
.pm-browse:hover { background: var(--surface-3); }

/* wiki section — game wiki rebuilt natively in the hub theme */
.wiki-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.wiki-frame { width: 100%; height: 72vh; border: 1px solid var(--border); border-radius: var(--r-lg); background: #fff; display: block; }
/* inverted raw rules page (faithful original blocks on the platform dark bg) */
.lp-frame { width: 100%; min-height: 600px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); display: block; }

.wiki-wrap .wiki-layout { display: grid; grid-template-columns: 196px 1fr; gap: 26px; align-items: start; }
.wiki-sidebar { position: sticky; top: 86px; }
.wiki-sidebar .sidebar-label { font-size: .64rem; letter-spacing: 1.6px; text-transform: uppercase; color: var(--faint); padding: 0 10px 8px; }
.wiki-sidebar .sidebar-links { display: flex; flex-direction: column; gap: 2px; }
.wiki-sidebar .sidebar-links a { display: block; padding: 8px 11px; border-radius: var(--r-sm); color: var(--muted); font-size: .9rem; text-decoration: none; }
.wiki-sidebar .sidebar-links a:hover { background: var(--surface); color: var(--text); }

.wiki-section { margin-bottom: 30px; scroll-margin-top: 86px; }
.wiki-section .ws-title { font-size: 1.35rem; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wiki-section > p { color: var(--muted); line-height: 1.55; }
.section-label { font-size: .68rem; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent-soft); }

.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.cmd-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border-2); border-radius: var(--r); padding: 14px 16px; }
.cmd-card.viewer { border-left-color: var(--good); }
.cmd-card.streamer { border-left-color: var(--accent); }
.cmd-card .cmd-cmd { font-family: ui-monospace, monospace; color: var(--accent-soft); font-weight: 700; font-size: 1rem; }
.cmd-card .cmd-aliases { font-size: .74rem; color: var(--faint); margin: 2px 0 7px; }
.cmd-card .cmd-text { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.cmd-card .cmd-text em { color: var(--text); font-style: normal; opacity: .85; }
.cmd-cost-pill { display: inline-block; margin-top: 9px; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.cmd-cost-pill.free { color: #05351f; background: rgba(94,224,160,.9); }
.cmd-cost-pill.coins { color: var(--gold); background: rgba(255,212,107,.14); border: 1px solid rgba(255,212,107,.3); }

.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.flow-step { flex: 1; min-width: 150px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.flow-step strong { color: var(--text); }
.flow-arrow { display: flex; align-items: center; color: var(--faint); font-size: 1.3rem; }

.wiki-table { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-top: 6px; }
.wiki-table th { text-align: left; padding: 10px 13px; background: var(--surface-2); color: var(--accent-soft); font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; }
.wiki-table td { padding: 10px 13px; border-top: 1px solid var(--border); color: var(--text); }
.wiki-table tr:hover td { background: var(--surface-2); }

.bld-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.bld-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
.bld-card .bld-name { font-weight: 700; font-size: .98rem; }
.bld-card .bld-desc { color: var(--muted); font-size: .84rem; line-height: 1.45; margin: 6px 0; }
.bld-card .bld-cost { font-size: .78rem; color: var(--gold); }
.bld-card .bld-bonus { font-size: .78rem; color: var(--good); margin-top: 2px; }
.bld-card .bld-free { color: var(--faint); }

.tip-box { background: var(--accent-bg); border: 1px solid var(--accent-bd); border-radius: var(--r); padding: 14px 16px; color: var(--text); font-size: .88rem; line-height: 1.55; }
.tip-box strong { color: var(--accent-soft); }

/* guide / setup pages (step flow) */
.wiki-wrap .guide-container { max-width: 800px; }
.gsection { margin-bottom: 30px; }
.gsection .section-header { margin-bottom: 14px; }
.gsection .section-title { font-size: 1.35rem; font-weight: 700; margin-top: 2px; }
.guide-badge { display: inline-block; font-size: .66rem; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent-soft); background: var(--accent-bg); border: 1px solid var(--accent-bd); border-radius: 999px; padding: 3px 11px; }
.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
.step-num { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-family: var(--pixel); font-size: 1.3rem; }
.step-body { flex: 1; min-width: 0; }
.step-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.step-desc { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.step-desc strong { color: var(--text); }
.step-action { display: inline-block; margin-top: 10px; font-size: .85rem; font-weight: 600; color: #fff; background: var(--accent); border-radius: var(--r-sm); padding: 8px 14px; text-decoration: none; }
.step-pill { display: inline-block; margin-top: 10px; font-size: .76rem; color: var(--accent-soft); background: var(--accent-bg); border: 1px solid var(--accent-bd); border-radius: 999px; padding: 3px 10px; }
.inline-code { font-family: ui-monospace, monospace; font-size: .85em; color: var(--accent-soft); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.flow-node { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 16px; }
.flow-icon { font-size: 1.4rem; }
.flow-label { font-size: .8rem; color: var(--muted); text-align: center; }

/* ---------- product detail page (catalog game): media gallery + info column ---------- */
.pdp { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; margin-bottom: 18px; }
.pdp-media { position: relative; min-width: 0; }
.pdp-stage { position: relative; aspect-ratio: 16 / 9; background: #07060f; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center; }
.pdp-media-el { width: 100%; height: 100%; object-fit: contain; display: block; border: 0; background: #07060f; }
.pdp-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(10,8,20,.55); border: 1px solid var(--border-2); color: #fff; font-size: 22px; line-height: 0; display: grid; place-items: center; cursor: pointer; z-index: 3; backdrop-filter: blur(4px); transition: background .15s, border-color .15s; }
.pdp-arrow:hover { background: var(--accent); border-color: var(--accent); }
.pdp-arrow.prev { left: 10px; } .pdp-arrow.next { right: 10px; }
.pdp-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.pdp-thumb { position: relative; flex: 0 0 104px; height: 60px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--bg); cursor: pointer; padding: 0; }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-thumb.on { border-color: var(--accent); }
.pdp-thumb .pdp-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.4); color: #fff; font-size: 1rem; }
.pdp-thumb-blank { display: grid; place-items: center; width: 100%; height: 100%; font-size: .6rem; color: var(--faint); text-transform: uppercase; }

.pdp-info { position: sticky; top: 86px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.pdp-icon { width: 56px; height: 56px; border-radius: 13px; image-rendering: pixelated; }
.pdp-cat { font-size: .68rem; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent-soft); margin-top: 12px; }
.pdp-title { font-size: 1.4rem; font-weight: 700; line-height: 1.15; margin: 4px 0 6px; }
.pdp-tagline { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.pdp-buy { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.pdp-price { font-size: .82rem; color: var(--good); font-weight: 700; margin-bottom: 2px; }
.pdp-buy .btn { width: 100%; text-align: center; }

/* ===== ported game rules ("lp-doc") — native dark adaptation: Fredoka + original palette ===== */
.lp-doc {
    display: flex; flex-direction: column; gap: 14px;
    font-family: 'Fredoka', var(--ui);
    /* original brand rarity palette (lifted a touch for the dark bg) */
    --rc-common: #8fa3b6; --rc-uncommon: #9b90ff; --rc-rare: #ff8bf0; --rc-epic: #ff8a5c; --rc-legendary: #ff6b6e;
    --lp-accent: #ffca5e;                       /* warm amber from the brand palette (not purple) */
    --lp-surface: rgba(255,255,255,0.035);      /* subtle translucent cards — no heavy black backdrop */
    --lp-surface-2: rgba(255,255,255,0.07);
    --lp-line: rgba(255,255,255,0.10);
}
/* generic baseline (subtle surfaces, neutral chips) for any unstyled landing block */
.lp-doc [class*="-grid"] { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.lp-doc [class*="-card"], .lp-doc [class*="-item"] { background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: var(--r); padding: 15px 16px; }
.lp-doc img { max-width: 100%; height: auto; }
.lp-doc [class*="-icon"] { color: var(--lp-accent); }
.lp-doc [class*="-icon"] img, .lp-doc img[class*="icon"] { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.lp-doc svg { stroke: currentColor; width: 38px; height: 38px; }   /* baseline so standalone/icon svgs never blow up */
.lp-doc [class*="-icon"] svg, .lp-doc svg[class*="-icon"] { width: 40px; height: 40px; }
.lp-doc [class*="-name"], .lp-doc [class*="-title"] { font-weight: 700; color: var(--text); }
.lp-doc [class*="-desc"], .lp-doc [class*="-note"], .lp-doc [class*="-text"] { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.lp-doc [class*="badge"], .lp-doc [class*="-pill"], .lp-doc [class*="-tag"], .lp-doc [class*="-type"] { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--lp-surface-2); color: var(--text); border: 1px solid var(--lp-line); }
.lp-doc [class*="-steps"] { display: flex; flex-direction: column; gap: 12px; }
.lp-doc .cmd-name { font-family: ui-monospace, monospace; color: var(--lp-accent); font-weight: 700; }

/* sections — no card backdrop, just a divider rhythm */
.lp-doc .section-card { background: transparent; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 26px 0 6px; }
.lp-doc .section-card:first-child { border-top: 0; padding-top: 2px; }
.lp-doc .section-header { text-align: center; margin-bottom: 18px; }
.lp-doc .section-title { font-family: 'Fredoka', var(--ui); font-weight: 700; font-size: 1.55rem; letter-spacing: .2px; color: var(--text); }
.lp-doc .section-note { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.lp-doc .pixel-art { image-rendering: pixelated; }

/* how-to steps */
.lp-doc .steps-row { display: flex; align-items: stretch; justify-content: center; gap: 14px; flex-wrap: wrap; }
.lp-doc .step-card { flex: 1; min-width: 190px; max-width: 280px; background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: var(--r); padding: 22px 18px; text-align: center; position: relative; }
.lp-doc .step-number { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--lp-accent); color: #2a1d05; font-family: 'Fredoka', var(--ui); font-weight: 700; font-size: 1rem; display: grid; place-items: center; }
.lp-doc .step-icon-wrap { display: grid; place-items: center; height: 60px; color: var(--lp-accent); margin: 6px 0 4px; }
.lp-doc .step-icon-wrap svg { width: 50px; height: 50px; }
.lp-doc .step-card .step-title { font-weight: 700; font-size: 1.05rem; margin: 6px 0; color: var(--text); }
.lp-doc .step-card .step-desc { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.lp-doc .command-badge { display: inline-block; margin-top: 12px; font-family: ui-monospace, monospace; font-size: .76rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: rgba(255,202,94,.14); color: var(--lp-accent); border: 1px solid rgba(255,202,94,.35); }
.lp-doc .command-badge.secondary { background: rgba(94,224,160,.14); color: var(--good); border-color: rgba(94,224,160,.4); }
.lp-doc .command-badge.danger { background: rgba(255,107,107,.14); color: var(--bad); border-color: rgba(255,107,107,.4); }
.lp-doc .step-arrow { display: flex; align-items: center; color: var(--faint); font-size: 1.6rem; }

/* game modes / outcomes — keep original win/lose semantics */
.lp-doc .outcomes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.lp-doc .outcome-card { background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: var(--r); padding: 22px; text-align: center; }
.lp-doc .outcome-card.win { border-color: rgba(94,224,160,.4); }
.lp-doc .outcome-card.whacked { border-color: rgba(255,107,107,.4); }
.lp-doc .outcome-percent { font-family: 'Fredoka', var(--ui); font-weight: 700; font-size: 2rem; color: var(--text); }
.lp-doc .outcome-icon { display: grid; place-items: center; color: var(--lp-accent); margin: 6px 0; }
.lp-doc .outcome-icon svg { width: 62px; height: 62px; }
.lp-doc .outcome-title { font-family: 'Fredoka', var(--ui); font-weight: 700; font-size: 1.4rem; }
.lp-doc .outcome-desc { color: var(--muted); font-size: .88rem; line-height: 1.5; margin: 6px 0 12px; }
.lp-doc .outcome-badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--lp-surface-2); color: var(--text); border: 1px solid var(--lp-line); }
.lp-doc .outcome-card.win .outcome-badge { background: rgba(94,224,160,.16); color: var(--good); border-color: rgba(94,224,160,.4); }
.lp-doc .outcome-card.whacked .outcome-badge { background: rgba(255,107,107,.16); color: var(--bad); border-color: rgba(255,107,107,.4); }

/* rpg progression */
.lp-doc .rpg-progression-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.lp-doc .rpg-features { display: flex; flex-direction: column; gap: 13px; }
.lp-doc .rpg-feature-item { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.lp-doc .rpg-feature-item strong { color: var(--text); }
.lp-doc .rpg-feature-icon { width: 30px; height: 30px; flex-shrink: 0; object-fit: contain; color: var(--lp-accent); }
.lp-doc img.rpg-feature-icon { image-rendering: pixelated; }
.lp-doc .rarity-table { display: flex; flex-direction: column; gap: 5px; background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: var(--r); padding: 12px; }
.lp-doc .rarity-row-compact { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: var(--r-sm); }
.lp-doc .rarity-row-compact:hover { background: var(--lp-surface-2); }
.lp-doc .rt-badge { font-family: 'Fredoka', var(--ui); font-weight: 700; font-size: .9rem; padding: 2px 10px; border-radius: 6px; background: var(--lp-surface-2); color: var(--text); min-width: 58px; text-align: center; }
.lp-doc .rt-badge.common { color: var(--rc-common); }
.lp-doc .rt-badge.uncommon { color: var(--rc-uncommon); }
.lp-doc .rt-badge.rare { color: var(--rc-rare); }
.lp-doc .rt-badge.epic { color: var(--rc-epic); }
.lp-doc .rt-badge.legendary { color: var(--rc-legendary); }
.lp-doc .rt-pts { color: var(--lp-accent); font-size: .85rem; flex: 1; }

/* commands */
.lp-doc .commands-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.lp-doc .command-item { display: flex; align-items: center; gap: 12px; background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: var(--r-sm); padding: 11px 14px; }
.lp-doc .command-item code { font-family: ui-monospace, monospace; color: var(--lp-accent); font-weight: 700; flex-shrink: 0; }
.lp-doc .command-item span { color: var(--muted); font-size: .86rem; }

/* leaderboard mockups (static sample rows) */
.lp-doc .authentic-leaderboard, .lp-doc .lb-table { background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: var(--r); overflow: hidden; }
.lp-doc .lb-header { padding: 10px 14px; font-family: 'Fredoka', var(--ui); font-weight: 700; text-align: center; background: var(--lp-surface-2); color: var(--text); }
.lp-doc .lb-entry, .lp-doc .lb-row { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-top: 1px solid var(--lp-line); font-size: .9rem; background: transparent; }
.lp-doc .lb-rank { min-width: 22px; text-align: center; font-weight: 700; color: var(--muted); }
.lp-doc .lb-entry.rank-1 .lb-rank, .lp-doc .lb-row.top-1 .lb-rank { color: #ffbc43; }
.lp-doc .lb-entry.rank-2 .lb-rank, .lp-doc .lb-row.top-2 .lb-rank { color: #cfd8e8; }
.lp-doc .lb-entry.rank-3 .lb-rank, .lp-doc .lb-row.top-3 .lb-rank { color: #e0a060; }
.lp-doc .lb-name, .lp-doc .lb-row-name { flex: 1; font-weight: 600; color: var(--text); }
.lp-doc .lb-level { color: var(--lp-accent); font-size: .82rem; }
.lp-doc .lb-wins { color: var(--good); font-size: .82rem; }
.lp-doc .lb-losses { color: var(--bad); font-size: .82rem; }
.lp-doc .lb-row-score, .lp-doc .lb-row-rank { color: var(--lp-accent); font-weight: 700; }

/* cheese rarity rows (CDN icons) + multiplier chips */
.lp-doc .rarity-row-compact img { width: 26px; height: 26px; object-fit: contain; }
.lp-doc .mult-item { background: var(--lp-surface-2); border: 1px solid var(--lp-line); border-radius: 999px; padding: 4px 11px; font-size: .78rem; color: var(--text); }
.lp-doc .star-icon { width: 20px; height: 20px; }

/* buy hook — the OBS section for a game you don't own (sales hook) */
.buy-hook { text-align: center; }
.buy-hook .bh-lock { font-size: 2rem; }
.buy-hook h2 { justify-content: center; margin-top: 6px; }
.buy-hook > .muted { max-width: 520px; margin: 4px auto 0; }
.bh-buy { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.bh-markets { margin-top: 16px; display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bh-mk { display: flex; gap: 8px; flex-wrap: wrap; }
.bh-mk .btn { padding: 7px 14px; font-size: .85rem; }

/* responsive: collapse sidebar to a top strip */
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
    .nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
    .nav-group { display: none; }
    .side-foot { margin: 0; }
    .content { padding: 20px 16px 60px; }
    .topbar { padding: 16px; }
    .ax-slide { flex-direction: column; aspect-ratio: auto; }
    .ax-banner { width: 100%; height: auto; aspect-ratio: 16 / 9; border-right: none; border-bottom: 1px solid var(--border); }
    .ax-body { padding: 20px 22px; }
    .ax-arrow { top: 28%; }
    /* hero: stack on mobile — scene as a top banner, text below, no overlay */
    .ax-slide.ax-hero { display: flex; flex-direction: column; aspect-ratio: auto; }
    .ax-hero-bg { position: static; width: 100%; height: auto; border-bottom: 1px solid var(--border); }
    .ax-hero::after { display: none; }
    .ax-hero .ax-body { position: static; width: 100%; }
    .wiki-wrap .wiki-layout { grid-template-columns: 1fr; }
    .wiki-sidebar { position: static; }
    .pdp { grid-template-columns: 1fr; }
    .pdp-info { position: static; }
    .lp-doc .rpg-progression-layout { grid-template-columns: 1fr; }
}

/* ===== Game global leaderboard (search / filters / sort / hp / status) ===== */
.glb-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.glb-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; flex: 1 1 220px; min-width: 200px; }
.glb-search svg { color: var(--muted); flex-shrink: 0; }
.glb-search input { background: none; border: 0; color: var(--text); font: inherit; font-size: .9rem; outline: none; width: 100%; }
.glb-search input::placeholder { color: var(--faint); }
.glb-fgroup { display: flex; gap: 6px; flex-wrap: wrap; }
.glb-fbtn { font: inherit; font-size: .8rem; font-weight: 600; padding: 8px 13px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; transition: all .15s; }
.glb-fbtn:hover { color: var(--text); border-color: var(--border-2); }
.glb-fbtn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.glb-statusbar { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; gap: 6px; }
.glb-refresh { display: flex; align-items: center; gap: 7px; color: var(--faint); }
.glb-refresh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 6px var(--good); animation: glbpulse 2s ease-in-out infinite; }
@keyframes glbpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.glb-tablewrap { padding: 0; overflow: hidden; }
.glb-table { width: 100%; border-collapse: collapse; }
.glb-table thead th { text-align: left; font-size: .7rem; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.glb-table tbody tr { border-bottom: 1px solid var(--border); }
.glb-table tbody tr:last-child { border-bottom: 0; }
.glb-table tbody tr:hover { background: var(--accent-bg); }
.glb-table td { padding: 12px 16px; font-size: .9rem; color: var(--text); vertical-align: middle; }
.glb-rank { font-family: var(--pixel); font-size: 1.15rem; color: var(--muted); width: 38px; }
.glb-rank.r1 { color: var(--gold); } .glb-rank.r2 { color: #cfd8e8; } .glb-rank.r3 { color: #e0a060; }
.glb-ch a { color: var(--text); font-weight: 600; text-decoration: none; }
.glb-ch a:hover { color: var(--accent-soft); }
.glb-boss-tag { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.glb-lv { font-weight: 700; color: var(--accent-soft); }
.glb-hp { min-width: 130px; }
.glb-hp-pct { font-size: .76rem; color: var(--muted); margin-bottom: 4px; }
.glb-hpbar { height: 7px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.glb-hpfill { height: 100%; background: var(--good); border-radius: 4px; }
.glb-hpfill.mid { background: var(--gold); } .glb-hpfill.low { background: var(--bad); }
.glb-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; background: var(--faint); }
.glb-dot.online { background: var(--good); box-shadow: 0 0 6px var(--good); }
.glb-st { font-size: .78rem; font-weight: 600; color: var(--muted); }
.glb-st.online { color: var(--good); }
.glb-seen { font-size: .82rem; color: var(--faint); white-space: nowrap; }
@media (max-width: 820px) { .glb-table .glb-hp, .glb-table th:nth-child(5), .glb-table th:nth-child(7), .glb-table td:nth-child(7) { display: none; } }

/* ===== Leaderboard widget (Overview) + storefront preview ===== */
.lbw-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.lbw-head h2 { margin: 0; }
.lbw-full { cursor: pointer; white-space: nowrap; }
.lbw-full:hover { color: var(--accent-soft); }
.lbw-you { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.lbw-you b { color: var(--accent-soft); }
.lbw-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-top: 1px solid var(--border); }
.lbw-row:first-child { border-top: 0; }
.lbw-row.me { background: var(--accent-bg); border-radius: var(--r-sm); }
.lbw-rank { font-family: var(--pixel); font-size: 1rem; color: var(--muted); min-width: 26px; text-align: center; }
.lbw-rank.r1 { color: var(--gold); } .lbw-rank.r2 { color: #cfd8e8; } .lbw-rank.r3 { color: #e0a060; }
.lbw-name { flex: 1; min-width: 0; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbw-name:hover { color: var(--accent-soft); }
.lbw-stat { font-size: .85rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.lb-preview { border-color: var(--accent-bd); }
.lbp-cta { margin-top: 12px; font-size: .85rem; }

/* ===== SK hand-built wiki + guide fragments (need styling in the hub) ===== */
.wiki-wrap { --text-mid: var(--muted); --green: var(--good); }
.wiki-wrap .wiki-section > p { color: var(--muted); }
/* wiki tables */
.wiki-wrap table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .88rem; }
.wiki-wrap thead th { text-align: left; font-size: .66rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 9px 11px; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
.wiki-wrap tbody td { padding: 9px 11px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wiki-wrap tbody tr:last-child td { border-bottom: 0; }
.wiki-wrap .td-name { font-weight: 600; color: var(--text); white-space: nowrap; }
.wiki-wrap .td-val { color: var(--text); font-variant-numeric: tabular-nums; }
.wiki-wrap .td-val2 { color: var(--muted); font-variant-numeric: tabular-nums; }
.wiki-wrap .td-glory { color: var(--gold); font-weight: 600; white-space: nowrap; }
.wiki-wrap .td-dim { color: var(--muted); font-size: .82rem; }
/* rarity pills */
.wiki-wrap .rar { display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .5px; padding: 2px 8px; border-radius: 999px; }
.wiki-wrap .rar-c { background: rgba(255,255,255,.08); color: var(--muted); }
.wiki-wrap .rar-r { background: rgba(86,184,255,.16); color: #8fc8ff; }
.wiki-wrap .rar-l { background: rgba(255,212,107,.16); color: var(--gold); }
/* How-It-Works flow step text */
.wiki-wrap .fs-num { font-size: .62rem; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.wiki-wrap .fs-action { font-family: var(--pixel); font-size: 1.05rem; color: var(--accent-soft); margin: 4px 0; }
.wiki-wrap .fs-sub { font-size: .78rem; color: var(--muted); }
/* City Scaling cards (the "not finished" section) */
.wiki-wrap .scale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.wiki-wrap .scale-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
.wiki-wrap .sc-label { font-size: .66rem; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.wiki-wrap .sc-formula { font-family: var(--pixel); font-size: 1.02rem; color: var(--accent-soft); margin-bottom: 9px; line-height: 1.2; }
.wiki-wrap .sc-examples { font-size: .8rem; color: var(--muted); line-height: 1.75; }
.wiki-wrap .tip-box { background: var(--accent-bg); border: 1px solid var(--accent-bd); border-radius: var(--r); padding: 13px 15px; font-size: .88rem; line-height: 1.6; color: var(--text); }
.wiki-wrap .tip-box strong { color: var(--accent-soft); }
.wiki-wrap .bld-card.first { border-color: var(--accent-bd); }
/* GUIDE: callouts */
.wiki-wrap .callout { display: flex; gap: 11px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-sm); padding: 12px 14px; margin-top: 12px; }
.wiki-wrap .callout.c-warn { border-left-color: var(--bad); }
.wiki-wrap .callout.c-tip  { border-left-color: var(--accent); }
.wiki-wrap .c-icon { flex-shrink: 0; font-size: 1.05rem; line-height: 1.4; }
.wiki-wrap .c-text { font-size: .87rem; color: var(--muted); line-height: 1.55; }
.wiki-wrap .c-text strong { color: var(--text); }
.wiki-wrap .inline-code { font-family: ui-monospace, monospace; font-size: .85em; background: var(--surface-3); color: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }
/* GUIDE: success box */
.wiki-wrap .success-box { display: flex; gap: 14px; align-items: flex-start; background: rgba(94,224,160,.08); border: 1px solid rgba(94,224,160,.25); border-radius: var(--r); padding: 18px 20px; margin-top: 22px; }
.wiki-wrap .s-icon { font-size: 1.5rem; line-height: 1; }
.wiki-wrap .success-title { font-weight: 700; letter-spacing: .5px; color: var(--good); margin-bottom: 5px; }
.wiki-wrap .success-desc { font-size: .9rem; color: var(--muted); line-height: 1.6; }
.wiki-wrap .success-desc strong { color: var(--text); }
/* GUIDE: command rows (as cards in cmd-grid) */
.wiki-wrap .cmd-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 13px 15px; }
.wiki-wrap .cmd-row .cmd-name.viewer { color: var(--good); }
.wiki-wrap .cmd-row .cmd-name.streamer { color: var(--accent-soft); }
.wiki-wrap .cmd-who { display: inline-block; margin-top: 9px; font-size: .6rem; font-weight: 700; letter-spacing: .5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
/* GUIDE: relink form */
.wiki-wrap .relink-intro { color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.wiki-wrap .relink-form { display: flex; flex-direction: column; gap: 13px; max-width: 460px; }
.wiki-wrap .relink-field label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.wiki-wrap .relink-btn { align-self: flex-start; background: var(--accent); color: #fff; border: 0; border-radius: var(--r-sm); padding: 11px 18px; font-weight: 600; font-size: .9rem; }
.wiki-wrap .relink-btn:hover { background: var(--accent-soft); }
.wiki-wrap #relink-msg:not(:empty) { font-size: .85rem; color: var(--muted); }
/* GUIDE: help box + outline button */
.wiki-wrap .help-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; color: var(--muted); line-height: 1.6; }
.wiki-wrap .help-box a { color: var(--accent-soft); }
.wiki-wrap .btn-outline { background: transparent; border: 1px solid var(--border-2); color: var(--text); }
.wiki-wrap .btn-outline:hover { border-color: var(--accent-bd); color: var(--accent-soft); }
/* Buildings page — effect per level */
.bld-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.bld-effect { font-size: .8rem; color: var(--muted); line-height: 1.45; }
.bld-now { margin-top: 9px; font-size: .78rem; font-weight: 600; color: var(--accent-soft); }
.bld-card.locked .bld-now { display: none; }

/* storefront: description + mini-leaderboard side by side (equal height) */
.pdp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.pdp-row > .card { margin: 0; }
@media (max-width: 860px) { .pdp-row { grid-template-columns: 1fr; } }

/* ===== Unified Setup Guide (install + activation, shared template) ===== */
.setup-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.setup-node { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 13px 16px; min-width: 104px; flex: 1 1 0; }
.setup-node .sn-icon { font-size: 1.35rem; line-height: 1; }
.setup-node .sn-label { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.setup-arrow { color: var(--faint); font-size: 1.2rem; flex-shrink: 0; }
.setup .card { margin-bottom: 16px; }
.setup-stage { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.setup-badge { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-bg); border: 1px solid var(--accent-bd); color: var(--accent-soft); display: grid; place-items: center; font-weight: 700; font-size: .95rem; flex-shrink: 0; }
.setup-stage h2 { margin: 0; font-size: 1.12rem; }
.setup-steps { margin: 6px 0 0; padding-left: 22px; color: var(--muted); line-height: 1.95; }
.setup-steps li { padding-left: 4px; }
.setup-steps b { color: var(--text); }
.setup-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 15px; }
.setup-cmds { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 13px; }
.setup-cmd { font-family: ui-monospace, "SF Mono", monospace; font-size: .9rem; color: var(--accent-soft); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 12px; }
.setup-warn { display: flex; gap: 11px; align-items: flex-start; background: rgba(255,107,107,.08); border: 1px solid rgba(255,107,107,.22); border-radius: var(--r-sm); padding: 12px 14px; margin-top: 15px; font-size: .87rem; color: var(--muted); line-height: 1.55; }
.setup-warn b { color: var(--text); }
.setup .inline-code { font-family: ui-monospace, monospace; font-size: .85em; background: var(--surface-3); color: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }
@media (max-width: 720px) { .setup-flow { gap: 6px; } .setup-node { min-width: 0; padding: 10px 8px; } .setup-arrow { font-size: .9rem; } }

/* in-hub activation state (owned) + img game-icon inside a hero */
.setup-activated { display: flex; gap: 11px; align-items: flex-start; background: rgba(94,224,160,.09); border: 1px solid rgba(94,224,160,.24); border-radius: var(--r-sm); padding: 13px 15px; font-size: .92rem; color: var(--muted); line-height: 1.5; }
.setup-activated b { color: var(--text); }
.hero .game-icon { border-radius: 16px; box-shadow: 0 8px 26px var(--accent-glow); flex-shrink: 0; }

/* setup: username recovery (relink) + StreamElements note */
.setup-badge.fix { background: rgba(255,180,84,.14); border-color: rgba(255,180,84,.32); color: #ffb454; }
.setup-activated.se { background: rgba(145,70,255,.10); border-color: rgba(145,70,255,.26); }
.relink-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-top: 14px; }
.relink-form input { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; color: var(--text); font-size: .92rem; width: 100%; }
.relink-form input::placeholder { color: var(--faint); }
.relink-form input:focus { outline: none; border-color: var(--accent-bd); }
.relink-form .btn { white-space: nowrap; }
.relink-msg { display: none; margin-top: 12px; font-size: .9rem; line-height: 1.5; }
.relink-msg.ok { color: var(--good); }
.relink-msg.err { color: #ff6b6b; }
.relink-msg b { color: var(--text); }
.setup-fix-foot { margin-top: 14px; font-size: .85rem; }
.setup-fix-foot a { color: var(--accent-soft); cursor: pointer; }
@media (max-width: 640px) { .relink-form { grid-template-columns: 1fr; } }

/* ---------- hub footer: socials + stores ---------- */
.content { flex: 1 0 auto; }   /* push the footer to the bottom on short pages */
.hub-foot { border-top: 1px solid var(--border); background: var(--bg-side); margin-top: auto; }
.foot-inner { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 28px; max-width: 1080px; padding: 34px 30px 26px; }
.foot-brand { max-width: 340px; }
.foot-logo { height: 22px; width: auto; filter: brightness(0) invert(1); opacity: .92; }
.foot-tagline { color: var(--muted); font-size: .86rem; line-height: 1.5; margin: 12px 0 15px; }
.foot-social { display: flex; gap: 10px; flex-wrap: wrap; }
.foot-social a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); transition: color .15s, border-color .15s, background .15s; }
.foot-social a:hover { color: var(--text); border-color: var(--accent-bd); background: var(--surface); }
.foot-social svg { width: 17px; height: 17px; fill: currentColor; }
.foot-col { display: flex; flex-direction: column; gap: 9px; }
.foot-head { font-size: .68rem; letter-spacing: 1.6px; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.foot-col a { color: var(--muted); font-size: .9rem; text-decoration: none; width: fit-content; }
.foot-col a:hover { color: var(--accent-soft); }
.foot-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 1080px; padding: 14px 30px; border-top: 1px solid var(--border); color: var(--faint); font-size: .8rem; }
@media (max-width: 760px) {
  .foot-inner { grid-template-columns: 1fr 1fr; gap: 22px; padding: 26px 16px 20px; }
  .foot-brand { grid-column: 1 / -1; max-width: none; }
  .foot-bar { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; }
}
