/* Game District (the games hub): design tokens, shell and shared components.
   Standalone: the hub no longer loads game-retro.css / game-portal.css / styles.css.
   Themes: night (default), day, contrast.  Motion: body[data-motion="reduced"] or prefers-reduced-motion. */

/* Games cursor set (--gcur-*): pixel-art SVG cursors in the games' ink/cream/gold palette, each with a keyword
   fallback. Native special cursors (zoom-in, grab, move, crosshair, not-allowed, help, wait, *-resize...) are not used
   in the hub or the shared games CSS: use these, or pointer / default / text. */
:root {
    --gcur-zoom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath d='M5 0h6v1h2v2h1v2h1v6h-1v2h-1v2h-2v1H5v-1H3v-2H2v-2H1V5h1V3h1V1h2z' fill='%23140c2a'/%3E%3Cpath d='M5 2h6v1h1v1h1v1h1v6h-1v1h-1v1h-1v1H5v-1H4v-1H3v-1H2V5h1V4h1V3h1z' fill='%23ffc94a'/%3E%3Cpath d='M6 4h4v1h1v1h1v4h-1v1h-1v1H6v-1H5v-1H4V6h1V5h1z' fill='%239fe6ff'/%3E%3Cpath d='M7 5h2v2h2v2H9v2H7V9H5V7h2z' fill='%23fff4d6'/%3E%3Cpath d='M7 6h2v1h1v2H9v1H7V9H6V7h1z' fill='%23140c2a' opacity='0'/%3E%3Cpath d='M13 13h2v1h1v1h1v1h1v1h1v1h1v1h1v1h1v2h-1v1h-2v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-2h1z' fill='%23140c2a'/%3E%3Cpath d='M14 15h1v1h1v1h1v1h1v1h1v1h1v1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1z' fill='%23ffc94a'/%3E%3C/svg%3E") 8 8, pointer;
    --gcur-grab: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath d='M7 3h2v1h1V2h2v1h1v1h1V3h2v1h1v3h1V6h2v1h1v7h-1v3h-1v2h-1v2H9v-2H8v-2H6v-2H4v-2H3v-2h1V9h2v1h1z' fill='%23140c2a'/%3E%3Cpath d='M8 4h1v7h1V3h2v8h1V4h1v7h1V4h1v8h1V8h2v6h-1v3h-1v2h-1v1h-6v-1H9v-2H8v-1H6v-1H5v-2H4v-1h2v1h1v1h1z' fill='%23fff4d6'/%3E%3C/svg%3E") 12 12, pointer;
    --gcur-grabbing: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath d='M8 6h9v1h2v1h2v7h-1v3h-1v2h-1v2H9v-2H8v-2H6v-2H5v-3h1V8h2z' fill='%23140c2a'/%3E%3Cpath d='M9 7h1v1h2V7h1v1h2V7h1v1h1v1h2v1h1v5h-1v3h-1v2h-1v1h-6v-1H9v-2H8v-1H7v-2H6v-3h1V9h2z' fill='%23fff4d6'/%3E%3Cpath d='M10 9h1v2h-1zM13 9h1v2h-1zM16 9h1v2h-1z' fill='%23140c2a'/%3E%3C/svg%3E") 12 12, pointer;
    --gcur-move: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpolygon points='12,1 16.5,5.5 13.5,5.5 13.5,10.5 18.5,10.5 18.5,7.5 23,12 18.5,16.5 18.5,13.5 13.5,13.5 13.5,18.5 16.5,18.5 12,23 7.5,18.5 10.5,18.5 10.5,13.5 5.5,13.5 5.5,16.5 1,12 5.5,7.5 5.5,10.5 10.5,10.5 10.5,5.5 7.5,5.5' fill='%23fff4d6' stroke='%23140c2a' stroke-width='1.5' stroke-linejoin='miter' paint-order='stroke'/%3E%3C/svg%3E") 12 12, pointer;
    --gcur-crosshair: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath d='M10 1h4v8h-4zM10 15h4v8h-4zM1 10h8v4H1zM15 10h8v4h-8zM10 10h4v4h-4z' fill='%23140c2a'/%3E%3Cpath d='M11 2h2v6h-2zM11 16h2v6h-2zM2 11h6v2H2zM16 11h6v2h-6z' fill='%23fff4d6'/%3E%3Cpath d='M11 11h2v2h-2z' fill='%23ffc94a'/%3E%3C/svg%3E") 12 12, default;
    --gcur-ns: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpolygon points='12,1 18,7.5 14,7.5 14,16.5 18,16.5 12,23 6,16.5 10,16.5 10,7.5 6,7.5' fill='%23fff4d6' stroke='%23140c2a' stroke-width='1.5' stroke-linejoin='miter' paint-order='stroke'/%3E%3C/svg%3E") 12 12, pointer;
}
:root {
    /* Night (default): a bright 90s arcade palette on deep grape - sunny yellow, magenta, teal, grape purple */
    --bg: #130a30;
    --bg-2: #1c1045;
    --surface: #221552;
    --surface-2: #2c1c66;
    --surface-3: #39267c;
    --line: rgba(205, 185, 255, .16);
    --line-2: rgba(205, 185, 255, .34);
    --text: #fff8ea;
    --muted: #d4cbf6;
    --dim: #ab9fe2;
    --gold: #ffd23f;
    --gold-2: #ffa21b;
    --pink: #ff4fb8;
    --cyan: #2ee6d6;
    --green: #6af2a8;
    --red: #ff7676;
    --violet: #b58cff;
    --on-gold: #2a1400;
    /* 90s accents (hub-90s.css): teal, magenta, sun, grape; --btn-* are the chunky bevelled buttons */
    --teal: #2ee6d6;
    --magenta: #ff4fb8;
    --sun: #ffd23f;
    --grape: #8a4dff;
    --btn-hi: #ffe680;
    --btn-edge: #1a0b3d;
    --title: #ffd23f;
    --title-shadow: #ff4fb8;
    --title-shadow-2: rgba(46, 230, 214, .55);
    --confetti-opacity: .16;
    --sb-track: #1a0f40;
    --sb-thumb: #2ee6d6;
    --sb-thumb-2: #ff4fb8;
    --glass: rgba(34, 21, 82, .8);
    --shadow: 0 18px 40px rgba(5, 0, 25, .5);
    --shadow-sm: 0 6px 16px rgba(5, 0, 25, .38);
    --radius: 16px;
    --radius-sm: 10px;
    --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Bungee', 'Nunito', system-ui, sans-serif;
    --top-h: 64px;
    --rar-common: #b9c0d8;
    --rar-uncommon: #6af2a8;
    --rar-rare: #4fc3ff;
    --rar-epic: #c08cff;
    --rar-legendary: #ffc83d;
    --rar-mythic: #ff4fb8;
    --focus: #2ee6d6;
    /* item tooltips: a deep grape card, every text colour at least WCAG AA (4.5:1) on it */
    --tip-bg: #12082c;
    --tip-bg-2: #21134a;
    --tip-line: rgba(205, 185, 255, .22);
    --tip-text: #fff8ea;
    --tip-muted: #d8d0f3;
    --tip-dim: #b9aee0;
    --tip-gold: #ffd862;
    color-scheme: dark;
}

