/* HIDE MAIN WINDOW SCROLLBAR PERMANENTLY (Native CSS) */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

:root {
    --theme-bg: #000000; /* Abyss — overridden by boot-theme.js / settings */
    --theme-bg-rgb: 0, 0, 0;
    --theme-primary: #ffffff;
    --theme-primary-rgb: 255, 255, 255;
    --theme-text: #cccccc;
    --theme-text-muted: #777777;
    --theme-on-primary: #000000;
    --theme-fg-strong: #ffffff;
    --theme-ring-track: rgba(255, 255, 255, 0.12);
}

@media (prefers-color-scheme: light) {
    :root {
        --theme-bg: #ffffff; /* Paper */
        --theme-bg-rgb: 255, 255, 255;
        --theme-primary: #000000;
        --theme-primary-rgb: 0, 0, 0;
        --theme-text: #333333;
        --theme-text-muted: #888888;
        --theme-on-primary: #ffffff;
        --theme-fg-strong: #333333;
        --theme-ring-track: rgba(0, 0, 0, 0.16);
    }
}

html,
body {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
    background-color: var(--theme-bg) !important;
}

/* Smooth theme switches — limited surfaces only (never universal * — breaks modal opacity/transitions) */
html.theme-animating,
html.theme-animating body {
    transition: background-color 500ms ease !important;
}

html.theme-animating #app-backdrop,
html.theme-animating #spa-content,
html.theme-animating #spa-boot-overlay,
html.theme-animating #spa-page-root,
html.theme-animating #spa-shell-footer {
    transition: background-color 500ms ease, color 500ms ease, border-color 500ms ease, box-shadow 500ms ease !important;
}

html.theme-animating .text-primary,
html.theme-animating .bg-primary,
html.theme-animating .border-primary,
html.theme-animating .header-typ-layer,
html.theme-animating .header-user-layer,
html.theme-animating .header-typ-wrapper,
html.theme-animating .header-user-wrapper,
html.theme-animating #caret::after,
html.theme-animating #spa-boot-caret::after,
html.theme-animating .player-level-avatar__progress,
html.theme-animating .player-level-avatar__track,
html.theme-animating .player-level-avatar__level,
html.theme-animating #header-account-xp-ring,
html.theme-animating #header-account-xp-track,
html.theme-animating #profile-xp-ring,
html.theme-animating #profile-xp-track,
html.theme-animating #word-progress,
html.theme-animating #wpm-display,
html.theme-animating #acc-display,
html.theme-animating #burst-display,
html.theme-animating #word-progress-bar {
    transition: background-color 500ms ease, color 500ms ease, border-color 500ms ease, fill 500ms ease, stroke 500ms ease, box-shadow 500ms ease, text-shadow 500ms ease, filter 500ms ease !important;
}

#app-body {
    background-color: transparent !important;
}

#app-backdrop {
    background-color: var(--theme-bg) !important;
    pointer-events: none;
}

/* One continuous painted column: page area + shell footer share this surface */
#spa-content {
    background-color: var(--theme-bg) !important;
}

#spa-page-root,
#spa-shell-footer,
body > header {
    background-color: transparent !important;
}

html {
    font-size: clamp(13px, 1.3032vw, 24px);
}

/* Graph Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 208, 255, 0.2);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 208, 255, 0.4);
}

/* Header Logo — rem so chrome tracks html { font-size: clamp(13px, 1.3032vw, 24px) }
   Reference: ~1440px viewport (1rem ≈ 18.77px). */
.header-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.557rem;
    width: 9.592rem;
    outline: none !important;
    border: none !important;
    background: transparent;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

#header-logo-link:focus,
#header-logo-link:focus-visible,
.header-logo-link:focus,
.header-logo-link:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.header-typ-wrapper,
.header-user-wrapper {
    background: transparent;
}

.header-logo-container {
    position: relative;
    width: 26.644rem;
    height: 26.644rem;
    transform: scale(0.5);
    margin: -13.322rem;
    flex-shrink: 0;
    pointer-events: none;
}

.header-logo-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.header-dynamic-layer {
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    opacity: 1;
}

