/* ── TOKENS ───────────────────────────────────────────────────── */
:root {
    --hdr:  54px;
    --ftr:  50px;
    --safe-top: clamp(0px, env(safe-area-inset-top, 0px), 44px);
    --safe-bottom: clamp(0px, env(safe-area-inset-bottom, 0px), 34px);
    --hdr-total: calc(var(--hdr) + var(--safe-top));
    --ftr-total: calc(var(--ftr) + var(--safe-bottom));
    --bg:   #050505;
    --text: #ffffff;
    --muted: rgba(255,255,255,0.42);
    --border: rgba(255,255,255,0.07);
    --panel-w: 320px;
    --font-head: 'Syne', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --accent: #ff4fb8;
    --accent-rgb: 255,79,184;
    --accent-muted: rgba(255,79,184,0.65);
    --effect-hue: 0deg;
}

body[data-skin="classic"] {
    --accent: #ff4fb8;
    --accent-rgb: 255,79,184;
    --accent-muted: rgba(255,79,184,0.65);
}

body[data-skin="neon"] {
    --accent: #2de5ff;
    --accent-rgb: 45,229,255;
    --accent-muted: rgba(45,229,255,0.65);
}

body[data-skin="sunset"] {
    --accent: #ff8f4f;
    --accent-rgb: 255,143,79;
    --accent-muted: rgba(255,143,79,0.65);
}

body[data-skin="ice"] {
    --accent: #9cb6ff;
    --accent-rgb: 156,182,255;
    --accent-muted: rgba(156,182,255,0.65);
}

body[data-skin="emerald"] {
    --accent: #2ed38f;
    --accent-rgb: 46,211,143;
    --accent-muted: rgba(46,211,143,0.65);
}

body[data-skin="crimson"] {
    --accent: #ff5d6f;
    --accent-rgb: 255,93,111;
    --accent-muted: rgba(255,93,111,0.65);
}

body[data-skin="amber"] {
    --accent: #f7b84a;
    --accent-rgb: 247,184,74;
    --accent-muted: rgba(247,184,74,0.65);
}

body[data-skin="violet"] {
    --accent: #b38cff;
    --accent-rgb: 179,140,255;
    --accent-muted: rgba(179,140,255,0.65);
}

/* ── RESET ────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── BASE ─────────────────────────────────────────────────────── */
html, body {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

/* ── CUSTOM CURSOR ────────────────────────────────────────────── */
@media (hover: hover) {
    body,
    a,
    button,
    input,
    textarea,
    select,
    [role="button"],
    .sp-tab,
    .fp-link {
        cursor: none !important;
    }

    #game-cursor {
        position: fixed;
        left: 0;
        top: 0;
        width: 10px;
        height: 10px;
        background: var(--accent);
        box-shadow: 0 0 8px rgba(var(--accent-rgb),0.85);
        border-radius: 0;
        pointer-events: none;
        transform: translate(-50%, -50%);
        will-change: transform, opacity;
        contain: layout style paint;
        z-index: 9999;
        transition: opacity 0.2s ease, background 0.2s ease, width 0.2s ease, height 0.2s ease, box-shadow 0.2s ease;
    }
    body[data-player-shape="square"] #game-cursor { border-radius: 0; clip-path: none; }
    body[data-player-shape="circle"] #game-cursor { border-radius: 50%; clip-path: none; }
    body[data-player-shape="diamond"] #game-cursor {
        border-radius: 0;
        clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    }
    body[data-player-shape="triangle"] #game-cursor {
        border-radius: 0;
        clip-path: polygon(50% 4%, 96% 92%, 4% 92%);
    }
    body[data-player-shape="hexagon"] #game-cursor {
        border-radius: 0;
        clip-path: polygon(25% 6%, 75% 6%, 96% 50%, 75% 94%, 25% 94%, 4% 50%);
    }
    body[data-player-shape="star"] #game-cursor {
        border-radius: 0;
        clip-path: polygon(50% 3%, 61% 35%, 95% 35%, 68% 55%, 79% 91%, 50% 71%, 21% 91%, 32% 55%, 5% 35%, 39% 35%);
    }

    #game-cursor.hover-ui {
        width: 14px;
        height: 14px;
        background: rgba(255,255,255,0.96);
        box-shadow: 0 0 12px rgba(255,255,255,0.38), 0 0 16px rgba(var(--accent-rgb),0.70);
    }

    body[data-player-effect]:not([data-player-effect="none"]) #game-cursor {
        background: var(--accent);
        box-shadow:
            0 0 10px rgba(var(--accent-rgb),0.78),
            0 0 20px hsla(var(--effect-hue), 96%, 66%, 0.40);
    }
    body[data-player-effect]:not([data-player-effect="none"]) #game-cursor.hover-ui {
        background: rgba(255,255,255,0.96);
        box-shadow:
            0 0 10px rgba(255,255,255,0.34),
            0 0 12px rgba(var(--accent-rgb),0.95),
            0 0 20px hsla(var(--effect-hue), 96%, 66%, 0.40);
    }

    body[data-cursor-quality="medium"] #game-cursor {
        box-shadow: 0 0 5px rgba(var(--accent-rgb),0.62);
    }

    body[data-cursor-quality="medium"] #game-cursor.hover-ui {
        box-shadow: 0 0 8px rgba(var(--accent-rgb),0.70);
    }

    body[data-cursor-quality="low"] #game-cursor {
        box-shadow: none;
        transition: opacity 0.16s ease, background 0.16s ease, width 0.16s ease, height 0.16s ease;
    }

    body[data-cursor-quality="low"] #game-cursor.hover-ui {
        width: 12px;
        height: 12px;
        box-shadow: 0 0 5px rgba(var(--accent-rgb),0.55);
    }

    #game-cursor.hover-disabled {
        width: 14px;
        height: 14px;
        background: rgba(220,220,228,0.42);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.34), 0 0 10px rgba(255,95,95,0.20);
    }

    #game-cursor.hover-disabled::after {
        content: '';
        position: absolute;
        left: 2px;
        top: 6px;
        width: 10px;
        height: 1.5px;
        background: rgba(255,118,118,0.95);
        transform: rotate(-45deg);
        transform-origin: center;
    }

    /* Restore native cursor when custom cursor is disabled via settings */
    body.cursor-native,
    body.cursor-native a,
    body.cursor-native button,
    body.cursor-native input,
    body.cursor-native textarea,
    body.cursor-native select,
    body.cursor-native [role="button"],
    body.cursor-native .sp-tab,
    body.cursor-native .fp-link {
        cursor: revert !important;
    }
    body.game-playing,
    body.game-playing a,
    body.game-playing button,
    body.game-playing input,
    body.game-playing textarea,
    body.game-playing select,
    body.game-playing [role="button"],
    body.game-playing .sp-tab,
    body.game-playing .fp-link {
        cursor: none !important;
    }
    body.game-playing #game-cursor {
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

/* ── NOISE OVERLAY ────────────────────────────────────────────── */
.noise {
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
    opacity: 0.038;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── MOUSE GLOW ───────────────────────────────────────────────── */
.mouse-glow {
    position: fixed;
    left: 0;
    top: 0;
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(255,255,255,0.045) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    will-change: transform;
    z-index: 0;
}

body[data-player-effect]:not([data-player-effect="none"]) .mouse-glow {
    background: radial-gradient(
        circle,
        rgba(255,255,255,0.05) 0%,
        hsla(var(--effect-hue), 95%, 64%, 0.16) 24%,
        transparent 68%
    );
}

body[data-cursor-quality="medium"] .mouse-glow {
    width: 620px;
    height: 620px;
    opacity: 0.026;
}

body[data-cursor-quality="low"] .mouse-glow {
    width: 520px;
    height: 520px;
    opacity: 0.015;
}

/* ── HEADER ───────────────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--hdr-total);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--safe-top) clamp(1rem, 3vw, 2rem) 0;
    z-index: 90;
    border-bottom: 1px solid var(--border);
    background: rgba(5,5,5,0.90);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.hdr-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}

.hdr-logo {
    width: 22px; height: 22px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 0 7px rgba(var(--accent-rgb),0.40));
}

.hdr-left:hover .hdr-logo {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(var(--accent-rgb),0.72));
}

.hdr-name {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text);
    opacity: 0.62;
    text-shadow: none;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.hdr-left:hover .hdr-name {
    opacity: 0.9;
    color: var(--text);
}

.hdr-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.sound-toggle {
    position: fixed;
    top: calc(var(--hdr-total) + 2.0rem);
    left: clamp(1.2rem, 3.6vw, 2.0rem);
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.34);
    background: rgba(8,8,10,0.82);
    color: rgba(236,236,241,0.92);
    cursor: pointer;
    z-index: 92;
    outline: none;
    transition: border-color 0.22s ease, color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.sound-toggle:hover {
    color: #ffffff;
    border-color: rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 0 14px rgba(255,255,255,0.14);
}

.sound-toggle[aria-pressed="true"] {
    color: rgba(255,138,32,0.96);
    border-color: rgba(255,138,32,0.62);
    background: rgba(255,138,32,0.14);
    box-shadow: 0 0 14px rgba(255,138,32,0.18);
}

.hdr-score {
    font-family: var(--font-head);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    opacity: 0;
    transition: opacity 0.3s ease;
    min-width: 2.5ch;
    text-align: right;
    padding-right: 0.1rem;
    /* subtle separator */
    border-right: 1px solid rgba(255,255,255,0.08);
    padding-right: 1.1rem;
    margin-right: -0.1rem;
}

.btn-scores {
    background: rgba(56,189,248,0.10);
    border: 1px solid rgba(56,189,248,0.42);
    color: rgba(125,211,252,0.95);
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    min-height: 36px;
    padding: 0.42rem 0.9rem;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    white-space: nowrap;
}

.btn-scores:hover {
    color: rgba(224,247,255,1);
    border-color: rgba(56,189,248,0.72);
    background: rgba(56,189,248,0.18);
    box-shadow: 0 0 16px rgba(56,189,248,0.24);
}

.hdr-gamemode {
    position: relative;
}

.btn-gamemode {
    background: rgba(255,255,255,0.085);
    border: 1px solid rgba(255,255,255,0.42);
    color: rgba(245,245,245,0.92);
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    min-height: 36px;
    padding: 0.42rem 0.9rem;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-gamemode:hover,
.btn-gamemode[aria-expanded="true"],
.btn-gamemode.active {
    color: #ffffff;
    border-color: rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.14);
    box-shadow: 0 0 16px rgba(255,255,255,0.16);
}

.btn-gamemode.is-disabled,
.btn-gamemode:disabled {
    opacity: 0.64;
    cursor: default;
    box-shadow: none;
    color: rgba(215,215,220,0.62);
    border-color: rgba(255,255,255,0.2);
    border-style: dashed;
    background: repeating-linear-gradient(
        135deg,
        rgba(255,255,255,0.03) 0px,
        rgba(255,255,255,0.03) 6px,
        rgba(255,255,255,0.01) 6px,
        rgba(255,255,255,0.01) 12px
    );
}

.btn-gamemode.is-disabled:hover,
.btn-gamemode:disabled:hover {
    color: rgba(215,215,220,0.62);
    border-color: rgba(255,255,255,0.2);
    background: repeating-linear-gradient(
        135deg,
        rgba(255,255,255,0.03) 0px,
        rgba(255,255,255,0.03) 6px,
        rgba(255,255,255,0.01) 6px,
        rgba(255,255,255,0.01) 12px
    );
    box-shadow: none;
}

.gamemode-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.45rem);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(8,8,10,0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.42);
    z-index: 110;
}

.gamemode-menu[hidden] {
    display: none;
}

.gamemode-item {
    width: 40px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(20,20,22,0.88);
    color: rgba(230,230,235,0.9);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.gamemode-item:hover {
    color: #ffffff;
    border-color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.12);
}

.gamemode-item.active {
    border-color: rgba(var(--accent-rgb),0.62);
    color: rgba(var(--accent-rgb),0.98);
    background: rgba(var(--accent-rgb),0.14);
    box-shadow: 0 0 14px rgba(var(--accent-rgb),0.22);
}

.btn-daily {
    background: rgba(255,138,32,0.10);
    border: 1px solid rgba(255,138,32,0.42);
    color: rgba(255,168,60,0.95);
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    min-height: 36px;
    padding: 0.42rem 0.9rem;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    white-space: nowrap;
}

.btn-daily:hover {
    color: rgba(255,168,60,1);
    border-color: rgba(255,138,32,0.72);
    background: rgba(255,138,32,0.18);
    box-shadow: 0 0 16px rgba(255,138,32,0.24);
}

.btn-daily.active {
    color: rgba(255,172,65,1);
    border-color: rgba(255,138,32,0.78);
    background: rgba(255,138,32,0.20);
    animation: challengeGlow 2.8s ease-in-out infinite;
}

@keyframes challengeGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(255,138,32,0.12); }
    50%       { box-shadow: 0 0 22px rgba(255,138,32,0.28); }
}

.btn-account {
    background: rgba(255,255,255,0.085);
    border: 1px solid rgba(255,255,255,0.42);
    color: rgba(245,245,245,0.92);
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    min-height: 36px;
    padding: 0.42rem 0.9rem;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
    order: 5;
}

.btn-account:hover {
    color: #ffffff;
    border-color: rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.14);
    box-shadow: 0 0 16px rgba(255,255,255,0.16);
}

.btn-account.active {
    color: #ffffff;
    border-color: rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.14);
    box-shadow: 0 0 16px rgba(255,255,255,0.16);
}

.hdr-notif {
    position: relative;
    order: 4;
}

.hdr-notif[hidden] {
    display: none;
}

.hdr-notif-btn {
    position: relative;
    background: rgba(255,255,255,0.085);
    border: 1px solid rgba(255,255,255,0.42);
    color: rgba(245,245,245,0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 42px;
    padding: 0.42rem 0.72rem;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.hdr-notif-btn:hover,
.hdr-notif-btn[aria-expanded="true"] {
    color: #ffffff;
    border-color: rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.14);
    box-shadow: 0 0 16px rgba(255,255,255,0.16);
}

.hdr-notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-rgb),0.6);
    background: rgba(var(--accent-rgb),0.95);
    color: #fff;
    font-size: 0.52rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 10px rgba(var(--accent-rgb),0.35);
}

.hdr-notif-badge[hidden] {
    display: none;
}

.hdr-notif-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(380px, calc(100vw - 1.2rem));
    max-height: min(65vh, 420px);
    overflow: auto;
    background: #111;
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.4);
    z-index: 210;
    animation: udropIn 0.15s ease both;
}

.hdr-notif-menu[hidden] {
    display: none;
}

.hdr-notif-head {
    padding: 0.64rem 0.78rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.82);
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.hdr-notif-list {
    padding: 0.32rem;
    display: flex;
    flex-direction: column;
    gap: 0.34rem;
}

.hdr-notif-empty {
    padding: 0.55rem 0.5rem;
    color: var(--muted);
    font-size: 0.56rem;
}

.hdr-notif-row {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.02);
    padding: 0.46rem 0.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
    align-items: center;
}

.hdr-notif-row.unread {
    border-color: rgba(var(--accent-rgb),0.42);
    background: rgba(var(--accent-rgb),0.09);
}

.hdr-notif-main {
    min-width: 0;
}