:root[data-theme="day"] {
    /* Day: a sunny Saturday-morning cream with lilac panels, teal, magenta and orange accents */
    --bg: #fff5e1;
    --bg-2: #f6e9ff;
    --surface: #fffdf8;
    --surface-2: #fbf0ff;
    --surface-3: #f0e0ff;
    --line: rgba(74, 34, 120, .16);
    --line-2: rgba(74, 34, 120, .32);
    --text: #24163a;
    --muted: #4f4166;
    --dim: #685a7e;
    --gold: #a65a00;
    --gold-2: #8a4700;
    --pink: #b5166e;
    --cyan: #00747a;
    --green: #12784a;
    --red: #b3261e;
    --violet: #6a2fc4;
    --on-gold: #fff8e8;
    --teal: #00a29a;
    --magenta: #d6248c;
    --sun: #ffc21a;
    --grape: #7a3fe0;
    --btn-hi: #a65a00;
    --btn-edge: #5a2d00;
    --title: #24163a;
    --title-shadow: #ffc21a;
    --title-shadow-2: rgba(0, 162, 154, .45);
    --confetti-opacity: .2;
    --sb-track: #f0e0ff;
    --sb-thumb: #00a29a;
    --sb-thumb-2: #d6248c;
    --glass: rgba(255, 253, 248, .88);
    --shadow: 0 16px 34px rgba(74, 34, 120, .18);
    --shadow-sm: 0 5px 14px rgba(74, 34, 120, .13);
    --rar-common: #5e6579;
    --rar-uncommon: #17794a;
    --rar-rare: #1c63c7;
    --rar-epic: #7a3fd0;
    --rar-legendary: #b86800;
    --rar-mythic: #c4235f;
    --focus: #00747a;
    --tip-bg: #fffdf7;
    --tip-bg-2: #f3e6ff;
    --tip-line: rgba(74, 34, 120, .24);
    --tip-text: #21190d;
    --tip-muted: #463b29;
    --tip-dim: #5a4e3a;
    --tip-gold: #7a4f00;
    color-scheme: light;
}