.header-typ-layer {
    background-color: #95efff;
    -webkit-mask-image: url('../logo-assets/typ_.png');
    mask-image: url('../logo-assets/typ_.png');
}

.header-user-layer {
    background-color: #ffffff;
    -webkit-mask-image: url('../logo-assets/user.png');
    mask-image: url('../logo-assets/user.png');
}

.header-static-layer {
    z-index: 3;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 0 6px #ff3344) drop-shadow(0 0 15px rgba(255, 51, 68, 0.55));
}

.header-typ-wrapper {
    z-index: 1;
    filter: drop-shadow(0 0 6px #95efff) drop-shadow(0 0 15px rgba(128, 235, 255, 0.55));
}

.header-user-wrapper {
    z-index: 2;
    filter: drop-shadow(0 0 6px #ffffff) drop-shadow(0 0 15px rgba(255, 255, 255, 0.55));
}

.footer-mute-btn {
    outline: none !important;
    box-shadow: none !important;
    transition: none !important;
    -webkit-tap-highlight-color: transparent;
    color: #475569 !important;
}

.footer-mute-btn:hover,
.footer-mute-btn:focus,
.footer-mute-btn:focus-visible,
.footer-mute-btn:active {
    outline: none !important;
    box-shadow: none !important;
    color: #475569 !important;
}

/* Footer link weight — mono fonts only ship 400/700, so 700 is the visible bump; pill stays regular */
.footer-nav-weight {
    font-weight: 700 !important;
}

.footer-nav-weight .footer-pill,
.footer-nav-weight .footer-pill * {
    font-weight: 400 !important;
}

/* Logos + Contact/Terms/Privacy share one gap (display:contents flattens the socials wrapper) */
.footer-nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-socials {
    display: contents;
}

.footer-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    line-height: 0;
    font: inherit;
}

.footer-social-btn:hover {
    color: var(--theme-primary, #00d0ff);
}

.footer-social-icon {
    width: 0.62rem;
    height: 0.62rem;
    display: block;
    flex-shrink: 0;
}

/* ── Player level avatar (photo + XP ring + level badge) ── */
.player-level-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
    color: #cbd5e1;
    --pla-size: 2.75rem;
    --pla-photo: 72.7%;
    --pla-stroke: 2.5;
    --pla-badge-min: 1.1rem;
    --pla-badge-h: 1.1rem;
    --pla-badge-px: 0.25rem;
    --pla-badge-font: 0.48rem;
    --pla-initial-font: 0.75rem;
    --pla-bot-font: 1.1rem;
    width: var(--pla-size);
    height: var(--pla-size);
}

.player-level-avatar--xs {
    --pla-size: 1.75rem;
    --pla-stroke: 3;
    --pla-badge-min: 0.85rem;
    --pla-badge-h: 0.85rem;
    --pla-badge-px: 0.15rem;
    --pla-badge-font: 0.373rem;
    --pla-initial-font: 0.55rem;
    --pla-bot-font: 0.7rem;
}

.player-level-avatar--sm {
    --pla-size: 2.25rem;
    --pla-stroke: 2.75;
    --pla-badge-min: 0.95rem;
    --pla-badge-h: 0.95rem;
    --pla-badge-px: 0.2rem;
    --pla-badge-font: 0.426rem;
    --pla-initial-font: 0.65rem;
    --pla-bot-font: 0.9rem;
}

.player-level-avatar--md {
    --pla-size: 2.75rem;
}

.player-level-avatar--lg {
    --pla-size: 3.5rem;
    --pla-badge-min: 1.25rem;
    --pla-badge-h: 1.25rem;
    --pla-badge-px: 0.3rem;
    --pla-badge-font: 0.533rem;
    --pla-initial-font: 0.95rem;
    --pla-bot-font: 1.35rem;
}

.player-level-avatar--xl {
    --pla-size: 4rem;
    --pla-badge-min: 1.35rem;
    --pla-badge-h: 1.35rem;
    --pla-badge-px: 0.35rem;
    --pla-badge-font: 0.586rem;
    --pla-initial-font: 1.05rem;
    --pla-bot-font: 1.5rem;
}

.player-level-avatar--host {
    --pla-size: 8rem;
    --pla-photo: 78%;
    --pla-stroke: 1.6;
    --pla-badge-min: 1.75rem;
    --pla-badge-h: 1.75rem;
    --pla-badge-px: 0.5rem;
    --pla-badge-font: 0.746rem;
    --pla-initial-font: 2rem;
    --pla-bot-font: 2.5rem;
}

@media (min-width: 768px) {
    .player-level-avatar--host {
        --pla-size: 8.5rem;
    }
}

.player-level-avatar__ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
}

