/* ==========================================================================
   SCHLEIMYCHEATS | HUB DESIGN SYSTEM
   Material: the black slime of the logo on a hot pink field.
   Type: Archivo, one variable family, squeezed hard for display, normal for text.
   Motion: transform and opacity only, every travel drops under reduced motion.
   ========================================================================== */

@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 400 900;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url('assets/fonts/archivo-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 400 900;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url('assets/fonts/archivo-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Geist Mono';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('assets/fonts/geist-mono-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Geist Mono';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('assets/fonts/geist-mono-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    color-scheme: dark;

    --font-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-code: 'Geist Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

    /* Ground and tone steps */
    --bg-page: #0d0b0e;
    --bg-surface: #161318;
    --bg-surface-raised: #1f1b22;
    --bg-surface-elevated: #2a2530;
    --bg-input: #100e12;
    --bg-input-focus: #19161c;

    /* Ink */
    --text-pure: #ffffff;
    --text-primary: #f8f4f6;
    --text-secondary: #ddd7dc;
    --text-muted: #aca4ad;
    --text-dim: #7e7680;

    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.14);

    /* Accent is user-themable from Settings, main.js writes these two */
    --gta-pink: #f7198e;
    --accent: var(--gta-pink);
    --on-accent: #0d0b0e;
    --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
    --accent-border: color-mix(in srgb, var(--accent) 45%, transparent);

    --success: #3ddc97;
    --error: #ff5c6c;
    --peach: #ffb27a;

    /* Round is the rule: slime has no corners */
    --radius-xs: 8px;
    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --radius-full: 999px;

    /* Shell */
    --bar: 76px;
    --rail: 232px;
    --gutter: clamp(16px, 3vw, 44px);

    /* Motion tokens */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --spring: cubic-bezier(0.2, 1.3, 0.3, 1);
    --t-fast: 140ms;
    --t-med: 260ms;
    --t-slow: 520ms;
}

@supports (transition-timing-function: linear(0, 1)) {
    :root {
        --spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
    }
}

/* ---------- Reset ---------- */

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

html {
    background: var(--bg-page);
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--bg-surface-elevated) transparent;
    scrollbar-width: thin;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; }
ul { list-style: none; }
code, pre { font-family: var(--font-code); font-variant-ligatures: none; }

button, a, [onclick], select, label, summary { cursor: pointer; }
input, textarea { cursor: text; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

nav, .logo, .tab-btn, button, .role-badge, .section-title, .panel-header, .stat-number {
    user-select: none;
    -webkit-user-select: none;
}

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    border: 3px solid var(--bg-page);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

.hidden { display: none !important; }

textarea#hidden-lua-script, #hidden-lua-script {
    display: none !important;
}

.f-icon-inline {
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.16em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.text-pink { color: var(--accent); }
.text-peach { color: var(--peach); }
.color-shift { color: inherit; }
.global-coin-icon { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.mt-25 { margin-top: 25px; }

/* ---------- Login poster ---------- */

#slime-login {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 4999;
    pointer-events: none;
    transition: opacity 460ms var(--ease-in-out);
}
#slime-login.is-done { opacity: 0; }

#login-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 14px;
    --login-pad: clamp(16px, 2.4vw, 36px);
    padding: var(--login-pad);
    background: var(--accent);
    color: #0d0b0e;
    overflow: hidden;
    transition: opacity var(--t-med) var(--ease-out), visibility 0s linear var(--t-med);
}
html.slime-on #login-overlay { background: transparent; }

#login-overlay.hidden {
    display: grid !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-logo {
    position: absolute;
    right: calc(var(--login-pad) + 2vw);
    bottom: calc(var(--login-pad) + 84px);
    width: min(25vw, 42vh);
    height: auto;
    transform: rotate(7deg);
    z-index: 2;
    pointer-events: auto;
    animation: stickerIn 900ms var(--spring) 260ms both;
}

.login-logo.login-logo-corner {
    top: var(--login-pad);
    left: auto;
    right: var(--login-pad);
    bottom: auto;
    margin: 0;
    width: min(13vw, 18vh);
}

/* SCHLEIMY is 3.86em wide at this stretch, so the word always fills the frame */
.login-title {
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: center;
    font-size: min(calc((100vw - 2 * var(--login-pad)) / 3.88), 39vh);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.83;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    color: #0d0b0e;
    transition: color var(--t-fast) linear;
}
.login-title .text-pink { display: block; color: inherit; }
html.slime-text .login-title { color: transparent; }

.login-desc {
    grid-column: 1;
    grid-row: 2;
    max-width: 34ch;
    font-size: clamp(1.05rem, 1.7vw, 1.5rem);
    font-weight: 600;
    line-height: 1.25;
    color: #0d0b0e;
}
.login-desc strong { font-weight: 800; }

.discord-login-btn-large {
    grid-column: 2;
    grid-row: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 34px;
    border-radius: var(--radius-full);
    background: #0d0b0e;
    color: #ffffff;
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    font-weight: 800;
    font-stretch: 75%;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: transform var(--t-med) var(--spring);
}
.discord-login-btn-large svg { flex-shrink: 0; transition: transform var(--t-med) var(--spring); }
.discord-login-btn-large:hover { transform: translateY(-2px); }
.discord-login-btn-large:hover svg { transform: rotate(-10deg) scale(1.1); }
.discord-login-btn-large:active { transform: scale(0.96); }
#login-overlay .action-btn { grid-column: 3; grid-row: 2; margin-top: 0; }

html.has-session .discord-login-btn-large,
html.has-session .login-desc { visibility: hidden; }

/* ---------- App shell ---------- */