.hdr-notif-title {
    color: rgba(255,255,255,0.9);
    font-size: 0.64rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hdr-notif-meta {
    margin-top: 0.12rem;
    color: var(--muted);
    font-size: 0.53rem;
}

.hdr-notif-type {
    margin-right: 0.3rem;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hdr-notif-actions {
    display: inline-flex;
    gap: 0.3rem;
}

.hdr-notif-action {
    min-height: 28px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: rgba(255,255,255,0.85);
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    padding: 0 0.45rem;
    cursor: pointer;
}

.hdr-notif-action.ok {
    border-color: rgba(74,222,128,0.45);
    color: rgba(134,239,172,0.95);
}

.hdr-notif-action.no {
    border-color: rgba(248,113,113,0.45);
    color: rgba(252,165,165,0.95);
}

.challenge-banner {
    position: fixed;
    top: calc(var(--hdr-total) + 0.6rem);
    left: 50%;
    transform: translateX(-50%);
    width: min(780px, calc(100vw - 2rem));
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.58rem 0.85rem;
    border: 1px solid rgba(255,138,32,0.30);
    background: rgba(12,9,5,0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 120;
    box-shadow: 0 0 20px rgba(255,138,32,0.07);
}

.challenge-banner.active {
    display: flex;
}

.challenge-banner[hidden] {
    display: none !important;
}

.challenge-banner i {
    color: rgba(255,150,45,0.85);
    flex-shrink: 0;
}

#challenge-text {
    flex: 1;
    min-width: 0;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255,168,60,0.90);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.challenge-close {
    border: none;
    background: none;
    color: rgba(255,255,255,0.65);
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.quest-board {
    position: fixed;
    left: 0.8rem;
    top: calc(var(--hdr-total) + 0.55rem);
    bottom: auto;
    width: min(320px, calc(100vw - 2rem));
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(7,7,7,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 124;
    padding: 0.62rem 0.66rem;
}

.quest-board[hidden] {
    display: none !important;
}

.quest-head {
    margin-bottom: 0.5rem;
}

.quest-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(255,255,255,0.78);
}

.quest-list {
    display: flex;
    flex-direction: column;
    gap: 0.36rem;
}

.quest-item {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
    padding: 0.45rem 0.5rem;
}

.quest-item.done {
    border-color: rgba(var(--accent-rgb),0.45);
    background: rgba(var(--accent-rgb),0.08);
}

.quest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.quest-label {
    font-size: 0.64rem;
    color: rgba(255,255,255,0.82);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.quest-icon {
    width: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(var(--accent-rgb),0.9);
    font-size: 0.58rem;
}

.quest-progress {
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    white-space: nowrap;
}

.quest-item.done .quest-progress {
    color: rgba(var(--accent-rgb),0.95);
}

/* ── DAILY PODIUM ─────────────────────────────────────────────── */
.daily-podium {
    position: fixed;
    left: 50%;
    bottom: calc(var(--ftr-total) + 0.5rem);
    transform: translateX(-50%);
    width: min(680px, calc(100vw - 1.5rem));
    border: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 125;
    padding: 0;
    overflow: visible;
}

.daily-podium.active {
    display: block;
}

.daily-podium[hidden] {
    display: none !important;
}

/* ── Header row ── */
.daily-podium-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.daily-podium-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--muted);
    white-space: nowrap;
}

/* ── Podium stage: silver | gold | bronze in one row ── */
.daily-podium-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas: "silver gold bronze";
    align-items: end;
    gap: 0.5rem;
    position: relative;
}

/* Floor glow under gold */
.daily-podium-list::before {
    content: '';
    position: absolute;
    left: 30%;
    right: 30%;
    bottom: 0;
    height: 50px;
    background: radial-gradient(ellipse at center bottom,
        rgba(249,205,71,0.14) 0%,
        rgba(249,205,71,0.04) 45%,
        transparent 72%);
    pointer-events: none;
}

/* Entries-1 and entries-2 variants */
.daily-podium-list.entries-1 {
    grid-template-columns: 1fr 2fr 1fr;
}

.daily-podium-list.entries-2 {
    grid-template-areas: "silver gold gold";
}

/* ── Individual cards ── */
.podium-card {
    --tier-rgb: 255,255,255;
    --tier-accent: rgba(255,255,255,0.15);
    --card-pt: 0.75rem;             /* top-padding drives height difference */
    grid-area: var(--area, auto);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: var(--card-pt) 0.85rem 0;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    animation: podiumReveal 480ms var(--ease) forwards;
    animation-play-state: paused;
}

/* Coloured top-edge accent line */
.podium-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--tier-accent) 30%,
        var(--tier-accent) 70%,
        transparent 100%);
}

/* Platform/step bar that sits at the bottom of the grid row */
.podium-card::after {
    content: '';
    display: block;
    height: var(--step-h, 20px);
    margin-top: 0.7rem;
    background: linear-gradient(180deg,
        rgba(var(--tier-rgb), 0.10) 0%,
        rgba(var(--tier-rgb), 0.04) 100%);
    border-top: 1px solid rgba(var(--tier-rgb), 0.22);
}

/* ── Gold ── */
.podium-card.podium-gold {
    --tier-rgb: 249,205,71;
    --tier-accent: rgba(255,219,96,0.9);
    --card-pt: 1.6rem;
    --step-h: 44px;
    grid-area: gold;
    z-index: 3;
    background: radial-gradient(120% 60% at 50% 0%,
        rgba(255,214,92,0.20) 0%,
        rgba(255,214,92,0.07) 55%,
        transparent 75%);
    border-left: 1px solid rgba(255,214,92,0.34);
    border-right: 1px solid rgba(255,214,92,0.34);
    box-shadow: 0 0 24px rgba(255,214,92,0.16), inset 0 1px 0 rgba(255,235,168,0.26);
}

/* ── Silver ── */
.podium-card.podium-silver {
    --tier-rgb: 200,214,228;
    --tier-accent: rgba(200,214,228,0.55);
    --card-pt: 1.1rem;
    --step-h: 30px;
    grid-area: silver;
    z-index: 2;
    background: radial-gradient(120% 60% at 50% 0%,
        rgba(200,214,228,0.06) 0%,
        transparent 65%);
    border-left: 1px solid rgba(200,214,228,0.12);
    border-right: 1px solid rgba(200,214,228,0.12);
}

/* ── Bronze ── */
.podium-card.podium-bronze {
    --tier-rgb: 212,146,94;
    --tier-accent: rgba(212,146,94,0.5);
    --card-pt: 0.75rem;
    --step-h: 20px;
    grid-area: bronze;
    z-index: 1;
    background: radial-gradient(120% 60% at 50% 0%,
        rgba(212,146,94,0.06) 0%,
        transparent 65%);
    border-left: 1px solid rgba(212,146,94,0.12);
    border-right: 1px solid rgba(212,146,94,0.12);
}

/* ── Animations ── */
@keyframes podiumReveal {
    0%   { opacity: 0; transform: translateY(14px); }
    100% { opacity: 1; transform: translateY(0); }
}

.daily-podium-list.animate .podium-card { animation-play-state: running; }
.daily-podium-list.animate .podium-card.podium-silver { animation-delay: 0ms; }
.daily-podium-list.animate .podium-card.podium-bronze { animation-delay: 80ms; }
.daily-podium-list.animate .podium-card.podium-gold   { animation-delay: 180ms; }

/* ── Card content ── */
.podium-emblem {
    font-size: 1.15rem;
    line-height: 1;
    margin-bottom: 0.45rem;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.podium-rank {
    font-size: 0.48rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.48);
    line-height: 1;
    margin-bottom: 0.22rem;
}

.podium-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.podium-name-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.podium-name-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.podium-name-link:hover {
    color: rgb(var(--accent-rgb));
    border-bottom-color: transparent;
}

.podium-score {
    font-family: var(--font-head);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    line-height: 1;
    margin-top: 0.4rem;
}

.podium-card.podium-gold .podium-score {
    color: rgba(255,227,132,1);
    text-shadow: 0 0 22px rgba(255,214,92,0.40);
}

.podium-card.podium-gold .podium-rank {
    color: rgba(255,224,121,0.88);
}

.podium-card.podium-silver .podium-rank {
    color: rgba(222,231,241,0.75);
}

.podium-card.podium-bronze .podium-rank {
    color: rgba(228,171,126,0.74);
}

.daily-podium-empty {
    grid-column: 1 / -1;
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
}

/* ── Compact podium on lobby (Top 3 chips) ───────────────────── */
.daily-podium--mini {
    width: min(760px, calc(100vw - 1.2rem));
    padding: 0.62rem 0.64rem;
    border-color: rgba(255,255,255,0.14);
    background: linear-gradient(180deg, rgba(6,8,12,0.90), rgba(5,6,9,0.86));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.daily-podium--mini .daily-podium-head {
    justify-content: space-between;
    margin-bottom: 0.52rem;
    gap: 0.5rem;
}
.daily-podium-open {
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.82);
    min-height: 28px;
    padding: 0.28rem 0.58rem;
    font-size: 0.50rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    white-space: nowrap;
}
.daily-podium-open:hover {
    border-color: rgba(var(--accent-rgb),0.52);
    background: rgba(var(--accent-rgb),0.14);
    color: rgba(255,255,255,0.95);
}
.daily-podium-list--mini {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    align-items: stretch;
}
.daily-podium-list--mini::before {
    display: none;
}
.daily-podium-list--mini .daily-podium-empty {
    padding: 0.9rem 0.55rem;
}
.podium-mini {
    --tier-rgb: 255,255,255;
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0.48rem 0.56rem;
    border: 1px solid rgba(var(--tier-rgb),0.22);
    background: rgba(var(--tier-rgb),0.06);
    min-height: 54px;
    overflow: hidden;
}
.podium-mini::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(var(--tier-rgb),0.13), rgba(var(--tier-rgb),0.03));
    opacity: 0.45;
}
.podium-mini > * {
    position: relative;
    z-index: 1;
}
.podium-mini-gold {
    --tier-rgb: 249,205,71;
}
.podium-mini-silver {
    --tier-rgb: 200,214,228;
}
.podium-mini-bronze {
    --tier-rgb: 212,146,94;
}
.podium-mini-emblem {
    font-size: 1rem;
    line-height: 1;
}
.podium-mini-main {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
}
.podium-mini-rank {
    font-size: 0.44rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.58);
    line-height: 1;
}
.podium-mini-name-link {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    min-width: 0;
    color: rgba(255,255,255,0.95);
    text-decoration: none;
}
.podium-mini-name-text {
    min-width: 0;
    font-size: 0.84rem;
    line-height: 1.1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.podium-mini-name-link:hover {
    color: rgb(var(--accent-rgb));
}
.podium-level-inline--mini {
    font-size: 0.44rem !important;
    letter-spacing: 0.09em !important;
    padding: 0.10rem 0.34rem !important;
}
.podium-mini-score {
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: rgba(255,255,255,0.95);
    line-height: 1;
}
.podium-mini-gold .podium-mini-score {
    color: rgba(255,227,132,1);
    text-shadow: 0 0 14px rgba(255,214,92,0.35);
}

/* ── GAME WRAP ────────────────────────────────────────────────── */
#game-wrap {
    position: fixed;
    top: var(--hdr-total);
    left: 0; right: 0;
    bottom: var(--ftr-total);
    overflow: hidden;
    z-index: 10;
    touch-action: manipulation;
}

#game-canvas {
    display: block;
    width: 100%; height: 100%;
    touch-action: none;
}

/* ── GAME OVERLAYS ────────────────────────────────────────────── */
.g-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(5,5,5,0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease);
}

.g-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.g-overlay--dead {
    background: rgba(5,5,5,0.88);
}

.g-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 2.5vh, 1.6rem);
    padding: 2rem;
    text-align: center;
}

.g-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: var(--muted);
}

.g-eyebrow::before,
.g-eyebrow::after {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.g-username {
    font-family: var(--font-head);
    font-size: clamp(1.6rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: -0.4rem;
}

#overlay-ready #ready-name {
    font-size: clamp(2.4rem, 8.5vw, 5.2rem);
    letter-spacing: -0.03em;
    line-height: 1;
    text-transform: uppercase;
}

#overlay-ready #ready-name.ready-name--challenge {
    color: rgba(251,146,60,0.98);
    text-shadow: 0 0 24px rgba(251,146,60,0.35);
}

.g-bigscore {
    font-family: var(--font-head);
    font-size: clamp(5.5rem, 18vw, 14rem);
    font-weight: 800;
    color: var(--text);
    line-height: 0.9;
    letter-spacing: -0.05em;
    margin: -0.2rem 0;
    text-shadow: 0 0 60px rgba(255,255,255,0.08), 0 2px 0 rgba(0,0,0,0.4);
}

/* ── USERNAME INPUT ───────────────────────────────────────────── */
#username-input {
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.20);
    color: var(--text);
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    font-weight: 300;
    padding: 0.4rem 0;
    text-align: center;
    width: min(220px, 70vw);
    outline: none;
    transition: border-color 0.3s ease;
    letter-spacing: 0.02em;
}

#username-input::placeholder {
    color: rgba(255,255,255,0.18);
}

#username-input:focus {
    border-bottom-color: var(--accent);
    box-shadow: 0 2px 12px rgba(var(--accent-rgb),0.18);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-7px); }
    40%       { transform: translateX(7px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

#username-input.shake {
    animation: shake 0.38s var(--ease);
}

/* ── GAME BUTTONS ─────────────────────────────────────────────── */
.g-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.18);
    color: var(--text);
    min-height: 44px;
    font-family: var(--font-body);
    font-size: 0.66rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    padding: 0.75rem 2.2rem;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    position: relative;
    overflow: hidden;
}

.g-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.g-btn:hover {
    background: rgba(var(--accent-rgb),0.06);
    border-color: var(--accent-muted);
    box-shadow: 0 0 22px rgba(var(--accent-rgb),0.14), inset 0 0 20px rgba(var(--accent-rgb),0.04);
}

.g-btn:hover::after { opacity: 1; }

.g-link {
    background: none;
    border: none;
    color: var(--muted);
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    font-family: var(--font-body);
    font-size: 0.60rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    cursor: pointer;
    padding: 0;
    margin-top: -0.3rem;
    transition: color 0.25s ease;
    outline: none;
}

.g-link:hover { color: var(--accent); }

/* ── FOOTER ───────────────────────────────────────────────────── */
.app-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--ftr-total);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    padding: 0 clamp(1rem, 3vw, 2rem) var(--safe-bottom);
    z-index: 90;
    border-top: 1px solid var(--border);
    background: rgba(5,5,5,0.90);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    gap: 1rem;
}

.fp-nav {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: nowrap;
    overflow: hidden;
    min-width: 0;
    justify-self: start;
}

.fp-legal {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    justify-self: center;
    min-width: 0;
}

.fp-legal-link {
    text-decoration: none;
    color: rgba(255,255,255,0.55);
    font-size: clamp(0.64rem, 1.4vw, 0.78rem);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.2s ease, transform 0.2s ease;
}
.fp-legal-link:link,
.fp-legal-link:visited {
    color: rgba(255,255,255,0.55);
}
.fp-legal-link-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: rgba(255,255,255,0.55);
    font-family: var(--font-body);
    font-size: clamp(0.64rem, 1.4vw, 0.78rem);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.fp-legal-link:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

.fp-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: rgba(255,255,255,0.55);
    font-size: clamp(0.62rem, 1.4vw, 0.76rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: color 0.2s ease, transform 0.2s ease;
    outline: none;
}

.fp-link:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

.fp-cat {
    display: inline-block;
    font-size: 0.44rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(255,255,255,0.30);
    border: 1px solid rgba(255,255,255,0.10);
    padding: 0.15rem 0.4rem;
    line-height: 1.4;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.fp-link:hover .fp-cat {
    color: rgba(var(--accent-rgb),0.70);
    border-color: rgba(var(--accent-rgb),0.30);
}

.fp-sep {
    color: var(--border);
    font-size: 0.75rem;
    user-select: none;
}

.fp-meta {
    font-size: 0.60rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    white-space: nowrap;
    flex-shrink: 0;
    justify-self: end;
    text-align: right;
}

/* ── COOKIE BANNER ───────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    right: 0.7rem;
    bottom: calc(var(--ftr-total) + 0.35rem);
    width: min(420px, calc(100vw - 1.4rem));
    border: 1px solid rgba(255,255,255,0.17);
    background: rgba(8,8,8,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.72rem 0.78rem;
    z-index: 170;
    display: grid;
    gap: 0.62rem;
}

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-title {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.84);
}

.cookie-copy p {
    margin-top: 0.36rem;
    font-size: 0.68rem;
    line-height: 1.32;
    color: rgba(255,255,255,0.72);
}

.cookie-actions {
    display: flex;
    gap: 0.46rem;
}

.cookie-btn {
    flex: 1;
    min-height: 34px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: rgba(255,255,255,0.84);
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    cursor: pointer;
}

.cookie-btn:hover {
    background: rgba(255,255,255,0.08);
}

.cookie-btn.cookie-btn--primary {
    border-color: var(--accent-muted);
    color: #ff85ca;
}

.cookie-btn.cookie-btn--primary:hover {
    background: rgba(var(--accent-rgb),0.15);
}

/* ── SCORE PANEL DRAG HANDLE ──────────────────────────────────── */
.sp-handle {
    display: none;
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.14);
    border-radius: 2px;
    margin: 0.75rem auto 0;
    flex-shrink: 0;
}