:root[data-theme="contrast"] {
    --bg: #000;
    --bg-2: #050505;
    --surface: #0b0b0b;
    --surface-2: #151515;
    --surface-3: #232323;
    --line: rgba(255, 255, 255, .55);
    --line-2: #fff;
    --text: #fff;
    --muted: #e8e8e8;
    --dim: #cfcfcf;
    --gold: #ffe14d;
    --gold-2: #ffd000;
    --on-gold: #000;
    --glass: rgba(0, 0, 0, .92);
    --focus: #00e5ff;
    --tip-bg: #000;
    --tip-bg-2: #111;
    --tip-line: #fff;
    --tip-text: #fff;
    --tip-muted: #f0f0f0;
    --tip-dim: #dedede;
    --tip-gold: #ffe14d;
    --teal: #00e5ff;
    --magenta: #ff66cc;
    --sun: #ffe14d;
    --grape: #ffffff;
    --btn-hi: #ffe14d;
    --btn-edge: #fff;
    --title: #fff;
    --title-shadow: transparent;
    --title-shadow-2: transparent;
    --confetti-opacity: 0;
    --sb-track: #000;
    --sb-thumb: #ffe14d;
    --sb-thumb-2: #ffe14d;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html[data-text="large"] { font-size: 112.5%; }
html[data-text="xlarge"] { font-size: 125%; }

body.hub-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(1200px 520px at 15% -10%, rgba(255, 95, 162, .13), transparent 60%),
        radial-gradient(900px 480px at 95% 0%, rgba(82, 214, 255, .11), transparent 60%),
        linear-gradient(180deg, var(--bg-2), var(--bg) 420px);
    background-attachment: fixed;
    overflow-x: hidden;
}
body.hub-page.dashboard-modal-open { overflow: hidden; }
body.hub-page img { max-width: 100%; }
body.hub-page button { font: inherit; color: inherit; }
body.hub-page a { color: var(--gold); }
body.hub-page h1, body.hub-page h2, body.hub-page h3, body.hub-page h4, body.hub-page p { margin: 0; }
body.hub-page ::selection { background: var(--pink); color: #fff; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 8px;
}