#mainNav {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--bar);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 var(--gutter) 0 20px;
    background: var(--bg-page);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(var(--rail) - 34px);
    flex-shrink: 0;
    min-width: 0;
}
.logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    transition: transform var(--t-slow) var(--spring);
}
.logo:hover img { transform: rotate(-8deg) scale(1.06); }
.logo-text {
    font-size: 1.62rem;
    font-weight: 900;
    font-stretch: 62%;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.hamburger-btn, .mobile-drawer-header { display: none; }

.nav-center {
    position: fixed;
    top: var(--bar);
    left: 0;
    bottom: 0;
    width: var(--rail);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 14px 24px 18px;
    overflow-y: auto;
    scrollbar-width: none;
}
.nav-center::-webkit-scrollbar { display: none; }

.tab-btn {
    position: relative;
    z-index: 1;
    width: 100%;
    flex-shrink: 0;
    padding: 12px 18px;
    border-radius: var(--radius-full);
    text-align: left;
    font-size: 1.12rem;
    font-weight: 800;
    font-stretch: 75%;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.tab-btn:hover:not(.active) { color: var(--text-pure); transform: translateX(4px); }
.tab-btn:active { transform: scale(0.97); }
.tab-btn.active { background: var(--accent); color: var(--on-accent); }
html.has-blob .tab-btn.active { background: transparent; }
.tab-btn[onclick*="vmaxcrack"] { margin-top: 20px; }

.nav-blob {
    position: absolute;
    left: 18px;
    right: 14px;
    top: 0;
    height: 48px;
    border-radius: 24px;
    background: var(--accent);
    pointer-events: none;
    transform-origin: 50% 0;
}

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nav-bell {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--text-secondary);
    transition: background-color var(--t-med) var(--ease-out), transform var(--t-med) var(--spring), color var(--t-med);
}
.nav-bell:hover { background: var(--bg-surface-raised); color: var(--text-pure); }
.nav-bell:active { transform: scale(0.92); }

.bell-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.72rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.nav-coin-display {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 16px 0 12px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: background-color var(--t-med) var(--ease-out), transform var(--t-med) var(--spring);
}
.nav-coin-display:hover { background: var(--bg-surface-raised); }
.nav-coin-display:active { transform: scale(0.96); }

.dl-btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 20px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--on-accent);
    font-size: 1.02rem;
    font-weight: 800;
    font-stretch: 75%;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: transform var(--t-med) var(--spring);
}
.dl-btn-nav svg { transition: transform var(--t-med) var(--spring); }
.dl-btn-nav:hover svg { transform: translateY(2px); }
.dl-btn-nav:active { transform: scale(0.96); }

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 4px 0 16px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    transition: background-color var(--t-med) var(--ease-out);
    min-width: 0;
}
.user-profile:hover { background: var(--bg-surface-raised); }
.user-text { min-width: 0; text-align: right; line-height: 1.15; }
.user-name {
    max-width: 130px;
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-uid { display: flex; justify-content: flex-end; font-size: 0.72rem; color: var(--text-muted); }
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-surface-elevated);
    flex-shrink: 0;
}

/* Dropdowns */

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    padding: 8px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-raised);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top right;
    transition: opacity var(--t-fast) var(--ease-out), transform var(--t-med) var(--ease-out), visibility 0s linear var(--t-med);
    z-index: 1100;
    cursor: default;
}
.notification-dropdown { width: 340px; }
.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity var(--t-fast) var(--ease-out), transform var(--t-med) var(--spring), visibility 0s;
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 12px;
}
.dropdown-header img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.dh-name { font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-link { font-size: 0.84rem; color: var(--accent); }
.dh-link:hover { text-decoration: underline; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast);
}
.dropdown-item:hover { background: var(--bg-surface-elevated); color: var(--text-pure); }
.item-logout:hover { color: var(--error); }

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: background-color var(--t-fast) var(--ease-out);
}
.notif-item:hover { background: var(--bg-surface-elevated); }
.notif-item.unread { background: var(--accent-soft); }
.notif-icon { flex-shrink: 0; color: var(--accent); }
.notif-text { min-width: 0; overflow-wrap: anywhere; }
.notif-time { display: block; font-size: 0.76rem; color: var(--text-muted); }

/* Page frame */

main {
    margin-left: var(--rail);
    padding: calc(var(--bar) + 18px) var(--gutter) 72px;
    min-height: 100vh;
    min-height: 100dvh;
}

.view-content { display: none; max-width: 1460px; margin: 0 auto; }
.view-content.active { display: block; }

.controls-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.controls-bar > div { min-width: 0; }

.section-title {
    font-size: clamp(3rem, 7.6vw, 7.6rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.88;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--text-pure);
}

.section-desc {
    max-width: 62ch;
    margin-bottom: 32px;
    font-size: 1.12rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

#configs .section-title, #settings .section-title, #leaderboard .section-title { margin-bottom: 14px; }

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

.action-btn, .submit-btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 22px;
    border-radius: var(--radius-full);
    overflow: hidden;
    font-size: 1.02rem;
    font-weight: 800;
    font-stretch: 75%;
    letter-spacing: 0.01em;
    line-height: 1.1;
    text-align: center;
    transition: transform var(--t-med) var(--spring), color var(--t-med) var(--ease-out);
}
.action-btn { background: var(--bg-surface-raised); color: var(--text-primary); }
.controls-bar .action-btn { background: var(--accent); color: var(--on-accent); }

/* Slime rises through the button on hover */
.action-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    z-index: -1;
    background: var(--accent);
    border-radius: 50% 50% 0 0 / 34% 34% 0 0;
    transform: translateY(104%);
    transition: transform 380ms var(--ease-out), border-radius 380ms var(--ease-out);
}
.controls-bar .action-btn::before { background: var(--text-pure); }
.action-btn:hover::before { transform: none; border-radius: 0; }
.action-btn:hover { color: var(--on-accent); }
.action-btn:active, .submit-btn:active { transform: scale(0.97); }

.submit-btn {
    width: 100%;
    min-height: 52px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 1.12rem;
}
.submit-btn:hover { transform: translateY(-1px); }
.modal-content .submit-btn { margin-top: 6px; }
.btn-gift-submit { background: var(--peach); }
.shop-btn-full { width: 100%; }