@media (max-width: 580px) {
    .sp-handle { display: block; }
}

/* ── SCORE PANEL ──────────────────────────────────────────────── */
.score-panel {
    position: fixed;
    top: 0; right: 0;
    width: var(--panel-w);
    height: 100%;
    z-index: 200;
    background: rgba(6,6,6,0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.5s var(--ease);
    overflow: hidden;
}

.score-panel.open { transform: translateX(0); }

.sp-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--safe-top) + 1rem) 1.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sp-title {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.26em;
    color: var(--muted);
}

.sp-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
    outline: none;
}

.sp-close:hover { color: var(--text); }

/* ── SCORE PANEL TABS ─────────────────────────────────────────── */
.sp-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sp-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.60rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    padding: 0.75rem 0;
    cursor: pointer;
    outline: none;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
    margin-bottom: -1px;
}

.sp-tab:hover { color: rgba(255,255,255,0.65); }

.sp-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* ── ACHIEVEMENT TOASTS ───────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: calc(var(--ftr-total) + 0.9rem);
    right: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-end;
    pointer-events: none;
}

.achievement-toast {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(12,12,12,0.97);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 0.7rem 1.1rem;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
    transition: transform 0.45s var(--ease), opacity 0.35s ease;
    min-width: 180px;
}

.achievement-toast.visible {
    transform: translateX(0);
    opacity: 1;
    border-color: rgba(var(--accent-rgb),0.35);
    box-shadow: 0 0 20px rgba(var(--accent-rgb),0.08);
}

.toast-icon {
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text);
    flex-shrink: 0;
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.toast-eyebrow {
    font-size: 0.52rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--muted);
}

.toast-label {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text);
    letter-spacing: 0.01em;
}

.sp-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1.75rem 2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.sp-list::-webkit-scrollbar { width: 3px; }
.sp-list::-webkit-scrollbar-track { background: transparent; }
.sp-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
}

.sp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.38);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.sp-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.account-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--panel-w);
    height: 100%;
    z-index: 210;
    background: rgba(6,6,6,0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.5s var(--ease);
    overflow: hidden;
}

.account-panel.open { transform: translateX(0); }

.ap-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem 1.5rem;
}

.ap-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.ap-tab {
    border: none;
    background: transparent;
    color: var(--muted);
    min-height: 38px;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    cursor: pointer;
}

.ap-tab.active {
    color: var(--text);
    background: rgba(var(--accent-rgb),0.08);
    box-shadow: inset 0 -2px 0 var(--accent);
}

.ap-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#auth-guest-view[hidden],
#auth-user-view[hidden],
.ap-form[hidden] {
    display: none !important;
}

/* Logged-in account pane removed; profile modal is primary. */
#auth-user-view {
    display: none !important;
}

.ap-form--tight {
    margin-top: 0.9rem;
}

.ap-label {
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.ap-input {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    min-height: 40px;
    padding: 0.55rem 0.65rem;
    outline: none;
    font-size: 0.92rem;
}

.ap-input:focus {
    border-color: var(--accent-muted);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb),0.12);
}

.ap-btn {
    margin-top: 0.35rem;
    min-height: 40px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    cursor: pointer;
}

.ap-btn:hover {
    background: rgba(255,255,255,0.08);
}

.ap-btn--ghost {
    border-color: rgba(255,255,255,0.16);
    color: rgba(255,255,255,0.8);
}

.ap-btn--danger {
    margin-top: 0.9rem;
    border-color: rgba(255,95,95,0.5);
    color: rgba(255,158,158,0.95);
}

.ap-btn--danger:hover {
    background: rgba(255,95,95,0.08);
}

.ap-hint {
    margin-top: 0.45rem;
    font-size: 0.54rem;
    line-height: 1.4;
    color: var(--muted);
}

.ap-user-card {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    padding: 0.8rem;
}

.ap-user-label {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
}

.ap-user-name {
    margin-top: 0.3rem;
    font-family: var(--font-head);
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--text);
}
.ap-user-name[data-level]:not([data-level=""])::before {
    content: attr(data-level);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.34rem;
    height: 1.28rem;
    padding: 0 0.12rem;
    margin-right: 0.32rem;
    vertical-align: middle;
    font-family: var(--font-head);
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    color: rgba(246,248,252,0.98);
    background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.07));
    border: 1px solid rgba(255,255,255,0.26);
    clip-path: polygon(28% 0%, 72% 0%, 100% 28%, 100% 72%, 72% 100%, 28% 100%, 0% 72%, 0% 28%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 0 12px rgba(0,0,0,0.35);
    text-shadow: 0 1px 2px rgba(0,0,0,0.64);
    font-variant-numeric: tabular-nums;
}

.ap-admin-badge {
    margin-top: 0.32rem;
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    padding: 0.18rem 0.44rem;
    border: 1px solid rgba(251,146,60,0.35);
    background: rgba(251,146,60,0.10);
    color: rgba(251,191,36,0.9);
    font-size: 0.48rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    width: fit-content;
}
.ap-admin-badge[hidden] { display: none; }

.ap-user-email {
    margin-top: 0.15rem;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.68);
}

.ap-stats-card {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
    padding: 0.72rem;
    margin-top: 0.75rem;
}

.ap-stats-grid {
    margin-top: 0.45rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.65rem;
}

.ap-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
}

.ap-stat-key {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.ap-stat-val {
    font-family: var(--font-head);
    font-size: 0.94rem;
    color: rgba(214,216,223,0.86);
}

.ap-last-seen {
    margin-top: 0.58rem;
    font-size: 0.58rem;
    color: rgba(255,255,255,0.65);
}

.ap-level-track {
    margin-top: 0.58rem;
}

.ap-level-meta {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.72);
}

.ap-level-meta span:first-child,
.ap-level-meta span:last-child {
    color: rgba(255,255,255,0.82);
}

.ap-level-pv {
    text-align: center;
    color: rgba(var(--accent-rgb),0.86);
}

.ap-level-bar {
    margin-top: 0.35rem;
    height: 0.46rem;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.03);
    overflow: hidden;
}

.ap-level-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(var(--accent-rgb),0.55), rgba(var(--accent-rgb),1));
    transition: width 0.25s ease;
}

.ap-mini-list {
    margin-top: 0.45rem;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.01);
}

.ap-mini-row {
    padding: 0.42rem 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 0.58rem;
    color: rgba(255,255,255,0.82);
}

.ap-mini-row:first-child {
    border-top: none;
}

.ap-mini-empty {
    padding: 0.45rem 0.5rem;
    font-size: 0.56rem;
    color: var(--muted);
}

.ap-sub-label {
    margin-top: 0.72rem;
}

#shop-forms,
#shop-bird-skins,
#shop-pipes,
#shop-backgrounds,
#shop-effects,
#shop-colors,
#shop-frames,
#shop-badges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.62rem;
}

#shop-forms .ap-mini-empty,
#shop-bird-skins .ap-mini-empty,
#shop-pipes .ap-mini-empty,
#shop-backgrounds .ap-mini-empty,
#shop-effects .ap-mini-empty,
#shop-colors .ap-mini-empty,
#shop-frames .ap-mini-empty,
#shop-badges .ap-mini-empty {
    grid-column: 1 / -1;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 0.75rem;
    text-align: center;
}

.ap-shop-row {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.24rem;
    min-height: 196px;
    padding: 0.62rem 0.58rem;
    border: 1px solid rgba(255,255,255,0.09);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    transition: border-color 0.18s, background 0.18s;
}

.ap-shop-row:hover {
    border-color: rgba(var(--accent-rgb),0.42);
    background: linear-gradient(180deg, rgba(var(--accent-rgb),0.08), rgba(var(--accent-rgb),0.03));
}

.ap-shop-row .ap-admin-btn {
    width: 100%;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    letter-spacing: 0.12em;
    padding: 0 0.4rem;
    margin-top: auto;
}

.ap-shop-preview {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,0.22);
    background: var(--shop-color, #ffffff);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.35),
        0 0 10px color-mix(in srgb, var(--shop-color, #ffffff) 40%, transparent);
    flex-shrink: 0;
}
.ap-shop-preview-wrap {
    width: 100%;
    flex: 1;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.12rem 0 0.30rem;
}
.ap-shop-preview--shape {
    background: rgba(255,255,255,0.92);
    --shop-color: #ffffff;
}
.ap-shop-preview--square { border-radius: 3px; }
.ap-shop-preview--circle { border-radius: 50%; }
.ap-shop-preview--sprite {
    width: 58px;
    height: 58px;
    border-radius: 3px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.1)),
        repeating-linear-gradient(
            45deg,
            rgba(255,255,255,0.04) 0 4px,
            rgba(255,255,255,0.02) 4px 8px
        );
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.35),
        0 0 10px rgba(var(--accent-rgb),0.28);
}
.ap-shop-preview--shape-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.1)),
        repeating-linear-gradient(
            45deg,
            rgba(255,255,255,0.04) 0 4px,
            rgba(255,255,255,0.02) 4px 8px
        );
}
.ap-shop-shape-chip {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255,255,255,0.46);
    background: rgba(246,246,250,0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.52);
}
.ap-shop-shape-chip--square { border-radius: 4px; }
.ap-shop-shape-chip--circle { border-radius: 50%; }
.ap-shop-shape-chip--diamond {
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.ap-shop-shape-chip--triangle {
    border-radius: 0;
    clip-path: polygon(50% 4%, 96% 92%, 4% 92%);
}
.ap-shop-shape-chip--hexagon {
    border-radius: 0;
    clip-path: polygon(25% 6%, 75% 6%, 96% 50%, 75% 94%, 25% 94%, 4% 50%);
}
.ap-shop-shape-chip--star {
    border-radius: 0;
    clip-path: polygon(50% 3%, 61% 35%, 95% 35%, 68% 55%, 79% 91%, 50% 71%, 21% 91%, 32% 55%, 5% 35%, 39% 35%);
}
.ap-shop-preview-canvas {
    width: 46px;
    height: 46px;
    image-rendering: pixelated;
}
.ap-shop-preview-canvas--pipe {
    width: 46px;
    height: 40px;
}
.ap-shop-preview-canvas--bg {
    width: 46px;
    height: 40px;
}
.ap-shop-preview-canvas--effect {
    width: 46px;
    height: 40px;
}
.ap-shop-preview--profile-frame,
.ap-shop-preview--profile-badge {
    width: 58px;
    height: 58px;
}
.ap-shop-profile-frame {
    --shop-frame-rgb: 255,255,255;
    --shop-frame-image: none;
    position: relative;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    box-shadow: none;
}
.ap-shop-profile-frame-ring {
    position: absolute;
    inset: -2px;
    overflow: hidden;
    border: 2px solid rgba(var(--shop-frame-rgb),0.85);
    box-shadow:
        inset 0 0 0 1px rgba(var(--shop-frame-rgb),0.30),
        0 0 12px rgba(var(--shop-frame-rgb),0.30);
}
.ap-shop-profile-frame.has-image .ap-shop-profile-frame-ring {
    background-image: var(--shop-frame-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.ap-shop-profile-frame.is-aurora .ap-shop-profile-frame-ring {
    animation: apShopFrameAuroraPulse 2.8s linear infinite;
}
@keyframes apShopFrameAuroraPulse {
    0% {
        border-color: rgba(142,226,255,0.95);
        box-shadow:
            inset 0 0 0 1px rgba(142,226,255,0.34),
            0 0 12px rgba(142,226,255,0.42);
    }
    33% {
        border-color: rgba(186,139,255,0.96);
        box-shadow:
            inset 0 0 0 1px rgba(186,139,255,0.36),
            0 0 15px rgba(186,139,255,0.46);
    }
    66% {
        border-color: rgba(255,122,211,0.95);
        box-shadow:
            inset 0 0 0 1px rgba(255,122,211,0.35),
            0 0 14px rgba(255,122,211,0.44);
    }
    100% {
        border-color: rgba(142,226,255,0.95);
        box-shadow:
            inset 0 0 0 1px rgba(142,226,255,0.34),
            0 0 12px rgba(142,226,255,0.42);
    }
}
.ap-shop-profile-badge-chip {
    min-height: 20px;
    min-width: 38px;
    max-width: 44px;
    padding: 0 0.28rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.24rem;
    border: 1px solid rgba(var(--accent-rgb),0.58);
    background: linear-gradient(180deg, rgba(var(--accent-rgb),0.28), rgba(var(--accent-rgb),0.12));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.28),
        0 0 10px rgba(var(--accent-rgb),0.28);
}
.ap-shop-profile-badge-chip i {
    font-size: 0.56rem;
    color: rgba(255,255,255,0.96);
    opacity: 1;
}
.ap-shop-profile-badge-chip span {
    font-size: 0.44rem;
    color: rgba(255,255,255,0.94);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}
.ap-shop-preview--theme {
    width: 56px;
    height: 40px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--shop-theme-a, #121212), var(--shop-theme-b, #2a2a2a));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.24),
        0 0 10px rgba(0,0,0,0.24);
}
.ap-shop-preview--pipe {
    position: relative;
    overflow: hidden;
}
.ap-shop-preview--pipe::before,
.ap-shop-preview--pipe::after {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 7px;
    border-radius: 1px;
    background: rgba(255,255,255,0.24);
}
.ap-shop-preview--pipe::before { left: 11px; }
.ap-shop-preview--pipe::after { right: 11px; }
.ap-shop-preview--bg {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0)),
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.08) 0 1px,
            transparent 1px 6px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255,255,255,0.08) 0 1px,
            transparent 1px 6px
        ),
        linear-gradient(180deg, var(--shop-theme-a, #101010), var(--shop-theme-b, #262626));
}
.ap-shop-preview--missing {
    border-style: dashed;
    border-color: rgba(255,120,120,0.7);
}
.ap-shop-preview--loading {
    border-style: dashed;
    border-color: rgba(var(--accent-rgb),0.66);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.18),
        0 0 10px rgba(var(--accent-rgb),0.28);
}

.ap-shop-row.is-unavailable {
    opacity: 0.62;
}

.ap-shop-label-name {
    font-size: 0.60rem;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
}
.ap-shop-label-cost {
    font-size: 0.50rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.25;
    min-height: 1.2em;
}

.ap-shop-limited {
    position: absolute;
    top: 0.34rem;
    right: 0.34rem;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    max-width: calc(100% - 0.8rem);
    font-size: 0.44rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(var(--accent-rgb),0.92);
    border: 1px solid rgba(var(--accent-rgb),0.35);
    background: rgba(var(--accent-rgb),0.12);
    padding: 0.12rem 0.34rem;
}
.ap-shop-preview i {
    font-size: 0.96rem;
    opacity: 0.9;
}

.ap-paypal-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.28rem;
    padding: 0.45rem 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.ap-paypal-card:first-child {
    border-top: none;
}

.ap-paypal-label {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.9);
}

.ap-paypal-price {
    font-size: 0.56rem;
    color: var(--muted);
}

.ap-paypal-card .ap-btn {
    margin-top: 0.2rem;
}