.player-level-avatar__track {
    stroke: var(--theme-ring-track, rgba(255, 255, 255, 0.12));
    stroke-width: var(--pla-stroke);
    transition: opacity 0.3s ease, stroke 0.5s ease;
}

.player-level-avatar__progress {
    stroke: rgb(var(--theme-primary-rgb, 255, 255, 255));
    stroke-width: var(--pla-stroke);
    transition: stroke-dashoffset 0.7s ease-out, opacity 0.3s ease, stroke 0.5s ease;
}

.player-level-avatar__photo {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--pla-photo);
    height: var(--pla-photo);
    border-radius: 9999px;
    overflow: hidden;
    background: rgba(26, 29, 35, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.player-level-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.player-level-avatar__initial {
    font-weight: 900;
    font-size: var(--pla-initial-font);
    line-height: 1;
    color: rgb(var(--theme-primary-rgb, 0, 208, 255));
    font-family: Inter, sans-serif;
}

.player-level-avatar__bot {
    font-size: var(--pla-bot-font) !important;
    line-height: 1;
    color: rgb(var(--theme-primary-rgb, 0, 208, 255));
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.player-level-avatar__level {
    position: absolute;
    bottom: -0.15rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    min-width: var(--pla-badge-min);
    height: var(--pla-badge-h);
    padding: 0 var(--pla-badge-px);
    border-radius: 9999px;
    background: rgb(var(--theme-primary-rgb, 255, 255, 255));
    color: var(--theme-on-primary, #0e1013);
    font-size: var(--pla-badge-font);
    font-weight: 900;
    line-height: var(--pla-badge-h);
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    font-family: Inter, sans-serif;
}

.player-level-avatar.is-dimmed {
    opacity: 0.9;
}

.player-level-avatar--clickable {
    cursor: pointer;
}

.player-level-avatar--clickable:hover .player-level-avatar__photo {
    border-color: rgba(var(--theme-primary-rgb, 0, 208, 255), 0.45);
}

.player-level-avatar--clickable:focus-visible {
    outline: 2px solid rgb(var(--theme-primary-rgb, 0, 208, 255));
    outline-offset: 2px;
    border-radius: 9999px;
}

/* Player profile box — transparent hit area, no dim/blur of the page behind */
#player-profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 240;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: transparent;
    transition: opacity 0.2s ease;
}

/* System confirm — same menu-bubble glass, transparent hit area (no page dim) */
#system-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: transparent;
    transition: opacity 0.2s ease;
}

/* Custom amount prompt — transparent hit area, no dim/blur of the page behind */
#custom-prompt-modal {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: transparent;
    transition: opacity 0.2s ease;
}

#custom-prompt-box {
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#system-confirm-box {
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#system-confirm-box .system-confirm-ok-danger {
    background: rgba(255, 51, 51, 0.15) !important;
    color: #ff5555 !important;
    border-color: rgba(255, 51, 51, 0.25) !important;
}

#system-confirm-box .system-confirm-ok-danger:hover {
    background: rgba(255, 51, 51, 0.25) !important;
}

/* Contact modal — same menu-bubble glass, transparent hit area (no page dim) */
#contact-modal {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: transparent;
    transition: opacity 0.2s ease;
}

#contact-box {
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#contact-problem-picker {
    z-index: 2;
}

.contact-problem-chevron {
    transition: transform 180ms ease;
}

#contact-problem-btn[aria-expanded="true"] .contact-problem-chevron {
    transform: rotate(180deg);
}

.contact-problem-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 30;
    display: grid;
    gap: 0.2rem;
    padding: 0.35rem;
    background: rgba(26, 29, 35, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}

.contact-problem-menu.hidden {
    display: none;
}