.btn-action-small {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    font-size: 0.86rem;
    font-weight: 800;
    font-stretch: 75%;
    transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast), transform var(--t-med) var(--spring);
}
.btn-action-small:active { transform: scale(0.96); }
.btn-action-red { color: var(--error); }
.btn-action-red:hover { background: var(--error); color: #0d0b0e; }
.btn-action-claim { color: var(--success); margin-right: 8px; }
.btn-action-claim:hover { background: var(--success); color: #0d0b0e; }

/* ---------- Panels ---------- */

.glass-panel {
    position: relative;
    padding: clamp(18px, 2.2vw, 28px);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.panel-header {
    margin-bottom: 14px;
    font-size: 1.5rem;
    font-weight: 900;
    font-stretch: 68%;
    line-height: 1.05;
    text-transform: uppercase;
}

.forum-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.main-categories { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.settings-full-width { grid-column: 1 / -1; }

.rank-loading {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
}

/* Hub home */

.hub-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: stretch;
}
.hub-side { display: grid; grid-auto-rows: minmax(0, 1fr); gap: 16px; }

.hub-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    min-height: 168px;
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    text-align: left;
    overflow: hidden;
    transition: background-color var(--t-med) var(--ease-out), transform var(--t-slow) var(--spring);
}
.hub-tile:hover { background: var(--bg-surface-raised); transform: translateY(-3px); }
.hub-tile:active { transform: scale(0.985); }
.hub-tile-title {
    font-size: clamp(1.9rem, 2.8vw, 2.6rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.95;
    text-transform: uppercase;
}
.hub-tile-sub { font-size: 0.98rem; color: var(--text-secondary); }
.hub-tile-star {
    position: absolute;
    top: -18px;
    right: -14px;
    width: 124px;
    height: 124px;
    fill: var(--text-pure);
    transition: transform 900ms var(--ease-out);
}
.hub-tile:hover .hub-tile-star { transform: rotate(40deg) scale(1.06); }
.hub-tile-accent { background: var(--accent); color: var(--on-accent); }
.hub-tile-accent:hover { background: var(--accent); }
.hub-tile-accent .hub-tile-sub { color: var(--on-accent); }

/* Announcements */

.forum-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 12px;
    margin: 0 -12px;
    border-radius: var(--radius-md);
    transition: background-color var(--t-fast) var(--ease-out);
}
.forum-row:hover { background: var(--bg-surface-raised); }
.f-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 1.3rem;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform var(--t-slow) var(--spring);
}
.forum-row:hover .f-icon { transform: rotate(-8deg) scale(1.05); }
.f-details h4 { font-size: 1.14rem; font-weight: 700; line-height: 1.25; }

/* ---------- Dashboard ---------- */

.stat-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 0;
    background: none;
}
.stat-box {
    padding: 20px 24px 22px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    min-width: 0;
}
.stat-box:last-child { background: var(--accent); color: var(--on-accent); }
.stat-box h4 { font-size: 1rem; font-weight: 600; }
.stat-number {
    margin-top: 6px;
    font-size: clamp(3.4rem, 7vw, 6rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.95;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-peach { color: inherit; }
.graph-panel h3 {
    font-size: 1.5rem;
    font-weight: 900;
    font-stretch: 68%;
    text-transform: uppercase;
}
.graph-subtext { margin-top: 8px; font-size: 0.92rem; color: var(--text-muted); }

/* ---------- Wall of Fame ---------- */

.rank-list-container { display: flex; flex-direction: column; gap: 2px; }
.rank-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    margin: 0 -12px;
    border-radius: var(--radius-md);
    transition: background-color var(--t-fast) var(--ease-out);
}
.rank-item:hover { background: var(--bg-surface-raised); }
.rank-pos {
    width: 48px;
    flex-shrink: 0;
    font-size: 2rem;
    font-weight: 900;
    font-stretch: 62%;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--text-dim);
}
.rank-1 { color: var(--accent); }
.rank-2 { color: var(--text-pure); }
.rank-3 { color: var(--text-secondary); }
.rank-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-surface-elevated);
    flex-shrink: 0;
}
.rank-info { min-width: 0; flex: 1; }
.rank-name { font-weight: 700; min-width: 0; cursor: pointer; }
.rank-stat { font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Channel ---------- */

.profile-header-container { margin-bottom: 18px; }

.channel-banner {
    position: relative;
    padding-top: clamp(130px, 16vw, 210px);
}
.channel-banner::before,
.channel-banner-video-wrap {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: clamp(170px, 20vw, 260px);
    border-radius: var(--radius-xl);
    overflow: hidden;
}
.channel-banner::before {
    background: var(--accent) url('assets/banner.jpg') center 68% / cover no-repeat;
}
.channel-banner-video-wrap video,
.channel-banner-video-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#channelBanner[src*="assets/logo"], #channelBanner:not([src]) { display: none; }

.channel-profile-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 0 clamp(16px, 2.6vw, 34px);
    min-width: 0;
}
.channel-avatar {
    width: clamp(104px, 12vw, 148px);
    height: clamp(104px, 12vw, 148px);
    border-radius: 50%;
    border: 8px solid var(--bg-page);
    object-fit: cover;
    background: var(--bg-surface-elevated);
    flex-shrink: 0;
}
.channel-info { min-width: 0; flex: 1; padding-top: clamp(50px, 4.8vw, 62px); }
.channel-name {
    font-size: clamp(2rem, 3.8vw, 3.2rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 1;
    text-transform: uppercase;
    min-width: 0;
}
.channel-handle { color: var(--text-muted); font-size: 0.95rem; }

.channel-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; }
.stat-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.95rem; color: var(--text-secondary); }
.stat-badge strong { color: var(--text-pure); font-variant-numeric: tabular-nums; }
.icon-purple { color: var(--text-muted); }