.hub-skip {
    position: absolute; left: 12px; top: -60px; z-index: 300;
    padding: 10px 16px; border-radius: 10px;
    background: var(--gold); color: var(--on-gold); font-weight: 800; text-decoration: none;
}
.hub-skip:focus { top: 10px; }
.sr-only {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ top bar */
.hub-top {
    position: sticky; top: 0; z-index: 120;
    display: flex; align-items: center; gap: 14px;
    min-height: var(--top-h);
    padding: 8px clamp(12px, 2.4vw, 28px);
    /* a plain see-through bar, no frosted-glass blur: a backdrop blur over the always-moving Sunnyside plaza cost the
       compositor ~9 fps on desktop. Opaque enough that the menu stays readable over any page or scene (every theme). */
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    border-bottom: 1px solid var(--line);
}
.hub-brand {
    display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
    color: var(--text) !important; text-decoration: none;
}
.hub-brand-mark {
    width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center;
    border-radius: 12px; background: linear-gradient(145deg, var(--pink), var(--violet));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .15) inset, 0 4px 14px rgba(255, 95, 162, .4);
}
.hub-brand-mark svg { width: 26px; height: 26px; }
.hub-brand-text { display: grid; line-height: 1.05; }
.hub-brand-text b { font-family: var(--font-display); font-size: 1.08rem; letter-spacing: .06em; color: var(--gold); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.hub-brand-text small { font-size: .7rem; color: var(--muted); font-weight: 700; letter-spacing: .04em; }

.hub-nav {
    display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0;
    overflow-x: auto; scrollbar-width: none; padding: 2px;
}
.hub-nav::-webkit-scrollbar { display: none; }
.dashboard-tab {
    display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
    padding: 9px 14px; border-radius: 12px; border: 1px solid transparent;
    background: transparent; color: var(--muted); font-weight: 800; font-size: .92rem; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .15s;
    white-space: nowrap;
}
.dashboard-tab i { font-size: 1.05rem; }
.dashboard-tab:hover { background: var(--surface-2); color: var(--text); }
.dashboard-tab.is-active {
    background: linear-gradient(180deg, var(--gold), var(--gold-2));
    color: var(--on-gold); border-color: rgba(255, 255, 255, .25);
    box-shadow: 0 4px 14px rgba(255, 157, 46, .35);
}
.dashboard-tab .hub-badge-dot {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: .7rem; font-weight: 900;
    display: inline-grid; place-items: center; background: var(--pink); color: #fff;
}

.hub-top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; }
.hub-wallet {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line); font-weight: 900; cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.hub-wallet.is-bump { animation: hubBump .5s ease; }
.hub-wallet.is-gain { box-shadow: 0 0 0 3px rgba(95, 227, 161, .5); }
.hub-wallet.is-spend { box-shadow: 0 0 0 3px rgba(255, 201, 74, .5); }
@keyframes hubBump { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 100% { transform: scale(1); } }

.hub-icon-btn {
    width: 40px; height: 40px; display: inline-grid; place-items: center; flex: 0 0 auto;
    border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
    color: var(--text); cursor: pointer; font-weight: 900; font-size: .85rem;
    transition: background .15s, transform .15s, border-color .15s;
}
.hub-icon-btn:hover { background: var(--surface-3); border-color: var(--line-2); transform: translateY(-1px); }
.hub-icon-btn[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }
.hub-lang-btn { width: auto; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; letter-spacing: .06em; }

.hub-player-chip {
    display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; color: var(--text); text-align: left;
    max-width: 240px; transition: border-color .15s, background .15s;
}
.hub-player-chip:hover { border-color: var(--gold); background: var(--surface-3); }
.dashboard-rail-avatar, .retro-avatar {
    width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; overflow: hidden;
    background: #f3d89d; border: 2px solid var(--gold); display: grid; place-items: center; color: #24140a;
}
.dashboard-rail-avatar svg, .retro-avatar svg { display: block; width: 100%; height: 100%; }
.dashboard-rail-name { display: grid; min-width: 0; line-height: 1.1; }
.dashboard-rail-title { font-weight: 900; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: grid; }
.dashboard-rail-username { font-size: .68rem; color: var(--dim); font-weight: 700; }
#dashboardRailSubtitle { font-size: .74rem; color: var(--muted); font-weight: 800; }
.dashboard-rail-display-name { overflow: hidden; text-overflow: ellipsis; }
.hub-player-chip .dashboard-coin-amount { display: none; }