.contact-problem-option {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    background: transparent;
    color: #94a3b8;
    font-size: 0.8125rem;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    outline: none;
    transition: background 140ms ease, color 140ms ease;
}

.contact-problem-option:hover,
.contact-problem-option:focus-visible {
    background: color-mix(in srgb, rgb(var(--theme-primary-rgb, 0, 208, 255)) 12%, transparent);
    color: #f1f5f9;
}

.contact-problem-option[aria-selected="true"] {
    background: color-mix(in srgb, rgb(var(--theme-primary-rgb, 0, 208, 255)) 18%, transparent);
    color: rgb(var(--theme-primary-rgb, 0, 208, 255));
}

.contact-pill-input,
.contact-pill-textarea {
    -webkit-appearance: none !important;
    appearance: none !important;
    background-color: rgba(0, 0, 0, 0.35) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.contact-pill-textarea {
    line-height: 1.45;
    overflow-y: auto;
    min-height: calc(1.45em * 2 + 1.25rem);
    max-height: calc(1.45em * 5 + 1.25rem);
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.contact-pill-textarea:hover {
    scrollbar-color: color-mix(in srgb, rgb(var(--theme-primary-rgb, 0, 208, 255)) 50%, transparent) transparent;
}

.contact-pill-textarea::-webkit-scrollbar {
    width: 6px;
}

.contact-pill-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.contact-pill-textarea::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
}

.contact-pill-textarea:hover::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, rgb(var(--theme-primary-rgb, 0, 208, 255)) 50%, transparent);
}

            #player-profile-box .ppc-hero-avatar {
                --pla-size: 7.5rem;
            }
            @media (min-width: 768px) {
                #player-profile-box .ppc-hero-avatar {
                    --pla-size: 8.5rem;
                }
            }

/* ── Cookie consent banner (same glass as header menu bubble) ── */
.usertypo-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10050;
    padding: 1rem;
    pointer-events: none;
}
.usertypo-cookie-banner.is-hidden {
    display: none;
}
.usertypo-cookie-banner__inner {
    pointer-events: auto;
    max-width: 40rem;
    margin: 0 auto;
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--theme-menu-bg, rgba(68, 68, 68, 0.4)) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    color: var(--theme-text, #ccc);
}
.usertypo-cookie-banner__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--theme-fg-strong, #fff);
    margin: 0 0 0.35rem;
}
.usertypo-cookie-banner__text {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--theme-text-muted, #888);
}
.usertypo-cookie-banner__text--tight {
    margin-top: 0.5rem;
}
.usertypo-cookie-banner__link {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: var(--theme-primary, #fff);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.usertypo-cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
    justify-content: flex-end;
}
.usertypo-cookie-btn {
    appearance: none;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.usertypo-cookie-btn--ghost {
    background: transparent;
    color: var(--theme-text, #ccc);
    border: 1px solid color-mix(in srgb, rgb(var(--theme-primary-rgb, 255, 255, 255)) 22%, transparent);
}
.usertypo-cookie-btn--ghost:hover {
    border-color: color-mix(in srgb, rgb(var(--theme-primary-rgb, 255, 255, 255)) 45%, transparent);
    color: var(--theme-fg-strong, #fff);
}
.usertypo-cookie-btn--primary {
    background: var(--theme-primary, #fff);
    color: var(--theme-on-primary, #000);
    border: 1px solid transparent;
}
.usertypo-cookie-btn--primary:hover {
    filter: brightness(1.05);
}
.usertypo-cookie-banner__details {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid color-mix(in srgb, rgb(var(--theme-primary-rgb, 255, 255, 255)) 12%, transparent);
}
.usertypo-cookie-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
}
.usertypo-cookie-row__label {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--theme-fg-strong, #fff);
}
.usertypo-cookie-row__hint {
    margin: 0.15rem 0 0;
    font-size: 0.7rem;
    color: var(--theme-text-muted, #888);
}
.usertypo-cookie-locked {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--theme-text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    padding-top: 0.15rem;
}
@media (max-width: 640px) {
    .usertypo-cookie-banner__actions {
        flex-direction: column;
    }
    .usertypo-cookie-btn {
        width: 100%;
        text-align: center;
    }
}