.ap-ach-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.ap-ach-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ap-ach-top {
    font-size: 0.56rem;
    color: rgba(255,255,255,0.86);
}

.ap-ach-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
}

.ap-ach-fill {
    height: 100%;
    background: rgba(var(--accent-rgb),0.55);
}

.ap-ach-fill.tier-1 { background: rgba(192,141,66,0.8); }
.ap-ach-fill.tier-2 { background: rgba(196,206,224,0.85); }
.ap-ach-fill.tier-3 { background: rgba(248,201,72,0.92); }

.ap-ach-meta {
    font-size: 0.54rem;
    color: var(--muted);
}

.ap-toggle {
    margin-top: 0.45rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.62rem;
    color: rgba(255,255,255,0.84);
}

.ap-toggle input {
    width: 14px;
    height: 14px;
}

.ap-admin {
    margin-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.09);
    padding-top: 0.8rem;
}

.ap-admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ap-admin-head .ap-btn {
    min-height: 32px;
    margin-top: 0;
    padding: 0.3rem 0.55rem;
    font-size: 0.5rem;
    letter-spacing: 0.14em;
}

.ap-admin-list {
    margin-top: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.ap-admin-empty {
    font-size: 0.58rem;
    color: var(--muted);
    padding: 0.3rem 0;
}

.ap-admin-row {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
    padding: 0.45rem 0.5rem;
}

.ap-admin-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.ap-admin-mode {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted);
}

.ap-admin-time {
    font-size: 0.54rem;
    color: rgba(255,255,255,0.58);
}

.ap-admin-main {
    margin-top: 0.22rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.ap-admin-name {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.9);
}

.ap-admin-score {
    font-family: var(--font-head);
    font-size: 0.92rem;
    color: rgba(255,255,255,0.92);
}

.ap-admin-actions {
    margin-top: 0.35rem;
}

.ap-admin-btn {
    width: 100%;
    min-height: 30px;
    border: 1px solid rgba(255,255,255,0.17);
    background: transparent;
    color: rgba(255,255,255,0.8);
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    cursor: pointer;
}

.ap-admin-btn:hover {
    background: rgba(255,255,255,0.08);
}

.ap-admin-btn.warn {
    border-color: rgba(255,120,120,0.46);
    color: rgba(255,170,170,0.95);
}

.ap-shop-row .ap-admin-btn .fa-square {
    font-size: 0.70em;
    margin-left: 0.20rem;
    vertical-align: baseline;
}

#form-change-username .stg-btn .fa-square {
    font-size: 0.72em;
    margin-left: 0.16rem;
    vertical-align: baseline;
}

#form-change-username .stg-btn .stg-cost-inline {
    display: inline-flex;
    align-items: center;
    letter-spacing: 0;
    white-space: nowrap;
}

.ap-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.38);
    z-index: 205;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.ap-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── LEVEL BADGE ──────────────────────────────────────────────── */
.level-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.46rem;
    height: 1.46rem;
    padding: 0 0.2rem;
    flex-shrink: 0;
    font-family: var(--font-head);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    color: rgba(247,248,252,0.98);
    background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
    border: 1px solid rgba(255,255,255,0.34);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.26), 0 0 14px rgba(0,0,0,0.32);
    text-shadow: 0 1px 2px rgba(0,0,0,0.65);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
}

.level-badge::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: inherit;
    pointer-events: none;
}

.level-badge--sm {
    min-width: 1.62rem;
    height: 1.62rem;
    font-size: 0.68rem;
    padding: 0 0.24rem;
}

.level-badge--xs {
    min-width: 1.32rem;
    height: 1.32rem;
    font-size: 0.54rem;
    padding: 0 0.16rem;
}

.level-badge--tiny {
    min-width: 1.18rem;
    height: 1.18rem;
    font-size: 0.5rem;
    padding: 0 0.14rem;
}

/* ── SCORE ROWS ───────────────────────────────────────────────── */
.score-row {
    display: grid;
    grid-template-columns: 2.35rem minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.95rem 0.25rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.score-row:last-child { border-bottom: 1px solid rgba(255,255,255,0.05); }

.score-rank {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    line-height: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.score-name {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 300;
    color: rgba(255,255,255,0.75);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-name-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.score-name-text {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.score-level-inline {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 1.05rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.68);
    font-size: 0.56rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1;
}
.score-name-link:hover {
    color: rgb(var(--accent-rgb));
    border-bottom-color: transparent;
}

.score-pts {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.score-row.score-me {
    background: rgba(var(--accent-rgb),0.04);
    box-shadow: inset 2px 0 0 rgba(var(--accent-rgb),0.55);
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
}
.score-row.score-me:hover { background: rgba(var(--accent-rgb),0.10); }
.score-row.score-me::after {
    content: '\f2bd';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    color: var(--accent);
    opacity: 0;
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.15s;
    pointer-events: none;
}
.score-row.score-me:hover::after { opacity: 0.80; }
.score-row.score-me .score-name { color: var(--text); font-weight: 400; }
.score-row.score-me .score-pts  { color: var(--accent); }

/* Top 3 medal colors */
.score-row[data-rank="1"] .score-rank { color: rgba(249,205,71,0.96); }
.score-row[data-rank="1"] .score-pts  { color: rgba(255,222,120,0.98); text-shadow: 0 0 14px rgba(249,205,71,0.26); }
.score-row[data-rank="1"] .score-name { color: rgba(255,236,171,0.95); }

.score-row[data-rank="2"] .score-rank { color: rgba(200,214,228,0.88); }
.score-row[data-rank="2"] .score-pts  { color: rgba(223,231,241,0.94); }
.score-row[data-rank="2"] .score-name { color: rgba(228,236,246,0.86); }

.score-row[data-rank="3"] .score-rank { color: rgba(212,146,94,0.88); }
.score-row[data-rank="3"] .score-pts  { color: rgba(223,166,118,0.94); }
.score-row[data-rank="3"] .score-name { color: rgba(233,184,142,0.84); }

@media (max-width: 640px) {
    .score-row {
        grid-template-columns: 2rem minmax(0, 1fr) auto;
        gap: 0.6rem;
        padding: 0.85rem 0.1rem;
    }
    .score-level-inline {
        height: 0.98rem;
        padding: 0 0.34rem;
        font-size: 0.5rem;
        letter-spacing: 0.1em;
    }
}

.score-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    padding: 2.5rem 0 1.5rem;
    opacity: 0.65;
}

.score-empty::before {
    content: '—';
    font-size: 1.2rem;
    letter-spacing: -0.05em;
    opacity: 0.4;
}

.score-source {
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    padding: 0.8rem 0 0.2rem;
}

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (hover: none), (pointer: coarse) {
    .mouse-glow { display: none; }
}

@media (max-width: 920px) {
    :root {
        --hdr: 58px;
        --ftr: 40px;
        --safe-top: clamp(14px, env(safe-area-inset-top, 0px), 48px);
        --safe-bottom: 0px;
        --hdr-total: calc(var(--hdr) + var(--safe-top) + 8px);
        --ftr-total: calc(var(--ftr) + var(--safe-bottom));
    }

    #game-wrap {
        bottom: var(--ftr-total) !important;
    }

    .hdr-name {
        display: none;
    }

    .hdr-right {
        gap: 0.5rem;
    }

    .btn-scores,
    .btn-gamemode,
    .btn-account,
    .hdr-notif-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.62rem;
        letter-spacing: 0.1em;
    }

    /* Daily keeps its amber color at all sizes */
    .btn-daily {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
        letter-spacing: 0;
    }

    .gamemode-menu {
        top: calc(100% + 0.3rem);
        padding: 0.35rem;
        gap: 0.35rem;
    }

    .gamemode-item {
        width: 36px;
        height: 32px;
    }

    .btn-label {
        display: none;
    }

    .sound-toggle {
        top: calc(var(--hdr-total) + 0.55rem);
        left: 1rem;
        width: 34px;
        height: 34px;
    }

    .g-box {
        width: min(92vw, 420px);
        padding: 1.2rem;
    }

    .g-btn {
        width: min(280px, 82vw);
        font-size: 0.7rem;
        letter-spacing: 0.14em;
    }

    .g-link {
        font-size: 0.65rem;
        margin-top: 0;
    }

    #username-input {
        width: min(280px, 82vw);
        font-size: 16px;
    }

    .app-header {
        height: var(--hdr-total);
        padding-top: calc(var(--safe-top) + 8px);
    }

    .app-footer {
        height: var(--ftr-total) !important;
        align-items: flex-end;
        grid-template-columns: 1fr auto 1fr;
        gap: 0.35rem;
        padding-top: 0;
        padding-bottom: var(--safe-bottom) !important;
    }

    .fp-nav {
        width: auto;
        justify-content: center;
        flex-wrap: nowrap;
        row-gap: 0;
    }

    .fp-legal {
        width: auto;
        justify-content: center;
    }

    .fp-meta {
        width: 100%;
        text-align: center;
    }

    .cookie-banner {
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        bottom: calc(var(--ftr-total) + 0.2rem);
        padding: 0.62rem 0.66rem;
    }

    .cookie-actions {
        flex-direction: column;
    }

    #toast-container {
        left: 0.75rem;
        right: 0.75rem;
        align-items: stretch;
    }

    .achievement-toast {
        width: 100%;
        min-width: 0;
    }

    .challenge-banner {
        width: calc(100vw - 1rem);
        top: calc(var(--hdr-total) + 0.45rem);
        padding: 0.56rem 0.7rem;
        gap: 0.55rem;
    }

    #challenge-text {
        font-size: 0.62rem;
        letter-spacing: 0.09em;
    }

    .quest-board {
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        top: calc(var(--hdr-total) + 3.2rem);
        bottom: auto;
        padding: 0.55rem 0.6rem;
    }

    /* ── Podium: compact on tablet/mobile ── */
    .daily-podium {
        width: calc(100vw - 1rem);
        bottom: calc(var(--ftr-total) + 0.25rem);
        padding: 0;
    }

    .daily-podium-head {
        margin-bottom: 0.65rem;
    }

    /* Stack as ranked rows: gold on top, then silver, bronze */
    .daily-podium-list,
    .daily-podium-list.entries-1,
    .daily-podium-list.entries-2 {
        grid-template-columns: 1fr;
        grid-template-areas:
            "gold"
            "silver"
            "bronze";
        gap: 0;
    }

    /* Hide floor glow on mobile */
    .daily-podium-list::before { display: none; }

    /* Each card becomes a horizontal row */
    .podium-card {
        --card-pt: 0;
        display: grid;
        grid-template-columns: 2rem 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 0.65rem;
        padding: 0.62rem 0.8rem;
        opacity: 1;
        transform: none;
        animation: none;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        border-radius: 0;
        background: none;
    }

    /* Gold gets a very subtle highlight row */
    .podium-card.podium-gold {
        background: rgba(249,205,71,0.04);
        border-bottom-color: rgba(249,205,71,0.12);
    }

    /* Top accent line stays, others removed */
    .podium-card::before { display: none; }

    /* Remove the platform step */
    .podium-card::after { display: none; }

    .podium-emblem {
        font-size: 1.15rem;
        margin: 0;
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
        justify-self: center;
    }

    .podium-rank {
        grid-column: 2;
        grid-row: 1;
        font-size: 0.44rem;
        letter-spacing: 0.14em;
        align-self: end;
    }

    .podium-name {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.84rem;
        font-weight: 500;
        align-self: start;
    }

    .podium-score {
        grid-column: 3;
        grid-row: 1 / 3;
        font-size: 1.2rem;
        font-weight: 700;
        margin-top: 0;
        align-self: center;
        justify-self: end;
    }

    .daily-podium--mini {
        width: calc(100vw - 1rem);
        bottom: calc(var(--ftr-total) + 0.25rem);
        padding: 0.55rem 0.55rem;
    }
    .daily-podium--mini .daily-podium-head {
        margin-bottom: 0.45rem;
    }
    .daily-podium--mini .daily-podium-list--mini {
        grid-template-columns: 1fr;
        gap: 0.36rem;
    }
    .daily-podium--mini .podium-mini {
        min-height: 50px;
        padding: 0.42rem 0.5rem;
    }
    .daily-podium--mini .podium-mini-score {
        font-size: 1.06rem;
    }
    .daily-podium--mini .podium-mini-name-text {
        font-size: 0.78rem;
    }
    .daily-podium--mini .daily-podium-open {
        min-height: 25px;
        font-size: 0.47rem;
        padding: 0.24rem 0.45rem;
    }
}

@media (display-mode: standalone) {
    :root {
        --safe-top: clamp(14px, env(safe-area-inset-top, 0px), 48px);
        --safe-bottom: 0px;
        --ftr: 40px;
        --hdr-total: calc(var(--hdr) + var(--safe-top) + 8px);
        --ftr-total: calc(var(--ftr) + var(--safe-bottom));
    }

    #game-wrap {
        bottom: 40px !important;
    }

    .app-header {
        height: var(--hdr-total);
        padding-top: calc(var(--safe-top) + 8px);
    }

    .app-footer {
        height: 40px !important;
        bottom: 0 !important;
        align-items: flex-end;
        flex-direction: row;
        justify-content: center;
        padding-top: 0;
        padding-bottom: 0 !important;
    }

    .daily-podium {
        bottom: calc(40px + 0.25rem) !important;
    }
}

html.ios-standalone,
html.ios-standalone body {
    height: var(--ios-vh, 100dvh) !important;
    min-height: var(--ios-vh, 100dvh) !important;
    overflow: hidden !important;
}

html.ios-standalone body {
    position: relative;
}

html.ios-standalone .app-footer {
    position: absolute !important;
    left: 0;
    right: 0;
    bottom: 0 !important;
    height: 40px !important;
    padding-bottom: 0 !important;
    align-items: center !important;
}

html.ios-standalone #game-wrap {
    position: absolute !important;
    top: var(--hdr-total);
    left: 0;
    right: 0;
    bottom: 40px !important;
}

html.ios-standalone .daily-podium {
    bottom: calc(40px + 0.25rem) !important;
}

/* Mobile keyboard mode: keep input flow clean while typing player name */
body.kb-open .app-footer {
    display: none !important;
}

body.kb-open .daily-podium {
    display: none !important;
}

body.kb-open #game-wrap {
    bottom: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .podium-card {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
}

/* Mobile: panel slides up from bottom */
@media (max-width: 580px) {
    :root { --panel-w: 100%; }

    .score-panel {
        top: auto;
        bottom: 0; left: 0;
        width: 100%;
        height: min(74%, 620px);
        border-left: none;
        border-top: 1px solid var(--border);
        transform: translateY(100%);
    }

    .score-panel.open { transform: translateY(0); }

    .account-panel {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: min(78%, 680px);
        border-left: none;
        border-top: 1px solid var(--border);
        transform: translateY(100%);
    }

    .account-panel.open { transform: translateY(0); }

    .ap-content {
        padding: 0.9rem 1rem 1rem;
    }

    .fp-cat { display: none; }

    .fp-meta { display: none; }

    .app-footer {
        grid-template-columns: 1fr;
        justify-items: center;
        row-gap: 0.1rem;
    }

    .fp-nav,
    .fp-legal {
        justify-self: center;
    }

    .fp-legal-link {
        font-size: 0.68rem;
    }

    .fp-link {
        font-size: 0.70rem;
    }

    .g-bigscore {
        font-size: clamp(4rem, 22vw, 7rem);
    }

    .sp-head {
        padding: 1rem 1rem 0.85rem;
    }

    .sp-list {
        padding: 0.5rem 1rem 1.35rem;
    }
}

/* Very small screens */
@media (max-width: 380px) {
    .fp-sep { display: none; }
    .fp-nav { gap: 0.5rem; }
    .fp-link { font-size: 0.65rem; }
}

/* ══════════════════════════════════════════════════════════════
   PROFILE MODAL
   ══════════════════════════════════════════════════════════════ */