/* ----------------------------------------------------------------- shell */
.hub-main { max-width: 1480px; margin: 0 auto; padding: 18px clamp(12px, 2.4vw, 28px) 56px; }
.hub-back {
    display: inline-flex; align-items: center; gap: 6px; color: var(--muted) !important; text-decoration: none;
    font-weight: 800; font-size: .85rem; padding: 4px 0;
}
.hub-back:hover { color: var(--gold) !important; }
.dashboard-tab-panel[hidden] { display: none !important; }
body[data-dashboard-tab]:not([data-dashboard-tab="games"]) .hub-hero { display: none; }
.hub-panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.hub-panel-head h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 2.1rem); letter-spacing: .02em; line-height: 1.05; }
.hub-panel-head p { color: var(--muted); max-width: 62ch; margin-top: 6px; }
.dashboard-shop-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.dashboard-shop-toolbar h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 2.1rem); line-height: 1.05; margin-top: 4px; }
.dashboard-shop-toolbar p { color: var(--muted); max-width: 62ch; margin-top: 6px; }

.retro-kicker {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .72rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--pink);
}
.retro-copy, .retro-title { margin: 0; }

.hub-card, .dashboard-player-panel, .dashboard-board {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 18px;
}
.hub-card > h3, .dashboard-board h2 { font-size: 1.1rem; }

/* ----------------------------------------------------------- buttons/forms */
.retro-button, .retro-button-secondary, .retro-button-danger {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 8px 16px; border-radius: 12px; border: 1px solid transparent;
    font-weight: 900; font-size: .92rem; line-height: 1.1; cursor: pointer; text-decoration: none;
    transition: transform .14s, filter .14s, background .14s, border-color .14s, box-shadow .14s;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.retro-button {
    background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: var(--on-gold) !important;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .28), 0 8px 18px rgba(255, 157, 46, .25);
}
.retro-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.retro-button:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .28); }
.retro-button-secondary { background: var(--surface-2); color: var(--text) !important; border-color: var(--line-2); }
.retro-button-secondary:hover { background: var(--surface-3); border-color: var(--gold); }
.retro-button-secondary.is-active { background: var(--surface-3); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.retro-button-danger { background: color-mix(in srgb, var(--red) 22%, var(--surface-2)); color: var(--text) !important; border-color: var(--red); }
.retro-button-danger:hover { background: color-mix(in srgb, var(--red) 40%, var(--surface-2)); }
.retro-button:disabled, .retro-button-secondary:disabled, .retro-button-danger:disabled,
.retro-button[aria-disabled="true"] { opacity: .55; cursor: default; transform: none; filter: grayscale(.4); box-shadow: none; }
.retro-button.is-pending, .retro-button-secondary.is-pending { opacity: .8; cursor: default; }
.retro-button-icon { display: inline-grid; place-items: center; }
.retro-button-icon svg { width: 1.1em; height: 1.1em; stroke: currentColor; fill: none; stroke-width: 2; }
.retro-button-icon img, .dashboard-inline-icon, .dashboard-heading-icon { width: 1.2em; height: 1.2em; vertical-align: -.2em; }

.retro-input, .retro-select, .hub-input,
body.hub-page input[type="text"], body.hub-page input[type="search"], body.hub-page input[type="email"],
body.hub-page input[type="password"], body.hub-page select, body.hub-page textarea {
    width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 12px;
    border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
    font: inherit; font-weight: 700;
}
body.hub-page input::placeholder { color: var(--dim); font-weight: 600; }
.retro-input:hover, .retro-select:hover, body.hub-page select:hover { border-color: var(--gold); }
.retro-field { display: grid; gap: 6px; }
.retro-field > label, .retro-field > span, .dashboard-shop-filter > span {
    font-size: .76rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.dashboard-shop-filter { display: grid; gap: 6px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--gold); width: 1.05rem; height: 1.05rem; }
input[type="color"] { width: 44px; height: 34px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); }
input[type="range"] { accent-color: var(--gold); width: 100%; }
.dashboard-check-row, .retro-check { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }

.retro-message { min-height: 1.2em; font-weight: 800; font-size: .9rem; color: var(--muted); }
.retro-message.success { color: var(--green); }
.retro-message.error { color: var(--red); }