.channel-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding: 0 clamp(16px, 2.6vw, 34px);
}
.btn-profile {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-raised);
    font-size: 0.98rem;
    font-weight: 800;
    font-stretch: 75%;
    transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast), transform var(--t-med) var(--spring);
}
.btn-profile:active { transform: scale(0.96); }
.btn-follow { background: var(--accent); color: var(--on-accent); }
.btn-follow:hover { background: var(--text-pure); }
.btn-prep:hover { background: var(--success); color: #0d0b0e; }
.btn-mrep:hover { background: var(--error); color: #0d0b0e; }
.btn-gift:hover { background: var(--peach); color: #0d0b0e; }

.channel-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    overflow-x: auto;
    scrollbar-width: none;
}
.channel-nav::-webkit-scrollbar { display: none; }
.c-nav-item {
    position: relative;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 800;
    font-stretch: 75%;
    white-space: nowrap;
    color: var(--text-muted);
    transition: background-color var(--t-med) var(--ease-out), color var(--t-med) var(--ease-out);
}
.c-nav-item:hover { color: var(--text-pure); }
.c-nav-item.active { background: var(--text-pure); color: var(--on-accent); }

.c-tab-content { display: none; }
.c-tab-content.active { display: block; animation: riseIn 420ms var(--ease-out) both; }

.about-panel { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.about-content { min-width: 0; flex: 1; }
.about-title {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 1.5rem;
    font-weight: 900;
    font-stretch: 68%;
    text-transform: uppercase;
}
.bio-text { max-width: 62ch; overflow-wrap: anywhere; white-space: pre-wrap; }
.btn-edit-bio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-raised);
    font-weight: 800;
    font-stretch: 75%;
    transition: background-color var(--t-fast) var(--ease-out);
}
.btn-edit-bio:hover { background: var(--bg-surface-elevated); }

/* ---------- Configs ---------- */

.search-input {
    flex: 1;
    min-width: 220px;
    max-width: 460px;
    height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    transition: background-color var(--t-med) var(--ease-out);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { background: var(--bg-surface-raised); outline: 2px solid var(--accent); outline-offset: 0; }

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 16px;
}
.config-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    min-width: 0;
    transition: background-color var(--t-med) var(--ease-out), transform var(--t-slow) var(--spring);
}
.config-card:hover { background: var(--bg-surface-raised); transform: translateY(-3px); }

/* Rows off screen skip layout and paint entirely until they scroll into view */
.config-card { content-visibility: auto; contain-intrinsic-size: auto 300px; }
.video-card { content-visibility: auto; contain-intrinsic-size: auto 420px; }
.chat-msg { content-visibility: auto; contain-intrinsic-size: auto 64px; }

.glass-panel, .hub-tile, .price-card, .stat-box { contain: layout style; }

.config-card h3 {
    margin-top: 10px;
    font-size: 1.9rem;
    font-weight: 900;
    font-stretch: 62%;
    line-height: 1.02;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.config-author { margin-top: 4px; font-size: 0.9rem; color: var(--text-muted); }
.config-desc { margin-top: 10px; color: var(--text-secondary); overflow-wrap: anywhere; }

.cfg-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 800;
    font-stretch: 75%;
}
.bg-RAGE { background: #ff5c6c; color: #0d0b0e; }
.bg-LEGIT { background: #3ddc97; color: #0d0b0e; }
.bg-VISUALS { background: #4fd8f0; color: #0d0b0e; }
.bg-HVH { background: #f2f2f2; color: #0d0b0e; }

.config-id {
    position: absolute;
    top: 22px;
    right: 22px;
    font-size: 0.84rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.btn-copy, .btn-delete {
    width: 100%;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: var(--radius-full);
    font-size: 0.98rem;
    font-weight: 800;
    font-stretch: 75%;
    transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast), transform var(--t-med) var(--spring);
}
.btn-copy { background: var(--text-pure); color: var(--on-accent); }
.btn-copy:hover { background: var(--accent); }
.btn-copy:active, .btn-delete:active { transform: scale(0.97); }
.btn-delete { background: none; color: var(--error); }
.btn-delete:hover { background: var(--error); color: #0d0b0e; }

/* Votes */

.vote-action-group {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
}
.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    transition: color var(--t-fast), transform var(--t-med) var(--spring);
}
.vote-btn:hover { color: var(--text-pure); }
.vote-btn:active { transform: scale(0.9); }
.vote-btn.active-like { color: var(--accent); }
.vote-btn.active-dislike { color: var(--error); }
.vote-divider { width: 2px; height: 16px; background: var(--border-medium); }

/* ---------- Feed ---------- */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 16px;
}
.video-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    overflow: hidden;
    min-width: 0;
    transition: background-color var(--t-med) var(--ease-out), transform var(--t-slow) var(--spring);
}
.video-card:hover { background: var(--bg-surface-raised); transform: translateY(-3px); }
.video-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-surface-elevated);
    cursor: pointer;
}
.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 800ms var(--ease-out);
}
.video-card:hover .video-thumbnail img { transform: scale(1.04); }
.play-btn-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin: -34px 0 0 -34px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    transition: transform var(--t-slow) var(--spring);
}
.play-btn-overlay svg { width: 28px; height: 28px; fill: currentColor; }
.video-card:hover .play-btn-overlay { transform: scale(1.12); }

.video-info { display: flex; flex-direction: column; flex: 1; padding: 16px 20px 18px; min-width: 0; }
.video-title {
    font-size: 1.7rem;
    font-weight: 900;
    font-stretch: 62%;
    line-height: 1.04;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.video-author {
    display: flex;
    align-items: center;
    margin: 8px 0;
    min-width: 0;
    font-size: 0.92rem;
    cursor: pointer;
}
.video-author img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.md-content p + p { margin-top: 0.5em; }
.md-content a { color: var(--accent); text-decoration: underline; }
.md-content code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--bg-surface-elevated);
    font-size: 0.88em;
}
.md-content pre {
    margin: 0.5em 0;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    overflow-x: auto;
}
.md-content pre code { padding: 0; background: none; }
.md-content img { max-height: 280px; border-radius: var(--radius-sm); }