.pmo {
    position: fixed;
    inset: 0;
    z-index: 350;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.5rem, 3vw, 2rem);
}
.pmo[hidden] { display: none !important; }

.pmo-bd {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.80);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.pmo-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 940px;
    height: min(88dvh, 820px);
    max-height: 88dvh;
    overflow-y: auto;
    background: rgba(7,7,7,0.98);
    border: 1px solid rgba(255,255,255,0.10);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.10) transparent;
    animation: pmoIn 0.38s var(--ease) both;
}
.pmo-card::-webkit-scrollbar { width: 3px; }
.pmo-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); }

@keyframes pmoIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* close button */
.pmo-x {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--muted);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.80rem;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    outline: none;
}
.pmo-x:hover { color: var(--text); background: rgba(255,255,255,0.10); }

/* ── Hero ── */
.pmo-hero {
    display: flex;
    align-items: center;
    gap: 1.3rem;
    padding: 1.8rem 1.5rem 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(145deg,
        rgba(var(--rank-rgb, var(--accent-rgb)), 0.10) 0%,
        transparent 58%);
    position: relative;
    overflow: hidden;
}
/* top accent line — color follows rank */
.pmo-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(var(--rank-rgb, var(--accent-rgb)), 0.75) 25%,
        rgba(var(--rank-rgb, var(--accent-rgb)), 0.75) 75%,
        transparent 100%);
}
/* subtle background glow */
.pmo-hero::after {
    content: '';
    position: absolute;
    top: -30px;
    left: -20px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle,
        rgba(var(--rank-rgb, var(--accent-rgb)), 0.08) 0%,
        transparent 70%);
    pointer-events: none;
}

.pmo-av {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    background: rgba(var(--rank-rgb, var(--accent-rgb)), 0.12);
    border: 1.5px solid rgba(var(--rank-rgb, var(--accent-rgb)), 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 2.4rem;
    font-weight: 800;
    color: rgb(var(--rank-rgb, var(--accent-rgb)));
    box-shadow: 0 0 30px rgba(var(--rank-rgb, var(--accent-rgb)), 0.20);
    transition: all 0.34s ease;
    position: relative;
    z-index: 1;
}
.pmo-av::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 2px solid transparent;
    box-shadow: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
    background-image: var(--profile-frame-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.pmo-av[data-custom-frame]:not([data-custom-frame="none"])::before {
    opacity: 1;
    border-color: rgba(var(--profile-frame-rgb, var(--accent-rgb)), 0.78);
    box-shadow:
        inset 0 0 0 1px rgba(var(--profile-frame-rgb, var(--accent-rgb)), 0.30),
        0 0 22px rgba(var(--profile-frame-rgb, var(--accent-rgb)), 0.32);
}
.pmo-av[data-custom-frame="profile_frame_aurora_anim"]::before {
    background-image: none !important;
    border-width: 2px;
    border-color: rgba(142,226,255,0.95);
    box-shadow:
        inset 0 0 0 1px rgba(142,226,255,0.34),
        0 0 18px rgba(142,226,255,0.44);
    animation: pmoFrameAuroraPulse 2.8s linear infinite;
}
@keyframes pmoFrameAuroraPulse {
    0% {
        border-color: rgba(142,226,255,0.95);
        box-shadow:
            inset 0 0 0 1px rgba(142,226,255,0.34),
            0 0 18px rgba(142,226,255,0.44);
    }
    33% {
        border-color: rgba(186,139,255,0.96);
        box-shadow:
            inset 0 0 0 1px rgba(186,139,255,0.36),
            0 0 22px rgba(186,139,255,0.48);
    }
    66% {
        border-color: rgba(255,122,211,0.95);
        box-shadow:
            inset 0 0 0 1px rgba(255,122,211,0.35),
            0 0 20px rgba(255,122,211,0.46);
    }
    100% {
        border-color: rgba(142,226,255,0.95);
        box-shadow:
            inset 0 0 0 1px rgba(142,226,255,0.34),
            0 0 18px rgba(142,226,255,0.44);
    }
}

.pmo-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.52rem;
    position: relative;
    z-index: 1;
}

.pmo-nrow {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.pmo-uname {
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

.pmo-flag {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
}

.pmo-level {
    height: 1.18rem;
    padding: 0 0.46rem;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
}

.podium-level-inline {
    height: 0.98rem;
    padding: 0 0.34rem;
    font-size: 0.48rem;
    letter-spacing: 0.11em;
}

.pmo-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.26rem 0.72rem;
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    border: 1px solid;
    width: fit-content;
    transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

/* Badges row (rank pill + team) */
.pmo-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    position: relative;
}

.pmo-rank-tip {
    position: absolute;
    left: 0;
    top: calc(100% + 0.45rem);
    min-width: min(420px, calc(100vw - 3rem));
    max-width: min(520px, calc(100vw - 3rem));
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(8,8,8,0.98);
    box-shadow: 0 14px 32px rgba(0,0,0,0.45);
    padding: 0.58rem 0.62rem;
    z-index: 6;
    pointer-events: none;
}
.pmo-rank-tip[hidden] { display: none !important; }
.pmo-rank-tip.open { animation: pmoTipIn 0.14s ease both; }
@keyframes pmoTipIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.pmo-rank-tip-head {
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.88);
}
.pmo-rank-tip-sub {
    margin-top: 0.22rem;
    font-size: 0.52rem;
    color: rgba(var(--rank-rgb, var(--accent-rgb)), 0.9);
}
.pmo-rank-tip-ladder {
    margin-top: 0.48rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.pmo-rank-tip-item {
    font-size: 0.46rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.14rem 0.32rem;
    border: 1px solid rgba(255,255,255,0.16);
    color: rgba(255,255,255,0.58);
    background: rgba(255,255,255,0.03);
}
.pmo-rank-tip-item.done {
    color: rgba(255,255,255,0.76);
    border-color: rgba(255,255,255,0.28);
}
.pmo-rank-tip-item.cur {
    color: rgb(var(--rank-rgb, var(--accent-rgb)));
    border-color: rgba(var(--rank-rgb, var(--accent-rgb)), 0.52);
    background: rgba(var(--rank-rgb, var(--accent-rgb)), 0.12);
}

.pmo-share {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.42rem;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    padding: 0.28rem 0.32rem 0.28rem 0.42rem;
    max-width: 100%;
}
.pmo-share > i {
    font-size: 0.54rem;
    color: rgba(255,255,255,0.55);
}
.pmo-share-link {
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pmo-share-link:hover {
    color: rgb(var(--rank-rgb, var(--accent-rgb)));
}
.pmo-share-copy {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.8);
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.62rem;
}
.pmo-share-copy:hover {
    border-color: rgba(var(--rank-rgb, var(--accent-rgb)), 0.45);
    color: rgb(var(--rank-rgb, var(--accent-rgb)));
    background: rgba(var(--rank-rgb, var(--accent-rgb)), 0.12);
}

.pmo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}
.pmo-actions[hidden] { display: none !important; }
.pmo-action-btn {
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.82);
    font-family: var(--font-body);
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    min-height: 31px;
    padding: 0.34rem 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s, opacity 0.18s;
}
.pmo-action-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.28);
    color: var(--text);
}
.pmo-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.pmo-action-btn--friend {
    border-color: rgba(74,222,128,0.35);
    color: rgba(134,239,172,0.95);
    background: rgba(74,222,128,0.09);
}
.pmo-action-btn--friend:hover {
    border-color: rgba(74,222,128,0.58);
    background: rgba(74,222,128,0.16);
}
/* Team badge */
.pmo-team {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.20rem 0.60rem;
    font-size: 0.54rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.04);
    width: fit-content;
    transition: opacity 0.3s;
}
.pmo-team[hidden] { display: none; }
.pmo-team i { font-size: 0.5rem; opacity: 0.75; }

.pmo-admin {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    padding: 0.20rem 0.60rem;
    font-size: 0.52rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    border: 1px solid rgba(251,146,60,0.34);
    color: rgba(251,191,36,0.92);
    background: rgba(251,146,60,0.10);
}
.pmo-admin[hidden] { display: none; }

.pmo-cbadge {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    padding: 0.20rem 0.60rem;
    font-size: 0.52rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    border: 1px solid rgba(var(--accent-rgb),0.40);
    color: rgba(255,255,255,0.92);
    background: rgba(var(--accent-rgb),0.10);
}
.pmo-cbadge i {
    font-size: 0.54rem;
    color: var(--accent);
}
.pmo-cbadge.pmo-cbadge--sponsor {
    border: 1px solid rgba(96,165,250,0.48);
    color: rgba(191,219,254,0.96);
    background: rgba(37,99,235,0.20);
    box-shadow:
        inset 0 0 0 1px rgba(147,197,253,0.16),
        0 0 12px rgba(59,130,246,0.18);
}
.pmo-cbadge.pmo-cbadge--sponsor i {
    color: rgba(147,197,253,0.98);
}
.pmo-cbadge[hidden] { display: none; }

/* ── Tier track ── */
.pmo-ttrack {
    padding: 1rem 1.5rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pmo-tiers {
    display: flex;
    align-items: flex-start;
    position: relative;
}
/* connecting line */
.pmo-tiers::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 11px;
    right: 11px;
    height: 1px;
    background: rgba(255,255,255,0.07);
}

.pmo-tstep {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.38rem;
    position: relative;
}
.pmo-tstep::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.35rem);
    transform: translateX(-50%);
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(8,8,8,0.96);
    color: rgba(255,255,255,0.86);
    font-size: 0.44rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0.2rem 0.36rem;
    opacity: 0;
    pointer-events: none;
    z-index: 4;
    transition: opacity 0.14s ease;
}
.pmo-tstep:hover::after,
.pmo-tstep:focus-within::after {
    opacity: 1;
}

.pmo-tdot {
    width: 21px;
    height: 21px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,0.18);
    transition: border-color 0.3s ease, background 0.3s ease,
                box-shadow 0.3s ease, color 0.3s ease;
}

.pmo-tstep.done .pmo-tdot {
    border-color: rgba(var(--rank-rgb, var(--accent-rgb)), 0.45);
    background:   rgba(var(--rank-rgb, var(--accent-rgb)), 0.10);
    color: rgba(255,255,255,0.40);
}
.pmo-tstep.cur .pmo-tdot {
    border-color: rgb(var(--rank-rgb, var(--accent-rgb)));
    background:   rgba(var(--rank-rgb, var(--accent-rgb)), 0.22);
    box-shadow: 0 0 16px rgba(var(--rank-rgb, var(--accent-rgb)), 0.55);
    color: rgb(var(--rank-rgb, var(--accent-rgb)));
}

.pmo-tlbl {
    font-size: 0.37rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,0.20);
    text-align: center;
    line-height: 1.2;
    transition: color 0.3s ease;
}
.pmo-tstep.done .pmo-tlbl { color: rgba(255,255,255,0.35); }
.pmo-tstep.cur  .pmo-tlbl {
    color: rgb(var(--rank-rgb, var(--accent-rgb)));
    font-weight: 600;
}

.pmo-tnext {
    flex: 0 0 auto;
    align-self: center;
    margin: 0 0.32rem;
    font-size: 0.52rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.46);
    transform: translateY(-0.5rem);
    white-space: nowrap;
}
.pmo-tnext.done {
    color: rgba(255,255,255,0.72);
}