.retro-empty {
    padding: 22px; border-radius: var(--radius-sm); border: 1px dashed var(--line-2);
    color: var(--muted); text-align: center; font-weight: 700; background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.retro-showcase-badge, .retro-difficulty-pill, .retro-account-pill, .retro-rank-pill, .dashboard-hero-stat {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: .74rem; font-weight: 800; line-height: 1.5; white-space: nowrap;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.retro-account-pill { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.retro-account-pill--guest { color: var(--muted); }
.retro-rank-pill { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.retro-flag {
    display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 4px; border-radius: 4px;
    font-size: .64rem; font-weight: 900; letter-spacing: .06em; background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2);
}
.dashboard-language-flags { display: inline-flex; gap: 4px; }
.dashboard-language-flag { display: inline-flex; }

/* coin amount */
.dashboard-coin-amount, .retro-coin-amount { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.dashboard-coin-amount-icon, .retro-coin-amount-icon {
    width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 55%, #c27a0a); color: #5a3300; font-size: .72rem;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .4);
}
.dashboard-coin-amount--compact { font-size: .85rem; }
.dashboard-coin-amount--compact .dashboard-coin-amount-icon { width: 16px; height: 16px; font-size: .6rem; }
.dashboard-coin-amount--price { font-size: 1.05rem; }
.dashboard-coin-balance { display: inline-flex; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 1.05rem; }

/* rarity */
.dashboard-rarity--common { --rar: var(--rar-common); }
.dashboard-rarity--uncommon { --rar: var(--rar-uncommon); }
.dashboard-rarity--rare { --rar: var(--rar-rare); }
.dashboard-rarity--epic { --rar: var(--rar-epic); }
.dashboard-rarity--legendary { --rar: var(--rar-legendary); }
.dashboard-rarity--mythic { --rar: var(--rar-mythic); }
.dashboard-rarity-pill {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
    font-size: .7rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase;
    color: var(--rar, var(--rar-common)); border: 1px solid color-mix(in srgb, var(--rar, var(--rar-common)) 60%, transparent);
    background: color-mix(in srgb, var(--rar, var(--rar-common)) 14%, var(--surface));
}
.dashboard-rarity-pill--mini { padding: 1px 7px; font-size: .62rem; }
.dashboard-rarity-icon { font-size: .72em; display: inline-grid; }

/* ----------------------------------------------------------- modals */
.hub-modal, .dashboard-wardrobe-modal, .dashboard-slot-modal, .dashboard-unsaved-modal, .dashboard-shop-preview-modal {
    position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
    background: rgba(5, 3, 14, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: hubFade .18s ease;
}
.hub-modal[hidden], .dashboard-wardrobe-modal[hidden], .dashboard-slot-modal[hidden],
.dashboard-unsaved-modal[hidden], .dashboard-shop-preview-modal[hidden] { display: none !important; }
/* Entrance animations never touch opacity: when the animation clock stalls (a hidden, occluded or busy window, the paused
 * html.hub-hidden state) a window must still be seen, not sit at opacity 0 over the page catching clicks (the "invisible
 * window"). The backdrop fades its colour in, the dialog only slides and grows; HubCore.settleModal() finishes both anyway. */
@keyframes hubFade { from { background-color: transparent; } }
@keyframes hubPop { from { transform: translateY(14px) scale(.97); } to { transform: none; } }
.hub-dialog, .dashboard-wardrobe-dialog, .dashboard-slot-dialog, .dashboard-unsaved-dialog, .dashboard-shop-preview-dialog {
    position: relative; width: min(960px, 100%); max-height: calc(100vh - 32px); overflow: auto;
    background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px;
    box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .04) inset; padding: 20px; animation: hubPop .22s ease;
}
.dashboard-slot-dialog, .dashboard-unsaved-dialog { width: min(560px, 100%); }
.dashboard-shop-preview-backdrop { position: absolute; inset: 0; }
.dashboard-slot-head, .dashboard-wardrobe-head, .dashboard-shop-preview-head, .hub-dialog-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px;
}
.dashboard-slot-head strong, .dashboard-wardrobe-head strong, .dashboard-shop-preview-head h3 { font-family: var(--font-display); font-size: 1.25rem; display: block; margin-top: 4px; }
.dashboard-wardrobe-head p, .dashboard-shop-preview-head p { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.dashboard-slot-close, .dashboard-shop-preview-close, .hub-close {
    width: 38px; height: 38px; flex: 0 0 auto; display: inline-grid; place-items: center; border-radius: 12px;
    border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer;
}
.dashboard-slot-close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.dashboard-slot-close:hover, .dashboard-shop-preview-close:hover, .hub-close:hover { background: var(--red); color: #fff; border-color: transparent; }
/* unsaved-changes dialogs: the eyebrow, then the title on its own line, then the text */
.dashboard-unsaved-dialog > div:first-child { display: grid; justify-items: start; gap: 6px; }
.dashboard-unsaved-dialog > div:first-child > strong { display: block; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.15; letter-spacing: .02em; }
.dashboard-unsaved-dialog > div:first-child > p { color: var(--muted); }
.dashboard-unsaved-actions, .dashboard-wardrobe-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; align-items: center; }

/* ----------------------------------------------------------- tooltips */
.dashboard-item-tooltip { display: none !important; }
.dashboard-floating-item-tooltip {
    display: grid !important; position: fixed; z-index: 400; width: min(320px, calc(100vw - 20px)); gap: 6px;
    padding: 12px 14px; border-radius: 14px; background: var(--tip-bg); color: var(--tip-text);
    border: 1px solid var(--rar, var(--tip-line)); box-shadow: var(--shadow), 0 0 22px color-mix(in srgb, var(--rar, #000) 35%, transparent);
    pointer-events: none; font-size: .82rem; line-height: 1.35; text-align: left; white-space: normal;
}
.dashboard-floating-item-tooltip > span { display: block; }
.dashboard-wardrobe2-tooltip-head { display: flex !important; align-items: center; gap: 10px; }
.dashboard-wardrobe2-tooltip-head > span:nth-child(2) { flex: 1; display: grid; min-width: 0; }
.dashboard-wardrobe2-tooltip-head strong { font-size: .95rem; }
.dashboard-wardrobe2-tooltip-head em { font-style: normal; color: var(--rar, var(--muted)); font-weight: 900; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.dashboard-wardrobe2-tooltip-head small { color: var(--tip-dim); font-weight: 800; font-size: .7rem; }
.dashboard-wardrobe2-tooltip-icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--tip-bg-2); border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
.dashboard-wardrobe2-tooltip-icon > * { max-width: 100%; max-height: 100%; }
.dashboard-wardrobe2-tooltip-description { color: var(--tip-text); }
.dashboard-wardrobe2-tooltip-flavor { color: var(--tip-muted); font-style: italic; }
.dashboard-wardrobe2-tooltip-line { height: 1px; background: var(--tip-line); }
.dashboard-wardrobe2-tooltip-requirement, .dashboard-wardrobe2-tooltip-set small { color: var(--tip-dim); font-size: .72rem; }
.dashboard-wardrobe2-tooltip-bound, .dashboard-wardrobe2-tooltip-stats, .dashboard-wardrobe2-tooltip-tags, .dashboard-wardrobe2-tooltip-effects { display: flex !important; flex-wrap: wrap; gap: 4px; }
.dashboard-wardrobe2-tooltip-bound span, .dashboard-wardrobe2-tooltip-stats span, .dashboard-wardrobe2-tooltip-tags span, .dashboard-wardrobe2-tooltip-effects span {
    padding: 1px 8px; border-radius: 999px; background: var(--tip-bg-2); border: 1px solid var(--tip-line); font-size: .68rem; font-weight: 800; color: var(--tip-muted);
}
.dashboard-wardrobe2-tooltip-set span { font-weight: 900; color: var(--tip-gold, var(--gold)); margin-right: 6px; }
.dashboard-wardrobe2-tooltip-foot { display: flex !important; justify-content: space-between; font-size: .72rem; color: var(--tip-dim); }
.dashboard-wardrobe2-tooltip-foot strong { color: var(--tip-text); }
.dashboard-three-cosmetic-preview { display: block; width: 100%; height: 150px; border-radius: 10px; background: var(--bg-2); position: relative; overflow: hidden; }
.dashboard-three-cosmetic-canvas { width: 100%; height: 100%; display: block; }
.dashboard-three-cosmetic-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-weight: 800; font-size: .78rem; }

/* generic floating text tip for [data-tip] */
.hub-tip {
    position: fixed; z-index: 450; max-width: 260px; padding: 6px 10px; border-radius: 8px;
    background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2);
    font-size: .78rem; font-weight: 800; pointer-events: none; box-shadow: var(--shadow-sm);
}

/* ----------------------------------------------------------- toasts */
.hub-toasts {
    position: fixed; right: 16px; bottom: 16px; z-index: 500; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.hub-toast {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
    background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow);
    font-weight: 800; pointer-events: auto; animation: hubToastIn .28s cubic-bezier(.2, .9, .3, 1.2);
}
.hub-toast i { font-size: 1.3rem; }
.hub-toast.is-success { border-color: var(--green); }
.hub-toast.is-success i { color: var(--green); }
.hub-toast.is-error { border-color: var(--red); }
.hub-toast.is-error i { color: var(--red); }
.hub-toast.is-info i { color: var(--cyan); }
.hub-toast.is-out { animation: hubToastOut .25s ease forwards; }
@keyframes hubToastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes hubToastOut { to { opacity: 0; transform: translateX(30px); } }
#dashboardMessage {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* confetti burst layer */
.hub-burst { position: fixed; pointer-events: none; z-index: 480; width: 0; height: 0; }
.hub-burst i {
    position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 2px;
    background: var(--c, var(--gold)); animation: hubBurst .9s cubic-bezier(.15, .8, .3, 1) forwards;
}
@keyframes hubBurst {
    0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.4); opacity: 0; }
}

/* ----------------------------------------------------------- reduced motion */
body[data-motion="reduced"] *, body[data-motion="reduced"] *::before, body[data-motion="reduced"] *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
    body[data-motion="auto"] *, body[data-motion="auto"] *::before, body[data-motion="auto"] *::after {
        animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
    }
}

/* ----------------------------------------------------------- responsive shell */
@media (max-width: 980px) {
    .hub-top { flex-wrap: wrap; row-gap: 6px; }
    .hub-nav { order: 3; flex: 1 0 100%; }
    .hub-brand-text small { display: none; }
}
@media (max-width: 560px) {
    .hub-player-chip .dashboard-rail-name { display: none; }
    .hub-player-chip { padding: 3px; }
    .dashboard-tab { padding: 8px 11px; }
    .dashboard-tab span { font-size: .84rem; }
    .hub-top-actions { gap: 6px; }
    .hub-lang-btn { padding: 0 9px; }
}

/* generic: the hidden attribute always wins over component display rules */
[hidden] { display: none !important; }

/* compact top navigation: only the active tab keeps its label */
@media (max-width: 1560px) and (min-width: 981px) {
    .dashboard-tab:not(.is-active) { padding: 9px 11px; }
    .dashboard-tab:not(.is-active) > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .hub-brand-text small { display: none; }
}

@media (max-width: 980px) { .hub-nav { -webkit-mask-image: linear-gradient(90deg, #000 0, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 0, #000 88%, transparent); padding-right: 24px; } }

/* Settings > a row opened from elsewhere (e.g. the buy toast's "Settings") flashes once */
.dashboard-check-row.is-flash, .hub-set-group.is-flash { border-radius: 10px; animation: hub-row-flash 1.4s ease-out; }
@keyframes hub-row-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--gold); background: color-mix(in srgb, var(--gold) 18%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; background: transparent; } }
@media (prefers-reduced-motion: reduce) { .dashboard-check-row.is-flash, .hub-set-group.is-flash { animation: none; box-shadow: 0 0 0 3px var(--gold); } }
/* holdScroll's spacer: invisible room below the results so a shorter list does not yank the page up */
.hub-scroll-spacer { display: block; width: 100%; pointer-events: none; visibility: hidden; }