.tip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    font-size: 0.94rem;
    font-weight: 800;
    font-stretch: 75%;
    transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast), transform var(--t-med) var(--spring);
}
.tip-btn:hover { background: var(--peach); color: #0d0b0e; }
.tip-btn:active { transform: scale(0.95); }

.feed-script-container {
    margin-top: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    overflow: hidden;
}
.feed-script-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-muted);
}
.feed-script-actions { display: flex; gap: 6px; }
.btn-script-action {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    font-size: 0.8rem;
    font-weight: 800;
    font-stretch: 75%;
    transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast);
}
.btn-script-action:hover { background: var(--accent); color: var(--on-accent); }
.feed-script-body {
    max-height: 160px;
    padding: 2px 12px 12px;
    overflow: auto;
    font-family: var(--font-code);
    font-size: 0.82rem;
    white-space: pre;
    color: var(--text-secondary);
}

/* ---------- Coin shop ---------- */

.shop-balance-display {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.5rem, 2.8vw, 2.4rem);
    font-weight: 900;
    font-stretch: 62%;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.shop-balance-display .global-coin-icon { width: 34px; height: 34px; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}
.price-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 26px 26px 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    overflow: hidden;
    transition: background-color var(--t-med) var(--ease-out), transform var(--t-slow) var(--spring);
}
.price-card:hover { background: var(--bg-surface-raised); transform: translateY(-4px); }
.price-card.lifetime { background: var(--accent); color: var(--on-accent); }
.price-card.lifetime:hover { background: var(--accent); }
.price-title {
    font-size: 1.9rem;
    font-weight: 900;
    font-stretch: 62%;
    line-height: 1.02;
    text-transform: uppercase;
}
.price-amount {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 10px;
    font-size: clamp(3.6rem, 6.4vw, 5.6rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.95;
    font-variant-numeric: tabular-nums;
}
.price-amount .global-coin-icon { width: 0.62em; height: 0.62em; }
.shop-desc { margin-bottom: 22px; flex: 1; }
.price-card.lifetime .submit-btn { background: var(--on-accent); color: var(--text-pure); }

/* ---------- Tickets ---------- */

.ticket-split-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 16px;
    height: calc(100vh - var(--bar) - 190px);
    min-height: 460px;
}
.ticket-sidebar { padding: 18px 12px; overflow-y: auto; }
.ticket-sidebar-header {
    padding: 0 10px 10px;
    font-size: 1.3rem;
    font-weight: 900;
    font-stretch: 68%;
    text-transform: uppercase;
}
.ticket-item {
    position: relative;
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background-color var(--t-fast) var(--ease-out);
}
.ticket-item:hover { background: var(--bg-surface-raised); }
.ticket-item.active { background: var(--accent); color: var(--on-accent); }
.ticket-item strong { display: block; font-size: 0.98rem; font-weight: 800; }
.ticket-item span { display: block; font-size: 0.86rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-item.active span { color: var(--on-accent); }
.t-badge-closed, .t-badge-claimed { width: fit-content; font-size: 0.74rem !important; font-weight: 800; }
.t-badge-closed { color: var(--error) !important; }
.t-badge-claimed { color: var(--success) !important; }

.ticket-main { display: flex; flex-direction: column; padding: 0; min-height: 0; overflow: hidden; }
.ticket-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    background: var(--bg-surface-raised);
}
.ticket-header-flex {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 1.15rem;
    font-weight: 800;
}
.ticket-actions { display: flex; align-items: center; flex-shrink: 0; }

.chat-area { flex: 1; min-height: 0; padding: 18px 22px; overflow-y: auto; }
.chat-msg { display: flex; gap: 12px; padding: 8px 0; }
.chat-msg img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.chat-msg-content { min-width: 0; flex: 1; }
.chat-msg.system .chat-msg-content {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-raised);
}
.chat-msg-header { display: flex; align-items: center; gap: 10px; }
.chat-msg-name { font-weight: 800; }
.chat-msg-time { font-size: 0.8rem; color: var(--text-muted); }
.chat-msg-text { overflow-wrap: anywhere; }

.chat-input-box { display: flex; gap: 8px; padding: 12px 14px; background: var(--bg-surface-raised); }
#chatInputMsg {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--bg-input);
}
#chatInputMsg:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.btn-send-chat {
    height: 46px;
    padding: 0 22px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 800;
    font-stretch: 75%;
    transition: transform var(--t-med) var(--spring);
}
.btn-send-chat:active { transform: scale(0.95); }
.closed-notice { padding: 14px 20px; text-align: center; color: var(--text-muted); background: var(--bg-surface-raised); }

/* ---------- Settings ---------- */

.settings-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 1.5rem;
    font-weight: 900;
    font-stretch: 68%;
    text-transform: uppercase;
}
.settings-desc { margin-bottom: 16px; color: var(--text-secondary); }

.perks-container { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.perk-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 12px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-raised);
}
.perk-btn {
    flex-shrink: 0;
    min-height: 38px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 800;
    font-stretch: 75%;
    transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast), transform var(--t-med) var(--spring);
}
.perk-btn:active { transform: scale(0.95); }
.perk-locked { background: var(--bg-surface-elevated); color: var(--text-muted); cursor: not-allowed; }
.perk-equip { background: var(--accent); color: var(--on-accent); }
.perk-unequip { background: var(--bg-surface-elevated); color: var(--text-primary); }