/* ── Stats grid ── */
.pmo-srow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pmo-st {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 1.05rem 0.4rem;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.pmo-st:last-child { border-right: none; }

.pmo-st b {
    font-family: var(--font-head);
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: rgba(214,217,225,0.84);
    line-height: 1;
}
.pmo-st--streak b { color: #ff8c14; }

.pmo-st span {
    font-size: 0.47rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

/* ── Sections ── */
.pmo-sec {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pmo-sec--last {
    border-bottom: none;
    padding-bottom: 1.6rem;
}

.pmo-sh {
    font-size: 0.53rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}
.pmo-acn {
    color: rgba(var(--accent-rgb),0.78);
    margin-left: auto;
}

/* ── Rank row ── */
.pmo-rrow {
    display: flex;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
}
.pmo-rrow--single .pmo-rc {
    align-items: flex-start;
    padding-left: 1.1rem;
}
.pmo-rc {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    padding: 0.9rem 0.5rem;
}
.pmo-rdiv {
    width: 1px;
    background: rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.pmo-rn {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: rgba(212,216,225,0.8);
    line-height: 1;
}
.pmo-rc span:last-child {
    font-size: 0.47rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

/* ── Rank progress bar ── */
.pmo-prog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.52rem;
}
.pmo-prog-meta span:first-child,
.pmo-prog-meta span:last-child {
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.42);
}
.pmo-pv {
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: rgb(var(--rank-rgb, var(--accent-rgb)));
    opacity: 0.88;
}
.pmo-pbar {
    height: 3px;
    background: rgba(255,255,255,0.07);
    overflow: hidden;
}
.pmo-pfill {
    height: 100%;
    background: linear-gradient(90deg,
        rgba(var(--rank-rgb, var(--accent-rgb)), 0.55),
        rgb(var(--rank-rgb, var(--accent-rgb))));
    transition: width 0.9s var(--ease);
}

/* ── Achievements ── */
.pmo-achgrid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.62rem;
}
.pmo-ai {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    background:
        radial-gradient(circle at 32% 24%, rgba(255,255,255,0.14), rgba(255,255,255,0.03) 42%, rgba(0,0,0,0.35) 100%),
        linear-gradient(145deg, rgba(10,16,26,0.95), rgba(4,7,12,0.96));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.16),
        0 6px 16px rgba(0,0,0,0.45);
    transition: color 0.2s ease, transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.pmo-ai.on {
    opacity: 1;
    border-color: rgba(var(--rank-rgb, var(--accent-rgb)), 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.26),
        0 0 0 1px rgba(var(--rank-rgb, var(--accent-rgb)), 0.25),
        0 10px 24px rgba(var(--rank-rgb, var(--accent-rgb)), 0.24);
}
.pmo-ai-ic {
    font-size: 1.9rem;
    line-height: 1;
    filter: grayscale(1) opacity(0.35);
    transition: filter 0.3s ease;
}
.pmo-ai.on .pmo-ai-ic { filter: none; color: rgb(var(--rank-rgb, var(--accent-rgb))); }
.pmo-ai:not(.on) { opacity: 0.55; }
.pmo-ai:hover {
    transform: translateY(-2px) scale(1.04);
    border-color: rgba(255,255,255,0.34);
}

/* ── Responsive ── */
@media (max-width: 580px) {
    .pmo {
        padding: 0;
        align-items: flex-end;
    }
    .pmo-card {
        width: 100%;
        max-width: 100%;
        max-height: 93dvh;
        border-left: none;
        border-right: none;
        border-bottom: none;
        animation: pmoInMobile 0.38s var(--ease) both;
    }
    @keyframes pmoInMobile {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .pmo-srow {
        grid-template-columns: repeat(2, 1fr);
    }
    .pmo-av {
        width: 78px;
        height: 78px;
        font-size: 2.1rem;
    }
    .pmo-av::before {
        inset: -6px;
    }
    .pmo-achgrid { gap: 0.46rem; }
    .pmo-rank-tip {
        left: 0;
        right: 0;
        min-width: 0;
        max-width: 100%;
    }
    .pmo-tnext {
        font-size: 0.44rem;
        margin: 0 0.16rem;
        transform: translateY(-0.42rem);
    }
    .pmo-st:nth-child(2) {
        border-right: 1px solid rgba(255,255,255,0.06);
    }
    .pmo-st:nth-child(3),
    .pmo-st:nth-child(4) {
        border-top: 1px solid rgba(255,255,255,0.06);
    }
}

@media (max-width: 480px) {
    .pmo-achgrid { gap: 0.36rem; }
    .pmo-ai {
        width: 44px;
        height: 44px;
    }
    .pmo-ai-ic {
        font-size: 1.58rem;
    }
}

/* ── HEADER USER DROPDOWN ─────────────────────────────────────── */
.hdr-udrop {
    position: relative;
}
.hdr-udrop[hidden] { display: none; }

.hdr-udrop-toggle {
    background: rgba(255,255,255,0.085);
    border: 1px solid rgba(255,255,255,0.42);
    color: rgba(245,245,245,0.92);
    display: inline-flex;
    align-items: center;
    gap: 0.52rem;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    min-height: 36px;
    padding: 0.42rem 0.8rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
.hdr-udrop-toggle:hover,
.hdr-udrop-toggle[aria-expanded="true"] {
    color: #ffffff;
    border-color: rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.14);
    box-shadow: 0 0 16px rgba(255,255,255,0.16);
}

.hdr-udrop-av {
    width: 22px; height: 22px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.52);
    color: rgba(255,255,255,0.95);
    font-size: 0.58rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hdr-udrop-caret {
    font-size: 0.52rem;
    opacity: 0.55;
    transition: transform 0.2s;
}
.hdr-udrop-toggle[aria-expanded="true"] .hdr-udrop-caret {
    transform: rotate(180deg);
}

/* Dropdown menu */
.hdr-udrop-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #111;
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.4);
    z-index: 200;
    padding: 0.3rem 0;
    animation: udropIn 0.15s ease both;
}
.hdr-udrop-menu[hidden] { display: none; }

@keyframes udropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* User header inside dropdown */
.hdr-udrop-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.65rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 0.3rem;
    pointer-events: none;
}
.hdr-udrop-uav {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.42);
    color: rgba(255,255,255,0.95);
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.hdr-udrop-uinfo { min-width: 0; }
.hdr-udrop-level-badge {
    height: 1.02rem;
    padding: 0 0.38rem;
    font-size: 0.5rem;
    letter-spacing: 0.11em;
    border-color: rgba(255,255,255,0.30);
    color: rgba(255,255,255,0.76);
    background: rgba(255,255,255,0.07);
    box-shadow: none;
}
.hdr-udrop-uname-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}
.hdr-udrop-uname {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hdr-udrop-urank {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
    margin-top: 0.15rem;
}

.hdr-udrop-admin-badge {
    margin-top: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.15rem 0.34rem;
    border: 1px solid rgba(251,146,60,0.32);
    background: rgba(251,146,60,0.10);
    color: rgba(251,191,36,0.9);
    font-size: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    width: fit-content;
}
.hdr-udrop-admin-badge[hidden] { display: none; }

/* Menu items */
.hdr-udrop-item {
    width: 100%;
    background: none;
    border: none;
    color: rgba(255,255,255,0.62);
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 0.58rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    text-align: left;
    white-space: nowrap;
}
.hdr-udrop-item:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.hdr-udrop-item i { width: 14px; text-align: center; font-size: 0.65rem; opacity: 0.75; flex-shrink: 0; }
.hdr-udrop-item:hover i { opacity: 1; }

.hdr-udrop-item--accent { color: var(--accent); }
.hdr-udrop-item--accent i { opacity: 1; }
.hdr-udrop-item--accent:hover { background: rgba(var(--accent-rgb),0.08); color: var(--accent); }

.hdr-udrop-item--admin { color: rgba(251,146,60,0.80); }
.hdr-udrop-item--admin i { opacity: 1; }
.hdr-udrop-item--admin:hover { background: rgba(251,146,60,0.08); color: rgba(251,146,60,1); }

.hdr-udrop-item--danger { color: rgba(248,113,113,0.75); }
.hdr-udrop-item--danger i { opacity: 1; }
.hdr-udrop-item--danger:hover { background: rgba(239,68,68,0.08); color: rgba(248,113,113,1); }

.hdr-udrop-item[hidden] { display: none; }

.hdr-udrop-sep {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 0.3rem 0;
}
.hdr-udrop-sep[hidden] { display: none; }

/* ── ADMIN / TICKET MODAL ─────────────────────────────────────── */
.adm {
    position: fixed;
    inset: 0;
    z-index: 310;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.adm[hidden] { display: none; }

.adm-bd {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.adm-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    max-height: 88dvh;
    background: #0e0e0e;
    border: 1px solid rgba(251,146,60,0.20);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 32px 80px rgba(0,0,0,0.65),
                0 0 60px rgba(251,146,60,0.04);
    display: flex;
    flex-direction: column;
    animation: admIn 0.30s var(--ease) both;
    overflow: hidden;
}

#adm .adm-card {
    max-width: 940px;
    height: min(88dvh, 820px);
    max-height: 88dvh;
}

@keyframes admIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.adm-x {
    position: absolute;
    top: 0.85rem; right: 0.85rem;
    width: 28px; height: 28px;
    background: none;
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: color 0.15s, background 0.15s;
    z-index: 2;
}
.adm-x:hover { color: var(--text); background: rgba(255,255,255,0.08); }

/* Admin modal header */
.adm-hdr {
    padding: 1.1rem 1.4rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}
.adm-hdr-icon {
    width: 30px; height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251,146,60,0.10);
    border: 1px solid rgba(251,146,60,0.25);
    color: rgba(251,146,60,0.90);
    font-size: 0.72rem;
    flex-shrink: 0;
}
.adm-hdr-title {
    font-family: var(--font-head);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}
.adm-hdr-sub {
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin-top: 0.1rem;
}

/* Ticket modal in shop-like style */
#tkt .adm-card {
    max-width: 940px;
    height: min(88dvh, 820px);
    max-height: 88dvh;
    background: #0c0c0c;
    border: 1px solid rgba(var(--accent-rgb),0.22);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6),
                0 32px 80px rgba(0,0,0,0.65),
                0 0 80px rgba(var(--accent-rgb),0.08);
}

#cnt .adm-card {
    max-width: 940px;
    height: min(88dvh, 820px);
    max-height: 88dvh;
    background: #0c0c0c;
    border: 1px solid rgba(var(--accent-rgb),0.22);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6),
                0 32px 80px rgba(0,0,0,0.65),
                0 0 80px rgba(var(--accent-rgb),0.08);
}
#cnt .adm-hdr {
    padding: 1.05rem 1.4rem 0.92rem;
    gap: 1rem;
}
#cnt .adm-hdr-icon {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
    background: rgba(var(--accent-rgb),0.12);
    border: 1px solid rgba(var(--accent-rgb),0.32);
    color: rgba(var(--accent-rgb),0.92);
}
#cnt .adm-hdr-title {
    font-size: 1.18rem;
    letter-spacing: -0.015em;
    line-height: 1.1;
}
#cnt #contact-body {
    min-height: 220px;
}
#cnt .adm-contact-intro {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    margin: 0 0 0.95rem;
    padding: 0.78rem 0.86rem;
    border: 1px solid rgba(var(--accent-rgb),0.24);
    background: linear-gradient(180deg, rgba(var(--accent-rgb),0.08), rgba(var(--accent-rgb),0.03));
}
#cnt .adm-contact-intro-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--accent-rgb),0.38);
    color: rgba(var(--accent-rgb),0.95);
    background: rgba(var(--accent-rgb),0.14);
    font-size: 0.68rem;
    flex-shrink: 0;
}
#cnt .adm-contact-intro-copy {
    min-width: 0;
}
#cnt .adm-contact-intro-title {
    margin: 0 0 0.2rem;
    font-family: var(--font-head);
    font-size: 0.80rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text);
}
#cnt .adm-contact-intro-text {
    margin: 0;
    font-size: 0.62rem;
    line-height: 1.55;
    color: rgba(255,255,255,0.70);
}
#cnt .adm-contact-mail-link {
    display: inline-block;
    margin-top: 0.46rem;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: rgba(var(--accent-rgb),0.96);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--accent-rgb),0.45);
}
#cnt .adm-contact-mail-link:hover {
    color: rgba(var(--accent-rgb),1);
    border-bottom-color: rgba(var(--accent-rgb),0.85);
}

#imp .adm-card,
#dps .adm-card {
    max-width: 940px;
    height: min(88dvh, 820px);
    max-height: 88dvh;
    background: #0c0c0c;
    border: 1px solid rgba(var(--accent-rgb),0.22);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6),
                0 32px 80px rgba(0,0,0,0.65),
                0 0 80px rgba(var(--accent-rgb),0.08);
}

#imp .adm-hdr,
#dps .adm-hdr {
    padding: 1.05rem 1.4rem 0.92rem;
    gap: 1rem;
}

#imp .adm-hdr-icon,
#dps .adm-hdr-icon {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
    background: rgba(var(--accent-rgb),0.12);
    border: 1px solid rgba(var(--accent-rgb),0.32);
    color: rgba(var(--accent-rgb),0.92);
}

#imp .adm-hdr-title,
#dps .adm-hdr-title {
    font-size: 1.18rem;
    letter-spacing: -0.015em;
    line-height: 1.1;
}

.adm-legal {
    display: grid;
    gap: 0.6rem;
    font-size: 0.68rem;
    line-height: 1.55;
    color: rgba(255,255,255,0.86);
}

.adm-legal h3 {
    margin: 0.25rem 0 0;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255,255,255,0.72);
}

.adm-legal p,
.adm-legal address {
    color: rgba(255,255,255,0.82);
}

.adm-legal address {
    font-style: normal;
}

.adm-legal a {
    color: rgba(var(--accent-rgb),0.96);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--accent-rgb),0.45);
}

.adm-legal a:hover {
    color: rgba(var(--accent-rgb),1);
    border-bottom-color: rgba(var(--accent-rgb),0.85);
}

#tkt .adm-hdr {
    padding: 1.05rem 1.4rem 0.92rem;
    gap: 1rem;
}

#tkt .adm-hdr-icon {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
    background: rgba(var(--accent-rgb),0.12);
    border: 1px solid rgba(var(--accent-rgb),0.32);
    color: rgba(var(--accent-rgb),0.92);
}

#tkt .adm-hdr-title {
    font-size: 1.18rem;
    letter-spacing: -0.015em;
    line-height: 1.1;
}

#tkt .adm-tabs {
    padding: 0 1rem;
    gap: 0.1rem;
}

#tkt .adm-tab.active {
    color: rgba(var(--accent-rgb),0.92);
    border-bottom-color: rgba(var(--accent-rgb),0.86);
}

#tkt .adm-body {
    padding: 1.2rem 1.4rem;
}

#tkt .adm-form-input,
#tkt .adm-form-select,
#tkt .adm-form-textarea {
    background: rgba(255,255,255,0.03);
}

#tkt .tkt-panel form {
    width: 100%;
    max-width: none;
}

#tkt #ticket-body {
    min-height: 210px;
}

/* Tabs */
.adm-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    padding: 0 1rem;
    gap: 0.1rem;
}
.adm-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.60rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 0.7rem 0.8rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.adm-tab:hover { color: var(--text); }
.adm-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.adm-tab[hidden] { display: none; }

/* Body */
.adm-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.1rem 1.4rem;
    scroll-behavior: smooth;
}
.adm-body::-webkit-scrollbar { width: 4px; }
.adm-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }

.adm-panel[hidden] { display: none; }

/* Ticket form */
.adm-form-label {
    display: block;
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin-bottom: 0.35rem;
    margin-top: 0.9rem;
}
.adm-form-label:first-child { margin-top: 0; }

.adm-form-input,
.adm-form-select,
.adm-form-textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.70rem;
    padding: 0.55rem 0.75rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.adm-form-input:focus,
.adm-form-select:focus,
.adm-form-textarea:focus {
    border-color: rgba(var(--accent-rgb),0.55);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.08);
}
.adm-form-textarea { resize: vertical; min-height: 90px; }
.adm-form-select option { background: #111; }
.adm-form-select-wrap {
    position: relative;
}
.adm-form-select-icon {
    position: absolute;
    left: 0.72rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.66rem;
    color: rgba(var(--accent-rgb),0.92);
    pointer-events: none;
}
.adm-form-select-wrap .adm-form-select {
    padding-left: 1.95rem;
}

.adm-form-btn {
    margin-top: 1rem;
    background: rgba(var(--accent-rgb),0.12);
    border: 1px solid rgba(var(--accent-rgb),0.40);
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}
.adm-form-btn:hover {
    background: rgba(var(--accent-rgb),0.20);
    border-color: rgba(var(--accent-rgb),0.70);
}
.adm-form-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Ticket list items */
.adm-ticket-item {
    border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 0.55rem;
    transition: border-color 0.15s;
    cursor: pointer;
}
.adm-ticket-item:hover { border-color: rgba(255,255,255,0.15); }

.adm-ticket-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
}
.adm-ticket-subj {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.adm-ticket-meta {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-top: 0.2rem;
}
.adm-ticket-status {
    font-size: 0.50rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 600;
    padding: 0.18rem 0.52rem;
    border: 1px solid;
    white-space: nowrap;
    flex-shrink: 0;
}
.adm-ticket-status--open   { color: rgba(74,222,128,0.90);  border-color: rgba(74,222,128,0.35); }
.adm-ticket-status--working{ color: rgba(59,130,246,0.92);  border-color: rgba(59,130,246,0.40); }
.adm-ticket-status--review { color: rgba(251,146,60,0.90);  border-color: rgba(251,146,60,0.35); }
.adm-ticket-status--closed { color: rgba(255,255,255,0.30); border-color: rgba(255,255,255,0.15); }

/* Ticket expanded body */
.adm-ticket-expand {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 0.75rem 0.9rem;
    background: rgba(255,255,255,0.02);
}
.adm-ticket-expand[hidden] { display: none; }
.adm-ticket-body {
    font-size: 0.66rem;
    color: rgba(255,255,255,0.70);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.adm-ticket-answer {
    margin-top: 0.7rem;
    padding: 0.7rem;
    border: 1px solid rgba(var(--accent-rgb),0.20);
    background: rgba(var(--accent-rgb),0.05);
}
.adm-ticket-answer-label {
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(var(--accent-rgb),0.85);
    margin-bottom: 0.34rem;
}
.adm-ticket-answer-body {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.82);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.adm-ticket-reply-wrap {
    margin-top: 0.7rem;
}
.adm-ticket-reply-label {
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 0.34rem;
}
.adm-ticket-reply-input {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.14);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.62rem;
    line-height: 1.55;
    padding: 0.58rem 0.68rem;
    box-sizing: border-box;
}
.adm-ticket-reply-input:focus {
    outline: none;
    border-color: rgba(var(--accent-rgb),0.52);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.10);
}
.adm-ticket-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.7rem;
    flex-wrap: wrap;
}
.adm-ticket-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.adm-ticket-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); border-color: rgba(255,255,255,0.25); }
.adm-ticket-btn--close:hover { border-color: rgba(248,113,113,0.40); color: rgba(248,113,113,0.85); background: rgba(239,68,68,0.06); }
.adm-ticket-btn--review:hover { border-color: rgba(251,146,60,0.40); color: rgba(251,146,60,0.90); background: rgba(251,146,60,0.06); }

/* Section headings inside panels */
.adm-sec-title {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0.55rem;
    margin-bottom: 0.75rem;
    margin-top: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.adm-sec-title:first-child { margin-top: 0; }
.adm-sec-title i { font-size: 0.55rem; opacity: 0.65; }

/* Empty state */
.adm-empty {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.60rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
}

/* Moderation panel wraps the existing admin-tools */
#admin-tools {
    padding: 0 !important;
    border: none !important;
    background: none !important;
    margin: 0;
}

/* Status indicator badge */
.adm-badge {
    font-size: 0.52rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border: 1px solid rgba(251,146,60,0.35);
    color: rgba(251,146,60,0.85);
    margin-left: auto;
}