.custom-bg-input { margin-top: 12px; padding: 16px 18px; border-radius: var(--radius-md); background: var(--bg-surface-raised); }
.custom-bg-input h4 { font-size: 1.04rem; font-weight: 800; }
.custom-bg-input p { margin-bottom: 10px; font-size: 0.94rem; color: var(--text-secondary); }
.input-row { display: flex; gap: 8px; }
.input-row input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--bg-input);
}
.input-row input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.btn-save-link {
    padding: 0 18px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 800;
    font-stretch: 75%;
    white-space: nowrap;
}

.customization-section { position: relative; margin-top: 16px; padding: 18px; border-radius: var(--radius-md); background: var(--bg-surface-raised); }
.lock-overlay-custom {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-raised);
    text-align: center;
    transition: opacity var(--t-med) var(--ease-out);
}
.lock-overlay-custom.unlocked { opacity: 0; pointer-events: none; }
.lock-overlay-custom h3 { font-size: 1.5rem; font-weight: 900; font-stretch: 68%; text-transform: uppercase; }

.custom-block { margin-bottom: 18px; }
.small-header-gray { margin-bottom: 8px; font-size: 0.96rem; font-weight: 700; color: var(--text-secondary); }
.name-preview-box {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    font-size: 1.5rem;
    overflow: hidden;
}

.style-grid, .color-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.discord-style-box {
    min-width: 64px;
    height: 46px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    font-weight: 700;
    transition: background-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast), transform var(--t-med) var(--spring);
}
.discord-style-box:hover { background: var(--bg-input); }
.discord-style-box:active { transform: scale(0.95); }
.discord-style-box.active { box-shadow: inset 0 0 0 2px var(--accent); }

.color-swatch, .theme-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--t-med) var(--spring);
}
.color-swatch:hover, .theme-btn:hover { transform: scale(1.1); }
.color-swatch.active, .theme-btn.active { box-shadow: 0 0 0 3px var(--bg-surface), 0 0 0 5px var(--text-pure); }

.swatch-white { background: #ffffff; }
.swatch-pink { background: #f7198e; }
.swatch-purple { background: #b491ff; }
.swatch-cyan { background: #00e5ff; }
.swatch-green { background: #39ff14; }
.swatch-red { background: #ff3333; }
.swatch-peach { background: #ff8c24; }
.swatch-yellow { background: #ffee00; }

.theme-options { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px; }
.theme-pink { background: #f7198e; }
.theme-purple { background: #b491ff; }
.theme-cyan { background: #00e5ff; }
.theme-green { background: #39ff14; }
.theme-red { background: #ff3333; }

.save-style-btn { max-width: 300px; }

.privacy-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.privacy-title { display: block; font-size: 1.08rem; }
.privacy-desc { display: block; font-size: 0.94rem; color: var(--text-secondary); }
.toggle-stream-btn { flex-shrink: 0; }

/* Purchased name styles, keep these keys in sync with the shop */
.font-default, .font-outfit { font-family: var(--font-body); font-weight: 800; }
.font-mono { font-family: var(--font-code); font-weight: 700; }
.font-impact { font-family: Impact, 'Arial Narrow', sans-serif; font-weight: 400; letter-spacing: 1px; }
.font-comic { font-family: 'Comic Sans MS', cursive; font-weight: 700; }
.font-pixel { font-family: 'Courier New', monospace; font-weight: 700; letter-spacing: -1px; }
.effect-solid { text-shadow: none; }
.effect-gradient-text {
    background: linear-gradient(90deg, #ffffff, #a1a1aa) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}
.effect-neon-text { text-shadow: 0 0 10px currentColor, 0 0 20px currentColor; }
.effect-toon-text { -webkit-text-stroke: 1.5px #000000; text-shadow: 2px 2px 0 #000000; }
.effect-pop-text { text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.2), 3px 3px 0 rgba(0, 0, 0, 0.8); }

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.role-FOUNDER { background: rgba(247, 25, 142, 0.16); color: #f7198e; }
.role-OWNER { background: rgba(180, 145, 255, 0.16); color: #b491ff; }
.role-HELPER { background: rgba(61, 220, 151, 0.16); color: #3ddc97; }
.role-USER { background: rgba(255, 255, 255, 0.08); color: #c9c3c8; }

.streamer-mode .user-uid, .streamer-mode .config-id, .streamer-mode .channel-handle {
    filter: blur(5px);
    user-select: none;
    transition: filter var(--t-med) var(--ease-out);
}
.streamer-mode .user-uid:hover, .streamer-mode .config-id:hover, .streamer-mode .channel-handle:hover { filter: none; }

/* ---------- Modals ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 6, 9, 0.78);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--t-med) var(--ease-out), visibility 0s linear var(--t-med);
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity var(--t-med) var(--ease-out), visibility 0s;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: min(90vh, 780px);
    padding: clamp(22px, 3vw, 34px);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    transform: translateY(14px) scale(0.965);
    transition: transform var(--t-med) var(--ease-out);
}
.modal-overlay.show .modal-content {
    transform: none;
    transition: transform 460ms var(--spring);
}

.close-modal {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-surface-raised);
    color: var(--text-secondary);
    transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast), transform var(--t-med) var(--spring);
    z-index: 2;
}
.close-modal:hover { background: var(--accent); color: var(--on-accent); transform: rotate(90deg); }

.modal-title {
    margin-bottom: 18px;
    padding-right: 42px;
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.95;
    text-transform: uppercase;
}
.modal-title .text-pink, .modal-title .text-peach, .modal-title.text-peach { color: inherit; }

.form-group { margin-bottom: 14px; }
.form-group label, .modal-field-label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.form-group input, .form-group textarea, .form-group select, .modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    transition: background-color var(--t-med) var(--ease-out);
}
.form-group textarea, textarea.modal-input { min-height: 96px; resize: vertical; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus, .modal-input:focus {
    background: var(--bg-input-focus);
    outline: 2px solid var(--accent);
    outline-offset: 0;
}
.form-group select option, .modal-input option { background: var(--bg-surface); }
.form-group ::placeholder, .modal-input::placeholder { color: var(--text-dim); }

.modal-check-group {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}
.modal-check-group label { display: flex; align-items: center; gap: 12px; font-size: 0.96rem; }
.modal-check-group input { width: 20px; height: 20px; accent-color: var(--accent); }

.admin-role-modal-content { max-width: 880px; width: 95%; max-height: 85vh; }
.admin-role-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-right: 44px;
    margin-bottom: 18px;
}
.admin-role-head .modal-title { margin-bottom: 0; padding-right: 0; }
.admin-role-head p { margin-top: 4px; color: var(--text-muted); font-size: 0.92rem; }
.admin-sync-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-raised);
}
.admin-sync-box small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 0.86rem; }
#adminRoleListContainer { display: flex; flex-direction: column; gap: 14px; }

.yt-modal-wrapper { max-width: 1000px; padding: 0; background: #000000; overflow: hidden; }
.yt-container { position: relative; aspect-ratio: 16 / 9; }
.yt-container iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Toasts ---------- */

#toast-container {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 6000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: min(420px, calc(100vw - 36px));
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 12px 14px;
    border-radius: var(--radius-full);
    background: var(--text-pure);
    color: var(--on-accent);
    font-size: 0.96rem;
    font-weight: 700;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    animation: toastIn 420ms var(--spring) both, toastOut 240ms var(--ease-in-out) 2740ms forwards;
}
.toast svg { flex-shrink: 0; }

/* ---------- VMAX and download pages ---------- */

.vmax-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.vmax-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 1.5rem;
    font-weight: 900;
    font-stretch: 68%;
    line-height: 1.05;
    text-transform: uppercase;
}
.vmax-list { display: grid; gap: 8px; }
.vmax-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.vmax-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.vmax-dot-pink { background: var(--accent); }
.vmax-red { color: var(--error); font-weight: 700; }
.vmax-muted { color: var(--text-muted); }
.vmax-step {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.9rem;
    font-weight: 800;
    flex-shrink: 0;
}
.vmax-steps li code {
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--bg-surface-elevated);
    font-size: 0.86em;
}

.vmax-game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; }
.vmax-game-badge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-raised);
    font-weight: 700;
    transition: background-color var(--t-fast) var(--ease-out);
}
.vmax-game-badge:hover { background: var(--bg-surface-elevated); }
.vmax-check { color: var(--accent); }
.vmax-sub { width: 100%; font-size: 0.84rem; font-weight: 500; color: var(--text-muted); }
.vmax-panel:nth-of-type(4) { grid-column: 1 / -1; }

.vmax-variants { display: grid; gap: 10px; }
.vmax-variant { padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-surface-raised); }
.vmax-variant-title { font-size: 1.14rem; font-weight: 800; }
.vmax-variant-detail { font-size: 0.96rem; }

.vmax-mobo-box { margin-top: 14px; }
.vmax-mobo-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; }
.vmax-mobo-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mobo-tag {
    padding: 3px 11px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-raised);
    font-size: 0.88rem;
    font-weight: 600;
}

.vmax-faq { padding: 8px 0; }
.vmax-faq-q { font-weight: 700; }
.vmax-faq-a { color: var(--text-secondary); }

.vmax-download-panel { grid-column: 1 / -1; background: var(--accent); color: var(--on-accent); }
.vmax-download-panel .vmax-muted { color: var(--on-accent); }
.vmax-download-panel strong[style] { color: inherit !important; }
.vmax-download-panel .action-btn { background: var(--on-accent); color: var(--text-pure); }
.vmax-download-panel .action-btn::before { background: var(--text-pure); }
.vmax-download-panel .action-btn:hover { color: var(--on-accent); }
.vmax-download-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.vmax-credits { margin-top: 12px; font-size: 0.94rem; }

.macro-panel { grid-column: 1 / -1; padding: clamp(36px, 6vw, 72px) 24px; text-align: center; }
.macro-panel .vmax-panel-header { justify-content: center; font-size: clamp(2rem, 4.4vw, 3.6rem); }
.macro-panel p { margin-bottom: 26px; color: var(--text-secondary); font-size: 1.1rem; }
.macro-panel .action-btn { background: var(--accent); color: var(--on-accent); min-height: 62px; padding: 16px 38px; font-size: 1.4rem; }
.macro-panel .action-btn::before { background: var(--text-pure); }

.load-more-row { margin-top: 26px; text-align: center; }

/* ---------- Skeletons ---------- */

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-surface-raised);
    border-radius: var(--radius-md);
}
.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.5s var(--ease-in-out) infinite;
}
.skeleton-video { width: 100%; aspect-ratio: 16 / 9; }
.skeleton-card { width: 100%; height: 180px; }

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

footer {
    margin-left: var(--rail);
    padding: 44px var(--gutter) 30px;
    background: var(--bg-surface);
    border-radius: var(--radius-xl) 0 0 0;
}
.footer-inner { max-width: 1460px; margin: 0 auto; }
.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.14em;
    /* Logo plus the 6.6em wide name fills the column at every width */
    font-size: min(calc((100vw - var(--rail) - 2 * var(--gutter)) / 7.7), 188px);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.88;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}
.footer-logo { width: 0.72em; height: 0.72em; object-fit: contain; flex-shrink: 0; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 20px; }
.footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-raised);
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast), transform var(--t-med) var(--spring);
}
.footer-btn:hover { background: var(--bg-surface-elevated); color: var(--text-pure); }
.footer-btn:active { transform: scale(0.97); }
.footer-sep { display: none; }
.footer-legal { margin-top: 20px; max-width: 86ch; }
.footer-disclaimer { font-size: 0.88rem; color: var(--text-muted); }
.footer-copy { margin-top: 6px; font-size: 0.88rem; color: var(--text-dim); }

/* ---------- Keyframes ---------- */

@keyframes riseIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.92); }
    to { opacity: 1; transform: none; }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateY(8px) scale(0.96); }
}
@keyframes shimmer {
    to { transform: translateX(100%); }
}
@keyframes stickerIn {
    from { opacity: 0; transform: rotate(-14deg) scale(0.5); }
    to { opacity: 1; transform: rotate(7deg) scale(1); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1400px) {
    .btn-text { display: none; }
    .dl-btn-nav { padding: 0 14px; }
    .hub-grid { grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr); }
}