@media (max-width: 580px) {
    .adm { padding: 0; align-items: flex-end; }
    .adm-card {
        max-width: 100%;
        max-height: 93dvh;
        border-left: none; border-right: none; border-bottom: none;
        animation: admInMobile 0.32s var(--ease) both;
    }
    @keyframes admInMobile {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .hdr-udrop-name { display: none; }
    .hdr-udrop-caret { display: none; }
    .hdr-udrop-level-badge {
        height: 0.96rem;
        padding: 0 0.3rem;
        font-size: 0.52rem;
        letter-spacing: 0.09em;
    }
}

/* ── SETTINGS MODAL ───────────────────────────────────────────── */
.stg {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.stg[hidden] { display: none; }

.stg-bd {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cfm {
    z-index: 360;
}

.cfm-card {
    width: min(460px, calc(100vw - 1.5rem));
    max-width: 100%;
}

.cfm-hdr {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.8rem;
}

.cfm-hdr-icon {
    color: rgba(255,170,95,0.95);
    border-color: rgba(255,170,95,0.45);
    background: rgba(255,170,95,0.10);
}

.cfm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.stg-card {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-width: 760px;
    max-height: 88dvh;
    background: #0e0e0e;
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 28px 70px rgba(0,0,0,0.60);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: stgIn 0.28s var(--ease) both;
}

@keyframes stgIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

.stg-x {
    position: absolute;
    top: 0.85rem; right: 0.85rem;
    width: 28px; height: 28px;
    background: none;
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: color 0.15s, background 0.15s;
    z-index: 2;
}
.stg-x:hover { color: var(--text); background: rgba(255,255,255,0.08); }

/* Header */
.stg-hdr {
    padding: 1.1rem 1.4rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}
.stg-hdr-icon {
    width: 30px; height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb),0.10);
    border: 1px solid rgba(var(--accent-rgb),0.25);
    color: var(--accent);
    font-size: 0.72rem;
    flex-shrink: 0;
}
.stg-hdr-title {
    font-family: var(--font-head);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}
.stg-hdr-sub {
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin-top: 0.1rem;
}

/* Settings modal: align header style with shop/support modal */
#stg .stg-card {
    width: 100%;
    max-width: 940px;
    height: min(88dvh, 820px);
    max-height: 88dvh;
    background: #0c0c0c;
    border: 1px solid rgba(var(--accent-rgb),0.22);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6),
                0 32px 80px rgba(0,0,0,0.65),
                0 0 80px rgba(var(--accent-rgb),0.08);
}

#stg .stg-hdr {
    padding: 1.05rem 1.4rem 0.92rem;
    gap: 1rem;
}

#stg .stg-hdr-icon {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
    background: rgba(var(--accent-rgb),0.12);
    border: 1px solid rgba(var(--accent-rgb),0.32);
    color: rgba(var(--accent-rgb),0.92);
}

#stg .stg-hdr-title {
    font-size: 1.18rem;
    letter-spacing: -0.015em;
    line-height: 1.1;
}

#stg .stg-tab.active {
    color: rgba(var(--accent-rgb),0.92);
    border-bottom-color: rgba(var(--accent-rgb),0.86);
}

/* Tabs */
.stg-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    padding: 0 1rem;
    gap: 0.1rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.stg-tabs::-webkit-scrollbar { display: none; }
.stg-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.60rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 0.7rem 0.8rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.stg-tab:hover { color: var(--text); }
.stg-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* Settings tabs: equal width like shop modal */
#stg .stg-tabs {
    padding: 0;
    gap: 0;
}
#stg .stg-tab {
    flex: 1 0 132px;
    min-width: 132px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.76rem 0.6rem;
}

#stg .stg-body {
    height: 100%;
}

#stg .stg-panel {
    min-height: 100%;
    box-sizing: border-box;
}

/* Body */
.stg-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem 1.4rem;
    scroll-behavior: smooth;
}
.stg-body::-webkit-scrollbar { width: 4px; }
.stg-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }

.stg-panel[hidden] { display: none; }

/* Section title */
.stg-sec {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0.5rem;
    margin-bottom: 0.85rem;
    margin-top: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.stg-sec:first-child { margin-top: 0; }
.stg-sec i { font-size: 0.52rem; opacity: 0.65; }

/* Info row */
.stg-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stg-info-row:last-child { border-bottom: none; }
.stg-info-key {
    font-size: 0.60rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}
.stg-info-val {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text);
}

/* Form elements (reuse adm styles) */
.stg-label {
    display: block;
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin-bottom: 0.35rem;
    margin-top: 0.9rem;
}
.stg-label:first-child { margin-top: 0; }
.stg-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.70rem;
    padding: 0.55rem 0.75rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.stg-input:focus {
    border-color: rgba(var(--accent-rgb),0.55);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.08);
}
.stg-btn {
    margin-top: 0.9rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.14);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}
.stg-btn:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.25); }
.stg-btn--accent {
    background: rgba(var(--accent-rgb),0.10);
    border-color: rgba(var(--accent-rgb),0.35);
    color: var(--accent);
}
.stg-btn--accent:hover { background: rgba(var(--accent-rgb),0.18); border-color: rgba(var(--accent-rgb),0.60); }
.stg-btn--danger { color: rgba(248,113,113,0.80); border-color: rgba(239,68,68,0.25); background: rgba(239,68,68,0.05); }
.stg-btn--danger:hover { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.50); color: rgba(248,113,113,1); }

/* Skin selector */
.stg-skins {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-top: 0.2rem;
}
.stg-skin {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: none;
    text-align: left;
    color: rgba(255,255,255,0.55);
    font-family: var(--font-body);
    font-size: 0.60rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.stg-skin:hover { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.03); color: var(--text); }
.stg-skin.active { border-color: var(--stg-skin-color, rgba(255,255,255,0.5)); background: rgba(255,255,255,0.04); color: var(--text); }
.stg-skin[hidden] { display: none !important; }
.stg-skin.stg-skin--disabled {
    opacity: 0.42;
    cursor: not-allowed;
    border-color: rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.015);
}
.stg-skin.stg-skin--disabled:hover {
    border-color: rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.015);
    color: rgba(255,255,255,0.55);
}
.stg-skin-dot {
    width: 18px; height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.15);
}
.stg-bird-dot {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
}
.stg-bird-dot-canvas {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
}
.stg-bird-dot--missing {
    border-style: dashed;
    border-color: rgba(255,120,120,0.7);
}
.stg-skin-name { font-weight: 500; }
.stg-choice-dot {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.06);
}
.stg-choice-dot i {
    font-size: 0.54rem;
    opacity: 0.9;
    color: rgba(255,255,255,0.86);
}
.stg-choice-dot--frame {
    background: transparent;
    border: 2px solid rgba(var(--stg-frame-rgb,255,255,255),0.82);
    box-shadow: inset 0 0 0 1px rgba(var(--stg-frame-rgb,255,255,255),0.26);
}
.stg-profile-frame.active .stg-choice-dot--frame {
    box-shadow:
        inset 0 0 0 1px rgba(var(--stg-frame-rgb,255,255,255),0.40),
        0 0 14px rgba(var(--stg-frame-rgb,255,255,255),0.34);
}
.stg-shape-dot {
    background: rgba(255,255,255,0.92);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 0 8px rgba(255,255,255,0.2);
}
.stg-shape-dot--square { border-radius: 3px; }
.stg-shape-dot--circle { border-radius: 50%; }
.stg-shape-dot--diamond {
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.stg-shape-dot--triangle {
    border-radius: 0;
    clip-path: polygon(50% 4%, 96% 92%, 4% 92%);
}
.stg-shape-dot--hexagon {
    border-radius: 0;
    clip-path: polygon(25% 6%, 75% 6%, 96% 50%, 75% 94%, 25% 94%, 4% 50%);
}
.stg-shape-dot--star {
    border-radius: 0;
    clip-path: polygon(50% 3%, 61% 35%, 95% 35%, 68% 55%, 79% 91%, 50% 71%, 21% 91%, 32% 55%, 5% 35%, 39% 35%);
}
.stg-bird-dot--classic {
    border-radius: 3px;
    background: linear-gradient(135deg, #f3f4f6 0%, #cfd3da 100%);
}
.stg-bird-dot--pixie {
    border-radius: 3px;
    background-image: url('assets/skin/Pixie_fly.png');
    background-size: 400% 400%;
    background-position: 0% 0%;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

/* Active state in Spiel + Profil tabs should follow current farbschema */
#stg-panel-game .stg-skin.active,
#stg-panel-profile .stg-skin.active {
    border-color: rgba(var(--accent-rgb),0.72);
    background: rgba(var(--accent-rgb),0.12);
    color: rgba(var(--accent-rgb),0.96);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb),0.16), inset 0 0 0 1px rgba(var(--accent-rgb),0.14);
}

#stg-panel-game .stg-skin.active .stg-skin-name,
#stg-panel-profile .stg-skin.active .stg-skin-name {
    color: rgba(var(--accent-rgb),0.98);
}

#stg-panel-game .stg-skin.active .stg-choice-dot,
#stg-panel-profile .stg-skin.active .stg-choice-dot {
    border-color: rgba(var(--accent-rgb),0.65);
    background: rgba(var(--accent-rgb),0.16);
}

#stg-panel-game .stg-skin.active .stg-choice-dot i,
#stg-panel-profile .stg-skin.active .stg-choice-dot i {
    color: rgba(var(--accent-rgb),0.98);
}

/* Toggle */
.stg-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.stg-toggle-row:last-child { border-bottom: none; }
.stg-toggle-label {
    font-size: 0.64rem;
    color: rgba(255,255,255,0.70);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.stg-toggle-desc {
    font-size: 0.55rem;
    color: var(--muted);
    margin-top: 0.2rem;
    text-transform: none;
    letter-spacing: 0;
}

/* Settings toggles (Homepage + Notifications) */
#stg-panel-homepage .ap-toggle,
#stg-panel-notifications .ap-toggle {
    margin-top: 0;
    position: relative;
    width: 42px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#stg-panel-homepage .ap-toggle input,
#stg-panel-notifications .ap-toggle input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

#stg-panel-homepage .ap-toggle span,
#stg-panel-notifications .ap-toggle span {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255,255,255,0.20);
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

#stg-panel-homepage .ap-toggle span::before,
#stg-panel-notifications .ap-toggle span::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 1px 3px rgba(0,0,0,0.45);
    transform: translate(0, -50%);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#stg-panel-homepage .ap-toggle input:checked + span,
#stg-panel-notifications .ap-toggle input:checked + span {
    border-color: rgba(var(--accent-rgb),0.70);
    background: rgba(var(--accent-rgb),0.24);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb),0.18), 0 0 14px rgba(var(--accent-rgb),0.20);
}

#stg-panel-homepage .ap-toggle input:checked + span::before,
#stg-panel-notifications .ap-toggle input:checked + span::before {
    transform: translate(20px, -50%);
    background: rgba(var(--accent-rgb),0.98);
    box-shadow: 0 0 10px rgba(var(--accent-rgb),0.55);
}

#stg-panel-homepage .ap-toggle input:focus-visible + span,
#stg-panel-notifications .ap-toggle input:focus-visible + span {
    border-color: rgba(var(--accent-rgb),0.85);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.20);
}

/* Hint text */
.stg-hint {
    font-size: 0.58rem;
    color: var(--muted);
    margin-top: 0.6rem;
    line-height: 1.5;
}

/* Password strength meter */
.stg-pw-meter {
    height: 3px;
    background: rgba(255,255,255,0.08);
    margin-top: 0.4rem;
    overflow: hidden;
}
.stg-pw-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background 0.3s;
}

/* Danger zone */
.stg-danger-box {
    border: 1px solid rgba(239,68,68,0.20);
    padding: 0.9rem 1rem;
    background: rgba(239,68,68,0.04);
    margin-top: 0.5rem;
}
.stg-danger-title {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(248,113,113,0.70);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width: 580px) {
    .stg { padding: 0; align-items: flex-end; }
    .stg-card {
        max-width: 100%;
        max-height: 93dvh;
        border-left: none; border-right: none; border-bottom: none;
        animation: stgInMob 0.30s var(--ease) both;
    }
    @keyframes stgInMob {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .stg-skins { grid-template-columns: repeat(2, 1fr); }
}

/* ── FRIENDS / DUELS MODALS ───────────────────────────────────── */
.frd-card,
.dul-card {
    width: 100%;
    max-width: 940px;
    height: min(88dvh, 820px);
    max-height: 88dvh;
}

#frd .stg-card {
    border: 1px solid rgba(var(--accent-rgb),0.22);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6),
                0 32px 80px rgba(0,0,0,0.65),
                0 0 80px rgba(var(--accent-rgb),0.08);
}
#frd .stg-hdr-title {
    font-size: 1.18rem;
    letter-spacing: -0.015em;
    line-height: 1.1;
}

#tm .stg-card {
    width: 100%;
    max-width: 940px;
    height: min(88dvh, 820px);
    max-height: 88dvh;
    border: 1px solid rgba(var(--accent-rgb),0.22);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6),
                0 32px 80px rgba(0,0,0,0.65),
                0 0 80px rgba(var(--accent-rgb),0.08);
}
#tm .stg-hdr-title {
    font-size: 1.18rem;
    letter-spacing: -0.015em;
    line-height: 1.1;
}
.frd-hdr-icon {
    background: rgba(var(--accent-rgb),0.12);
    border-color: rgba(var(--accent-rgb),0.32);
    color: rgba(var(--accent-rgb),0.95);
}
.dul-hdr-icon {
    background: rgba(var(--accent-rgb),0.12);
    border-color: rgba(var(--accent-rgb),0.32);
    color: var(--accent);
}
.frd-list,
.dul-list {
    margin-top: 0.6rem;
}