@media (max-width: 1200px) {
    .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .price-card.lifetime { grid-column: 1 / -1; order: -1; }
    .vmax-container, .forum-grid { grid-template-columns: minmax(0, 1fr); }
    .hub-grid { grid-template-columns: minmax(0, 1fr); }
    .hub-side { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; }
    .hub-tile { min-height: 148px; }
}

@media (max-width: 960px) {
    :root { --bar: 66px; }
    .footer-brand { font-size: calc((100vw - 2 * var(--gutter)) / 7.7); }

    #mainNav { gap: 8px; padding: 0 16px; }
    .logo { width: auto; }
    .logo img { width: 42px; height: 42px; }
    .logo-text { display: none; }

    .hamburger-btn {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--bg-surface);
        flex-shrink: 0;
    }

    .nav-center {
        top: 0;
        width: min(84vw, 330px);
        padding: 14px 14px 24px;
        background: var(--bg-surface);
        border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
        transform: translateX(-104%);
        visibility: hidden;
        transition: transform 420ms var(--ease-out), visibility 0s linear 420ms;
        z-index: 1200;
    }
    .nav-center.mobile-open {
        transform: none;
        visibility: visible;
        transition: transform 420ms var(--ease-out), visibility 0s;
    }
    .nav-blob { left: 14px; }
    .tab-btn { font-size: 1.3rem; padding: 12px 18px; }

    .mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 4px 12px;
        flex-shrink: 0;
    }
    .mobile-drawer-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 1.6rem;
        font-weight: 900;
        font-stretch: 62%;
        text-transform: uppercase;
    }
    .mobile-drawer-logo { width: 40px; height: 40px; object-fit: contain; }
    .mobile-drawer-close {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--bg-surface-raised);
    }

    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 990;
        background: rgba(8, 6, 9, 0.7);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--t-med) var(--ease-out);
    }
    .mobile-nav-backdrop.show { opacity: 1; pointer-events: auto; }

    .user-text { display: none; }
    .user-profile { padding: 0; background: none; height: 44px; }
    .nav-coin-display { height: 44px; padding: 0 12px 0 8px; }
    .nav-bell { width: 44px; height: 44px; }
    .dl-btn-nav { width: 44px; height: 44px; padding: 0; justify-content: center; }
    .notification-dropdown { position: fixed; top: calc(var(--bar) + 4px); left: 12px; right: 12px; width: auto; }

    main { margin-left: 0; padding-top: calc(var(--bar) + 14px); }
    footer { margin-left: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }

    .ticket-split-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
    .ticket-sidebar { max-height: 220px; }
    .ticket-main { height: 62vh; min-height: 420px; }
    .hub-side { grid-template-columns: minmax(0, 1fr); }
    .perks-container { grid-template-columns: minmax(0, 1fr); }
    .stat-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-box:last-child { grid-column: 1 / -1; }

}

@media (max-width: 640px) {
    #login-overlay { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; row-gap: 14px; }
    .login-logo { right: auto; left: 50%; bottom: auto; top: 20vh; width: min(58vw, 30vh); margin-left: calc(min(58vw, 30vh) / -2); }
    .login-title { align-self: end; margin-bottom: 8vh; }
    .login-desc { grid-row: 2; }
    .discord-login-btn-large { grid-column: 1; grid-row: 3; width: 100%; }
    #login-overlay .action-btn { grid-column: 1; grid-row: 4; }

    .pricing-grid { grid-template-columns: minmax(0, 1fr); }
    .section-desc { font-size: 1.02rem; margin-bottom: 22px; }
    .controls-bar .action-btn { width: 100%; }
    .search-input { max-width: none; width: 100%; flex: 1 1 100%; }
    .channel-profile-wrapper { flex-direction: column; align-items: flex-start; gap: 6px; }
    .channel-info { padding-top: 0; }
    .privacy-row { flex-direction: column; align-items: stretch; }
    .ticket-main-header { flex-direction: column; align-items: flex-start; }
    .modal-overlay { padding: 10px; align-items: flex-end; }
    .modal-content { max-height: 92vh; border-radius: var(--radius-lg); }
    .nav-coin-display { display: none; }
}

/* Set by the head script when the system asks for reduced motion: colour and
   opacity keep their easing, everything that travels stops travelling. */
html.calm *, html.calm *::before, html.calm *::after {
    scroll-behavior: auto !important;
    transition-property: color, background-color, opacity, box-shadow, visibility !important;
}
html.calm .toast { animation: calmIn 200ms linear both, calmOut 240ms linear 2740ms forwards; }
html.calm .c-tab-content.active { animation: calmIn 240ms linear both; }
html.calm .login-logo { animation: calmIn 300ms linear both; transform: rotate(7deg); }
html.calm .skeleton::after { display: none; }
html.calm .modal-content,
html.calm .profile-dropdown,
html.calm .action-btn::before { transition: none; }
html.calm .modal-content,
html.calm .profile-dropdown { transform: none; }
html.calm .hub-tile:hover,
html.calm .config-card:hover,
html.calm .video-card:hover,
html.calm .price-card:hover,
html.calm .submit-btn:hover,
html.calm .tab-btn:hover:not(.active),
html.calm .discord-login-btn-large:hover { transform: none; }
html.calm .logo:hover img,
html.calm .forum-row:hover .f-icon,
html.calm .video-card:hover .video-thumbnail img,
html.calm .hub-tile:hover .hub-tile-star { transform: none; }

@keyframes calmIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes calmOut { to { opacity: 0; } }