.frd-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    padding: 0.42rem 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.frd-row:first-child { border-top: none; }
.frd-row-main {
    min-width: 0;
}
.frd-row-inline {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 0.55rem;
}
.frd-row-title {
    font-size: 0.58rem;
    color: rgba(255,255,255,0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.frd-row-name-btn {
    border: none;
    background: transparent;
    margin: 0;
    padding: 0;
    text-align: left;
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255,255,255,0.95);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.frd-row-name-btn:hover {
    color: rgba(var(--accent-rgb),0.95);
}
.frd-row-col {
    font-size: 0.58rem;
    color: rgba(255,255,255,0.72);
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.frd-row-col--score {
    color: rgba(255,255,255,0.84);
}
.frd-row-meta {
    font-size: 0.5rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.frd-row-meta--strong {
    color: rgba(255,255,255,0.82);
}
.frd-row-actions {
    display: inline-flex;
    gap: 0.35rem;
}
.frd-btn {
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.82);
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.24rem 0.4rem;
    cursor: pointer;
}
.frd-btn:hover {
    border-color: rgba(255,255,255,0.36);
    background: rgba(255,255,255,0.08);
}
.frd-btn.ok {
    border-color: rgba(var(--accent-rgb),0.45);
    color: rgba(var(--accent-rgb),0.94);
    background: rgba(var(--accent-rgb),0.12);
}
.frd-btn.no {
    border-color: rgba(251,113,133,0.45);
    color: rgba(251,113,133,0.92);
    background: rgba(251,113,133,0.08);
}
.frd-row.unread {
    background: rgba(var(--accent-rgb),0.08);
}

/* ── TEAM MODAL ───────────────────────────────────────────────── */
.tmm-card {
    border-color: rgba(var(--accent-rgb),0.22);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6),
                0 32px 80px rgba(0,0,0,0.65),
                0 0 80px rgba(var(--accent-rgb),0.08);
}
.tmm-hdr-icon {
    background: rgba(var(--accent-rgb),0.12);
    border-color: rgba(var(--accent-rgb),0.32);
    color: rgba(var(--accent-rgb),0.92);
}
.tmm-status {
    border: 1px solid rgba(var(--accent-rgb),0.28);
    background: rgba(var(--accent-rgb),0.10);
    color: rgba(var(--accent-rgb),0.92);
    font-size: 0.56rem;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    padding: 0.5rem 0.62rem;
    margin-bottom: 0.9rem;
}
.tmm-list { margin-top: 0.35rem; }
.tm-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.55rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.tm-row:first-child { border-top: none; }
.tm-row-info { min-width: 0; }
.tm-row-title {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tm-row-meta {
    margin-top: 0.16rem;
    font-size: 0.53rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tm-row-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.tm-btn {
    border: 1px solid rgba(255,255,255,0.20);
    background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.82);
    font-family: var(--font-body);
    font-size: 0.48rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    min-height: 26px;
    padding: 0.24rem 0.48rem;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
}
.tm-btn:hover {
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.95);
}
.tm-btn--accent {
    border-color: rgba(var(--accent-rgb),0.35);
    color: rgba(var(--accent-rgb),0.92);
    background: rgba(var(--accent-rgb),0.12);
}
.tm-btn--accent:hover {
    border-color: rgba(var(--accent-rgb),0.60);
    background: rgba(var(--accent-rgb),0.18);
    color: rgba(var(--accent-rgb),1);
}
.tm-btn--danger {
    border-color: rgba(239,68,68,0.35);
    color: rgba(252,165,165,0.92);
}
.tm-btn--danger:hover {
    border-color: rgba(239,68,68,0.60);
    background: rgba(239,68,68,0.11);
    color: rgba(254,202,202,1);
}
.tm-tag {
    font-size: 0.48rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: rgba(255,255,255,0.46);
}
.tmm-actions {
    margin-top: 0.85rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.48rem;
}

@media (max-width: 580px) {
    .tm-row {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .tm-row-actions { justify-content: flex-start; }
    .tmm-actions { grid-template-columns: 1fr; }
}

/* ── SHOP MODAL ───────────────────────────────────────────────── */
.shp {
    position: fixed;
    inset: 0;
    z-index: 315;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.shp[hidden] { display: none; }

.shp-bd {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.shp-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 940px;
    height: min(88dvh, 860px);
    max-height: 88dvh;
    background: #0c0c0c;
    border: 1px solid rgba(var(--accent-rgb),0.22);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6),
                0 32px 80px rgba(0,0,0,0.65),
                0 0 80px rgba(var(--accent-rgb),0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: shpIn 0.30s var(--ease) both;
}
@keyframes shpIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.shp-x {
    position: absolute;
    top: 0.85rem; right: 0.85rem;
    width: 28px; height: 28px;
    background: none;
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: color 0.15s, background 0.15s;
    z-index: 2;
}
.shp-x:hover { color: var(--text); background: rgba(255,255,255,0.08); }

/* Header */
.shp-hdr {
    padding: 1.05rem 1.4rem 0.92rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}
.shp-hdr-icon {
    width: 34px; height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb),0.12);
    border: 1px solid rgba(var(--accent-rgb),0.32);
    color: rgba(var(--accent-rgb),0.92);
    font-size: 0.78rem;
    flex-shrink: 0;
}
.shp-hdr-title {
    font-family: var(--font-head);
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.1;
    color: var(--text);
}
/* Coin balance in header */
.shp-hdr-coins {
    margin-left: auto;
    margin-right: 2.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(var(--accent-rgb),0.34);
    background: rgba(var(--accent-rgb),0.10);
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(var(--accent-rgb),0.95);
    white-space: nowrap;
}
.shp-hdr-coins i { font-size: 0.60rem; }

/* Tabs */
.shp-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    padding: 0 1rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.shp-tabs::-webkit-scrollbar { display: none; }
.shp-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.60rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.shp-tab:hover { color: var(--text); }
.shp-tab.active { color: rgba(var(--accent-rgb),0.92); border-bottom-color: rgba(var(--accent-rgb),0.86); }

/* Body */
.shp-body {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 1.2rem 1.4rem;
}
.shp-body::-webkit-scrollbar { width: 4px; }
.shp-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); }

.shp-panel[hidden] { display: none; }
.shp-panel {
    min-height: 100%;
    box-sizing: border-box;
}

/* Section title */
.shp-sec {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0.5rem;
    margin-bottom: 0.9rem;
    margin-top: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.shp-sec:first-child { margin-top: 0; }
.shp-sec i { font-size: 0.52rem; opacity: 0.65; }

.shp-daily {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.7rem;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.10);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    padding: 0.72rem 0.76rem;
}

.shp-daily-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
}

.shp-daily-title {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.93);
}

.shp-daily-meta {
    font-size: 0.54rem;
    color: var(--muted);
    letter-spacing: 0.06em;
}

.shp-daily #shop-daily-reward-claim {
    width: clamp(148px, 19vw, 214px);
    min-height: 38px;
    padding: 0.5rem 0.9rem;
    border: 1px solid rgba(var(--accent-rgb), 0.66);
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.26), rgba(var(--accent-rgb), 0.12));
    color: rgba(255,255,255,0.97);
    font-size: 0.56rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(0,0,0,0.38);
    box-shadow:
        0 8px 20px rgba(var(--accent-rgb), 0.20),
        inset 0 1px 0 rgba(255,255,255,0.18);
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease,
        color 0.16s ease;
}

.shp-daily #shop-daily-reward-claim:not(:disabled):hover,
.shp-daily #shop-daily-reward-claim:not(:disabled):focus-visible {
    border-color: rgba(var(--accent-rgb), 0.9);
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.34), rgba(var(--accent-rgb), 0.16));
    box-shadow:
        0 0 0 1px rgba(var(--accent-rgb), 0.2),
        0 12px 26px rgba(var(--accent-rgb), 0.30),
        inset 0 1px 0 rgba(255,255,255,0.24);
    transform: translateY(-1px);
}

.shp-daily #shop-daily-reward-claim:disabled {
    border-color: rgba(255,255,255,0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    color: rgba(255,255,255,0.48);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
    cursor: not-allowed;
    transform: none;
}

/* ── Item grid ── */
.shp-item-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}
.shp-item {
    border: 1px solid rgba(255,255,255,0.08);
    padding: 1rem 0.75rem 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
    cursor: not-allowed;
}
.shp-item--locked { opacity: 0.45; }
.shp-item--soon {
    opacity: 0.60;
    border-color: rgba(var(--accent-rgb),0.16);
}
.shp-item--soon:hover {
    border-color: rgba(var(--accent-rgb),0.34);
    background: rgba(var(--accent-rgb),0.08);
    opacity: 0.80;
}
.shp-item-ico {
    font-size: 1.6rem;
    line-height: 1;
    filter: grayscale(0.5);
}
.shp-item--locked .shp-item-ico { filter: grayscale(1); }
.shp-item-name {
    font-size: 0.60rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.65);
}
.shp-item-price {
    font-size: 0.56rem;
    color: rgba(var(--accent-rgb),0.78);
    display: flex;
    align-items: center;
    gap: 0.28rem;
}
.shp-item-price i { font-size: 0.48rem; }
.shp-item-badge {
    position: absolute;
    top: -1px; right: -1px;
    font-size: 0.44rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 0.15rem 0.4rem;
    font-weight: 600;
}
.shp-item-badge--soon { background: rgba(var(--accent-rgb),0.16); color: rgba(var(--accent-rgb),0.90); border: 1px solid rgba(var(--accent-rgb),0.30); }
.shp-item-badge--locked { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.35); border: 1px solid rgba(255,255,255,0.12); }
.shp-item-lock {
    position: absolute;
    bottom: 0.45rem; right: 0.5rem;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.20);
}

/* ── Package grid (buy coins) ── */
.shp-pkg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}
.shp-pkg {
    -webkit-appearance: none;
    appearance: none;
    font-family: var(--font-body);
    border: 1px solid rgba(var(--accent-rgb),0.24);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    background: rgba(var(--accent-rgb),0.07);
    position: relative;
}
.shp-pkg:hover {
    border-color: rgba(var(--accent-rgb),0.52);
    background: rgba(var(--accent-rgb),0.12);
    box-shadow: 0 0 20px rgba(var(--accent-rgb),0.14);
}
.shp-pkg:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.shp-pkg--popular { border-color: rgba(var(--accent-rgb),0.38); }
.shp-pkg-badge {
    position: absolute;
    top: -1px; left: 50%; transform: translateX(-50%);
    font-size: 0.44rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 0.12rem 0.55rem;
    background: rgba(var(--accent-rgb),0.22);
    border: 1px solid rgba(var(--accent-rgb),0.42);
    color: rgba(var(--accent-rgb),0.95);
    font-weight: 600;
    white-space: nowrap;
}
.shp-pkg-amount {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(var(--accent-rgb),0.95);
    letter-spacing: -0.02em;
    line-height: 1;
}
.shp-pkg-label {
    font-size: 0.54rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
}
.shp-pkg-price {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
}
.shp-pkg-bonus {
    font-size: 0.52rem;
    color: rgba(74,222,128,0.80);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

/* PayPal wrapper */
.shp-paypal-wrap {
    margin-top: 0.8rem;
}
.shp-paypal-hint {
    font-size: 0.55rem;
    color: var(--muted);
    text-align: center;
    margin-top: 0.6rem;
    line-height: 1.5;
}

/* Shop offline banner */
.shp-offline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    text-align: center;
}
.shp-offline[hidden] { display: none; }
.shp-offline-icon { font-size: 2.2rem; opacity: 0.35; }
.shp-offline-title {
    font-family: var(--font-head);
    font-size: 0.90rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
}
.shp-offline-sub {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
}

/* Admin shop toggle inside adm-panel */
.adm-shop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 1rem;
    background: rgba(255,255,255,0.02);
}
.adm-shop-info { }
.adm-shop-label {
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255,255,255,0.70);
}
.adm-shop-desc {
    font-size: 0.54rem;
    color: var(--muted);
    margin-top: 0.2rem;
    text-transform: none;
    letter-spacing: 0;
}

@media (max-width: 580px) {
    .shp { padding: 0; align-items: flex-end; }
    .shp-card {
        max-width: 100%;
        height: 93dvh;
        max-height: 93dvh;
        border-left: none; border-right: none; border-bottom: none;
        animation: shpInMob 0.32s var(--ease) both;
    }
    @keyframes shpInMob {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .shp-item-grid { grid-template-columns: repeat(2, 1fr); }
    .shp-pkg-grid  { grid-template-columns: repeat(2, 1fr); }
    #shop-forms,
    #shop-bird-skins,
    #shop-pipes,
    #shop-backgrounds,
    #shop-effects,
    #shop-colors,
    #shop-frames,
    #shop-badges {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }
    .ap-shop-row {
        min-height: 178px;
        padding: 0.54rem 0.5rem;
    }
    .ap-shop-preview-wrap {
        min-height: 66px;
        margin-bottom: 0.22rem;
    }
    .ap-shop-preview--sprite {
        width: 48px;
        height: 48px;
    }
    .ap-shop-preview-canvas {
        width: 38px;
        height: 38px;
    }
    .ap-shop-preview-canvas--pipe {
        width: 38px;
        height: 33px;
    }
    .ap-shop-preview-canvas--bg {
        width: 38px;
        height: 33px;
    }
    .ap-shop-preview-canvas--effect {
        width: 38px;
        height: 33px;
    }
    .ap-shop-profile-frame {
        width: 34px;
        height: 34px;
    }
    .ap-shop-profile-badge-chip {
        min-height: 18px;
        min-width: 34px;
        max-width: 40px;
    }
    .ap-shop-profile-badge-chip span {
        font-size: 0.40rem;
    }
    .ap-shop-preview--theme {
        width: 48px;
        height: 34px;
    }
    .shp-hdr-coins {
        margin-right: 2.45rem;
        gap: 0.34rem;
        padding: 0.26rem 0.56rem;
        font-size: 0.58rem;
        letter-spacing: 0.10em;
    }
    .shp-hdr-coins span { display: none; }
    .shp-hdr-coins #shp-coins-display {
        display: inline;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        color: rgba(var(--accent-rgb),1);
    }
    .shp-daily { grid-template-columns: 1fr; }
    .shp-daily #shop-daily-reward-claim {
        width: 100%;
        min-height: 36px;
    }
}

/* ── ACHIEVEMENTS MODAL ────────────────────────────────────────── */
.acm {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.5rem, 3vw, 2rem);
}
.acm[hidden] { display: none; }

.acm-bd {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.80);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.acm-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 940px;
    height: min(88dvh, 820px);
    max-height: 88dvh;
    background: rgba(7,7,7,0.98);
    border: 1px solid rgba(var(--accent-rgb),0.22);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6),
                0 24px 80px rgba(0,0,0,0.7),
                0 0 80px rgba(var(--accent-rgb),0.08);
    display: flex;
    flex-direction: column;
    animation: pmoIn 0.38s var(--ease) both;
    overflow: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.10) transparent;
}

.acm-x {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(var(--accent-rgb),0.22);
    color: var(--muted);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.80rem;
    cursor: pointer;
    line-height: 1;
    transition: border-color .2s, color .2s, background .2s;
}
.acm-x:hover {
    color: rgb(var(--accent-rgb));
    background: rgba(var(--accent-rgb),0.14);
    border-color: rgba(var(--accent-rgb),0.46);
}

/* Header */
.acm-hdr {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.4rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.acm-hdr-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(var(--accent-rgb),0.12);
    border: 1px solid rgba(var(--accent-rgb),0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    color: var(--accent);
    flex-shrink: 0;
}
.acm-hdr-title {
    font-family: var(--font-head);
    font-size: 1.18rem;
    letter-spacing: -0.015em;
    line-height: 1.1;
}
.acm-hdr-sub {
    font-size: 0.54rem;
    color: rgba(255,255,255,0.4);
    margin-top: 0.15rem;
}

/* Scrollable body */
.acm-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem 1.2rem;
    overscroll-behavior: contain;
}
.acm-body::-webkit-scrollbar { width: 4px; }
.acm-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }

/* Section titles */
.acm-sec-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 0.75rem;
    margin-top: 0;
}
.acm-sec-title--gap { margin-top: 1.4rem; }
.acm-sec-title i { font-size: 0.55rem; opacity: 0.65; }

/* Achievement grid — reuses pmo-ai styles from profile modal */
.acm-achgrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.42rem;
}

.acm-ach-card {
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
    padding: 0.5rem 0.46rem;
    min-height: 86px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    outline: none;
}
.acm-ach-card:hover,
.acm-ach-card:focus-visible {
    border-color: rgba(var(--accent-rgb),0.45);
    background: rgba(var(--accent-rgb),0.08);
    transform: translateY(-1px);
}
.acm-ach-card.done {
    border-color: rgba(var(--accent-rgb),0.55);
    background: rgba(var(--accent-rgb),0.13);
}
.acm-ach-icon {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255,255,255,0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.9);
    font-size: 0.64rem;
}
.acm-ach-card.done .acm-ach-icon {
    border-color: rgba(var(--accent-rgb),0.5);
    color: rgb(var(--accent-rgb));
}
.acm-ach-name {
    font-size: 0.52rem;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.92);
    line-height: 1.18;
}
.acm-ach-prog {
    margin-top: auto;
    font-size: 0.45rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}
.acm-ach-card.done .acm-ach-prog {
    color: rgba(var(--accent-rgb),0.95);
}

.acm-ach-card[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    width: min(230px, 72vw);
    background: rgba(6,6,8,0.98);
    border: 1px solid rgba(var(--accent-rgb),0.35);
    color: rgba(255,255,255,0.88);
    font-size: 0.5rem;
    line-height: 1.3;
    letter-spacing: 0.03em;
    padding: 0.42rem 0.48rem;
    box-shadow: 0 10px 28px rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
    z-index: 8;
}
.acm-ach-card:hover::after,
.acm-ach-card:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
    .acm-achgrid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .acm { padding: 0; align-items: flex-end; }
    .acm-card {
        max-width: 100%;
        max-height: 92dvh;
        border-left: none; border-right: none; border-bottom: none;
        animation: pmoInMobile 0.38s var(--ease) both;
    }
    .acm-achgrid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Unified Modal Backdrop (no game bleed-through) ──────────── */
.pmo-bd,
.stg-bd,
.shp-bd,
.adm-bd,
.acm-bd {
    background: rgba(0,0,0,0.96) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
