/* RC Tech Village — base styles (extracted from index.html main <style>) */
    /* =========================================================
   STEP 5 — FINAL CSS CLEANUP
   Structure:
   01. reset + tokens
   02. shared ui
   03. header
   04. dropdowns
   05. lobby layout
   06. modals
   07. profile
   08. shop
   09. missions
   10. community
   11. contacts
   12. HUD
   13. responsive

   z-index ladder:
   --z-base: 1
   --z-overlay: 2
   --z-page-ui: 10
   --z-header: 100
   --z-dropdown-backdrop: 1090
   --z-dropdown: 1100
   --z-dropdown-top: 1120
   --z-hud-status: 1800
   --z-run-overlay: 2000
   --z-station-refuel-countdown: 2050
   --z-station-refuel-overlay: 2060
   --z-modal-profile: 2600
   --z-modal-high: 3000
   --z-toast: 5000
   --z-auth-overlay: 9000
   --z-start-screen: 99999
   ========================================================= */

/* =========================
   01. reset + tokens
   ========================= */
:root {
    --neon: #00f2ff;
    --disabled-opacity: 0.42;       /* S1.2: unified faded state for disabled interactive buttons */
    --disabled-field-opacity: 0.55; /* S1.2: disabled form fields stay readable */
    --empty-text: #cfe0e8;                 /* S1.3: shared empty-state / note text colour */
    --empty-border: rgba(0, 242, 255, 0.2);/* S1.3: shared empty-state dashed border */
    --empty-bg: rgba(255, 255, 255, 0.025);/* S1.3: shared empty-state subtle fill */
    --section-radius: 14px;                /* S1.3: shared corner radius for section cards + empty boxes */
    --neon-pink: #ff007f;
    --glass: rgba(10, 15, 20, 0.65);
    --glass-strong: rgba(8, 16, 22, 0.94);
    --glass-soft: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(0, 242, 255, 0.2);
    --glass-border-soft: rgba(0, 242, 255, 0.14);
    --text-main: #ffffff;
    --text-soft: #c6d7de;
    --text-muted: #8da2ad;
    --panel-radius: 12px;
    --panel-radius-lg: 22px;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-neon: 0 0 15px var(--neon);
    --font: 'Segoe UI', Roboto, Helvetica, sans-serif;

    /* Patch 4.1 shell sizing: shared desktop columns for lobby/header/footer. */
    --lobby-left-column: 360px;
    --lobby-right-column: 320px;
    --header-logo-column: var(--lobby-left-column);

    --z-base: 1;
    --z-overlay: 2;
    --z-page-ui: 10;
    --z-header: 100;
    --z-dropdown-backdrop: 1090;
    --z-dropdown: 1100;
    --z-dropdown-top: 1120;
    --z-hud-status: 1800;
    --z-run-overlay: 2000;
    --z-station-refuel-countdown: 2050;
    --z-station-refuel-overlay: 2060;
    --z-modal-profile: 2600;
    --z-modal-high: 3000;
    --z-toast: 5000;
    --z-auth-overlay: 9000;
    --z-start-screen: 99999;
}

    html, body {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100dvh;
        background: #050505;
        color: white;
        font-family: var(--font);
        overflow: hidden;
        touch-action: none;
        text-transform: uppercase;
    }

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

    /* Usernames are stored and shown exactly as typed (mixed case) — opt out of the
       global uppercase theme on the surfaces that render a username. `.user-handle` is the
       base class every renderPriorityNameHtml() output carries (leaderboard, in-ride chat,
       players list), so plain players (no priority/admin/premium badge) are covered too. */
    .user-handle,
    #logged-in-username,
    .hud-pilot-name,
    .priority-name,
    .public-profile-name,
    .profile-name,
    .friend-name,
    .header-friend-name,
    .chat-person-name,
    .player-cell-name,
    .social-compact-name,
    .social-settings-preview-name,
    .admin-name,
    .premium-name {
        text-transform: none;
    }

    /* shared utility patterns for future refactors */
    .ui-glass-panel {
        background: var(--glass);
        border: 1px solid var(--glass-border);
        border-radius: var(--panel-radius);
        box-shadow: var(--shadow-glass);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .ui-action-button {
        border: 1px solid var(--neon);
        border-radius: 10px;
        background: transparent;
        color: var(--neon);
        cursor: pointer;
        font-weight: 800;
        transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }

    .ui-action-button:hover {
        background: var(--neon);
        color: #000;
        box-shadow: var(--shadow-neon);
    }

    .ui-modal-window {
        background: linear-gradient(180deg, rgba(8, 16, 22, 0.95) 0%, rgba(7, 14, 20, 0.88) 100%);
        border: 1px solid var(--glass-border);
        border-radius: var(--panel-radius-lg);
        box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42), 0 0 18px rgba(0, 242, 255, 0.12);
    }

    .ui-panel-title {
        color: var(--text-main);
        font-weight: 900;
        letter-spacing: 1px;
    }

    .ui-filter-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        padding: 0 12px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(0, 242, 255, 0.16);
        color: var(--text-soft);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.8px;
    }

    .ui-mini-square-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-icon-frame {
        border: 1px solid rgba(255, 255, 255, 0.15);
        background: rgba(0, 0, 0, 0.32);
        color: var(--text-main);
    }

    .btn-icon-frame:hover {
        border-color: var(--neon);
        color: var(--neon);
        box-shadow: 0 0 12px rgba(0, 242, 255, 0.22);
        /* S1.3: keep a dark surface on hover. These icon buttons also carry .ui-action-button,
           whose :hover fills the background with var(--neon) — same color as the icon above,
           making the ✕ vanish into the button. Restore the dark base so the neon glyph stays visible. */
        background: rgba(0, 0, 0, 0.32);
    }

    .btn-surface {
        border: 1px solid rgba(0, 242, 255, 0.16);
        background: rgba(255, 255, 255, 0.03);
        color: #d8e8ef;
        font-weight: 800;
        letter-spacing: 1px;
    }

    .btn-surface:hover {
        border-color: rgba(0, 242, 255, 0.35);
        background: rgba(0, 242, 255, 0.08);
        /* S1.3: keep label light on hover. .ui-action-button:hover sets color:#000 for the
           neon-fill style, but .btn-surface hover only tints the background — so the text
           must stay light here or it turns near-black on a dark surface (unreadable). */
        color: #eaf6fb;
    }

    /* S1.3: standardize all section REFRESH buttons. Base .mini-action-btn is width:100%
       text-align:left (for vertical menus); the refresh buttons live in many different header
       containers (.panel-title, .achievement-toolbar, run-history header sibling, message/
       notification toolbars), so target them by action to make every one compact + uniform
       (otherwise e.g. Achievements/Run-History REFRESH stretch full-width). */
    .mini-action-btn[data-action^="refresh-"] {
        width: auto;
        text-align: center;
    }

    .btn-primary-accent {
        border: none;
        background: linear-gradient(90deg, rgba(255,215,0,0.95), rgba(255,0,127,0.92));
        color: #000;
        font-weight: 900;
        box-shadow: 0 10px 24px rgba(255, 0, 127, 0.14);
    }

    /* Keep the accent gradient + dark label on hover. The combined-class selector is needed
       because most accent buttons are also .mini-action-btn, whose later :hover rule
       (faint dark bg) would otherwise win on equal specificity and leave black-on-dark text. */
    .btn-primary-accent:hover,
    .mini-action-btn.btn-primary-accent:hover {
        background: linear-gradient(90deg, rgba(255,224,60,1), rgba(255,40,150,1));
        color: #000;
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(255, 0, 127, 0.18);
    }

    /* S1.3: spent/in-flight CLAIM state — dim + desaturate the accent so an already-used
       button reads as inactive and can't be clicked again before the re-render removes it. */
    .btn-primary-accent:disabled,
    .btn-primary-accent.is-loading {
        opacity: var(--disabled-opacity);
        filter: grayscale(0.5);
        cursor: progress;
        box-shadow: none;
        transform: none;
    }

    .btn-pill-ghost {
        border-radius: 999px;
        border: 1px solid rgba(0, 242, 255, 0.18);
        background: rgba(255,255,255,0.04);
        color: #f4fbff;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 1px;
    }

    .btn-pill-ghost:hover {
        background: rgba(0,242,255,0.10);
        border-color: rgba(0,242,255,0.34);
    }

    /* =========================
       02b. shared ui consolidation
       ========================= */
    .menu-dropdown-panel,
    .quick-panel,

    .notification-panel-actions,
    .notification-actions {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }

    .notification-panel-actions button,
    .notification-actions button,
    .quick-panel .notification-mini-btn {
        min-height: 28px;
        height: 28px;
        padding: 0 10px;
        border-radius: 8px;
        font-size: 10px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .social-action-row {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 8px;
    }

    .social-action-row .mini-action-btn,
    .social-action-row .square-action-btn {
        min-height: 28px;
        height: 28px;
        padding: 0 10px;
        font-size: 10px;
    }

    .online-dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        display: inline-block;
        margin-right: 6px;
        background: #4cff8f;
        box-shadow: 0 0 8px rgba(76,255,143,.75);
    }

    .online-dot.offline {
        background: #8b98a0;
        box-shadow: none;
    }

    .online-dot.ingame {
        background: var(--neon);
        box-shadow: 0 0 8px rgba(0,242,255,.85);
    }

    .mobile-burger-panel {
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .station-refuel-card,
    .run-summary-card,
    .startup-window,
    .profile-card,
    .shop-window,
    .hub-window {
        border-radius: var(--panel-radius-lg);
        border: 1px solid var(--glass-border);
        box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42), 0 0 18px rgba(0, 242, 255, 0.12);
    }

    .burger-btn,
    .nav-icon-btn,
    .nav-msg-btn,
    .startup-btn,
    .run-summary-btn,
    .menu-item-btn,
    .mini-action-btn,
    .contact-submit-btn,
    .profile-close-btn,
    .shop-close-btn,
    .watch-fullscreen-btn,
    .fs-button {
        transition:
            background 0.2s ease,
            color 0.2s ease,
            box-shadow 0.2s ease,
            border-color 0.2s ease,
            transform 0.2s ease;
    }

    .filter-chip,
    .camera-chip,
    .live-meta-chip,
    .stat-chip,
    .hud-mini-chip {
        font-weight: 800;
        letter-spacing: 0.8px;
    }

    .route-grid,
    .run-summary-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .footer-grid,
    .run-summary-actions,
    .hub-panel-grid,
    .hub-panel-split,
    .full-chat-layout {
        gap: 14px;
    }


    /* =========================
       Global neon scrollbars
       ========================= */
    * {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 242, 255, 0.82) rgba(255, 255, 255, 0.045);
    }

    *::-webkit-scrollbar {
        width: 7px;
        height: 7px;
    }

    *::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.045);
        border-radius: 999px;
    }

    *::-webkit-scrollbar-thumb {
        background:
            linear-gradient(
                180deg,
                rgba(0, 242, 255, 0.95),
                rgba(0, 122, 255, 0.72)
            );
        border-radius: 999px;
        border: 1px solid rgba(0, 242, 255, 0.28);
        box-shadow: 0 0 10px rgba(0, 242, 255, 0.34);
    }

    *::-webkit-scrollbar-thumb:hover {
        background:
            linear-gradient(
                180deg,
                rgba(0, 242, 255, 1),
                rgba(0, 170, 255, 0.92)
            );
        box-shadow: 0 0 14px rgba(0, 242, 255, 0.52);
    }

    *::-webkit-scrollbar-corner {
        background: transparent;
    }

    body,
    .sidebar-left,
    .sidebar-right,
    .leaderboard-scroll,
    .leaderboard-list,
    .hub-panel-content,
    .full-chat-messages,
    .global-chat-messages,
    .chat-messages,
    .shop-grid,
    .shop-window,
    .profile-main,
    .profile-container,
    .community-list,
    .mission-list,
    .contacts-panel,
    .location-accordion {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 242, 255, 0.88) rgba(255, 255, 255, 0.045);
    }


    /* =========================
       02. shared ui
       ========================= */
    .glass-panel {
        background: var(--glass);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .neon-btn {
        width: 100%;
        padding: 15px;
        margin-bottom: 15px;
        background: var(--neon);
        color: black;
        border: none;
        border-radius: 4px;
        font-weight: bold;
        font-size: 16px;
        cursor: pointer;
        transition: 0.3s;
        letter-spacing: 1px;
    }

    .neon-btn:hover {
        background: white;
        box-shadow: 0 0 15px var(--neon);
    }

    /* S1.2: single shared loader (replaces ad-hoc "Loading…" text divs) */
    .app-loader {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 18px;
        color: var(--neon);
        font-size: 12px;
        letter-spacing: 1px;
        text-transform: uppercase;
    }
    .app-loader-spin {
        width: 18px;
        height: 18px;
        border: 2px solid rgba(0, 242, 255, 0.22);
        border-top-color: var(--neon);
        border-radius: 50%;
        animation: app-loader-spin 0.8s linear infinite;
        flex: 0 0 auto;
    }
    @keyframes app-loader-spin {
        to { transform: rotate(360deg); }
    }
    @media (prefers-reduced-motion: reduce) {
        .app-loader-spin { animation-duration: 2s; }
    }

    /* S1.2: in-flight / disabled state for submit buttons (loading-on-submit) */
    .neon-btn:disabled,
    .neon-btn.is-loading {
        opacity: var(--disabled-opacity);
        cursor: progress;
        box-shadow: none;
    }
    .neon-btn:disabled:hover,
    .neon-btn.is-loading:hover {
        background: transparent;
        box-shadow: none;
    }

    .btn-action {
        background: transparent;
        color: var(--neon);
        padding: 8px 16px;
        border: 1px solid var(--neon);
        border-radius: 4px;
        cursor: pointer;
        font-weight: bold;
        transition: 0.3s;
        text-shadow: 0 0 5px var(--neon);
        box-shadow: inset 0 0 5px rgba(0, 242, 255, 0.2);
        text-transform: uppercase;
    }

    .btn-action:hover {
        background: var(--neon);
        color: black;
        box-shadow: 0 0 15px var(--neon);
    }

    .btn-logout {
        border-color: #ff4444;
        color: #ff4444;
        text-shadow: none;
        box-shadow: none;
    }

    .btn-logout:hover {
        background: #ff4444;
        color: white;
        box-shadow: 0 0 15px #ff4444;
    }

    .label {
        font-size: 10px;
        color: #aaa;
        margin-bottom: 2px;
        letter-spacing: 1px;
    }

    .val {
        font-size: 18px;
        font-weight: bold;
        color: var(--neon);
    }

    /* =========================
       06. modals / startup layers
       ========================= */
    #start-screen {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        background: #050505;
        z-index: var(--z-start-screen);
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        transition: opacity 0.5s;
        pointer-events: auto;
    }

    #auth-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        background: rgba(10, 15, 20, 0.95);
        z-index: var(--z-auth-overlay);
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
        transition: opacity 0.5s ease-in-out;
    }

    .start-btn {
        font-size: 24px;
        color: var(--neon);
        border: 2px solid var(--neon);
        padding: 15px 40px;
        font-weight: 900;
        letter-spacing: 4px;
        box-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
        border-radius: 5px;
        animation: pulseStart 2s infinite;
        background: rgba(0, 0, 0, 0.8);
    }

    @keyframes pulseStart {
        0% { box-shadow: 0 0 10px var(--neon); text-shadow: 0 0 5px var(--neon); transform: scale(1); }
        50% { box-shadow: 0 0 30px var(--neon); text-shadow: 0 0 20px var(--neon); transform: scale(1.02); }
        100% { box-shadow: 0 0 10px var(--neon); text-shadow: 0 0 5px var(--neon); transform: scale(1); }
    }

    .glass-panel-auth {
        width: 90%;
        max-width: 350px;
        padding: 40px 30px;
        text-align: center;
        border: 1px solid var(--neon);
        background: var(--glass);
        border-radius: 12px;
        box-shadow: 0 0 30px rgba(0, 242, 255, 0.2);
        backdrop-filter: blur(10px);
    }

    /* =========================
       05. lobby layout / background layers
       ========================= */
    .lobby-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        z-index: 2;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 25, 35, 0.4) 100%);
        backdrop-filter: blur(6px);
        pointer-events: none;
    }

    .lobby-bg {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        z-index: 1;
        pointer-events: none;
    }

    #global-overlay,
    #lobby-video-container {
        pointer-events: none !important;
    }

    /* =========================
       05. lobby layout / page views
       ========================= */
    .page-view {
        position: absolute;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        padding-top: 80px;
        box-sizing: border-box;
        overflow: hidden;
        display: none;
        flex-direction: column;
        z-index: 10;
    }

    .lobby-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: minmax(260px, var(--header-logo-column)) minmax(0, 1fr) minmax(320px, max-content);
        align-items: center;
        gap: 24px;
        padding: 14px 28px;
        background: linear-gradient(180deg, rgba(3, 10, 14, 0.86) 0%, rgba(5, 12, 18, 0.72) 100%);
        border-bottom: 1px solid rgba(0, 242, 255, 0.18);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(255,255,255,0.03);
        z-index: 1000;
        backdrop-filter: blur(14px);
    }

    .nav-left {
        display: flex;
        align-items: center;
        justify-self: stretch;
        min-width: 0;
        width: 100%;
    }

    .brand-slot {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
    }

    .brand-logo-img {
        width: 42px;
        height: 42px;
        object-fit: contain;
        flex: 0 0 auto;
        display: none;
        filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.36));
    }

    .brand-slot.has-image .brand-logo-img {
        display: block;
    }

    .brand-slot.has-image .brand-logo-mark {
        display: none;
    }

    .nav-center {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 28px;
        justify-self: center;
        min-width: 0;
        margin: 0;
    }

    .logo {
        min-width: 0;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        font-size: 28px;
        font-weight: 900;
        color: white;
        text-shadow: 0 0 10px var(--neon), 0 0 20px var(--neon);
        letter-spacing: 2px;
        margin: 0;
        cursor: pointer;
        line-height: 1;
    }

    .brand-logo-mark {
        flex: 0 0 auto;
        filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.36));
    }

    .brand-logo-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* The " - Alcoy" suffix doesn't fit any current header layout: the desktop logo
       column (--header-logo-column: 360px) leaves ~303px for text while the full brand
       needs ~402px, so it always rendered as "RCTECHVILLAGE - A…". Hidden until the
       layout gets room for it (widening the column collides admin nav links with the
       header icon buttons). */
    .brand-logo-suffix {
        display: none;
    }

    /* =========================
       02c. button families
       ========================= */

    /* =========================
       02d. panel / layout families
       ========================= */
    .panel-frame {
        background: var(--glass);
        border: 1px solid var(--glass-border-soft);
        border-radius: var(--panel-radius);
        box-shadow: var(--shadow-glass);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .panel-frame-strong {
        background: linear-gradient(180deg, rgba(8, 16, 22, 0.95) 0%, rgba(7, 14, 20, 0.9) 100%);
        border: 1px solid var(--glass-border);
        border-radius: var(--panel-radius-lg);
        box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42), 0 0 18px rgba(0, 242, 255, 0.12);
    }

    .layout-window-shell {
        position: absolute;
        top: 100px;
        left: 430px;
        right: 380px;
        bottom: 40px;
        z-index: 2;
        padding: 24px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .modal-cover {
        position: absolute;
        inset: 0;
        display: none;
    }

    .modal-cover.is-open {
        display: block;
    }

    .modal-backdrop-shared {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    .is-hidden {
        display: none !important;
    }

    .auth-dialog {
        width: min(420px, calc(100vw - 28px));
        padding: 34px 28px;
        text-align: center;
    }

    .auth-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }

    .auth-title {
        color: var(--neon);
        margin-bottom: 25px;
        font-weight: 900;
    }

    .auth-input {
        width: 100%;
        padding: 12px;
        background: rgba(0,0,0,0.5);
        border: 1px solid var(--glass-border);
        color: white;
        text-align: center;
    }

    .auth-input + .auth-input {
        margin-top: 15px;
    }

    /* Give the submit button the same gap from PASSWORD as the inputs have from
       each other, so AUTHENTICATE doesn't crowd the password field. */
    #auth-submit-btn {
        margin-top: 15px;
    }

    .auth-error {
        min-height: 20px;
        margin-top: 14px;
        color: #ff4444;
        font-size: 12px;
        letter-spacing: 0.5px;
    }

    .modal-window-shared {
        position: relative;
        z-index: 2;
    }

    .public-profile-card,
    .profile-card,
    .startup-window,
    .run-summary-card,
    .station-refuel-card,
    .glass-panel-auth {
        background: linear-gradient(180deg, rgba(8, 16, 22, 0.96) 0%, rgba(7, 14, 20, 0.92) 100%);
        border: 1px solid var(--glass-border);
        box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42), 0 0 18px rgba(0, 242, 255, 0.12);
    }

    .shop-window,
    .hub-window {
        left: 430px;
        right: 380px;
    }

    .menu-dropdown-panel:hover,
    .quick-panel:hover,
    .mobile-burger-panel:hover,
    .news-card:hover,
    .offer-card:hover,
    .route-card:hover,
    .shop-card:hover {
        border-color: rgba(0, 242, 255, 0.3);
    }
/* =========================
       03. header
       ========================= */
.nav-links {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 30px;
    }

    .nav-links a {
        color: #aaa;
        text-decoration: none;
        font-weight: bold;
        font-size: 16px;
        transition: 0.3s;
        cursor: pointer;
        letter-spacing: 1px;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: var(--neon);
        text-shadow: 0 0 10px var(--neon);
    }

    .server-status-pill {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 12px;
        border: 1px solid rgba(0, 242, 255, 0.2);
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.35);
        white-space: nowrap;
        font-size: 12px;
        letter-spacing: 1px;
        color: #cfd8dc;
        box-shadow: inset 0 0 10px rgba(0, 242, 255, 0.06);
    }

    .server-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ff4444;
        box-shadow: 0 0 8px #ff4444;
        flex: 0 0 auto;
    }

    .user-profile-nav {
        display: flex;
        align-items: center;
        gap: 14px;
        justify-self: end;
        margin-left: 0;
    }

    .pilot-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        line-height: 1.1;
        cursor: pointer;
        padding: 6px 10px;
        border-radius: 12px;
        transition: background 0.2s ease, box-shadow 0.2s ease;
    }

    .pilot-line {
        display: flex;
        gap: 6px;
        align-items: center;
        font-size: 13px;
        font-weight: bold;
        letter-spacing: 1px;
        color: white;
    }

    .pilot-label {
        color: #8c9aa3;
    }

    .pilot-subline {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 4px;
        font-size: 11px;
        letter-spacing: 1px;
        color: #9fb2bc;
    }

    .pilot-divider {
        opacity: 0.5;
    }

    #nav-pilot-level {
        color: var(--neon-pink);
        font-weight: bold;
    }

    #nav-pilot-energy {
        color: var(--neon);
        font-weight: bold;
        text-shadow: 0 0 6px rgba(0, 242, 255, 0.35);
    }

    .nav-msg-btn {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        border: 1px solid rgba(0, 242, 255, 0.35);
        background: rgba(0, 0, 0, 0.35);
        color: var(--neon);
        cursor: pointer;
        font-size: 16px;
        font-weight: bold;
        box-shadow: inset 0 0 8px rgba(0, 242, 255, 0.08);
    }

    .nav-msg-btn:hover {
        background: rgba(0, 242, 255, 0.12);
        box-shadow: 0 0 12px rgba(0, 242, 255, 0.2);
    }

    .auth-buttons {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .auth-buttons .btn-action {
        min-width: 92px;
    }

    .burger-btn {
        display: none;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        border: 1px solid rgba(0, 242, 255, 0.22);
        background: rgba(0,0,0,0.28);
        color: var(--neon);
        margin-right: 12px;
        cursor: pointer;
        font-size: 18px;
    }

    .shop-link {
        color: #ffe7a1 !important;
        background: linear-gradient(90deg, rgba(255,215,0,0.10), rgba(255,255,255,0));
        padding: 6px 10px;
        border-radius: 999px;
    }

    /* These header icon buttons also carry .ui-action-button, whose base style draws a
       1px neon border (+ neon hover fill/shadow). The reset must win by SPECIFICITY, not
       by source order — an order-dependent reset can lose (stale/mixed cached CSS) and
       all four header buttons light up with a stuck neon outline until reload. */
    .nav-icon-btn.ui-action-button,
    .nav-icon-btn {
        position: relative;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        border: none;
        background: rgba(0, 0, 0, 0.18);
        color: var(--neon);
        cursor: pointer;
        font-size: 21px;
        font-weight: bold;
        box-shadow: none;
        transition: 0.2s;
    }

    .nav-icon-btn.ui-action-button:hover,
    .nav-icon-btn:hover {
        background: rgba(0, 242, 255, 0.10);
        box-shadow: 0 0 10px rgba(0, 242, 255, 0.14);
        /* keep the glyph neon: .ui-action-button:hover sets color:#000 for its
           neon-fill style, which would hide the icon on this dark surface */
        color: var(--neon);
    }

    .nav-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 16px;
        height: 16px;
        border-radius: 999px;
        background: #ff4444;
        color: white;
        font-size: 10px;
        line-height: 16px;
        text-align: center;
        box-shadow: 0 0 10px rgba(255,68,68,0.35);
        padding: 0 4px;
    }

    /* =========================
       04. dropdowns
       ========================= */
.ui-backdrop {
        position: fixed;
        inset: 74px 0 0 0;
        z-index: var(--z-dropdown-backdrop);
        background: rgba(1, 7, 11, 0.28);
        backdrop-filter: blur(4px);
    }

    .menu-dropdown-host, .quick-panel-host {
        position: fixed;
        top: 76px;
        left: 0;
        width: 100%;
        z-index: var(--z-dropdown);
        pointer-events: none;
    }

    .menu-dropdown-panel {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        min-width: 260px;
        display: none;
        pointer-events: auto;
        background: rgba(8, 16, 22, 0.94);
        border: 1px solid rgba(0, 242, 255, 0.18);
        border-radius: 16px;
        padding: 12px;
        box-shadow: 0 22px 50px rgba(0,0,0,0.42), 0 0 18px rgba(0,242,255,0.1);
        backdrop-filter: blur(16px);
    }

    .menu-dropdown-panel.active, .quick-panel.active, .mobile-burger-panel.active {
        display: flex;
    }

    .menu-dropdown-panel {
        flex-direction: column;
        gap: 8px;
    }

    .menu-item-btn, .menu-item-btn,
    .mini-action-btn {
        width: 100%;
        padding: 11px 14px;
        border-radius: 10px;
        text-align: left;
        cursor: pointer;
        text-transform: uppercase;
    }

    .menu-item-btn:hover,
    .mini-action-btn:hover {
        border-color: rgba(0, 242, 255, 0.35);
        background: rgba(0,242,255,0.08);
    }

    .quick-panel {
        position: absolute;
        right: 24px;
        display: none;
        flex-direction: column;
        gap: 10px;
        pointer-events: auto;
        width: min(320px, calc(100vw - 24px));
        background: rgba(8, 16, 22, 0.96);
        border: 1px solid rgba(0,242,255,0.18);
        border-radius: 16px;
        padding: 14px;
        box-shadow: 0 22px 50px rgba(0,0,0,0.42);
        backdrop-filter: blur(16px);
    }

    .quick-panel-title {
        font-size: 12px;
        letter-spacing: 2px;
        color: #91afba;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        padding-bottom: 8px;
    }

    .quick-panel-body, .quick-note {
        font-size: 12px;
        line-height: 1.5;
        color: var(--empty-text);
        text-transform: none;
    }

    #quick-panel-messages { top: 0; }
    #quick-panel-friends { top: 0; }
    #quick-panel-notifications { top: 0; }
    #quick-panel-settings { top: 0; }

    .mobile-burger-panel {
        position: fixed;
        top: 74px;
        left: 12px;
        z-index: var(--z-dropdown-top);
        width: min(280px, calc(100vw - 24px));
        display: none;
        flex-direction: column;
        gap: 8px;
        padding: 14px;
        background: rgba(8,16,22,0.96);
        border: 1px solid rgba(0,242,255,0.18);
        border-radius: 16px;
        backdrop-filter: blur(16px);
        box-shadow: 0 22px 50px rgba(0,0,0,0.42);
    }

    .lobby-shell {
        display: flex;
        flex-direction: column;
        gap: 18px;
        height: 100%;
        padding: 20px 28px 18px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .lobby-grid {
        display: grid;
        grid-template-columns: var(--lobby-left-column) minmax(420px, 1fr) var(--lobby-right-column);
        gap: 22px;
        min-height: 0;
        flex: 1;
        overflow: hidden;
    }

    .lobby-column-left, .lobby-column-right, .lobby-center-column {
        min-height: 0;
    }

    .lobby-center-column {
        min-width: 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .center-view {
        display: none !important;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .center-view.active {
        display: flex !important;
        flex-direction: column;
        gap: 22px;
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    #center-view-lobby.active {
        display: grid !important;
        grid-template-rows: minmax(380px, 1fr) minmax(96px, auto) minmax(160px, auto);
        gap: 14px;
        align-content: stretch;
    }

    #center-view-hub.active,
    #center-view-shop.active {
        display: flex !important;
        flex-direction: column;
    }

    .center-page-card {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: rgba(4, 8, 12, 0.82);
    }

    .center-page-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding-right: 4px;
    }

    .center-page-stack {
        display: flex;
        flex-direction: column;
        gap: 18px;
        min-height: 0;
    }
    #center-content-host[data-center-mode="lobby"] #center-view-lobby { display: grid !important; }
    #center-content-host[data-center-mode="missions"] #center-view-hub,
    #center-content-host[data-center-mode="community"] #center-view-hub,
    #center-content-host[data-center-mode="gallery"] #center-view-hub,
    #center-content-host[data-center-mode="contacts"] #center-view-hub,
    #center-content-host[data-center-mode="lobby_sections"] #center-view-hub,
    #center-content-host[data-center-mode="garage"] #center-view-hub,
    #center-content-host[data-center-mode="schedule"] #center-view-hub,
    #center-content-host[data-center-mode="announcements"] #center-view-hub,
    #center-content-host[data-center-mode="news"] #center-view-hub,
    #center-content-host[data-center-mode="admin"] #center-view-hub { display: flex !important; }
    #center-content-host[data-center-mode="shop"] #center-view-shop { display: flex !important; }
    #center-content-host[data-center-mode="watch"] #center-view-watch { display: flex !important; }

    #center-content-host[data-center-mode="lobby"] #center-view-hub,
    #center-content-host[data-center-mode="lobby"] #center-view-shop,
    #center-content-host[data-center-mode="lobby"] #center-view-watch,
    #center-content-host[data-center-mode="missions"] #center-view-lobby,
    #center-content-host[data-center-mode="missions"] #center-view-shop,
    #center-content-host[data-center-mode="missions"] #center-view-watch,
    #center-content-host[data-center-mode="community"] #center-view-lobby,
    #center-content-host[data-center-mode="community"] #center-view-shop,
    #center-content-host[data-center-mode="community"] #center-view-watch,
    #center-content-host[data-center-mode="contacts"] #center-view-lobby,
    #center-content-host[data-center-mode="contacts"] #center-view-shop,
    #center-content-host[data-center-mode="contacts"] #center-view-watch,
    #center-content-host[data-center-mode="gallery"] #center-view-lobby,
    #center-content-host[data-center-mode="gallery"] #center-view-shop,
    #center-content-host[data-center-mode="gallery"] #center-view-watch,
    #center-content-host[data-center-mode="lobby_sections"] #center-view-lobby,
    #center-content-host[data-center-mode="lobby_sections"] #center-view-shop,
    #center-content-host[data-center-mode="lobby_sections"] #center-view-watch,
    #center-content-host[data-center-mode="garage"] #center-view-lobby,
    #center-content-host[data-center-mode="garage"] #center-view-shop,
    #center-content-host[data-center-mode="garage"] #center-view-watch,
    #center-content-host[data-center-mode="schedule"] #center-view-lobby,
    #center-content-host[data-center-mode="schedule"] #center-view-shop,
    #center-content-host[data-center-mode="schedule"] #center-view-watch,
    #center-content-host[data-center-mode="announcements"] #center-view-lobby,
    #center-content-host[data-center-mode="announcements"] #center-view-shop,
    #center-content-host[data-center-mode="announcements"] #center-view-watch,
    #center-content-host[data-center-mode="news"] #center-view-lobby,
    #center-content-host[data-center-mode="news"] #center-view-shop,
    #center-content-host[data-center-mode="news"] #center-view-watch,
    #center-content-host[data-center-mode="admin"] #center-view-lobby,
    #center-content-host[data-center-mode="admin"] #center-view-shop,
    #center-content-host[data-center-mode="admin"] #center-view-watch,
    #center-content-host[data-center-mode="shop"] #center-view-lobby,
    #center-content-host[data-center-mode="shop"] #center-view-hub,
    #center-content-host[data-center-mode="shop"] #center-view-watch,
    #center-content-host[data-center-mode="watch"] #center-view-lobby,
    #center-content-host[data-center-mode="watch"] #center-view-hub,
    #center-content-host[data-center-mode="watch"] #center-view-shop {
        display: none !important;
    }


    .live-video-card, .global-chat-card, .leaderboard-card, .promo-banner-card, .offers-card, .watch-mini-card, .lobby-banner-card, .lobby-news-card {
        min-height: 0;
    }

    #center-view-lobby {
        display: grid;
        grid-template-rows: minmax(380px, 1fr) minmax(96px, auto) minmax(160px, auto);
        gap: 14px;
        align-content: stretch;
    }

    #center-view-watch {
        display: none;
        flex-direction: column;
        min-height: 0;
    }

    .lobby-banner-card {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .lobby-banner-stage {
        position: relative;
        flex: 1 1 auto;
        min-height: 300px;
        border-radius: 18px;
        overflow: hidden;
        border: 1px solid rgba(0,242,255,0.18);
        background: radial-gradient(circle at top, rgba(0,242,255,0.08), rgba(2,7,10,0.96));
        cursor: pointer;
    }

    .lobby-banner-media {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0.92;
    }

    .lobby-banner-fallback {
        position: absolute;
        inset: 0;
        background:
            linear-gradient(180deg, rgba(1, 8, 12, 0.06), rgba(1, 8, 12, 0.84)),
            radial-gradient(circle at top right, rgba(0,242,255,0.18), transparent 38%);
    }

    .lobby-banner-overlay {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: 28px;
        background: linear-gradient(180deg, rgba(0,0,0,0.06), rgba(0,0,0,0.62));
    }

    .lobby-banner-kicker {
        font-size: 12px;
        letter-spacing: 2px;
        color: var(--neon);
        margin-bottom: 8px;
    }

    .lobby-banner-title {
        font-size: clamp(28px, 4vw, 56px);
        line-height: 0.96;
        font-weight: 900;
        color: #eef5f8;
        text-shadow: 0 0 18px rgba(0,0,0,0.48);
        max-width: 76%;
    }

    .lobby-banner-subtitle {
        margin-top: 12px;
        max-width: 68%;
        font-size: 13px;
        line-height: 1.45;
        color: #dbe8ed;
        text-transform: none;
    }

    .lobby-banner-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-top: 18px;
    }

    .lobby-banner-dots {
        display: flex;
        gap: 8px;
    }

    .banner-dot {
        width: 10px;
        height: 10px;
        border-radius: 999px;
        border: 1px solid rgba(255,255,255,0.26);
        background: rgba(255,255,255,0.12);
        cursor: pointer;
    }

    .banner-dot.active {
        background: var(--neon);
        border-color: var(--neon);
        box-shadow: 0 0 10px rgba(0,242,255,0.28);
    }

    .lobby-banner-cta {
        padding: 10px 16px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.20);
        background: rgba(2,10,12,0.42);
        color: #f5fbff;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 1px;
        cursor: pointer;
    }

    .lobby-news-card {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 12px 14px;
    }

    .lobby-news-card .panel-title {
        margin-bottom: 8px;
        padding-bottom: 7px;
    }

    .lobby-news-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        min-height: 0;
    }

    .lobby-news-item {
        min-height: 66px;
        padding: 7px;
        border-radius: 14px;
        border: 1px solid rgba(0,242,255,0.12);
        background: rgba(255,255,255,0.03);
        cursor: pointer;
        transition: 0.18s ease;
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        overflow: hidden;
    }

    .lobby-news-item:hover {
        transform: translateY(-1px);
        border-color: rgba(0,242,255,0.28);
        background: rgba(0,242,255,0.05);
    }

    .lobby-news-thumb {
        width: 72px;
        height: 52px;
        border-radius: 10px;
        overflow: hidden;
        border: 1px solid rgba(0,242,255,0.14);
        background:
            radial-gradient(circle at top right, rgba(0,242,255,0.18), transparent 40%),
            linear-gradient(135deg, rgba(255,255,255,0.07), rgba(0,0,0,0.24));
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--neon);
        font-size: 18px;
        flex: 0 0 auto;
    }

    .lobby-news-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .lobby-news-item-body {
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
    }

    .lobby-news-item-title {
        font-size: 12px;
        line-height: 1.18;
        color: #f4fbff;
        font-weight: 900;
        letter-spacing: 0.4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .lobby-news-item-meta {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        font-size: 10px;
        color: #8da2ad;
        white-space: nowrap;
    }

    .lobby-news-type {
        flex: 0 0 auto;
        padding: 3px 6px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.18);
        background: rgba(0,242,255,0.07);
        color: var(--neon);
        font-size: 9px;
        font-weight: 900;
        letter-spacing: 0.8px;
    }

    .lobby-news-date {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .lobby-news-item-copy {
        display: none;
    }

    .watch-mini-card {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        cursor: pointer;
    }

    .watch-mini-frame {
        position: relative;
        min-height: 152px;
        border-radius: 14px;
        overflow: hidden;
        border: 1px solid rgba(0,242,255,0.14);
        background: #000;
    }

    .watch-mini-topline {
        position: absolute;
        top: 10px;
        left: 10px;
        right: 10px;
        z-index: 3;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        pointer-events: none;
    }

    .watch-mini-pill {
        padding: 6px 10px;
        border-radius: 999px;
        background: rgba(3,10,14,0.66);
        border: 1px solid rgba(0,242,255,0.18);
        color: #f5fcff;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 1px;
    }

    .watch-view-tabs {
        display: flex;
        gap: 10px;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }

    .watch-view-tab {
        padding: 10px 14px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.16);
        background: rgba(255,255,255,0.04);
        color: #d7e7ed;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 1px;
        cursor: pointer;
    }

    .watch-view-tab.active {
        background: rgba(0,242,255,0.16);
        border-color: rgba(0,242,255,0.42);
        color: white;
        box-shadow: 0 0 14px rgba(0,242,255,0.16);
    }

    .watch-panel {
        display: none;
        flex-direction: column;
        min-height: 0;
        flex: 1 1 auto;
    }

    .watch-panel.active {
        display: flex;
    }

    .watch-video-feed-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .watch-video-card {
        border-radius: 16px;
        border: 1px solid rgba(0,242,255,0.12);
        background: rgba(255,255,255,0.03);
        overflow: hidden;
        cursor: pointer;
        transition: .18s ease;
    }

    .watch-video-card:hover {
        transform: translateY(-2px);
        border-color: rgba(0,242,255,0.28);
        background: rgba(0,242,255,0.05);
    }

    .watch-video-thumb {
        height: 180px;
        background:
            linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.62)),
            radial-gradient(circle at top right, rgba(0,242,255,0.20), transparent 36%),
            #081116;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #e8f5fb;
        font-size: 22px;
        font-weight: 900;
        letter-spacing: 2px;
    }

    .watch-video-meta {
        padding: 14px;
    }

    .watch-video-title {
        font-size: 13px;
        font-weight: 900;
        color: #f4fbff;
        margin-bottom: 6px;
    }

    .watch-video-copy {
        font-size: 12px;
        color: #c7d8de;
        line-height: 1.45;
        text-transform: none;
    }

    .watch-toolbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin-bottom: 10px;
    }

    .watch-toolbar-right {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .watch-fullscreen-btn {
        padding: 9px 12px;
    }

    .watch-mini-frame video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .watch-mini-overlay {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        padding: 12px;
        background: linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.52));
    }

    .watch-mini-tag {
        padding: 7px 10px;
        border-radius: 999px;
        background: rgba(3,10,14,0.64);
        border: 1px solid rgba(0,242,255,0.18);
        color: #f3f9fb;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 1px;
    }

    .watch-mini-open {
        padding: 8px 12px;
        border-radius: 999px;
        background: rgba(0,242,255,0.14);
        color: white;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 1px;
        border: 1px solid rgba(0,242,255,0.22);
    }

    .watch-mini-meta,
    .watch-live-meta {
        display: flex;
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .watch-mini-title,
    .watch-live-title {
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 1px;
        color: #f7fdff;
    }

    .watch-mini-copy,
    .watch-live-copy {
        font-size: 10px;
        color: #c7d8de;
        text-transform: none;
        letter-spacing: .3px;
    }

    .camera-switcher.overlay {
        position: absolute;
        top: 14px;
        left: 14px;
        z-index: 4;
        margin-bottom: 0;
    }

    .live-video-overlay {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 3;
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 16px;
        padding: 18px;
        background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.62));
        pointer-events: none;
    }

    .live-video-overlay-right {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .live-meta-chip {
        padding: 7px 10px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.16);
        background: rgba(3,10,14,0.58);
        color: #dcebF2;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    .banner-arrow-btn {
        width: 38px;
        height: 38px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.22);
        background: rgba(3,10,14,0.58);
        color: #f3fbff;
        cursor: pointer;
        font-size: 18px;
        font-weight: 900;
    }

    .banner-arrow-btn:hover {
        border-color: rgba(0,242,255,0.44);
        background: rgba(0,242,255,0.12);
    }


    .location-accordion {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .location-group {
        border-radius: 14px;
        border: 1px solid rgba(0,242,255,0.12);
        background: rgba(255,255,255,0.02);
        overflow: hidden;
    }

    .location-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 14px 16px;
        background: rgba(255,255,255,0.02);
        border: none;
        color: white;
        cursor: pointer;
        text-align: left;
        font-weight: 800;
        letter-spacing: 1px;
    }

    .location-header.active {
        background: rgba(0,242,255,0.08);
        box-shadow: inset 0 -1px 0 rgba(255,255,255,0.03);
    }

    .location-title-wrap {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
    }

    .location-title {
        font-size: 16px;
        color: #f3fbff;
        font-weight: 900;
    }

    .location-subtitle {
        font-size: 11px;
        color: #8da2ad;
        text-transform: none;
    }

    .location-badges {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .location-badge {
        padding: 5px 8px;
        border-radius: 999px;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 1px;
        border: 1px solid rgba(255,255,255,0.12);
        background: rgba(255,255,255,0.04);
        color: #d7e4ea;
    }

    .location-badge.live {
        border-color: rgba(0,242,255,0.22);
        color: var(--neon);
    }

    .location-badge.soon {
        border-color: rgba(255,215,111,0.24);
        color: #ffd27a;
    }

    .location-arrow {
        font-size: 16px;
        color: #9cc7d3;
    }

    .location-body {
        display: none;
        padding: 0 14px 14px;
    }

    .location-body.expanded {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .location-empty {
        padding: 16px;
        border-radius: var(--section-radius);
        border: 1px dashed var(--empty-border);
        color: var(--empty-text);
        background: var(--empty-bg);
        font-size: 12px;
        text-transform: none;
        line-height: 1.5;
    }

    .watch-page-card {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .watch-page-copy {
        font-size: 12px;
        color: #a5bbc5;
        text-transform: none;
        margin-bottom: 10px;
    }

    #center-view-lobby .global-chat-card {
        max-height: none;
    }

    /* Lobby chat fills the card: messages scroll, the input row stays pinned at the bottom
       (no empty gap, input doesn't drift on scroll). The card is a flex column (.glass-panel). */
    #center-view-lobby .global-chat-messages {
        max-height: none;
    }

    .live-video-card {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .live-video-frame {
        position: relative;
        flex: 1 1 auto;
        min-height: 300px;
        height: 100%;
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid rgba(0,242,255,0.16);
        background: #000;
    }

    .live-video-frame iframe,
    .live-video-frame video {
        display: block;
        width: 100%;
        height: 100%;
        border: none;
        background: #000;
        object-fit: cover;
    }

    .hud-video-status {
        position: absolute;
        left: 50%;
        bottom: 26px;
        transform: translateX(-50%);
        z-index: 6;
        min-width: 260px;
        max-width: min(70vw, 720px);
        padding: 12px 16px;
        border-radius: 12px;
        border: 1px solid rgba(0, 242, 255, 0.18);
        background: rgba(3, 10, 14, 0.72);
        color: #dbe8ed;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 1px;
        text-align: center;
        text-transform: uppercase;
        box-shadow: 0 8px 24px rgba(0,0,0,0.35);
        backdrop-filter: blur(10px);
        pointer-events: none;
        opacity: 0;
        transition: opacity .18s ease, transform .18s ease;
    }

    .hud-video-status.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .hud-video-status.error {
        border-color: rgba(255, 93, 93, 0.28);
        color: #ffd4d4;
        background: rgba(40, 6, 10, 0.78);
    }

    .hud-video-status.success {
        border-color: rgba(38, 209, 107, 0.28);
        color: #d7ffea;
        background: rgba(4, 28, 16, 0.76);
    }

    .camera-switcher {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }

    .camera-chip {
        padding: 7px 12px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.22);
        background: rgba(0,0,0,0.48);
        color: #d8ebf3;
        cursor: pointer;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 1px;
        box-shadow: 0 0 12px rgba(0,0,0,0.18);
    }

    .camera-chip.active {
        background: rgba(0,242,255,0.16);
        color: white;
        border-color: rgba(0,242,255,0.45);
    }

    .global-chat-messages {
        flex: 1;
        min-height: 96px;
        max-height: 176px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 8px;
        font-size: 12px;
        color: #e8f1f5;
        text-transform: none;
        padding-right: 4px;
    }

    .global-chat-msg { text-transform: none; color: #d5e3ea; }
    .global-chat-msg b { color: var(--neon); }
    .global-chat-system-msg {
        border-left: 2px solid rgba(0,242,255,.46);
        padding-left: 8px;
        background: rgba(0,242,255,.045);
    }
    .global-chat-msg .priority-name {
        color: #ffd700;
        text-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
    }

    .global-chat-input-row {
        display: flex;
        gap: 10px;
        margin-top: 12px;
        flex-shrink: 0;
    }

    .global-chat-input-row input, .footer-form input, .footer-form textarea {
        width: 100%;
        padding: 10px 12px;
        border-radius: 10px;
        border: 1px solid rgba(0,242,255,0.14);
        background: rgba(0,0,0,0.32);
        color: white;
        outline: none;
        text-transform: none;
        box-sizing: border-box;
    }

    .global-chat-input-row button {
        min-width: 110px;
        border-radius: 10px;
        border: none;
        background: var(--neon);
        color: black;
        font-weight: 900;
        cursor: pointer;
        /* i18n: dictionary stores normal-case "Send"; keep the caps look via CSS. */
        text-transform: uppercase;
    }

    .leaderboard-card {
        flex: 1 1 auto;
        min-height: 0;
    }

    .leaderboard-scroll {
        overflow-y: auto;
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding-right: 4px;
    }

    .leader-row.clickable {
        cursor: pointer;
        transition: background 0.18s ease, transform 0.18s ease;
    }

    .leader-row.clickable:hover {
        background: rgba(0,242,255,0.08);
        transform: translateX(3px);
    }

    .promo-banner-body {
        min-height: 120px;
        border-radius: 14px;
        border: 1px dashed rgba(0,242,255,0.24);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #b7ccd5;
        text-align: center;
        padding: 18px;
    }

    .offer-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .offer-item {
        padding: 10px 12px;
        border-radius: 12px;
        background: rgba(255,255,255,0.03);
        color: #d6e5ec;
        font-size: 12px;
        text-transform: none;
    }

    .lobby-footer {
        display: flex;
        flex-direction: column;
        gap: 12px;
        min-height: 0;
    }

    .footer-grid {
        display: grid;
        grid-template-columns: var(--lobby-left-column) minmax(0, 1fr) var(--lobby-right-column);
        gap: 22px;
        align-items: stretch;
    }

    .footer-card {
        min-height: 90px;
        justify-content: center;
    }

    .footer-text { color: #d1e0e7; font-size: 12px; line-height: 1.6; text-transform: none; }

    .footer-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .footer-banner-card {
        min-height: 90px;
        display: flex;
        justify-content: center;
    }

    .footer-banner-body {
        width: 98%;
        min-height: 68px;
        color: #b7ccd5;
        padding: 18px;
    }

    .public-profile-modal {
        position: fixed;
        inset: 0;
        z-index: var(--z-modal-profile);
        background: rgba(1,6,10,0.58);
        backdrop-filter: blur(8px);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .public-profile-card {
        width: min(720px, 100%);
        position: relative;
        border-radius: 22px;
        padding: 28px;
        background: linear-gradient(180deg, rgba(8, 16, 22, 0.95) 0%, rgba(7, 14, 20, 0.88) 100%);
    }

    .public-profile-hero {
        display: flex;
        gap: 18px;
        align-items: center;
        margin-bottom: 20px;
    }

    .public-profile-avatar {
        width: 92px;
        height: 92px;
        border-radius: 18px;
        border: 2px solid var(--neon);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 44px;
        background: radial-gradient(circle at 30% 30%, rgba(0, 242, 255, 0.22), rgba(0, 242, 255, 0.06));
        box-shadow: 0 0 24px rgba(0,242,255,0.24);
    }

    .public-profile-left-rail {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        flex: 0 0 150px;
    }

    .public-profile-main-rail {
        min-width: 0;
        flex: 1 1 auto;
    }

    .public-profile-name { font-size: 28px; font-weight: 900; color: white; }
    .public-profile-rank { font-size: 12px; color: var(--neon-pink); margin-top: 4px; }
    .public-profile-score { font-size: 14px; color: var(--neon); margin-top: 8px; }
    .public-profile-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 20px; }
    .public-profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

    .profile-license-card {
        width: 100%;
        margin: 0 0 16px;
        padding: 12px;
        border-radius: 14px;
        border: 1px solid rgba(0, 242, 255, 0.22);
        background:
            linear-gradient(135deg, rgba(0, 242, 255, 0.10), rgba(255, 255, 255, 0.025)),
            rgba(0, 0, 0, 0.30);
        box-shadow: inset 0 0 18px rgba(0, 242, 255, 0.04), 0 0 14px rgba(0, 242, 255, 0.08);
        text-align: left;
    }

    .public-profile-left-rail .profile-license-card {
        margin-bottom: 0;
        min-width: 150px;
    }

    .profile-license-label {
        font-size: 10px;
        letter-spacing: 1.4px;
        color: var(--text-muted);
        margin-bottom: 7px;
    }

    .profile-license-main {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #f7fdff;
        font-size: 13px;
        font-weight: 950;
        letter-spacing: 0.7px;
        line-height: 1.25;
    }

    .profile-license-badge {
        font-size: 22px;
        line-height: 1;
        flex: 0 0 auto;
    }

    .profile-license-limit,
    .profile-license-next {
        margin-top: 6px;
        color: var(--neon);
        font-size: 11px;
        font-weight: 850;
        letter-spacing: 0.8px;
        line-height: 1.3;
    }

    .profile-license-next {
        color: #ffd27a;
    }

    .profile-sidebar-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 16px;
    }

    .profile-sidebar-actions .mini-action-btn {
        width: 100%;
        min-height: 36px;
        justify-content: center;
        text-align: center;
    }
    /* =========================
       05. lobby layout / content panels
       ========================= */
    .lobby-content {
        display: flex;
        flex: 1;
        padding: 30px 40px;
        gap: 30px;
        overflow: hidden;
        z-index: 10;
    }

    .panel-title {
        font-size: 14px;
        color: #888;
        letter-spacing: 2px;
        margin-bottom: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 10px;
        display: flex;
        justify-content: space-between;
    }

    .sidebar-left {
        flex: 1;
        max-width: 400px;
        overflow-y: auto;
    }
    .car-list {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .car-card {
        background: rgba(0, 0, 0, 0.4);
        border-left: 3px solid #333;
        padding: 15px;
        border-radius: 0 8px 8px 0;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
        overflow: hidden;
    }

    .car-card:hover {
        background: rgba(0, 242, 255, 0.1);
        transform: translateX(5px);
    }

    .car-card.free { border-left-color: var(--neon); }
    .car-card.busy { border-left-color: #ffa500; }
    .car-card.offline { border-left-color: #ff4444; opacity: 0.6; cursor: not-allowed; }

    .car-name {
        font-size: 15px;
        font-weight: 800;
        margin-bottom: 5px;
        color: white;
    }

    .car-stats {
        font-size: 12px;
        color: #aaa;
        display: flex;
        gap: 15px;
    }

    .car-status-text {
        position: absolute;
        top: 15px;
        right: 15px;
        font-size: 10px;
        font-weight: bold;
        letter-spacing: 1px;
    }

    .free .car-status-text {
        color: var(--neon);
        text-shadow: 0 0 5px var(--neon);
    }

    .busy .car-status-text { color: #ffa500; }
    .offline .car-status-text { color: #ff4444; }

    .sidebar-right {
        width: 320px;
        display: flex;
        flex-direction: column;
        gap: 18px;
        height: 100%;
        min-height: 0;
    }

    .leaderboard-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        font-size: 14px;
        min-height: 0;
        flex: 1 1 auto;
    }

    .leader-row {
        display: flex;
        justify-content: space-between;
        padding: 8px 10px;
        background: rgba(255, 255, 255, 0.02);
        border-radius: 4px;
    }

    .leader-row:nth-child(1) {
        color: #ffd700;
        background: rgba(255, 215, 0, 0.1);
        border-left: 2px solid #ffd700;
    }

    .leader-row:nth-child(2) {
        color: #c0c0c0;
        border-left: 2px solid #c0c0c0;
    }

    .leader-row:nth-child(3) {
        color: #cd7f32;
        border-left: 2px solid #cd7f32;
    }

    /* =========================
       08. shop
       ========================= */
    .shop-modal {
        position: fixed;
        inset: 0;
        z-index: var(--z-modal-high);
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .shop-modal .shop-backdrop,
    .shop-modal .shop-window,
    .hub-modal .hub-backdrop,
    .hub-modal .hub-window {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .shop-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(6px);
    }

    .shop-window,

    .shop-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 18px;
    }

    .shop-kicker {
        font-size: 11px;
        letter-spacing: 2px;
        color: #8da2ad;
        margin-bottom: 4px;
    }

    .shop-title {
        margin: 0;
        font-size: 32px;
        color: white;
        text-shadow: 0 0 12px rgba(0, 242, 255, 0.35);
    }

    .shop-close-btn,
    .profile-close-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .shop-tabs {
        display: flex;
        gap: 12px;
        margin-bottom: 20px;
    }

    .shop-tab {
        padding: 12px 18px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(0, 0, 0, 0.28);
        color: #b7c3c9;
        cursor: pointer;
        font-weight: bold;
        letter-spacing: 1px;
        transition: 0.2s;
    }

    /* i18n: these lobby center-view controls store normal-case labels in the dictionary;
       keep the existing all-caps look via CSS instead of baking caps into the strings. */
    .watch-view-tab,
    .camera-chip,
    .watch-fullscreen-btn,
    .shop-tab {
        text-transform: uppercase;
    }

    .shop-tab.active {
        color: black;
        background: var(--neon);
        border-color: var(--neon);
        box-shadow: 0 0 14px rgba(0, 242, 255, 0.3);
    }

    /* =========================
       08. shop / catalog panels
       ========================= */
.shop-body {
        flex: 1;
        overflow-y: auto;
        padding-right: 4px;
    }

    .shop-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .shop-card {
        min-height: 150px;
        background: rgba(0, 0, 0, 0.28);
        border: 1px solid rgba(0, 242, 255, 0.14);
        border-radius: 14px;
        padding: 18px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        transition: 0.2s;
    }

    .shop-card:hover {
        transform: translateY(-2px);
        border-color: rgba(0, 242, 255, 0.35);
        box-shadow: 0 0 16px rgba(0, 242, 255, 0.12);
    }

    .shop-card.success-flash {
        border-color: #23d16b;
        box-shadow: 0 0 18px rgba(35, 209, 107, 0.35);
    }

    .shop-card-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
    }

    .shop-icon {
        font-size: 28px;
        line-height: 1;
    }

    .shop-badge {
        font-size: 10px;
        color: #8da2ad;
        letter-spacing: 1px;
    }

    .shop-name {
        margin-top: 10px;
        font-size: 18px;
        font-weight: bold;
        color: white;
    }

    .shop-subtitle {
        margin-top: 6px;
        font-size: 12px;
        color: #9eb0ba;
        line-height: 1.35;
        text-transform: none;
    }

    .shop-buy-btn {
        margin-top: 16px;
        width: 100%;
        padding: 12px;
        border: 1px solid transparent; /* S1.3: reserve space so the hover border doesn't shift layout */
        border-radius: 10px;
        background: var(--neon);
        color: black;
        font-weight: 900;
        cursor: pointer;
        letter-spacing: 1px;
    }

    /* i18n Stage 2: shop cards are JS-rendered from normal-case dictionary values;
       keep the existing all-caps look via CSS (overrides .shop-subtitle's text-transform:none
       — must stay after that rule in source order to win). */
    .shop-name,
    .shop-badge,
    .shop-subtitle,
    .shop-buy-btn {
        text-transform: uppercase;
    }

    .shop-buy-btn:hover {
        background: white;
        /* S1.3: keep a crisp defined border on hover instead of only a soft (blurred) glow */
        border-color: var(--neon);
        box-shadow: 0 0 8px rgba(0, 242, 255, 0.22);
    }



    .guest-hidden {
        display: none !important;
    }

    .hub-modal {
        position: fixed;
        inset: 0;
        z-index: 2950;
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .hub-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.35);
        backdrop-filter: blur(6px);
    }

    .hub-window {
        position: absolute;
        top: 100px;
        left: 430px;
        right: 380px;
        bottom: 40px;
        z-index: 2;
        padding: 24px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .hub-panel-grid {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        gap: 18px;
        min-height: 0;
    }

    .hub-panel-split {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 16px;
        min-height: 0;
    }

    .hub-section-card {
        border: 1px solid rgba(0,242,255,0.14);
        background: rgba(0,0,0,0.22);
        border-radius: var(--section-radius);
        padding: 16px;
    }

    .hub-stack-layout {
        display: flex;
        flex-direction: column;
        gap: 18px;
        min-height: 0;
    }

    .hub-section-card.full-width {
        width: 100%;
        box-sizing: border-box;
    }

    .friend-card.compact,
    .chat-person-card.compact {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 14px;
    }

    .friend-card-main,
    .chat-person-main {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .friend-card.compact .friend-name,
    .chat-person-card.compact .chat-person-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .square-action-btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        border: none;
        border-radius: 10px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--neon);
        color: black;
        font-size: 17px;
        font-weight: 900;
        cursor: pointer;
        box-shadow: 0 0 12px rgba(0, 242, 255, 0.18);
    }

    .square-action-btn.alt {
        background: rgba(255,255,255,0.05);
        color: var(--neon);
        border: 1px solid rgba(0,242,255,0.18);
        box-shadow: none;
    }

    .square-action-btn:disabled {
        opacity: var(--disabled-opacity);
        cursor: not-allowed;
        box-shadow: none;
    }

    /* Clickable usernames (friend requests) — open the short public profile like TOP PLAYERS. */
    .friend-name.clickable,
    .header-friend-name.clickable {
        cursor: pointer;
    }
    .friend-name.clickable:hover,
    .header-friend-name.clickable:hover {
        text-decoration: underline;
    }


    /* =========================
       09b. maps & routes v2
       ========================= */
    .maps-v2-shell {
        min-height: 0;
    }

    .maps-v2-section {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .maps-v2-layout {
        --maps-stage-height: clamp(430px, 48vh, 520px);
        --maps-list-min-height: 150px;
        display: grid;
        grid-template-columns: 245px minmax(0, 1fr) 310px;
        gap: 14px;
        min-height: 0;
        height: calc(var(--maps-stage-height) + var(--maps-list-min-height) + 14px);
        max-height: calc(var(--maps-stage-height) + var(--maps-list-min-height) + 14px);
        overflow: hidden;
    }

    .maps-v2-shell-premium .maps-v2-section {
        min-height: calc(100dvh - 154px);
    }

    .maps-v2-shell-premium .maps-v2-layout {
        --maps-stage-height: clamp(470px, 58vh, 640px);
        height: calc(100dvh - 250px);
        max-height: calc(100dvh - 250px);
        min-height: calc(var(--maps-stage-height) + 120px);
    }

    .maps-v2-left,
    .maps-v2-right,
    .maps-v2-center {
        min-height: 0;
    }

    .maps-v2-left,
    .maps-v2-right {
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow-y: auto;
        padding-right: 4px;
    }

    .maps-v2-center {
        display: flex;
        flex-direction: column;
        gap: 12px;
        min-width: 0;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .map-location-card,
    .map-route-card,
    .map-detail-card,
    .map-filter-block,
    .map-qa-card {
        border-radius: 14px;
        border: 1px solid rgba(0,242,255,0.14);
        background: rgba(255,255,255,0.03);
        padding: 12px;
    }

    .map-location-card,
    .map-route-card,
    .map-filter-chip,
    .map-marker {
        cursor: pointer;
    }

    .map-location-card.active,
    .map-route-card.active,
    .map-filter-chip.active {
        border-color: rgba(0,242,255,0.44);
        background: rgba(0,242,255,0.10);
        box-shadow: 0 0 16px rgba(0,242,255,0.10);
    }

    .map-card-title {
        color: #f5fbff;
        font-size: 13px;
        font-weight: 950;
        letter-spacing: .7px;
    }

    .map-card-meta,
    .map-card-copy {
        margin-top: 6px;
        color: #a8bbc3;
        font-size: 11px;
        line-height: 1.42;
        text-transform: none;
    }

    .map-filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .map-filter-chip {
        min-height: 29px;
        padding: 7px 9px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.16);
        background: rgba(255,255,255,0.035);
        color: #d8e8ee;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .7px;
    }

    .map-stage-card {
        position: relative;
        flex: 0 0 var(--maps-stage-height, 480px);
        height: var(--maps-stage-height, 480px);
        min-height: var(--maps-stage-height, 480px);
        max-height: var(--maps-stage-height, 480px);
        border-radius: 18px;
        overflow: hidden;
        border: 1px solid rgba(0,242,255,0.18);
        background:
            radial-gradient(circle at top left, rgba(0,242,255,0.16), transparent 32%),
            linear-gradient(135deg, rgba(10,20,24,0.94), rgba(2,7,10,0.98));
    }

    .map-stage-media,
    .map-stage-media iframe,
    .map-stage-media img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: none;
        object-fit: cover;
        display: block;
    }

    .map-stage-media img {
        opacity: .58;
        filter: saturate(.9) contrast(1.05);
    }

    .map-stage-grid {
        position: absolute;
        inset: 0;
        background-image:
            linear-gradient(rgba(0,242,255,.055) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0,242,255,.055) 1px, transparent 1px);
        background-size: 44px 44px;
        pointer-events: none;
        mix-blend-mode: screen;
    }

    .map-stage-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.58));
        pointer-events: none;
    }

    .map-marker {
        position: absolute;
        z-index: 4;
        transform: translate(-50%, -50%);
        min-width: 34px;
        height: 34px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.46);
        background: rgba(2,10,14,.80);
        color: #fff;
        box-shadow: 0 0 14px rgba(0,242,255,.24);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 17px;
        transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    }

    .map-marker:hover {
        transform: translate(-50%, -50%) scale(1.20);
        border-color: rgba(255,215,0,.92);
        box-shadow: 0 0 24px rgba(255,215,0,.34), 0 0 24px rgba(0,242,255,.24);
        z-index: 7;
    }

    .map-marker.in-route {
        transform: translate(-50%, -50%) scale(1.50);
        border-color: rgba(255,215,0,.96);
        background: rgba(8, 20, 18, .92);
        box-shadow:
            0 0 30px rgba(255,215,0,.45),
            0 0 32px rgba(0,242,255,.34),
            inset 0 0 14px rgba(255,215,0,.14);
        z-index: 6;
    }

    .map-marker.active {
        transform: translate(-50%, -50%) scale(1.62);
        border-color: rgba(255,255,255,.96);
        box-shadow:
            0 0 34px rgba(255,215,0,.58),
            0 0 40px rgba(0,242,255,.42),
            inset 0 0 14px rgba(255,255,255,.16);
        z-index: 8;
    }

    .map-marker-step-index {
        position: absolute;
        top: -9px;
        right: -9px;
        width: 17px;
        height: 17px;
        border-radius: 999px;
        display: none;
        align-items: center;
        justify-content: center;
        background: rgba(255,215,0,.96);
        color: #03080a;
        border: 1px solid rgba(255,255,255,.72);
        font-size: 9px;
        font-weight: 950;
        box-shadow: 0 0 14px rgba(255,215,0,.42);
    }

    .map-marker.in-route .map-marker-step-index,
    .map-marker.active .map-marker-step-index {
        display: flex;
    }

    .map-route-svg {
        position: absolute;
        inset: 0;
        z-index: 3;
        width: 100%;
        height: 100%;
        pointer-events: none;
        overflow: visible;
    }

    .map-route-svg .map-route-glow-line {
        fill: none;
        stroke: rgba(0,242,255,.30);
        stroke-width: 1.2;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-dasharray: 1.1 8.4;
        animation: mapRouteDash 2.8s linear infinite;
        filter: drop-shadow(0 0 7px rgba(0,242,255,.42));
    }

    .map-route-svg .map-route-core-line {
        fill: none;
        stroke: rgba(255,215,0,.90);
        stroke-width: 1.1;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-dasharray: 1.1 8.4;
        animation: mapRouteDash 2.8s linear infinite;
        filter: drop-shadow(0 0 6px rgba(255,215,0,.42));
    }

    .map-route-svg .map-route-dot {
        fill: rgba(255,215,0,.95);
        stroke: rgba(3,10,14,.95);
        stroke-width: .8;
        filter: drop-shadow(0 0 7px rgba(255,215,0,.45));
    }

    @keyframes mapRouteDash {
        to { stroke-dashoffset: -48; }
    }

    .map-marker.type-fuel,
    .map-marker.type-service { border-color: rgba(255,215,0,.7); }
    .map-marker.type-danger { border-color: rgba(255,68,68,.7); }
    .map-marker.type-photo { border-color: rgba(255,0,127,.68); }
    .map-marker.type-water { border-color: rgba(0,170,255,.78); }
    .map-marker.type-hill,
    .map-marker.type-bridge { border-color: rgba(190,120,255,.7); }
    .map-marker.type-start,
    .map-marker.type-finish { border-color: rgba(76,255,143,.78); }

    .map-marker-tooltip {
        position: absolute;
        left: 50%;
        bottom: 38px;
        transform: translateX(-50%);
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        padding: 5px 8px;
        border-radius: 8px;
        border: 1px solid rgba(0,242,255,.18);
        background: rgba(2,10,14,.92);
        color: #dff8ff;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .8px;
    }

    .map-marker:hover .map-marker-tooltip { opacity: 1; }

    .map-route-strip {
        position: absolute;
        left: 14px;
        right: 14px;
        bottom: 14px;
        z-index: 5;
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
        padding: 10px 12px;
        border-radius: 14px;
        border: 1px solid rgba(0,242,255,0.18);
        background: rgba(2,10,14,.78);
        backdrop-filter: blur(8px);
    }

    .map-route-step {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #dcecf2;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .8px;
    }

    .map-route-step::after {
        content: '→';
        color: var(--neon);
        opacity: .75;
    }

    .map-route-step:last-child::after { content: ''; }

    .map-stage-topline {
        position: absolute;
        top: 14px;
        left: 14px;
        right: 14px;
        z-index: 5;
        display: flex;
        justify-content: space-between;
        gap: 10px;
        align-items: flex-start;
        pointer-events: none;
    }

    .map-stage-chip {
        padding: 7px 10px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.18);
        background: rgba(2,10,14,.70);
        color: #f5fdff;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .8px;
        backdrop-filter: blur(8px);
    }

    .map-route-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        padding-right: 4px;
        overscroll-behavior: contain;
    }

    .map-route-card-top {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        align-items: flex-start;
    }

    .map-route-badges,
    .map-detail-actions,
    .map-detail-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
    }

    .map-mini-badge {
        padding: 4px 7px;
        border-radius: 999px;
        border: 1px solid rgba(255,255,255,.12);
        background: rgba(255,255,255,.04);
        color: #d8e8ee;
        font-size: 9px;
        font-weight: 900;
        letter-spacing: .7px;
    }

    .map-waypoint-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
    }

    .map-waypoint-row {
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        padding: 8px;
        border-radius: 12px;
        border: 1px solid rgba(0,242,255,.10);
        background: rgba(255,255,255,.025);
    }

    .map-waypoint-index {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0,242,255,.14);
        color: #fff;
        font-size: 10px;
        font-weight: 950;
    }

    .map-loading-box {
        min-height: 420px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 18px;
        border: 1px dashed rgba(0,242,255,.22);
        color: #bdd3db;
        text-align: center;
        padding: 24px;
    }

    .admin-map-preview-card {
        border-radius: 14px;
        border: 1px solid rgba(0,242,255,0.14);
        background: rgba(255,255,255,0.025);
        padding: 12px;
        margin-top: 12px;
    }

    .admin-map-preview-stage {
        position: relative;
        height: 280px;
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid rgba(0,242,255,0.18);
        background:
            radial-gradient(circle at top left, rgba(0,242,255,0.12), transparent 34%),
            linear-gradient(135deg, rgba(10,20,24,0.96), rgba(2,7,10,0.98));
        cursor: crosshair;
        user-select: none;
        touch-action: none;
    }

    .admin-map-preview-stage img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: .48;
        filter: saturate(.9) contrast(1.05);
        pointer-events: none;
    }

    .admin-map-preview-grid {
        position: absolute;
        inset: 0;
        background-image:
            linear-gradient(rgba(0,242,255,.06) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0,242,255,.06) 1px, transparent 1px);
        background-size: 40px 40px;
        pointer-events: none;
    }

    .admin-map-preview-marker {
        position: absolute;
        z-index: 4;
        transform: translate(-50%, -50%);
        width: 42px;
        height: 42px;
        border-radius: 999px;
        border: 1px solid rgba(255,215,0,.82);
        background: rgba(2,10,14,.86);
        color: #fff;
        box-shadow: 0 0 20px rgba(255,215,0,.25), 0 0 18px rgba(0,242,255,.16);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        cursor: grab;
        touch-action: none;
    }

    .admin-map-preview-marker:active { cursor: grabbing; }

    .admin-map-preview-coords {
        color: var(--neon);
        font-size: 11px;
        font-weight: 900;
        letter-spacing: .8px;
    }



    /* =========================
       v5.17.7 Maps sizing / preview fixes
       ========================= */
    #center-hub-body.maps-body-active {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    #center-hub-body.maps-body-active .maps-v2-shell,
    #center-hub-body.maps-body-active .maps-v2-section {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    #center-hub-body.maps-body-active .maps-v2-layout {
        height: 100% !important;
        max-height: none !important;
        min-height: 0 !important;
        grid-template-rows: minmax(0, 1fr);
        align-items: stretch;
    }

    #center-hub-body.maps-body-active .maps-v2-center {
        display: grid !important;
        grid-template-rows: var(--maps-stage-height, 500px) minmax(0, 1fr);
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    #center-hub-body.maps-body-active .map-stage-card {
        flex: none !important;
        height: var(--maps-stage-height, 500px) !important;
        min-height: var(--maps-stage-height, 500px) !important;
        max-height: var(--maps-stage-height, 500px) !important;
    }

    #center-hub-body.maps-body-active .map-route-list {
        height: 100%;
        min-height: 0;
        max-height: none;
    }

    #center-hub-body.maps-body-active .maps-v2-shell-premium .maps-v2-section,
    #center-hub-body.maps-body-active .maps-v2-shell-premium .maps-v2-layout {
        height: 100% !important;
        max-height: none !important;
        min-height: 0 !important;
    }



    /* =========================
       v5.18.3 QA stabilization
       ========================= */
    #center-hub-body.maps-body-active .maps-v2-layout {
        --maps-stage-height: clamp(430px, 52vh, 560px);
    }

    #center-hub-body.maps-body-active .maps-v2-center {
        grid-template-rows: minmax(430px, var(--maps-stage-height, 520px)) minmax(0, 1fr) !important;
    }

    #center-hub-body.maps-body-active .map-stage-card {
        align-self: stretch;
        width: 100%;
    }

    #center-hub-body.maps-body-active .map-route-list {
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }

    .qa-check-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .qa-check-card {
        border: 1px solid rgba(0,242,255,0.14);
        background: rgba(255,255,255,0.035);
        border-radius: 12px;
        padding: 10px 12px;
        color: #dbe8ed;
        font-size: 11px;
        text-transform: none;
        line-height: 1.35;
    }

    .qa-check-card b { color: #f5fbff; text-transform: uppercase; letter-spacing: .7px; }
    .qa-check-card.ready { border-color: rgba(38,209,107,.28); background: rgba(38,209,107,.055); }
    .qa-check-card.warn { border-color: rgba(255,215,0,.28); background: rgba(255,215,0,.06); }
    .qa-check-card.fail { border-color: rgba(255,68,68,.34); background: rgba(255,68,68,.07); }

    @media (max-width: 1180px) {
        .qa-check-grid { grid-template-columns: 1fr; }
    }

    .map-stage-card.route-preview-flash {
        animation: mapRoutePreviewFlash 1.25s ease-out 1;
    }

    @keyframes mapRoutePreviewFlash {
        0% { box-shadow: 0 0 0 rgba(0,242,255,0), inset 0 0 0 rgba(255,215,0,0); border-color: rgba(255,215,0,0.95); }
        35% { box-shadow: 0 0 34px rgba(255,215,0,0.28), 0 0 28px rgba(0,242,255,0.18); border-color: rgba(255,215,0,0.95); }
        100% { box-shadow: 0 0 0 rgba(0,242,255,0); border-color: rgba(0,242,255,0.18); }
    }


    .map-stage-card.route-preview-sequence .map-marker.in-route {
        animation: mapMarkerRouteSequence 1.15s ease-in-out 1;
        animation-delay: calc(var(--route-step, 0) * 0.26s);
    }

    .map-stage-card.route-preview-sequence .map-marker-step-index {
        animation: mapMarkerStepBadgeSequence 1.15s ease-in-out 1;
        animation-delay: calc(var(--route-step, 0) * 0.26s);
    }

    @keyframes mapMarkerRouteSequence {
        0% { transform: translate(-50%, -50%) scale(1.50); }
        32% {
            transform: translate(-50%, -50%) scale(2.08);
            border-color: rgba(255,255,255,.98);
            box-shadow:
                0 0 48px rgba(255,215,0,.82),
                0 0 54px rgba(0,242,255,.62),
                inset 0 0 18px rgba(255,255,255,.22);
        }
        100% { transform: translate(-50%, -50%) scale(1.50); }
    }

    @keyframes mapMarkerStepBadgeSequence {
        0% { transform: scale(1); }
        32% { transform: scale(1.45); }
        100% { transform: scale(1); }
    }

    .map-route-step {
        border: 0;
        background: transparent;
        cursor: pointer;
        padding: 0;
        text-transform: uppercase;
    }

    .map-route-step:hover {
        color: #ffffff;
        text-shadow: 0 0 10px rgba(0,242,255,0.34);
    }

    @media (max-width: 1180px) {
        .maps-v2-layout {
            --maps-stage-height: clamp(360px, 48vh, 470px);
            grid-template-columns: 1fr;
            height: auto;
            max-height: none;
            overflow: visible;
        }
        .maps-v2-left, .maps-v2-right { max-height: none; }
        .map-stage-card {
            height: var(--maps-stage-height, 410px);
            min-height: var(--maps-stage-height, 410px);
            max-height: var(--maps-stage-height, 410px);
        }
        .map-route-list { max-height: 300px; }
        .maps-v2-shell-premium .maps-v2-section { min-height: 0; }
    }

    /* =========================
       10. community
       ========================= */
.community-people-filter {
        display: flex;
        gap: 8px;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }

    .full-chat-sidebar-head {
        margin-bottom: 12px;
    }


    .hub-hero-box {
        min-height: 300px;
        border-radius: var(--section-radius);
        border: 1px dashed var(--empty-border);
        background: linear-gradient(180deg, rgba(0,242,255,0.06), rgba(0,0,0,0.22));
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        color: var(--empty-text);
        font-size: 18px;
        font-weight: 800;
        letter-spacing: 1px;
        padding: 20px;
    }

    /* i18n Stage 2: JS-rendered contact buttons + hero box use normal-case dictionary
       values; keep the existing all-caps look via CSS. */
    .contact-submit-btn,
    .hub-hero-box {
        text-transform: uppercase;
    }

    /* =========================
       09. missions
       ========================= */
.quest-grid, .reward-grid, .friends-list, .chat-people-list {
        display: grid;
        gap: 12px;
    }

    .quest-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .quest-card, .friend-card, .reward-card, .chat-person-card, .route-card, .merch-soon-card {
        background: rgba(255,255,255,0.03);
        border: 1px solid rgba(0,242,255,0.14);
        border-radius: 14px;
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* Stage 3 (S3.1b): forward-looking daily-login reward ladder */
    .daily-ladder {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding: 4px 2px 8px;
        scrollbar-width: thin;
    }
    .daily-ladder-cell {
        flex: 0 0 auto;
        min-width: 92px;
        background: rgba(255,255,255,0.03);
        border: 1px solid rgba(0,242,255,0.14);
        border-radius: 12px;
        padding: 12px 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        text-align: center;
    }
    .daily-ladder-cell.is-today {
        border-color: var(--neon, #00f2ff);
        box-shadow: 0 0 0 1px rgba(0,242,255,0.35) inset;
    }
    .daily-ladder-cell.is-claimed { opacity: 0.7; }
    .daily-ladder-cell.is-upcoming { opacity: 0.78; }
    .daily-ladder-day {
        font-weight: 800;
        font-size: 11px;
        letter-spacing: 1px;
        color: #c6d7de;
    }
    .daily-ladder-cell.is-today .daily-ladder-day { color: var(--neon, #00f2ff); }
    .daily-ladder-amount {
        font-weight: 800;
        font-size: 14px;
        color: #fff;
    }
    .daily-ladder-bonus {
        font-size: 10px;
        font-weight: 700;
        color: var(--neon-pink, #ff4fd8);
    }
    .daily-ladder-state {
        font-size: 10px;
        font-weight: 700;
        color: #9fb3bb;
        letter-spacing: 0.5px;
    }
    .daily-ladder-claim { font-size: 11px; padding: 4px 10px; }

    .quest-name, .friend-name, .reward-name, .chat-person-name {
        font-weight: 800;
        color: #fff;
        font-size: 13px;
    }

    .quest-desc, .friend-meta, .reward-meta, .chat-person-meta, /* =========================
       11. contacts
       ========================= */
.contacts-copy {
        font-size: 12px;
        color: #c6d7de;
        text-transform: none;
        line-height: 1.45;
    }

    .mini-progress {
        height: 8px;
        border-radius: 999px;
        background: rgba(255,255,255,0.08);
        overflow: hidden;
        border: 1px solid rgba(0,242,255,0.12);
    }

    .mini-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, rgba(0,242,255,0.85), rgba(255,0,127,0.82));
        box-shadow: 0 0 10px rgba(0,242,255,0.25);
    }

    .reward-icon, .quest-reward-icon {
        font-size: 20px;
    }

    .reward-card.premium-reward-card {
        border-color: rgba(190, 120, 255, 0.32);
        background: linear-gradient(180deg, rgba(130, 60, 220, 0.12), rgba(255,255,255,0.03));
    }

    .reward-card.claimed-reward-card {
        border-color: rgba(0, 242, 255, 0.24);
    }

    /* S1.3: a pending (claimable) reward already shows the bright orange CLAIM button — drop the
       cyan card frame so it doesn't read as a clashing green outline around the orange button. */
    .reward-card.pending-reward-card {
        border-color: transparent;
    }

    .reward-card-cta {
        margin-top: 2px;
        align-self: flex-start;
        min-height: 30px;
        padding: 7px 10px;
        border-radius: 999px;
        font-size: 10px;
        letter-spacing: 0.9px;
    }

    .friends-filter-row, .leader-filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 14px;
    }

    .players-stats-row,
    .news-stats-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: -2px 0 14px;
    }

    .stat-chip {
        padding: 7px 11px;
        border-radius: 999px;
        border: 1px solid rgba(255,255,255,0.10);
        background: rgba(255,255,255,0.035);
        color: #d6e5eb;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.6px;
        /* i18n Stage 2: stat chips are JS-rendered from normal-case dictionary values;
           keep the existing all-caps look via CSS. */
        text-transform: uppercase;
    }

    .inline-ad-banner {
        min-height: 54px;
        border-radius: 12px;
        border: 1px dashed rgba(0,242,255,0.22);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 10px 14px;
        color: #b9cfda;
        background: linear-gradient(90deg, rgba(255,215,0,0.08), rgba(0,242,255,0.05));
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    .filter-chip {
        padding: 8px 12px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.14);
        background: rgba(255,255,255,0.03);
        color: #d9e6eb;
        cursor: pointer;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 1px;
        /* i18n Stage 2: filter/sort chips are JS-rendered from normal-case dictionary
           values; keep the existing all-caps look via CSS. */
        text-transform: uppercase;
    }

    .filter-chip.active {
        background: rgba(0,242,255,0.14);
        border-color: rgba(0,242,255,0.38);
        color: #fff;
    }

    .friends-search {
        margin-bottom: 14px;
    }

    .friends-search input, .contacts-form input, .contacts-form textarea {
        width: 100%;
        padding: 11px 12px;
        border-radius: 10px;
        border: 1px solid rgba(0,242,255,0.14);
        background: rgba(0,0,0,0.32);
        color: white;
        outline: none;
        box-sizing: border-box;
        text-transform: none;
    }

    .contacts-form {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .contacts-form textarea {
        min-height: 160px;
        resize: vertical;
    }

    .full-chat-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 18px;
        min-height: 520px;
        height: 100%;
        align-items: stretch;
    }

    .full-chat-sidebar, .full-chat-main {
        min-height: 0;
        height: 100%;
    }

    .full-chat-main {
        display: flex;
        flex-direction: column;
    }

    .full-chat-messages {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-right: 6px;
        margin-bottom: 12px;
    }

    .full-chat-row {
        padding: 10px 12px;
        border-radius: 12px;
        background: rgba(255,255,255,0.03);
        font-size: 12px;
        color: #dbe6eb;
        text-transform: none;
    }

    .full-chat-row b {
        color: var(--neon);
    }

    .chat-person-card button, .friend-card button, .reward-claim-all, .contact-submit-btn {
        align-self: flex-end;
        min-width: 148px;
        padding: 11px 14px;
    }

    .contact-submit-btn:active {
        transform: scale(0.98);
    }

    .route-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .route-card {
        align-items: center;
        justify-content: center;
        min-height: 120px;
        font-weight: 900;
        font-size: 16px;
        cursor: pointer;
    }

    .contacts-socials {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 14px;
    }

    .contacts-social-btn {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        border: 1px solid rgba(0,242,255,0.22);
        background: rgba(255,255,255,0.03);
        color: var(--neon);
        cursor: pointer;
        font-size: 16px;
        font-weight: 800;
    }

    .leaderboard-alt-list {
        display: grid;
        gap: 10px;
    }

    .leaderboard-table {
        width: 100%;
        display: grid;
        gap: 8px;
    }

    .leaderboard-table-header,
    .leaderboard-table-row {
        display: grid;
        grid-template-columns: minmax(260px, 1.35fr) minmax(140px, .75fr) minmax(140px, .75fr) minmax(140px, .75fr);
        gap: 12px;
        align-items: center;
    }

    .leaderboard-table-header {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: 0 10px 6px;
        background: rgba(2, 8, 12, 0.92);
        border-bottom: 1px solid rgba(0,242,255,0.14);
    }

    .leaderboard-sort-btn {
        min-height: 34px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.16);
        background: rgba(255,255,255,0.035);
        color: #d8e8ef;
        font-size: 11px;
        font-weight: 950;
        letter-spacing: .9px;
        cursor: pointer;
        text-align: left;
        padding: 0 12px;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .leaderboard-sort-btn.metric {
        text-align: right;
    }

    .leaderboard-sort-btn.active {
        background: rgba(0,242,255,0.14);
        border-color: rgba(0,242,255,0.46);
        color: #ffffff;
        box-shadow: 0 0 14px rgba(0,242,255,0.16);
    }

    .leaderboard-table-row {
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 10px;
        background: rgba(255,255,255,0.025);
        border-left: 2px solid rgba(0,242,255,0.10);
        cursor: pointer;
        transition: background .16s ease, border-color .16s ease;
    }

    .leaderboard-table-row:hover {
        background: rgba(0,242,255,0.07);
        border-left-color: rgba(0,242,255,0.42);
    }

    .leaderboard-table-row.top-1 {
        color: #ffd700;
        background: rgba(255, 215, 0, 0.08);
        border-left-color: rgba(255, 215, 0, 0.88);
    }

    .leaderboard-table-row.top-2 {
        border-left-color: rgba(192,192,192,.75);
    }

    .leaderboard-table-row.top-3 {
        border-left-color: rgba(205,127,50,.82);
    }

    .leaderboard-driver-cell {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 8px;
        color: #f5fbff;
        font-weight: 900;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .leaderboard-rank-chip {
        flex: 0 0 auto;
        min-width: 26px;
        color: #9fb4bd;
        font-weight: 950;
        text-align: right;
    }

    .leaderboard-metric-cell {
        text-align: right;
        font-weight: 950;
        color: #eaf6fb;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }

    .leaderboard-metric-cell.score { color: #ffd700; }
    .leaderboard-metric-cell.energy { color: var(--neon); }
    .leaderboard-metric-cell.time { color: #d8e8ef; }

    @media (max-width: 820px) {
        .leaderboard-table-header,
        .leaderboard-table-row {
            grid-template-columns: minmax(180px, 1.2fr) minmax(92px, .7fr) minmax(92px, .7fr) minmax(92px, .7fr);
            gap: 8px;
        }
        .leaderboard-sort-btn {
            padding: 0 8px;
            font-size: 9px;
        }
        .leaderboard-table-row {
            padding: 9px 8px;
        }
    }

    @media (max-width: 1180px) {
        .hub-window {
            left: 22px;
            right: 22px;
        }
        .hub-panel-grid, .hub-panel-split, .full-chat-layout {
            grid-template-columns: 1fr;
        }
        .quest-grid, .route-grid, .lobby-news-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        #center-view-lobby,
        #center-view-lobby.active {
            grid-template-rows: minmax(340px, 1fr) minmax(170px, auto) minmax(160px, auto);
        }
        .lobby-news-item {
            min-height: 76px;
        }
        .lobby-banner-title,
        .lobby-banner-subtitle {
            max-width: 100%;
        }
    }


    /* =========================
       06. modals / startup fuel
       ========================= */
    .startup-modal {
        position: fixed;
        inset: 0;
        z-index: 2800;
        display: none;
    }

    .startup-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.42);
        backdrop-filter: blur(6px);
    }

    .startup-window {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: min(560px, calc(100vw - 32px));
        padding: 28px;
        z-index: 2;
        text-align: center;
    }

    .startup-kicker {
        font-size: 11px;
        letter-spacing: 2px;
        color: #8da2ad;
        margin-bottom: 10px;
    }

    .startup-title {
        margin: 0 0 10px;
        font-size: 30px;
        color: white;
        text-shadow: 0 0 12px rgba(0, 242, 255, 0.28);
    }

    .startup-subtitle {
        margin: 0 0 18px;
        font-size: 13px;
        color: #a8bbc3;
        line-height: 1.45;
        text-transform: none;
    }

    .startup-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        margin-top: 10px;
    }

    .startup-btn {
        min-height: 52px;
        border-radius: 12px;
        border: 1px solid rgba(0, 242, 255, 0.2);
        background: rgba(0, 0, 0, 0.28);
        color: #dce8ed;
        font-weight: 900;
        letter-spacing: 1px;
        cursor: pointer;
        transition: 0.2s;
    }

    .startup-btn:hover {
        transform: translateY(-1px);
        border-color: rgba(0, 242, 255, 0.42);
        box-shadow: 0 0 16px rgba(0, 242, 255, 0.14);
    }

    .startup-btn.primary {
        background: var(--neon);
        color: black;
        border-color: var(--neon);
    }

    .startup-btn.buy-energy {
        background: linear-gradient(90deg, rgba(255,215,0,0.96), rgba(255,0,127,0.90));
        color: #050505;
        border-color: rgba(255,215,0,0.82);
        box-shadow: 0 0 18px rgba(255, 215, 0, 0.18);
    }

    .startup-btn.disabled,
    .startup-btn:disabled {
        opacity: var(--disabled-opacity);
        cursor: not-allowed;
        pointer-events: none;
        box-shadow: none !important;
        transform: none !important;
        border-color: rgba(255,255,255,0.10) !important;
        background: rgba(255,255,255,0.05) !important;
        color: #8fa0a8 !important;
    }

    .startup-energy-note {
        margin-top: 12px;
        font-size: 12px;
        color: #ffd27a;
        text-transform: none;
        line-height: 1.45;
        min-height: 18px;
    }

    /* =========================
       07. profile
       ========================= */
    #profile-view {
        position: fixed;
        inset: 0;
        z-index: 2200;
        overflow-y: auto;
        background: rgba(1, 6, 10, 0.55);
        backdrop-filter: blur(8px);
        display: none;
        padding-top: 0;
    }

    .profile-container {
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100dvh;
        width: 100%;
        padding: 96px 24px 24px;
        box-sizing: border-box;
    }

    .profile-card {
        position: relative;
        z-index: 3;
        width: min(1080px, 100%);
        padding: 32px;
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: 36px;
        background: linear-gradient(180deg, rgba(8, 16, 22, 0.95) 0%, rgba(7, 14, 20, 0.88) 100%);
        border: 1px solid rgba(0, 242, 255, 0.2);
        border-radius: 22px;
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 30px rgba(0, 242, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.03);
        overflow: hidden;
    }

    .profile-sidebar {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        border-right: 1px solid rgba(0, 242, 255, 0.12);
        padding-right: 28px;
    }

    .profile-avatar {
        position: relative;
        width: 108px;
        height: 108px;
        background: radial-gradient(circle at 30% 30%, rgba(0, 242, 255, 0.22), rgba(0, 242, 255, 0.06));
        border: 2px solid var(--neon);
        border-radius: 18px;
        margin: 0 auto 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 54px;
        box-shadow: 0 0 24px rgba(0, 242, 255, 0.24);
    }

    .profile-avatar.priority-active {
        border-color: #ffd700;
        box-shadow: 0 0 22px rgba(255, 215, 0, 0.38);
    }

    .profile-avatar.priority-active::after {
        content: '👑';
        position: absolute;
        top: -10px;
        right: -10px;
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255,225,111,0.95) 0%, rgba(255,183,0,0.92) 100%);
        box-shadow: 0 0 16px rgba(255, 215, 0, 0.45);
        font-size: 18px;
    }

    .profile-name {
        font-size: 24px;
        font-weight: 900;
        color: white;
        text-shadow: 0 0 10px var(--neon);
        margin-bottom: 5px;
        word-break: break-all;
    }

    .profile-rank {
        color: var(--neon-pink);
        font-weight: bold;
        letter-spacing: 1px;
        font-size: 12px;
        margin-bottom: 12px;
        text-transform: uppercase;
    }

    .priority-pass-status {
        min-height: 18px;
        margin-bottom: 14px;
        font-size: 11px;
        color: #ffd700;
        letter-spacing: 1px;
        text-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
    }

    .profile-premium-btn {
        width: 100%;
        min-height: 38px;
        margin: 0 0 16px;
        border-radius: 12px;
        border: 1px solid rgba(190, 120, 255, 0.36);
        background: linear-gradient(90deg, rgba(160, 92, 255, 0.18), rgba(0, 242, 255, 0.08));
        color: #f3e8ff;
        font-weight: 900;
        letter-spacing: 1px;
        cursor: pointer;
        text-transform: uppercase;
        box-shadow: 0 0 14px rgba(180, 120, 255, 0.12);
    }

    .profile-premium-btn {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        line-height: 1.15;
        white-space: nowrap;
    }

    .profile-premium-btn .premium-date-line {
        display: block;
        font-size: 0.86em;
        letter-spacing: 0.8px;
        opacity: 0.95;
        white-space: nowrap;
    }


    .profile-premium-btn:hover {
        border-color: rgba(210, 170, 255, 0.74);
        box-shadow: 0 0 20px rgba(180, 120, 255, 0.26);
        transform: translateY(-1px);
    }

    .shop-card-premium {
        border-color: rgba(190, 120, 255, 0.34) !important;
        box-shadow: 0 0 18px rgba(180, 120, 255, 0.14);
    }

    .shop-card-premium .shop-badge {
        color: #f3d7ff;
        border-color: rgba(190, 120, 255, 0.38);
    }

    .premium-prompt-modal {
        position: fixed;
        inset: 0;
        z-index: var(--z-modal-high);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 24px;
        background: rgba(0, 0, 0, 0.62);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .premium-prompt-card {
        width: min(560px, calc(100vw - 32px));
        border-radius: 24px;
        border: 1px solid rgba(190, 120, 255, 0.38);
        background: linear-gradient(180deg, rgba(16, 8, 28, 0.96), rgba(7, 14, 20, 0.94));
        box-shadow: 0 24px 60px rgba(0,0,0,0.46), 0 0 26px rgba(180,120,255,0.18);
        padding: 28px;
        text-align: center;
    }

    .premium-prompt-icon {
        font-size: 54px;
        margin-bottom: 10px;
    }

    .premium-prompt-title {
        font-size: 26px;
        font-weight: 950;
        letter-spacing: 1.4px;
        color: #f3e8ff;
    }

    .premium-prompt-copy {
        margin: 14px auto 20px;
        max-width: 430px;
        color: var(--text-soft);
        line-height: 1.45;
        text-transform: none;
    }

    .premium-prompt-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 20px;
    }

    .premium-prompt-chip {
        border-radius: 12px;
        border: 1px solid rgba(190, 120, 255, 0.22);
        background: rgba(255, 255, 255, 0.04);
        padding: 10px;
        font-size: 11px;
        color: #f6ecff;
        font-weight: 850;
    }

    .premium-prompt-actions {
        display: flex;
        gap: 10px;
        justify-content: center;
        flex-wrap: wrap;
    }

    /*.profile-backdrop {
        position: absolute;
        inset: 0;
        z-index: 1;
    }*/

    .profile-close-btn {
        position: absolute;
        top: 18px;
        right: 18px;
        z-index: 3;
        border-radius: 12px;
    }

    .xp-container {
        width: 100%;
        background: rgba(0, 0, 0, 0.6);
        border: 1px solid var(--neon);
        border-radius: 5px;
        height: 18px;
        position: relative;
        margin-bottom: 20px;
    }

    .xp-bar {
        height: 100%;
        background: var(--neon);
        transition: width 0.5s ease-in-out;
        box-shadow: 0 0 10px var(--neon);
    }

    .xp-text {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        text-align: center;
        font-size: 10px;
        line-height: 18px;
        font-weight: bold;
        color: white;
        letter-spacing: 1px;
        text-shadow: 1px 1px 2px black;
    }

    .points-summary {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 20px;
        text-align: left;
        background: rgba(0, 0, 0, 0.4);
        padding: 12px;
        border-radius: 8px;
        border: 1px solid rgba(0, 242, 255, 0.2);
        box-sizing: border-box;
    }

    .points-row {
        display: flex;
        justify-content: space-between;
        font-size: 11px;
        font-weight: bold;
        letter-spacing: 1px;
        color: #888;
    }

    .points-row span:last-child {
        color: var(--neon);
        font-size: 14px;
        text-shadow: 0 0 5px rgba(0, 242, 255, 0.5);
    }

    .points-row.record span:last-child {
        color: #ffd700;
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }

    .profile-main {
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    .stat-category-title {
        font-size: 14px;
        color: var(--neon-pink);
        border-bottom: 1px solid rgba(255, 0, 127, 0.3);
        padding-bottom: 5px;
        margin-bottom: 15px;
        letter-spacing: 2px;
    }

    .profile-stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
    }

    .stat-box {
        background: rgba(255, 255, 255, 0.02);
        padding: 12px;
        border-left: 3px solid var(--neon);
        border-radius: 0 8px 8px 0;
        transition: 0.2s;
    }

    .stat-box:hover {
        background: rgba(0, 242, 255, 0.05);
        transform: translateX(3px);
    }

    .stat-box .label {
        font-size: 10px;
        color: #888;
        margin-bottom: 5px;
        letter-spacing: 1px;
    }

    .stat-box .value {
        font-size: 20px;
        font-weight: bold;
        color: white;
    }

    .stat-box .unit {
        font-size: 12px;
        color: #aaa;
        font-weight: normal;
    }

    .achievements-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .badge {
        background: rgba(255, 215, 0, 0.1);
        border: 1px solid #ffd700;
        color: #ffd700;
        padding: 6px 12px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: bold;
        letter-spacing: 1px;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    }

    .achievement-grid,
    .journal-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }

    .achievement-card,
    .journal-card {
        background: rgba(255, 255, 255, 0.035);
        border: 1px solid rgba(0, 242, 255, 0.16);
        border-radius: 14px;
        padding: 14px;
        box-shadow: inset 0 0 14px rgba(0, 242, 255, 0.035);
    }

    .achievement-card.unlocked {
        border-color: rgba(255, 215, 0, 0.55);
        box-shadow: 0 0 14px rgba(255, 215, 0, 0.12);
    }

    .achievement-card.reward-ready {
        border-color: rgba(0, 242, 255, 0.42);
        background: linear-gradient(180deg, rgba(0, 242, 255, 0.08), rgba(255,255,255,0.03));
    }

    .achievement-card.locked {
        opacity: 0.72;
    }

    .achievement-card.secret {
        border-style: dashed;
    }

    /* Stage 3 (S3.2): hardware/feature-pending achievements shown as visible stubs */
    .achievement-card.coming-soon {
        position: relative;
        opacity: 0.55;
        border-style: dashed;
        filter: grayscale(0.4);
    }
    .achievement-card.coming-soon .achievement-reward-line {
        color: #9fb3bb;
    }
    .achievement-soon-badge {
        align-self: flex-start;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 1px;
        color: #0b0f12;
        background: var(--neon, #00f2ff);
        border-radius: 999px;
        padding: 2px 8px;
        margin-bottom: 4px;
        opacity: 0.85;
    }

    .achievement-toolbar {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }

    .achievement-category-row {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 12px;
    }

    .achievement-reward-line {
        margin-top: 8px;
        font-size: 11px;
        color: var(--neon);
        font-weight: 800;
        letter-spacing: .7px;
    }

    .achievement-icon {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .achievement-name,
    .journal-main-title {
        font-weight: 900;
        letter-spacing: 1px;
        color: #fff;
        margin-bottom: 5px;
    }

    .achievement-meta,
    .journal-meta {
        color: var(--text-soft);
        font-size: 12px;
        line-height: 1.45;
        text-transform: none;
    }

    .journal-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
        flex-wrap: wrap;
    }

    .journal-table-wrap {
        width: 100%;
        overflow-x: auto;
    }

    .journal-table {
        width: 100%;
        min-width: 960px;
        border-collapse: collapse;
        font-size: 12px;
    }

    .journal-table th,
    .journal-table td {
        padding: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        vertical-align: top;
        text-align: left;
    }

    .journal-table th {
        color: var(--neon);
        font-size: 10px;
        letter-spacing: 1px;
    }

    .journal-player-chip {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        margin: 2px 5px 2px 0;
        padding: 4px 8px;
        border-radius: 999px;
        border: 1px solid rgba(0, 242, 255, 0.24);
        background: rgba(0, 242, 255, 0.07);
        color: #eafcff;
        font-weight: 800;
        cursor: pointer;
    }

    .journal-premium-lock {
        margin-top: 14px;
        padding: 14px;
        border-radius: 14px;
        border: 1px solid rgba(255, 215, 0, 0.35);
        background: rgba(255, 215, 0, 0.08);
        color: #ffe7a1;
        text-transform: none;
    }

    .run-media-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-width: 150px;
    }

    .run-media-chip {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 4px 8px;
        align-items: center;
        padding: 7px 8px;
        border-radius: 12px;
        border: 1px solid rgba(0, 242, 255, 0.18);
        background: rgba(255,255,255,0.035);
    }

    .run-media-chip button {
        min-height: 26px;
        padding: 4px 8px;
        font-size: 10px;
        border-radius: 999px;
    }

    .run-media-title {
        color: #f3fbff;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.6px;
    }

    .run-media-sub {
        grid-column: 1 / -1;
        color: var(--text-soft);
        font-size: 10px;
        text-transform: none;
    }

    .run-media-empty {
        color: var(--text-muted);
        font-size: 11px;
        text-transform: none;
    }

    /* =========================
       12. HUD / top instruments
       ========================= */
    .hud-top-instruments {
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 20;
        width: 480px;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        pointer-events: none;
    }

    .instrument-circle {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: white;
        min-width: 80px;
    }

    .instrument-label {
        font-size: 10px;
        color: #aaa;
        letter-spacing: 1px;
        margin-bottom: 4px;
    }

    .circle-gauge {
        width: 44px;
        height: 44px;
        border: 2px solid var(--neon);
        border-radius: 50%;
        position: relative;
        box-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
        background: rgba(0, 0, 0, 0.35);
    }

    .circle-line {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 30px;
        height: 2px;
        background: var(--neon);
        transform: translate(-50%, -50%) rotate(0deg);
        transform-origin: center center;
        box-shadow: 0 0 8px var(--neon);
    }

    .instrument-value {
        margin-top: 4px;
        font-size: 14px;
        font-weight: bold;
        color: var(--neon);
        text-shadow: 0 0 8px var(--neon);
    }

    .compass-box {
        width: 220px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .compass-line {
        position: relative;
        width: 200px;
        height: 18px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 4px;
    }

    .compass-tick {
        width: 2px;
        height: 4px;
        background: rgba(0, 242, 255, 0.5);
    }

    .compass-tick.major {
        height: 7px;
        background: var(--neon);
    }

    .compass-dot {
        width: 8px;
        height: 8px;
        background: red;
        border-radius: 50%;
        box-shadow: 0 0 10px red;
    }

    .compass-heading {
        margin-top: 2px;
        font-size: 22px;
        font-weight: bold;
        color: var(--neon);
        letter-spacing: 6px;
        text-shadow: 0 0 10px var(--neon);
    }

    /* =========================
       12. HUD / controls + overlays
       ========================= */
    #hud-view {
        display: none;
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        background: #000;
        overflow: hidden;
        user-select: none;
        -webkit-user-select: none;
        z-index: var(--z-toast);
    }

    .hud-overlay {
        position: absolute;
        z-index: 10;
        pointer-events: none;
        text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    }

    .top-left { top: 30px; left: 30px; }
    .top-right { top: 30px; right: 30px; text-align: right; }
    .bot-left { bottom: 40px; left: 30px; width: 220px; text-align: left; }
    .bot-right { bottom: 40px; right: 30px; width: 220px; text-align: right; }

    .trail-name {
        font-size: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        margin-bottom: 5px;
        padding-bottom: 3px;
    }

    .timer-display {
        font-size: 32px;
        font-weight: 900;
        color: white;
        margin-bottom: 10px;
        font-variant-numeric: tabular-nums;
    }

    .points {
        font-size: 46px;
        font-weight: 900;
        color: white;
        line-height: 1;
    }

    .multiplier-tag {
        background: var(--neon);
        color: black;
        padding: 2px 8px;
        font-size: 18px;
        font-weight: 900;
        border-radius: 4px;
        margin-top: 5px;
        box-shadow: 0 0 15px var(--neon);
        animation: pulse 2s infinite;
        display: inline-block;
    }

    @keyframes pulse {
        0% { opacity: 0.8; transform: scale(1); }
        50% { opacity: 1; transform: scale(1.1); }
        100% { opacity: 0.8; transform: scale(1); }
    }

    .mid-right {
        top: 30%;
        right: 30px;
        text-align: right;
        width: 190px;
        pointer-events: auto;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .hud-telemetry-stack {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 6px;
    }

    .hud-mini-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 10px;
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 10px;
        background: rgba(255,255,255,0.03);
    }

    .hud-mini-row .label {
        margin-bottom: 0;
    }

    .hud-mini-val {
        font-size: 13px;
        font-weight: 900;
        color: #f1fbff;
        letter-spacing: 1px;
        white-space: nowrap;
    }

    .hud-mini-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        align-self: flex-end;
        min-height: 30px;
        padding: 0 12px;
        border-radius: 999px;
        border: 1px solid rgba(255,255,255,0.10);
        background: rgba(255,255,255,0.04);
        color: #c8d8de;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 1px;
    }

    .hud-mini-chip.active {
        border-color: rgba(0,242,255,0.28);
        background: rgba(0,242,255,0.14);
        color: #f6feff;
        box-shadow: 0 0 12px rgba(0,242,255,0.14);
    }

    .fuel-bar-bg {
        width: 100%;
        height: 6px;
        background: rgba(255, 255, 255, 0.1);
        margin-top: 5px;
        position: relative;
        border-radius: 3px;
        overflow: hidden;
    }

    #fuel-fill {
        height: 100%;
        width: 100%;
        background: var(--neon);
        box-shadow: 0 0 10px var(--neon);
        transition: width 0.5s;
    }

    .control-bar-bg {
        width: 100%;
        height: 10px;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid var(--neon);
        position: relative;
        margin-top: 20px;
        border-radius: 5px;
        overflow: hidden;
    }

    #throttle-fill {
        height: 100%;
        width: 0%;
        background: var(--neon);
        transition: width 0.1s;
    }

    .steer-bar-wrapper {
        width: 100%;
        height: 10px;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid var(--neon);
        position: relative;
        margin-top: 10px;
        border-radius: 5px;
    }

    .steer-cursor {
        width: 16px;
        height: 18px;
        background: var(--neon);
        border-radius: 3px;
        position: absolute;
        top: -5px;
        left: 50%;
        transform: translateX(-50%);
        box-shadow: 0 0 10px var(--neon);
        transition: left 0.1s linear;
        z-index: 3;
    }

    #virtual-joysticks {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 50;
        pointer-events: none;
    }

    #joy-left {
        position: absolute;
        bottom: 150px;
        left: 100px;
    }

    #joy-right {
        position: absolute;
        bottom: 150px;
        right: 100px;
    }

    .joy-zone {
        width: 150px;
        height: 150px;
        background: rgba(0, 242, 255, 0.05);
        border: 2px dashed rgba(0, 242, 255, 0.3);
        border-radius: 50%;
        pointer-events: auto;
        touch-action: none;
    }

    .joy-stick {
        width: 60px;
        height: 60px;
        background: rgba(0, 242, 255, 0.5);
        border: 2px solid var(--neon);
        border-radius: 50%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        box-shadow: 0 0 15px var(--neon);
        transition: transform 0.1s ease-out;
        pointer-events: none;
    }

    /* =========================
       12. HUD / refuel widgets
       ========================= */


    /* =========================
       Patch v3.7 — HUD State Feedback
       ========================= */
    .hud-state-strip {
        position: absolute;
        top: 82px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 32;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 5px 8px;
        border-radius: 999px;
        background: rgba(3, 10, 14, 0.24);
        border: 1px solid rgba(0, 242, 255, 0.12);
        box-shadow: 0 8px 22px rgba(0,0,0,0.18);
        backdrop-filter: blur(8px);
        pointer-events: none;
    }

    .hud-state-pill {
        min-width: 58px;
        padding: 4px 8px;
        border-radius: 999px;
        border: 1px solid rgba(255,255,255,0.12);
        background: rgba(255,255,255,0.035);
        color: #cddce2;
        font-size: 9px;
        line-height: 1;
        font-weight: 900;
        letter-spacing: .9px;
        text-align: center;
        text-transform: uppercase;
        text-shadow: 0 0 8px rgba(0,0,0,0.35);
        white-space: nowrap;
    }

    .hud-state-pill.ok {
        color: #e9feff;
        border-color: rgba(0,242,255,0.42);
        background: rgba(0,242,255,0.13);
        box-shadow: 0 0 14px rgba(0,242,255,0.16);
    }

    .hud-state-pill.warn {
        color: #fff0b6;
        border-color: rgba(255,215,0,0.38);
        background: rgba(255,215,0,0.11);
        box-shadow: 0 0 12px rgba(255,215,0,0.13);
    }

    .hud-state-pill.bad {
        color: #ffd2d2;
        border-color: rgba(255,80,95,0.42);
        background: rgba(255,80,95,0.12);
        box-shadow: 0 0 12px rgba(255,80,95,0.14);
    }

    .hud-state-pill.idle {
        color: #98aeb7;
        border-color: rgba(255,255,255,0.10);
        background: rgba(255,255,255,0.025);
    }

    .hud-system-btn.disabled,
    .hud-system-btn:disabled {
        opacity: var(--disabled-opacity);
        cursor: not-allowed;
        filter: grayscale(.45);
        box-shadow: none !important;
    }

    .hud-system-btn.available {
        border-color: rgba(0,242,255,0.42);
    }

    /* Stage 4: physical aux system whose car hardware is offline / not equipped. */
    .hud-system-btn.hw-offline {
        border-color: rgba(255,120,120,0.4);
        filter: grayscale(.5);
    }
    .hud-system-btn.hw-offline::after {
        content: "OFFLINE";
        position: absolute;
        top: 2px;
        right: 4px;
        font-size: 8px;
        letter-spacing: .5px;
        color: rgba(255,140,140,0.9);
    }

    .hud-system-btn.busy {
        color: #fff0b6;
        border-color: rgba(255,215,0,0.42);
        background: rgba(255,215,0,0.09);
        box-shadow: 0 0 14px rgba(255,215,0,0.12);
    }

    .lightning-btn.refuel-available {
        border-color: rgba(0,242,255,0.9);
        box-shadow: 0 0 26px rgba(0,242,255,0.36), inset 0 0 16px rgba(0,242,255,0.12);
    }

    .lightning-btn.refuel-ready,
    .lightning-btn.refuel-active {
        border-color: rgba(255,215,0,0.9);
        color: #ffd96a;
        box-shadow: 0 0 30px rgba(255,215,0,0.38), inset 0 0 20px rgba(255,215,0,0.13);
    }

    .lightning-btn.refuel-no-energy,
    .lightning-btn.refuel-disabled {
        opacity: var(--disabled-opacity);
        filter: grayscale(1);
        box-shadow: none;
    }

    .hud-mini-chip.refuel-ready,
    .hud-mini-chip.active {
        color: #fff0b6;
        border-color: rgba(255,215,0,0.38);
        background: rgba(255,215,0,0.11);
    }

    .hud-mini-chip.refuel-no-energy {
        color: #ffd2d2;
        border-color: rgba(255,80,95,0.35);
        background: rgba(255,80,95,0.10);
    }

    .lightning-btn {
        width: 80px;
        height: 80px;
        margin: 10px auto;
        background: radial-gradient(circle, rgba(0, 242, 255, 0.15) 0%, rgba(0, 0, 0, 0.6) 100%);
        border: 2px solid var(--neon);
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 35px;
        color: var(--neon);
        cursor: pointer;
        transition: 0.1s;
        pointer-events: auto;
        box-shadow: 0 0 20px rgba(0, 242, 255, 0.25);
    }

    .lightning-btn:active {
        transform: scale(0.9);
        background: var(--neon);
        color: black;
    }

    .lightning-btn.disabled {
        opacity: var(--disabled-opacity);
        filter: grayscale(1);
        pointer-events: none;
        box-shadow: none;
    }

    .lightning-label {
        font-size: 10px;
        color: var(--neon);
        text-align: center;
        letter-spacing: 2px;
        font-weight: 900;
    }

    .hud-energy-balance {
        margin-top: 8px;
        font-size: 11px;
        color: #cfe7ef;
        text-align: center;
        letter-spacing: 1px;
        text-shadow: 0 0 8px rgba(0, 242, 255, 0.15);
        min-height: 14px;
    }


        
.hud-xp-panel {
    position: absolute;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 24;
    width: min(360px, calc(100vw - 60px));
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.hud-xp-tag {
    font-size: 10px;
    color: #9fb2bc;
    letter-spacing: 1px;
    opacity: 0.9;
    white-space: nowrap;
}

.hud-xp-level {
    font-size: 10px;
    color: var(--neon);
    letter-spacing: 1px;
    white-space: nowrap;
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.2);
}

.hud-xp-bar-bg {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 242, 255, 0.12);
}

.hud-xp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(0,242,255,0.8) 0%, rgba(255,0,127,0.9) 100%);
    box-shadow: 0 0 12px rgba(0, 242, 255, 0.26);
    transition: width 0.25s ease;
}

.hud-xp-topline,
.hud-xp-subline,
.hud-floating-layer,
.hud-float-text,
.hud-float-text.score,
.hud-float-text.xp {
    display: none;
}

@keyframes hudFloatUp {
    0% { opacity: 0; }
    100% { opacity: 0; }
}

/* =========================
       10. community + 11. contacts
       ========================= */

    #chat-container {
        position: absolute;
        z-index: 100;
        pointer-events: auto;
        background: rgba(0, 0, 0, 0.7);
        border: 1px solid var(--glass-border);
        border-radius: 5px;
        display: none;
        flex-direction: column;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
    }

    #crew-roster {
        border-bottom: 1px solid var(--glass-border);
        padding: 5px;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .crew-slot {
        display: flex;
        justify-content: space-between;
        padding: 3px 8px;
        border-radius: 3px;
        font-size: 11px;
        font-weight: bold;
        letter-spacing: 1px;
    }

    .crew-slot.driver {
        background: var(--neon);
        color: black;
        box-shadow: 0 0 5px var(--neon);
    }

    .crew-slot.vip {
        background: #ffd700;
        color: black;
        box-shadow: 0 0 5px #ffd700;
    }

    .crew-slot.empty {
        background: rgba(255, 255, 255, 0.05);
        color: #555;
        border: 1px dashed #333;
    }

    .crew-status {
        font-size: 9px;
        opacity: 0.8;
    }

    .hud-mission-card {
        margin: 6px 6px 4px;
        border: 1px solid rgba(0, 242, 255, 0.20);
        border-radius: 10px;
        background: linear-gradient(180deg, rgba(0, 242, 255, 0.075), rgba(0, 0, 0, 0.26));
        overflow: hidden;
        box-shadow: inset 0 0 12px rgba(0, 242, 255, 0.04);
    }

    .hud-mission-header {
        width: 100%;
        border: none;
        background: rgba(0, 0, 0, 0.18);
        color: var(--neon);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 8px 10px;
        cursor: pointer;
        font-size: 11px;
        font-weight: 950;
        letter-spacing: 1.2px;
        text-align: left;
        /* i18n: dictionary stores normal-case "Missions"; keep the caps look via CSS. */
        text-transform: uppercase;
    }

    .hud-mission-status-dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: rgba(255,255,255,0.22);
        box-shadow: none;
        flex: 0 0 auto;
    }

    .hud-mission-card.active .hud-mission-status-dot {
        background: #4cff8f;
        box-shadow: 0 0 10px rgba(76,255,143,0.55);
    }

    .hud-mission-body {
        padding: 8px 10px 10px;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .hud-mission-title {
        font-size: 12px;
        font-weight: 950;
        color: #f6fdff;
        letter-spacing: 0.7px;
        line-height: 1.2;
    }

    .hud-mission-line {
        font-size: 10px;
        color: #a9c4ce;
        line-height: 1.35;
        text-transform: none;
    }

    .hud-mission-panel {
        display: none;
        border-top: 1px solid rgba(0, 242, 255, 0.12);
        padding: 8px;
        background: rgba(1, 8, 12, 0.62);
        max-height: 220px;
        overflow-y: auto;
    }

    .hud-mission-card.panel-open .hud-mission-panel {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .hud-mission-actions {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 2px;
    }

    .hud-mission-mini-btn {
        min-height: 26px;
        padding: 5px 8px;
        border-radius: 8px;
        font-size: 9px;
        min-width: 72px;
    }

    .hud-route-overlay {
        position: absolute;
        left: 50%;
        bottom: 212px;
        transform: translateX(-50%) translateY(10px);
        z-index: var(--z-run-overlay);
        width: min(420px, calc(100vw - 42px));
        display: none;
        flex-direction: column;
        gap: 10px;
        padding: 13px 14px;
        border-radius: 18px;
        border: 1px solid rgba(0, 242, 255, 0.28);
        background: linear-gradient(180deg, rgba(4, 14, 18, 0.94), rgba(2, 8, 12, 0.88));
        box-shadow: 0 18px 44px rgba(0,0,0,.48), 0 0 26px rgba(0,242,255,.12);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        pointer-events: auto;
        opacity: 0;
        transition: opacity .16s ease, transform .16s ease;
    }

    .hud-route-overlay.open {
        display: flex;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .hud-route-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
    }

    .hud-route-kicker {
        color: var(--neon);
        font-size: 10px;
        font-weight: 950;
        letter-spacing: 1.5px;
    }

    .hud-route-title {
        margin-top: 3px;
        color: #f6fdff;
        font-size: 14px;
        font-weight: 950;
        letter-spacing: .8px;
        line-height: 1.15;
    }

    .hud-route-close {
        width: 30px;
        height: 30px;
        min-width: 30px;
        border-radius: 10px;
        border: 1px solid rgba(0,242,255,.22);
        background: rgba(255,255,255,.035);
        color: #dff8ff;
        cursor: pointer;
        font-weight: 950;
    }

    .hud-route-list {
        display: flex;
        flex-direction: column;
        gap: 7px;
    }

    .hud-route-step-row {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr) 30px;
        align-items: center;
        gap: 9px;
        padding: 7px 8px;
        border-radius: 12px;
        border: 1px solid rgba(0,242,255,.10);
        background: rgba(255,255,255,.035);
        color: #dcebf0;
    }

    .hud-route-step-row.done {
        border-color: rgba(76,255,143,.20);
        background: rgba(76,255,143,.055);
    }

    .hud-route-step-row.next {
        border-color: rgba(255,215,0,.40);
        background: linear-gradient(90deg, rgba(255,215,0,.13), rgba(0,242,255,.055));
        box-shadow: 0 0 16px rgba(255,215,0,.10);
    }

    .hud-route-step-index {
        width: 22px;
        height: 22px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(0,242,255,.14);
        color: #ffffff;
        font-size: 10px;
        font-weight: 950;
    }

    .hud-route-step-row.done .hud-route-step-index {
        background: rgba(76,255,143,.22);
        color: #d9ffeb;
    }

    .hud-route-step-row.next .hud-route-step-index {
        background: rgba(255,215,0,.92);
        color: #041014;
    }

    .hud-route-step-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 11px;
        font-weight: 950;
        letter-spacing: .7px;
    }

    .hud-route-step-state {
        text-align: right;
        color: var(--neon);
        font-size: 14px;
        font-weight: 950;
    }

    .hud-route-foot {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        color: #9fb7c2;
        font-size: 10px;
        line-height: 1.3;
        text-transform: none;
    }

    @media (max-width: 760px), (max-height: 760px) {
        .hud-route-overlay {
            bottom: 174px;
            width: min(380px, calc(100vw - 24px));
        }
    }

    .hud-mission-choice {
        padding: 8px;
        border-radius: 10px;
        border: 1px solid rgba(0, 242, 255, 0.12);
        background: rgba(255,255,255,0.035);
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .hud-mission-choice-title {
        color: #f5fbff;
        font-size: 11px;
        font-weight: 900;
    }

    .hud-mission-choice-meta {
        color: #9fb3bd;
        font-size: 9px;
        line-height: 1.3;
        text-transform: none;
    }

    .chat-messages {
        flex-grow: 1;
        overflow-y: auto;
        padding: 8px;
        font-size: 12px;
        color: white;
        height: 120px;
        text-transform: none;
        font-family: monospace;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .crew-voice-toolbar {
        display: flex;
        gap: 8px;
        padding: 8px;
        border-top: 1px solid rgba(0, 242, 255, 0.12);
        border-bottom: 1px solid rgba(0, 242, 255, 0.12);
        background: rgba(255,255,255,0.02);
    }

    .crew-voice-btn {
        flex: 1 1 0;
        min-height: 34px;
        border-radius: 10px;
        border: 1px solid rgba(0, 242, 255, 0.18);
        background: rgba(255,255,255,0.04);
        color: #d7e7ed;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 1px;
        cursor: pointer;
        transition: .18s ease;
        /* i18n: dictionary stores normal-case "Push to Talk"; keep the caps look via CSS. */
        text-transform: uppercase;
    }

    .crew-voice-btn:hover {
        border-color: rgba(0, 242, 255, 0.34);
        background: rgba(0,242,255,0.08);
    }

    .crew-voice-btn.active {
        background: rgba(0,242,255,0.16);
        color: white;
        border-color: rgba(0, 242, 255, 0.42);
        box-shadow: 0 0 14px rgba(0, 242, 255, 0.15);
    }

    .crew-voice-btn.push.active {
        background: rgba(255,0,127,0.18);
        border-color: rgba(255,0,127,0.42);
        box-shadow: 0 0 16px rgba(255,0,127,0.16);
    }

    .crew-voice-btn.disabled {
        opacity: var(--disabled-opacity);
        cursor: not-allowed;
        box-shadow: none;
    }

    .crew-voice-members {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px;
        min-height: 24px;
        background: rgba(255,255,255,0.015);
        border-bottom: 1px solid rgba(0, 242, 255, 0.10);
    }

    .voice-member-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 5px 8px;
        border-radius: 999px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(0, 242, 255, 0.10);
        color: #d7e7ed;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .7px;
    }

    .voice-member-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(255,255,255,0.28);
        box-shadow: none;
    }

    .voice-member-pill.talking .voice-member-dot {
        background: #00f2ff;
        box-shadow: 0 0 10px rgba(0, 242, 255, 0.52);
    }

    .voice-member-pill.muted .voice-member-dot {
        background: #ff6666;
        box-shadow: 0 0 10px rgba(255, 102, 102, 0.28);
    }

    .voice-member-role {
        color: #8da2ad;
    }

    /* Stage 6 — local mic level meter (Google-Meet style): proves the mic works + which device,
       even when alone in the car. Driven by --voice-level (0..1) set each frame from 07e. */
    .voice-mic-row {
        display: none;
        align-items: center;
        gap: 8px;
        padding: 6px 9px;
        border-bottom: 1px solid rgba(0, 242, 255, 0.10);
        background: rgba(255,255,255,0.015);
        --voice-level: 0;
    }
    .voice-mic-row.mic-active { display: flex; }

    .voice-mic-meter-dot {
        flex: 0 0 auto;
        width: 12px; height: 12px;
        border-radius: 50%;
        background: rgba(120,140,150,0.5);
        transform: scale(calc(0.85 + var(--voice-level) * 0.6));
        box-shadow: 0 0 calc(2px + var(--voice-level) * 16px) rgba(33, 211, 106, calc(var(--voice-level) * 0.9));
        transition: transform .06s linear;
    }
    .voice-mic-row.speaking .voice-mic-meter-dot {
        background: #21d36a;
        box-shadow: 0 0 calc(6px + var(--voice-level) * 18px) rgba(33, 211, 106, 0.7);
    }
    .voice-mic-row.mic-muted .voice-mic-meter-dot {
        background: #ff6666;
        box-shadow: none;
    }

    .voice-mic-meter-track {
        position: relative;
        flex: 1 1 0;
        height: 6px;
        border-radius: 4px;
        background: rgba(255,255,255,0.07);
        overflow: hidden;
    }
    .voice-mic-meter-fill {
        position: absolute;
        left: 0; top: 0; bottom: 0;
        width: calc(var(--voice-level) * 100%);
        background: linear-gradient(90deg, #21d36a, #5fe39a);
        transition: width .06s linear;
    }
    .voice-mic-row.mic-muted .voice-mic-meter-fill {
        background: rgba(255, 102, 102, 0.6);
    }

    .voice-mic-device {
        flex: 0 0 auto;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: .5px;
        color: #8da2ad;
        text-transform: none;
    }

    .voice-link-status {
        display: none;
        padding: 4px 9px 7px;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: .6px;
        color: #8da2ad;
    }
    .voice-link-status.show { display: block; }
    .voice-link-status.ok { color: #21d36a; }
    .voice-link-status.wait { color: #f0c419; }
    .voice-link-status.fail { color: #ff6b6b; }

    .chat-input-area {
        display: flex;
        border-top: 1px solid rgba(0, 242, 255, 0.3);
    }

    .chat-input-area input {
        flex-grow: 1;
        background: transparent;
        border: none;
        color: white;
        padding: 8px;
        font-size: 12px;
        outline: none;
        text-transform: none;
        font-family: var(--font);
    }

    .chat-input-area button {
        background: var(--neon);
        color: black;
        border: none;
        font-weight: bold;
        font-size: 14px;
        cursor: pointer;
        padding: 0 15px;
    }

    .chat-input-area button:hover {
        background: white;
    }

    .chat-msg-driver b {
        color: var(--neon) !important;
        text-shadow: 0 0 5px var(--neon);
    }

    .chat-msg-vip b {
        color: #ffd700 !important;
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }

    .chat-msg-spectator b {
        color: #aaa !important;
    }

    .chat-driver,
    .chat-passenger {
        top: 50%;
        left: 30px;
        width: 260px;
        transform: translateY(-50%);
    }

    .chat-passenger {
        border-color: rgba(255, 215, 0, 0.34);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.10), 0 0 15px rgba(0, 0, 0, 0.8);
    }

    .hud-system-dock {
        position: absolute;
        left: 50%;
        bottom: 24px;
        transform: translateX(-50%);
        z-index: var(--z-page-ui);
        pointer-events: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: min(760px, calc(100vw - 340px));
    }

    .hud-function-row {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
        border: 1px solid rgba(0, 242, 255, 0.16);
        border-radius: 18px;
        background: rgba(3, 10, 15, 0.62);
        box-shadow: 0 12px 30px rgba(0,0,0,0.28), 0 0 18px rgba(0,242,255,0.08);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .hud-function-row.secondary {
        display: none;
        border-color: rgba(255, 215, 0, 0.16);
    }

    .hud-system-dock.expanded .hud-function-row.secondary {
        display: flex;
    }

    .hud-system-btn {
        position: relative;
        min-width: 74px;
        min-height: 38px;
        padding: 6px 10px;
        border-radius: 12px;
        border: 1px solid rgba(0, 242, 255, 0.24);
        background: rgba(255,255,255,0.04);
        color: #d8eef5;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .8px;
        cursor: pointer;
        text-transform: uppercase;
    }

    .hud-system-btn:hover {
        border-color: rgba(0, 242, 255, 0.48);
        background: rgba(0,242,255,0.10);
        color: #fff;
    }

    .hud-system-btn.active {
        background: rgba(0,242,255,0.18);
        border-color: rgba(0,242,255,0.62);
        color: #fff;
        box-shadow: 0 0 14px rgba(0,242,255,0.20);
    }

    .hud-system-btn.danger {
        border-color: rgba(255,0,127,0.28);
    }

    .track-pool-btn {
        position: relative;
        overflow: hidden;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 44px;
        isolation: isolate;
    }

    .track-pool-btn::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--pool-progress, 0) * 1%);
        background: linear-gradient(0deg, rgba(0,242,255,0.45), rgba(0,242,255,0.14));
        box-shadow: 0 0 16px rgba(0,242,255,0.28);
        transition: height 0.28s ease;
        z-index: -1;
    }

    .track-pool-btn .effect-label { line-height: 1; }

    .track-pool-btn .effect-progress {
        color: #8ff7ff;
        font-size: 9px;
        line-height: 1;
        letter-spacing: .5px;
        text-shadow: 0 0 7px rgba(0,242,255,.38);
    }

    .track-pool-btn.pool-full {
        border-color: rgba(0,242,255,0.72);
        box-shadow: 0 0 16px rgba(0,242,255,0.28);
    }

    .hud-system-btn.gold {
        border-color: rgba(255,215,0,0.30);
        color: #ffe8a6;
    }

    .hud-system-btn[disabled],
    .hud-system-btn.disabled {
        opacity: var(--disabled-opacity);
        cursor: not-allowed;
        box-shadow: none;
    }

    /* =========================
       PATCH v3.5 — HUD driving interface cleanup
       ========================= */
    .hud-v35-glass {
        border: 1px solid rgba(0, 242, 255, 0.18);
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(3, 10, 15, 0.72), rgba(3, 10, 15, 0.46));
        box-shadow: 0 14px 34px rgba(0,0,0,0.30), 0 0 18px rgba(0,242,255,0.08);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 12px 14px;
    }

    #hud-view .top-left,
    #hud-view .top-right,
    #hud-view .mid-right {
        border: 1px solid rgba(0, 242, 255, 0.14);
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(3, 10, 15, 0.70), rgba(3, 10, 15, 0.42));
        box-shadow: 0 14px 34px rgba(0,0,0,0.28), 0 0 18px rgba(0,242,255,0.07);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 12px 14px;
    }

    #hud-view .top-left { min-width: 210px; }
    #hud-view .top-right { min-width: 220px; }
    #hud-view .mid-right { width: 220px; }

    #hud-view .trail-name {
        border-bottom-color: rgba(0, 242, 255, 0.16);
        color: #f4fbff;
        font-size: 15px;
        font-weight: 950;
        letter-spacing: 1.2px;
    }

    #hud-view .timer-display {
        margin-bottom: 8px;
        color: #f8fdff;
        font-size: 28px;
        letter-spacing: 1px;
    }

    #hud-view .points {
        font-size: 34px;
        letter-spacing: 1px;
    }

    #hud-view .multiplier-tag {
        border-radius: 999px;
        padding: 5px 10px;
        font-size: 13px;
        letter-spacing: 1px;
        animation: none;
    }

    .hud-top-instruments {
        width: min(430px, calc(100vw - 520px));
        top: 18px;
        padding: 8px 14px;
        border: 1px solid rgba(0, 242, 255, 0.12);
        border-radius: 999px;
        background: rgba(3, 10, 15, 0.44);
        box-shadow: 0 12px 28px rgba(0,0,0,0.24);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .hud-top-instruments .circle-gauge {
        width: 38px;
        height: 38px;
    }

    .hud-top-instruments .instrument-value {
        font-size: 12px;
    }

    .hud-xp-panel {
        top: 88px;
        width: min(330px, calc(100vw - 60px));
        padding: 8px 10px;
        border: 1px solid rgba(0, 242, 255, 0.12);
        border-radius: 999px;
        background: rgba(3, 10, 15, 0.42);
        box-shadow: 0 12px 26px rgba(0,0,0,0.20);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .hud-status-card {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .hud-status-card .label {
        letter-spacing: 1.1px;
        color: #91aab4;
    }

    .hud-status-card .val {
        color: #eaf9ff;
        font-size: 15px;
        text-shadow: 0 0 8px rgba(0,242,255,0.20);
    }

    .hud-fuel-block {
        padding: 9px 10px;
        border-radius: 13px;
        border: 1px solid rgba(255,255,255,0.08);
        background: rgba(255,255,255,0.035);
    }

    .hud-system-dock {
        width: min(860px, calc(100vw - 360px));
        bottom: 24px;
        gap: 6px;
    }

    .hud-dock-card {
        width: 100%;
        border: 1px solid rgba(0, 242, 255, 0.16);
        border-radius: 20px;
        background: linear-gradient(180deg, rgba(3, 10, 15, 0.78), rgba(3, 10, 15, 0.54));
        box-shadow: 0 18px 40px rgba(0,0,0,0.32), 0 0 22px rgba(0,242,255,0.08);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        padding: 8px;
    }

    .hud-dock-title-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 2px 6px 8px;
        color: #8da2ad;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 1.4px;
    }

    .hud-dock-status {
        color: #d9f7ff;
        opacity: 0.88;
    }

    .hud-function-row {
        width: 100%;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        gap: 7px;
    }

    .hud-function-row.primary {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        margin-bottom: 7px;
    }

    .hud-function-row.media {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .hud-function-row.secondary {
        display: none;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 215, 0, 0.13);
    }

    .hud-system-dock.expanded .hud-function-row.secondary {
        display: grid;
    }

    .hud-system-btn {
        min-width: 0;
        width: 100%;
        min-height: 48px;
        border-radius: 14px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        line-height: 1.05;
        background: rgba(255,255,255,0.045);
        border-color: rgba(0, 242, 255, 0.18);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
    }

    .hud-system-btn .hud-btn-icon {
        display: block;
        font-size: 15px;
        line-height: 1;
    }

    .hud-system-btn .hud-btn-label {
        display: block;
        font-size: 10px;
        font-weight: 950;
        letter-spacing: .85px;
    }

    .hud-system-btn .hud-btn-sub {
        display: block;
        color: #90a9b3;
        font-size: 8px;
        font-weight: 800;
        letter-spacing: .6px;
    }

    .hud-system-btn.active .hud-btn-sub,
    .hud-system-btn:hover .hud-btn-sub {
        color: #d6faff;
    }

    .hud-system-btn.hud-primary-action {
        border-color: rgba(0, 242, 255, 0.30);
        background: linear-gradient(180deg, rgba(0,242,255,0.12), rgba(255,255,255,0.04));
    }

    .hud-system-btn.hud-media-action {
        border-color: rgba(120, 170, 255, 0.24);
    }

    .hud-system-btn.hud-more-action {
        border-color: rgba(255, 215, 0, 0.28);
        color: #ffe8a6;
    }

    .hud-system-dock.expanded .hud-more-action {
        background: rgba(255, 215, 0, 0.12);
        box-shadow: 0 0 14px rgba(255, 215, 0, 0.14);
    }

    .hud-media-note {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        border-radius: 14px;
        border: 1px dashed rgba(0,242,255,0.14);
        color: #91aab4;
        font-size: 9px;
        font-weight: 900;
        letter-spacing: .8px;
        text-align: center;
        padding: 0 8px;
        background: rgba(255,255,255,0.025);
    }

    .bot-left,
    .bot-right {
        bottom: 118px;
        padding: 10px 12px;
        border: 1px solid rgba(0, 242, 255, 0.12);
        border-radius: 14px;
        background: rgba(3, 10, 15, 0.42);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .btn-exit-new {
        width: 100%;
        padding: 10px;
        background: rgba(255, 68, 68, 0.15);
        color: #ff4444;
        border: none;
        border-bottom: 1px solid rgba(255, 68, 68, 0.3);
        font-weight: bold;
        font-size: 10px;
        cursor: pointer;
        letter-spacing: 1px;
        /* i18n: dictionary stores normal-case "Exit to lobby"; keep the caps look via CSS. */
        text-transform: uppercase;
    }

    #passenger-warning {
        position: absolute;
        top: 116px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(8, 16, 22, 0.76);
        color: #d7e7ed;
        padding: 8px 16px;
        font-weight: bold;
        border-radius: 12px;
        display: none;
        z-index: 100;
        text-align: center;
        border: 1px solid rgba(0, 242, 255, 0.20);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
        font-size: 11px;
        letter-spacing: 1px;
        backdrop-filter: blur(10px);
        min-width: 220px;
    }

    /* =========================
       06. modals / refuel + run summary
       ========================= */
    #refuel-overlay {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.85);
        z-index: var(--z-run-overlay);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        backdrop-filter: blur(5px);
        pointer-events: auto;
    }

    #station-refuel-countdown {
        display: none;
        position: absolute;
        inset: 0;
        z-index: var(--z-station-refuel-countdown);
        align-items: center;
        justify-content: center;
        pointer-events: none;
    }

    #station-refuel-countdown .control-countdown-text {
        font-size: 88px;
        color: #ffffff;
        text-shadow: 0 0 24px rgba(0, 242, 255, 0.75), 0 0 42px rgba(0, 0, 0, 0.72);
    }

    #station-refuel-overlay {
        display: none;
        position: absolute;
        inset: 0;
        z-index: var(--z-station-refuel-overlay);
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.42);
        backdrop-filter: blur(3px);
        pointer-events: none;
    }

    .station-refuel-card {
        width: max(54vw, 760px);
        max-width: calc(100vw - 64px);
        min-height: 430px;
        padding: 24px 26px 26px;
        border-radius: 22px;
        border: 1px solid rgba(0, 242, 255, 0.22);
        background: linear-gradient(180deg, rgba(8, 16, 22, 0.96) 0%, rgba(7, 14, 20, 0.94) 100%);
        box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45), 0 0 24px rgba(0, 242, 255, 0.08);
        display: flex;
        flex-direction: column;
        gap: 18px;
    }

    .station-refuel-kicker {
        text-align: center;
        color: #8da2ad;
        font-size: 12px;
        letter-spacing: 2px;
    }

    .station-refuel-title {
        text-align: center;
        color: var(--neon);
        font-size: 42px;
        font-weight: 900;
        letter-spacing: 2px;
        text-shadow: 0 0 16px rgba(0, 242, 255, 0.35);
    }

    .station-refuel-video-slot {
        flex: 1 1 auto;
        min-height: 230px;
        aspect-ratio: 16 / 9;
        border-radius: 18px;
        border: 1px dashed rgba(0, 242, 255, 0.18);
        background:
            linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.16)),
            radial-gradient(circle at top right, rgba(0,242,255,0.14), transparent 32%),
            rgba(255,255,255,0.03);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        color: #b7ccd5;
        font-size: 13px;
        letter-spacing: 1px;
        padding: 18px;
    }

    .station-refuel-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        color: #d8e8ef;
        font-size: 12px;
        letter-spacing: 1px;
    }

    .station-refuel-progress {
        height: 18px;
        border-radius: 999px;
        overflow: hidden;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(0,242,255,0.14);
        box-shadow: inset 0 0 10px rgba(0,0,0,0.22);
    }

    .station-refuel-progress-fill {
        width: 0%;
        height: 100%;
        background: linear-gradient(90deg, rgba(0,242,255,0.85), rgba(255,255,255,0.9));
        box-shadow: 0 0 14px rgba(0,242,255,0.28);
        transition: width 0.25s ease;
    }

    .refuel-title {
        color: #ff4444;
        font-size: 60px;
        text-shadow: 0 0 20px #ff4444;
        margin-bottom: 10px;
        font-weight: 900;
        letter-spacing: 2px;
        text-align: center;
    }

    .refuel-timer {
        font-size: 90px;
        font-weight: 900;
        margin: 10px 0 30px 0;
        color: white;
        text-shadow: 0 0 10px white;
    }

    .refuel-btn {
        padding: 15px 40px;
        background: var(--neon);
        color: black;
        font-weight: 900;
        font-size: 18px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        box-shadow: 0 0 20px var(--neon);
        transition: transform 0.1s;
        letter-spacing: 1px;
        margin-top: 20px;
        /* i18n: dictionaries store normal-case labels; keep the caps look via CSS.
           Also covers .run-summary-btn (they all carry .refuel-btn). */
        text-transform: uppercase;
    }

    .run-summary-card {
        width: min(760px, calc(100vw - 40px));
        padding: 24px;
        border-radius: 20px;
        border: 1px solid rgba(0, 242, 255, 0.22);
        background: linear-gradient(180deg, rgba(8, 16, 22, 0.96) 0%, rgba(7, 14, 20, 0.92) 100%);
        box-shadow: 0 22px 60px rgba(0,0,0,0.45), 0 0 24px rgba(0,242,255,0.08);
    }

    .run-summary-kicker {
        font-size: 12px;
        color: #8da2ad;
        letter-spacing: 2px;
        margin-bottom: 14px;
        text-align: center;
    }

    .run-summary-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .run-summary-item {
        padding: 14px;
        border-radius: 14px;
        background: rgba(255,255,255,0.03);
        border: 1px solid rgba(0,242,255,0.14);
        display: flex;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .run-summary-item span {
        font-size: 11px;
        color: #8da2ad;
        letter-spacing: 1px;
    }

    .run-summary-item strong {
        font-size: 22px;
        color: #fff;
        text-shadow: 0 0 10px rgba(0,242,255,0.18);
    }

    .run-summary-note {
        margin-top: 16px;
        padding: 12px 14px;
        border-radius: 12px;
        border: 1px solid rgba(255, 215, 0, 0.22);
        background: linear-gradient(90deg, rgba(255,215,0,0.08), rgba(0,242,255,0.05));
        color: #f5df9b;
        font-size: 12px;
        line-height: 1.45;
        text-transform: none;
        letter-spacing: 0.4px;
    }

    .run-summary-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        margin-top: 18px;
    }

    #run-summary-refuel-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    /* Mid-run voluntary exit: EXIT is the only action — make it one full-width centred button. */
    .run-summary-actions.solo-exit {
        grid-template-columns: 1fr;
    }
    .run-summary-actions.solo-exit #run-summary-exit-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .run-summary-btn {
        margin-top: 0;
        border-radius: 12px;
        font-size: 15px;
        min-height: 52px;
    }

    .run-summary-btn.secondary {
        background: rgba(255,255,255,0.06);
        color: #d8e8ef;
        box-shadow: none;
        border: 1px solid rgba(0,242,255,0.14);
    }

    @keyframes fuelFlash {
        0%   { box-shadow: 0 0 0 rgba(255, 255, 255, 0); filter: brightness(1); }
        30%  { box-shadow: 0 0 18px rgba(255, 255, 255, 0.9), 0 0 28px rgba(0, 242, 255, 0.9); filter: brightness(1.8); }
        100% { box-shadow: 0 0 0 rgba(255, 255, 255, 0); filter: brightness(1); }
    }

    .fuel-flash {
        animation: fuelFlash 0.35s ease-out;
    }

    /* =========================
       12. HUD / lobby visibility rules
       ========================= */
    body.hud-active #main-nav,
    body.hud-active #global-overlay,
    body.hud-active #lobby-view,
    body.hud-active #profile-view {
        display: none !important;
    }


    .pilot-meta:hover {
        background: rgba(0, 242, 255, 0.08);
        box-shadow: inset 0 0 0 1px rgba(0, 242, 255, 0.12);
    }

    .video-quality-selector {
        display: flex;
        gap: 6px;
        margin-top: 8px;
        pointer-events: auto;
    }

    .q-btn {
        background: rgba(0, 0, 0, 0.58);
        border: 1px solid rgba(0, 242, 255, 0.28);
        color: #9cb6c0;
        padding: 4px 10px;
        min-width: 42px;
        height: 30px;
        font-size: 11px;
        font-weight: bold;
        cursor: pointer;
        border-radius: 6px;
        transition: all 0.2s ease;
    }

    .q-btn:hover {
        border-color: var(--neon);
        color: white;
        box-shadow: 0 0 10px rgba(0, 242, 255, 0.18);
    }

    .q-btn.active {
        background: var(--neon);
        color: black;
        border-color: var(--neon);
        box-shadow: 0 0 12px var(--neon);
    }

    .fs-button {
        min-width: 42px;
        height: 30px;
        background: rgba(0, 0, 0, 0.58);
        border: 1px solid rgba(0, 242, 255, 0.28);
        color: #9cb6c0;
        cursor: pointer;
        font-size: 11px;
        font-weight: bold;
        border-radius: 6px;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        box-shadow: none;
        pointer-events: auto;
        transition: all 0.2s ease;
    }

    .fs-button:hover {
        border-color: var(--neon);
        color: white;
        box-shadow: 0 0 10px rgba(0, 242, 255, 0.18);
        background: rgba(0, 242, 255, 0.1);
    }

    .hud-transfer-btn {
        min-width: 154px;
        border-color: rgba(0, 242, 255, 0.40);
        color: var(--neon);
        box-shadow: 0 0 14px rgba(0, 242, 255, 0.10);
        white-space: nowrap;
    }

    .hud-transfer-btn:hover {
        background: rgba(0, 242, 255, 0.10);
        box-shadow: 0 0 18px rgba(0, 242, 255, 0.22);
    }

    .hud-transfer-btn.disabled,
    .hud-transfer-btn:disabled {
        opacity: var(--disabled-opacity);
        cursor: not-allowed;
        box-shadow: none;
    }

    .control-countdown-overlay {
        position: absolute;
        inset: 0;
        z-index: var(--z-hud-status);
        display: none;
        align-items: center;
        justify-content: center;
        pointer-events: none;
    }

    .control-countdown-text {
        font-size: 72px;
        font-weight: 900;
        letter-spacing: 6px;
        color: #ffffff;
        text-shadow: 0 0 20px rgba(0, 242, 255, 0.75), 0 0 40px rgba(0, 0, 0, 0.55);
        animation: controlPulse 0.85s ease;
    }

    @keyframes controlPulse {
        0% { transform: scale(0.72); opacity: 0; }
        35% { transform: scale(1.04); opacity: 1; }
        100% { transform: scale(1); opacity: 1; }
    }

    .toast-container {
        position: fixed;
        top: 90px;
        right: 18px;
        z-index: 7000;
        display: flex;
        flex-direction: column;
        gap: 10px;
        pointer-events: none;
    }

    .toast {
        min-width: 220px;
        max-width: 360px;
        padding: 12px 14px;
        border-radius: 12px;
        background: rgba(8, 16, 22, 0.92);
        border: 1px solid rgba(0,242,255,0.24);
        box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 18px rgba(0,242,255,0.12);
        color: white;
        font-size: 12px;
        letter-spacing: 0.5px;
        text-transform: none;
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity .22s ease, transform .22s ease;
    }

    .toast.show {
        opacity: 1;
        transform: translateY(0);
    }

    .toast.success {
        border-color: rgba(35,209,107,0.35);
        box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 18px rgba(35,209,107,0.18);
    }

    .toast.warn {
        border-color: rgba(255,189,46,0.35);
        box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 18px rgba(255,189,46,0.18);
    }

    .toast.error {
        border-color: rgba(255,68,68,0.35);
        box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 18px rgba(255,68,68,0.18);
    }

    .leader-row .priority-name,
    .crew-slot .priority-name,
    .chat-messages .priority-name {
        color: #ffd700;
        text-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
    }

    .admin-name {
        color: #8ff7ff !important;
        text-shadow: 0 0 10px rgba(0, 242, 255, 0.45);
    }

    .premium-name {
        color: #d9b8ff !important;
        text-shadow: 0 0 10px rgba(180, 120, 255, 0.32);
    }

    .rtv-badge-row {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        margin-right: 4px;
        vertical-align: middle;
    }

    .rtv-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 16px;
        height: 16px;
        padding: 0 3px;
        border-radius: 999px;
        font-size: 11px;
        line-height: 1;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.12);
        box-shadow: 0 0 8px rgba(0,0,0,0.24);
    }

    .rtv-badge-admin,
    .rtv-badge-superadmin {
        border-color: rgba(0,242,255,0.42);
        box-shadow: 0 0 10px rgba(0,242,255,0.24);
    }

    .rtv-badge-premium {
        border-color: rgba(188,120,255,0.46);
        box-shadow: 0 0 10px rgba(188,120,255,0.22);
    }

    .rtv-badge-priority {
        border-color: rgba(255,215,0,0.48);
        box-shadow: 0 0 10px rgba(255,215,0,0.22);
    }

    .chat-msg-system {
        color: #8ff7ff;
        border-left: 2px solid rgba(0,242,255,0.46);
        padding-left: 6px;
        background: rgba(0,242,255,0.05);
    }

    #admin-control-overlay {
        position: absolute;
        top: 82px;
        left: 50%;
        transform: translateX(-50%);
        display: none;
        z-index: 115;
        pointer-events: none;
        padding: 9px 18px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,0.42);
        background: linear-gradient(90deg, rgba(0,0,0,0.78), rgba(0,80,96,0.45));
        color: #8ff7ff;
        font-size: 12px;
        font-weight: 950;
        letter-spacing: 1.6px;
        text-align: center;
        box-shadow: 0 0 18px rgba(0,242,255,0.24), 0 12px 24px rgba(0,0,0,0.36);
        text-shadow: 0 0 8px rgba(0,242,255,0.4);
    }


    /* =========================
       Patch 4.9 — shell QA / responsive safeguards
       ========================= */
    @media (max-width: 1460px) {
        .lobby-nav {
            grid-template-columns: minmax(220px, 320px) minmax(160px, 1fr) max-content;
            gap: 14px;
            padding-left: 20px;
            padding-right: 20px;
        }
        #desktop-nav-links {
            display: none !important;
        }
        .burger-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        /* Burger mode: the logo grid column caps at 320px (~215px left for text), so
           28px "RcTechVillage" (~264px) ellipsized to "RCTECHVIL…". 21px keeps it
           (~205px incl. letter-spacing) inside the column with margin. */
        .logo {
            font-size: 21px;
        }
        .brand-logo-text {
            max-width: 220px;
        }
        .server-status-pill {
            max-width: 190px;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .user-profile-nav {
            gap: 10px;
        }
    }

    @media (max-width: 1280px) {
        .lobby-grid {
            grid-template-columns: 320px minmax(340px, 1fr) var(--lobby-right-column);
        }
        .footer-grid {
            grid-template-columns: 320px minmax(0, 1fr) var(--lobby-right-column);
        }
    }

    @media (max-width: 1100px) {
        .footer-grid {
            grid-template-columns: 1fr;
        }
        #center-view-lobby.active,
        #center-view-lobby {
            grid-template-rows: minmax(280px, 1fr) minmax(116px, auto) minmax(168px, auto);
        }
        .lobby-news-grid {
            grid-template-columns: 1fr;
        }
    }

    @media (max-width: 720px) {
        .quick-panel {
            right: 12px;
            left: 12px;
            width: auto;
            max-height: calc(100dvh - 96px);
            overflow-y: auto;
        }
        .quick-panel-toolbar.compact-actions,
        .message-toolbar {
            grid-template-columns: 1fr;
        }
        .header-friend-row,
        .header-friend-request-row {
            grid-template-columns: auto minmax(0, 1fr) auto;
            gap: 8px;
            padding: 8px;
        }
        .header-friend-menu-host .user-action-menu {
            right: 0;
            left: auto;
        }
    }
    /* =========================
       13. responsive
       ========================= */
    @media (max-width: 1300px) {
        .shop-window,
        .hub-window {
            left: 40px;
            right: 40px;
        }
    }

    /* Below 800px the header has no room for the brand text at all (down to ~70px free
       when logged in) — keep only the flag mark rather than an ellipsized "RCT…". */
    @media (max-width: 800px) {
        .brand-logo-text {
            display: none;
        }
    }

    @media (max-width: 950px) {
        .hide-on-mobile {
            display: none !important;
        }

        .shop-window,
        .hub-window {
            left: 12px;
            right: 12px;
            top: 78px;
            bottom: 16px;
            padding: 18px;
        }

        .startup-window,
        .run-summary-card,
        .station-refuel-card,
        .profile-card {
            width: min(100%, calc(100vw - 24px));
            max-width: calc(100vw - 24px);
        }

        .profile-card {
            grid-template-columns: 1fr;
            gap: 22px;
            padding: 22px;
            border-radius: 18px;
        }

        .profile-sidebar {
            border-right: none;
            border-bottom: 1px solid var(--glass-border);
            padding-right: 0;
            padding-bottom: 20px;
        }

        .lobby-shell { overflow-y: auto; }

        .lobby-grid {
            grid-template-columns: 1fr;
            grid-auto-rows: auto;
        }

        .lobby-center-column {
            grid-template-rows: auto auto;
        }



        .sidebar-left,
        .sidebar-right {
            width: 100%;
            max-width: 100%;
        }

        .timer-display {
            font-size: 20px !important;
            margin-bottom: 5px !important;
        }

        .points {
            font-size: 28px !important;
        }

        .top-left {
            top: 15px !important;
            left: 15px !important;
        }

        .top-right {
            top: 15px !important;
            right: 15px !important;
        }

        #joy-left {
            left: 20px !important;
            bottom: 70px !important;
        }

        #joy-right {
            right: 20px !important;
            bottom: 70px !important;
        }

        .joy-zone {
            width: 120px !important;
            height: 120px !important;
        }

        .joy-stick {
            width: 50px !important;
            height: 50px !important;
        }

        .bot-left {
            left: 15px !important;
            bottom: 15px !important;
            width: 140px !important;
        }

        .bot-right {
            right: 15px !important;
            bottom: 15px !important;
            width: 140px !important;
        }

        .mid-right {
            top: auto;
            bottom: 80px;
            right: 20px;
            width: 132px;
        }

        .lightning-btn {
            width: 60px;
            height: 60px;
            font-size: 25px;
        }

        .chat-driver,
        .chat-passenger {
            top: 20px;
            left: 20px;
            right: auto;
            transform: none;
            width: 220px;
        }

        .hud-system-dock {
            left: 50%;
            bottom: 8px;
            width: min(520px, calc(100vw - 170px));
        }

        .hud-system-dock {
            width: min(560px, calc(100vw - 170px));
        }

        .hud-dock-title-row {
            display: none;
        }

        .hud-dock-card {
            padding: 6px;
        }

        .hud-function-row.primary,
        .hud-function-row.media,
        .hud-function-row.secondary {
            grid-template-columns: repeat(5, minmax(48px, 1fr));
            gap: 5px;
        }

        .hud-system-btn {
            min-width: 0;
            min-height: 38px;
            font-size: 9px;
            padding: 4px 5px;
        }

        .hud-system-btn .hud-btn-icon {
            display: none;
        }

        .hud-system-btn .hud-btn-label {
            font-size: 8.5px;
        }

        .hud-system-btn .hud-btn-sub {
            display: none;
        }

        .run-summary-grid {
            grid-template-columns: 1fr 1fr;
        }

        .run-summary-actions {
            grid-template-columns: 1fr;
        }

        .lobby-nav {
            grid-template-columns: 1fr auto auto;
            gap: 12px;
            padding: 12px 16px;
        }

        .nav-center {
            justify-content: center;
            gap: 12px;
        }

        .burger-btn { display: inline-flex; align-items:center; justify-content:center; }

        .auth-buttons .btn-action { min-width: 78px; padding: 7px 12px; font-size: 12px; }

        /* must match the base rule's bumped specificity (.nav-icon-btn.ui-action-button)
           or this mobile size override stops applying */
        .nav-icon-btn.ui-action-button,
        .nav-icon-btn { width: 34px; height: 34px; font-size: 14px; }

        .logo {
            max-width: 100%;
            font-size: 20px;
            gap: 7px;
        }

        .brand-logo-img {
            width: 34px;
            height: 34px;
        }

        /* "RcTechVillage" at 20px is ~196px — a 180px cap left it ellipsized ("RCTECHVIL…").
           205px fits the whole word; below 800px there is no room at all, so the text is
           hidden entirely (flag mark stays) instead of showing dots. */
        .brand-logo-text {
            max-width: 205px;
        }

        .user-profile-nav { gap: 8px; }

        .server-status-pill {
            max-width: 160px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .pilot-meta {
            display: none;
        }

        .nav-msg-btn {
            width: 34px;
            height: 34px;
            font-size: 14px;
        }

        .fs-button {
            display: none !important;
        }

        .shop-window {
            top: 78px;
            left: 12px;
            right: 12px;
            bottom: 12px;
            padding: 16px;
        }

        .shop-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .shop-title {
            font-size: 24px;
        }
    }

    .premium-stats-card {
        display: grid;
        gap: 13px;
        width: 100%;
        color: #f4f4f2;
    }

    .premium-stats-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.12);
        font-size: 20px;
        font-weight: 950;
        letter-spacing: 0.2px;
        text-transform: none;
    }

    .premium-stats-arrow {
        color: rgba(255,255,255,0.55);
        font-size: 30px;
        line-height: 1;
    }

    .premium-stat-hero {
        display: grid;
        grid-template-columns: 58px 1fr;
        align-items: center;
        gap: 14px;
        padding: 12px 0;
    }

    .premium-stat-hero-icon {
        font-size: 42px;
        filter: drop-shadow(0 0 12px rgba(255, 70, 120, 0.26));
    }

    .premium-stat-hero-label {
        color: rgba(255,255,255,0.70);
        font-size: 13px;
        font-weight: 850;
        letter-spacing: 0.5px;
        text-transform: none;
    }

    .premium-stat-hero-value {
        color: #fff;
        font-size: 30px;
        line-height: 1.05;
        font-weight: 1000;
        letter-spacing: -0.6px;
        text-transform: none;
    }

    .premium-stat-row {
        display: grid;
        grid-template-columns: 34px 1fr auto;
        align-items: center;
        gap: 10px;
        min-height: 45px;
        padding: 9px 0;
        border-top: 1px solid rgba(255,255,255,0.10);
    }

    .premium-stat-icon {
        width: 30px;
        text-align: center;
        font-size: 22px;
    }

    .premium-stat-label {
        color: rgba(255,255,255,0.78);
        font-size: 14px;
        font-weight: 850;
        text-transform: none;
    }

    .premium-stat-value {
        color: #f4f4f2;
        font-size: 15px;
        font-weight: 950;
        letter-spacing: 0.2px;
        text-transform: none;
        white-space: nowrap;
    }

    .premium-stat-note {
        margin-top: 4px;
        padding: 9px 11px;
        border-radius: 12px;
        border: 1px solid rgba(190, 120, 255, 0.20);
        background: rgba(190, 120, 255, 0.08);
        color: rgba(245, 235, 255, 0.80);
        font-size: 11px;
        line-height: 1.3;
        text-transform: none;
    }


    body.premium-ad-free .watch-mini-frame {
        min-height: 178px;
    }

    body.premium-ad-free .offers-card {
        flex: 0 0 auto;
    }

    .premium-stats-card.compact {
        gap: 8px;
    }

    .premium-stats-card.compact .premium-stat-hero {
        padding: 2px 0 7px;
    }

    .premium-stats-card.compact .premium-stat-hero-icon {
        font-size: 34px;
    }

    .premium-stats-card.compact .premium-stat-hero-value {
        font-size: 23px;
    }

    .premium-stats-card.compact .premium-stat-row {
        min-height: 34px;
        padding: 5px 0;
    }

    .premium-stats-card.compact .premium-stat-icon {
        font-size: 18px;
    }

    .premium-stats-card.compact .premium-stat-label {
        font-size: 12px;
    }

    .premium-stats-card.compact .premium-stat-value {
        font-size: 13px;
    }

    .premium-stats-card.compact .premium-stat-note {
        margin-top: 2px;
        padding: 7px 9px;
        font-size: 10px;
    }

    .profile-main {
        gap: 18px;
    }

    .profile-stat-section {
        padding: 14px;
        border-radius: 16px;
        background: rgba(255,255,255,0.025);
        border: 1px solid rgba(0,242,255,0.08);
    }

    .profile-stat-section.driver-stats-section {
        border-color: rgba(190, 120, 255, 0.20);
        background: linear-gradient(180deg, rgba(190, 120, 255, 0.07), rgba(255,255,255,0.02));
    }

    .profile-driver-grid {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    }

    .profile-telemetry-grid {
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    }

    .stat-box.driver-highlight {
        border-left-color: #d9b8ff;
        background: rgba(190,120,255,0.065);
    }

    .stat-box.telemetry-box {
        border-left-color: rgba(0,242,255,0.72);
    }



    /* =========================
       Schedule / booking calendar
       ========================= */
    .schedule-toolbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        margin-bottom: 16px;
    }

    .schedule-month-title {
        font-size: clamp(24px, 3vw, 42px);
        font-weight: 900;
        letter-spacing: 2px;
        color: var(--text-main);
        text-shadow: 0 0 12px rgba(0, 242, 255, 0.18);
    }

    .schedule-toolbar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    .schedule-calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 10px;
    }

    .schedule-weekday {
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 1px;
        text-align: center;
        padding: 8px 4px;
    }

    .schedule-day-cell {
        min-height: 132px;
        border-radius: 16px;
        border: 1px solid rgba(0, 242, 255, 0.16);
        background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(0,0,0,0.25));
        color: var(--text-main);
        padding: 10px;
        text-align: left;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        gap: 7px;
        transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    }

    .schedule-day-cell:hover {
        border-color: rgba(0, 242, 255, 0.45);
        box-shadow: 0 0 18px rgba(0, 242, 255, 0.12);
        transform: translateY(-1px);
    }

    .schedule-day-cell.outside-month {
        opacity: 0.28;
        pointer-events: none;
    }

    .schedule-day-cell.today {
        border-color: rgba(255, 215, 0, 0.65);
        box-shadow: inset 0 0 18px rgba(255, 215, 0, 0.08);
    }

    .schedule-day-number {
        font-size: 16px;
        font-weight: 900;
        color: var(--neon);
    }

    .schedule-day-items {
        display: flex;
        flex-direction: column;
        gap: 5px;
        min-height: 0;
    }

    .schedule-chip {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        border-radius: 999px;
        padding: 5px 8px;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .4px;
        background: rgba(0, 242, 255, 0.10);
        border: 1px solid rgba(0, 242, 255, 0.18);
        color: #dffbff;
    }

    .schedule-chip.booking {
        background: rgba(255, 215, 0, 0.10);
        border-color: rgba(255, 215, 0, 0.25);
        color: #fff0b3;
    }

    .schedule-chip.announcement {
        background: rgba(255, 0, 127, 0.12);
        border-color: rgba(255, 0, 127, 0.24);
        color: #ffd6e8;
    }

    .schedule-chip.maintenance,
    .schedule-chip.closed {
        background: rgba(255, 68, 68, 0.14);
        border-color: rgba(255, 68, 68, 0.34);
        color: #ffd3d3;
    }

    .schedule-chip.cancelled,
    .schedule-chip.completed {
        opacity: 0.58;
        filter: grayscale(0.5);
    }

    .schedule-detail-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 8px;
    }

    .schedule-status-pill {
        display: inline-flex;
        align-items: center;
        padding: 3px 8px;
        border-radius: 999px;
        border: 1px solid rgba(0,242,255,.18);
        color: var(--text-soft);
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .7px;
    }

    .schedule-modal {
        position: fixed;
        inset: 0;
        z-index: var(--z-modal-high);
        display: none;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.58);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        padding: 18px;
    }

    .schedule-modal.is-open { display: flex; }

    .schedule-modal-card {
        width: min(760px, calc(100vw - 28px));
        max-height: min(86dvh, 820px);
        overflow-y: auto;
        padding: 22px;
        border-radius: var(--panel-radius-lg);
        border: 1px solid var(--glass-border);
        background: linear-gradient(180deg, rgba(8, 16, 22, 0.98), rgba(7, 14, 20, 0.94));
        box-shadow: 0 22px 50px rgba(0,0,0,.48), 0 0 22px rgba(0,242,255,.12);
    }

    .schedule-modal-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin-bottom: 14px;
    }

    .schedule-form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 12px;
    }

    .schedule-form-grid label {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .8px;
        color: var(--text-muted);
    }

    .schedule-form-grid input,
    .schedule-form-grid select,
    .schedule-form-grid textarea {
        width: 100%;
        padding: 11px;
        border-radius: 10px;
        border: 1px solid rgba(0,242,255,.18);
        background: rgba(0,0,0,.32);
        color: white;
        text-transform: none;
    }

    .schedule-form-grid textarea {
        min-height: 86px;
        resize: vertical;
        grid-column: 1 / -1;
    }

    .schedule-day-detail-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 12px 0 16px;
    }

    .schedule-detail-row {
        border-radius: 12px;
        border: 1px solid rgba(0,242,255,.14);
        background: rgba(255,255,255,.04);
        padding: 10px 12px;
        text-transform: none;
    }

    .schedule-detail-row b { color: var(--neon); text-transform: uppercase; }

    .schedule-modal-card [data-action] {
        pointer-events: auto;
    }

    .schedule-action-row {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 12px;
    }

    .schedule-action-row .mini-action-btn {
        flex: 1 1 180px;
    }

    .schedule-locked-cta {
        cursor: pointer;
    }


    .schedule-party-box {
        margin-top: 10px;
        padding: 10px;
        border-radius: 12px;
        border: 1px solid rgba(0, 242, 255, 0.15);
        background: rgba(255,255,255,0.035);
        text-transform: none;
    }

    .schedule-party-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 8px;
    }

    .schedule-queue-pill {
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        margin-top: 6px;
        padding: 7px 9px;
        border-radius: 10px;
        border: 1px solid rgba(0, 242, 255, 0.16);
        background: rgba(0, 242, 255, 0.045);
        color: #dffaff;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 0.8px;
    }

    .schedule-enter-btn {
        border-color: rgba(0, 242, 255, 0.5) !important;
    }

    .schedule-party-tag {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border-radius: 999px;
        padding: 5px 9px;
        border: 1px solid rgba(0,242,255,0.16);
        background: rgba(0,0,0,0.28);
        color: #d8f8ff;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.6px;
        text-transform: uppercase;
    }

    .schedule-inline-checks {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-top: 10px;
    }

    .schedule-inline-checks label {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 9px 10px;
        border: 1px solid rgba(0,242,255,0.12);
        border-radius: 10px;
        background: rgba(255,255,255,0.025);
        color: var(--text-soft);
        font-size: 11px;
        font-weight: 800;
    }

    @media (max-width: 900px) {
        .schedule-calendar-grid { gap: 7px; }
        .schedule-day-cell { min-height: 104px; padding: 8px; }
        .schedule-form-grid { grid-template-columns: 1fr; }
    }


    .party-room-card {
        margin-top: 10px;
        padding: 10px;
        border: 1px solid rgba(0,255,200,0.25);
        border-radius: 12px;
        background: rgba(8,16,22,0.92);
        box-shadow: 0 0 18px rgba(0,255,200,0.08) inset;
        display: none;
        gap: 8px;
        flex-direction: column;
    }
    .party-room-card.visible { display: flex; }
    .party-room-head {
        display:flex; justify-content:space-between; align-items:center; gap:10px;
        color: var(--neon); font-size: 12px; letter-spacing: .08em;
    }
    .party-room-meta { color:#cde6ea; font-size:11px; opacity:.9; }
    .party-room-queue { display:flex; flex-direction:column; gap:6px; }
    .party-queue-item {
        display:flex; justify-content:space-between; align-items:center; gap:10px;
        padding: 6px 8px; border-radius: 9px; background: rgba(255,255,255,0.03);
        border:1px solid rgba(255,255,255,0.06); font-size:11px; color:#eef8fb;
    }
    .party-queue-item.active { border-color: rgba(0,255,200,0.55); box-shadow: 0 0 12px rgba(0,255,200,0.14); }
    .party-queue-item.you { background: rgba(0,255,200,0.08); }
    .party-queue-pos { min-width: 42px; color: var(--neon); font-weight: 700; }
    .party-queue-user { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .party-queue-role { color:#b7c9cd; font-size:10px; }
    .party-room-actions { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
    .party-room-actions .hud-system-btn { width:100%; }


    .party-room-timer {
        height: 8px; border-radius: 999px; overflow: hidden;
        background: rgba(255,255,255,0.06); border:1px solid rgba(0,242,255,0.16);
    }
    .party-room-timer-fill {
        height: 100%; width: var(--turn-progress, 0%);
        background: linear-gradient(90deg, rgba(0,242,255,.35), rgba(0,255,200,.95));
        box-shadow: 0 0 12px rgba(0,255,200,.35);
        transition: width .25s linear;
    }
    .party-room-requests {
        display:flex; flex-direction:column; gap:6px; margin-top: 2px;
    }
    .party-request-item {
        display:grid; grid-template-columns:1fr auto auto; gap:6px; align-items:center;
        padding:6px 8px; border-radius:9px; border:1px solid rgba(255,255,255,.08);
        background:rgba(255,255,255,.035); color:#e8fbff; font-size:11px;
    }
    .party-mini-btn {
        border:1px solid rgba(0,242,255,.26); background:rgba(0,0,0,.25); color:var(--neon);
        border-radius:8px; padding:4px 7px; cursor:pointer; font-weight:800; font-size:10px;
    }
    .party-mini-btn.danger { border-color:rgba(255,68,68,.45); color:#ff7676; }
    .party-queue-actions { display:flex; gap:4px; }
    .party-queue-kick {
        border:1px solid rgba(255,68,68,.45); color:#ff7777; background:rgba(255,68,68,.08);
        border-radius:7px; padding:2px 6px; font-size:10px; cursor:pointer; font-weight:900;
    }
    .party-join-request-modal {
        position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); z-index:var(--z-modal-high);
        width:min(360px, calc(100vw - 32px)); padding:18px; display:none; flex-direction:column; gap:12px;
        background:rgba(8,16,22,.98); border:1px solid rgba(0,242,255,.28); border-radius:18px;
        box-shadow:0 24px 60px rgba(0,0,0,.55), 0 0 22px rgba(0,242,255,.12);
    }
    .party-join-request-modal.visible { display:flex; }
    .party-join-request-modal h3 { margin:0; color:var(--neon); font-size:16px; }
    .party-join-request-modal p { margin:0; color:#cfe3e8; font-size:12px; line-height:1.4; text-transform:none; }
    .party-join-request-modal textarea {
        width:100%; min-height:70px; resize:vertical; border-radius:10px; padding:10px;
        background:rgba(0,0,0,.35); color:white; border:1px solid rgba(0,242,255,.18);
    }
    .party-join-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }



    /* =========================
       Garage / vehicle showroom
       ========================= */
    .garage-toolbar {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 16px;
        flex-wrap: wrap;
    }

    .garage-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .garage-gallery-shell {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .garage-gallery-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px;
        border: 1px solid rgba(0, 242, 255, 0.12);
        border-radius: 14px;
        background: rgba(255,255,255,0.025);
    }

    .garage-gallery-counter {
        color: var(--text-soft);
        font-size: 12px;
        font-weight: 900;
        letter-spacing: .08em;
        text-align: center;
    }

    .garage-gallery-counter b {
        color: var(--neon);
    }

    .garage-card {
        position: relative;
        overflow: hidden;
        border-radius: 22px;
        border: 1px solid rgba(0, 242, 255, 0.18);
        background: linear-gradient(180deg, rgba(8, 16, 22, 0.94), rgba(3, 8, 12, 0.88));
        box-shadow: 0 22px 54px rgba(0,0,0,0.32), inset 0 0 24px rgba(0,242,255,0.04);
        padding: clamp(16px, 2vw, 28px);
        display: grid;
        grid-template-columns: minmax(280px, 1.05fr) minmax(280px, .95fr);
        gap: 20px;
        width: 100%;
        min-height: 520px;
    }

    .garage-card-main,
    .garage-card-side {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    @media (max-width: 900px) {
        .garage-card { grid-template-columns: 1fr; min-height: 0; }
    }

    .garage-card.reserved { border-color: rgba(255, 215, 0, 0.34); }
    .garage-card.busy { border-color: rgba(255, 0, 127, 0.34); }
    .garage-card.offline { opacity: 0.88; filter: grayscale(0.28); border-color: rgba(255, 68, 68, 0.45); }

    .garage-card-head {
        display:flex;
        align-items:flex-start;
        justify-content:space-between;
        gap:12px;
    }

    .garage-car-title {
        font-size: 18px;
        font-weight: 900;
        letter-spacing: 1px;
        color: #fff;
    }

    .garage-status-pill {
        border: 1px solid rgba(0,242,255,0.22);
        border-radius: 999px;
        padding: 5px 9px;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .08em;
        color: var(--neon);
        background: rgba(0,0,0,0.28);
        white-space: nowrap;
    }

    .garage-status-pill.offline {
        color: #ff4444;
        border-color: rgba(255,68,68,0.55);
        background: rgba(255,68,68,0.10);
        box-shadow: 0 0 14px rgba(255,68,68,0.14);
    }

    .garage-status-pill.busy { color: var(--neon-pink); border-color: rgba(255,0,127,0.38); }
    .garage-status-pill.reserved { color: #ffd24a; border-color: rgba(255,210,74,0.38); }

    .garage-model-stage {
        position: relative;
        flex: 1 1 auto;
        min-height: 340px;
        border-radius: 16px;
        border: 1px solid rgba(255,255,255,0.06);
        background:
            radial-gradient(circle at 50% 0%, rgba(0,242,255,0.16), transparent 46%),
            linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.30));
        display:flex;
        align-items:center;
        justify-content:center;
        perspective: 900px;
        overflow: hidden;
    }

    .garage-model-stage::after {
        content: '3D MODEL SLOT / GLB READY';
        position:absolute;
        left:12px;
        bottom:10px;
        color: rgba(198,215,222,0.72);
        font-size: 10px;
        letter-spacing:.1em;
    }

    .garage-model-car {
        width: min(280px, 54vw);
        height: 104px;
        border-radius: 20px 24px 12px 12px;
        background: linear-gradient(135deg, rgba(0,242,255,0.18), rgba(255,255,255,0.08));
        border: 1px solid rgba(0,242,255,0.42);
        box-shadow: 0 0 24px rgba(0,242,255,0.25);
        transform: rotateX(58deg) rotateZ(-24deg);
        position: relative;
    }

    .garage-model-car::before,
    .garage-model-car::after {
        content:'';
        position:absolute;
        bottom:-26px;
        width:58px;
        height:58px;
        border-radius:50%;
        border:5px solid rgba(255,255,255,0.22);
        background:#050505;
        box-shadow: 0 0 10px rgba(0,242,255,0.22);
    }
    .garage-model-car::before { left:32px; }
    .garage-model-car::after { right:32px; }

    .garage-model-camera {
        position:absolute;
        top:-26px;
        left:50%;
        transform: translateX(-50%);
        width:62px;
        height:24px;
        border-radius:8px;
        background:rgba(255,255,255,0.16);
        border:1px solid rgba(0,242,255,0.5);
    }

    .garage-spec-grid {
        display:grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .garage-spec {
        border:1px solid rgba(255,255,255,0.07);
        background: rgba(255,255,255,0.035);
        border-radius: 12px;
        padding: 9px;
        min-height: 52px;
    }

    .garage-spec-label {
        font-size: 9px;
        color: var(--text-muted);
        letter-spacing: .1em;
        margin-bottom: 5px;
    }

    .garage-spec-value {
        font-size: 12px;
        color: #fff;
        font-weight: 800;
        line-height: 1.25;
    }

    .garage-booking-note {
        font-size: 11px;
        line-height: 1.45;
        color: var(--text-soft);
        text-transform: none;
    }

    .garage-actions {
        display:grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: auto;
    }

    .garage-actions .wide { grid-column: 1 / -1; }

    .garage-actions button:disabled,
    .garage-actions .garage-book-btn:disabled {
        cursor: not-allowed;
        opacity: var(--disabled-opacity);
        filter: grayscale(0.85);
        background: rgba(120, 130, 135, 0.16) !important;
        border-color: rgba(160, 170, 175, 0.22) !important;
        color: rgba(210, 220, 225, 0.54) !important;
        box-shadow: none !important;
    }

    .garage-book-btn.disabled-label {
        background: rgba(120, 130, 135, 0.16) !important;
        border-color: rgba(160, 170, 175, 0.22) !important;
        color: rgba(210, 220, 225, 0.54) !important;
    }

    .garage-model-stage.has-embed {
        padding: 0;
        background: rgba(0,0,0,0.42);
        perspective: none;
    }

    .garage-model-stage.has-embed::after {
        content: 'SKETCHFAB / EMBED MEDIA';
        z-index: 2;
        pointer-events: none;
        text-shadow: 0 0 8px rgba(0,0,0,0.85);
    }

    .garage-model-stage.has-embed .garage-model-car {
        display: none;
    }

    .garage-embed-wrapper,
    .garage-embed-wrapper iframe {
        width: 100%;
        height: 100%;
    }

    .garage-embed-wrapper {
        position: absolute;
        inset: 0;
        border-radius: 16px;
        overflow: hidden;
        background: #020508;
    }

    .garage-embed-wrapper iframe {
        display: block;
        border: 0;
        min-height: 340px;
    }

    .garage-embed-attribution {
        position: absolute;
        left: 10px;
        right: 10px;
        top: 10px;
        z-index: 2;
        margin: 0;
        padding: 6px 8px;
        border-radius: 999px;
        background: rgba(0,0,0,0.52);
        color: rgba(235,245,248,0.78);
        font-size: 10px;
        line-height: 1.3;
        text-transform: none;
        pointer-events: auto;
    }

    .garage-embed-attribution a {
        color: var(--neon);
        font-weight: 800;
        text-decoration: none;
    }

    .garage-card-switching {
        animation: garageCardIn 0.18s ease-out both;
    }

    @keyframes garageCardIn {
        from { opacity: 0.45; transform: translateY(4px) scale(0.995); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }


    .quick-panel-toolbar {
        display: flex;
        gap: 8px;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
    }
    .notification-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-height: 360px;
        overflow-y: auto;
        padding-right: 2px;
    }
    .notification-item {
        border: 1px solid rgba(0, 242, 255, 0.14);
        background: rgba(255,255,255,0.035);
        border-radius: 12px;
        padding: 10px;
        color: #dfeff4;
        text-transform: none;
    }
    .notification-item.high,
    .notification-item.urgent {
        border-color: rgba(255, 215, 0, 0.30);
        box-shadow: 0 0 14px rgba(255, 215, 0, 0.08);
    }
    .notification-title {
        display:flex;
        justify-content:space-between;
        gap:10px;
        color: var(--neon);
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: .8px;
    }
    .notification-body {
        margin-top: 5px;
        font-size: 12px;
        line-height: 1.45;
        color: #c7d9de;
    }
    .notification-actions {
        display:flex;
        gap:8px;
        margin-top:8px;
    }
    .notification-mini-btn {
        border-radius: 999px;
        padding: 6px 10px;
        font-size: 10px;
        cursor:pointer;
    }

    .quick-panel-toolbar.compact-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    .quick-panel-toolbar.compact-actions .mini-action-btn,
    .notification-actions .notification-mini-btn {
        min-height: 26px;
        height: 26px;
        padding: 0 9px;
        font-size: 9px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }
    .notification-actions .notification-mini-btn {
        min-width: 62px;
    }
    .message-toolbar {
        display:grid;
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap:6px;
        margin-bottom:8px;
    }
    .message-toolbar .mini-action-btn {
        min-height:26px;
        height:26px;
        padding:0 9px;
        font-size:9px;
        display:inline-flex;
        align-items:center;
        justify-content:center;
    }
    .message-thread-list, .private-message-list {
        display:flex;
        flex-direction:column;
        gap:8px;
        max-height:330px;
        overflow-y:auto;
        padding-right:2px;
    }
    .message-thread-item {
        border:1px solid rgba(0,242,255,0.14);
        background:rgba(255,255,255,0.035);
        border-radius:12px;
        padding:10px;
        color:#dfeff4;
        cursor:pointer;
        text-transform:none;
    }
    .message-thread-item:hover {
        border-color:rgba(0,242,255,0.35);
        background:rgba(0,242,255,0.06);
    }
    .message-thread-top {
        display:flex;
        justify-content:space-between;
        gap:10px;
        color:var(--neon);
        font-size:12px;
        font-weight:900;
        text-transform:uppercase;
    }
    .message-thread-preview {
        margin-top:5px;
        color:#c7d9de;
        font-size:12px;
        line-height:1.4;
    }
    .message-unread-pill {
        background:#ff4444;
        color:#fff;
        border-radius:999px;
        padding:2px 6px;
        font-size:10px;
        min-width:18px;
        text-align:center;
    }
    .private-message-view {
        display:none;
        flex-direction:column;
        gap:8px;
    }
    .private-message-view.active { display:flex; }
    .private-message-bubble {
        max-width:92%;
        padding:8px 10px;
        border-radius:12px;
        background:rgba(255,255,255,0.05);
        border:1px solid rgba(255,255,255,0.08);
        color:#e7f7fb;
        font-size:12px;
        line-height:1.4;
        text-transform:none;
    }
    .private-message-bubble.mine {
        align-self:flex-end;
        border-color:rgba(0,242,255,0.26);
        background:rgba(0,242,255,0.08);
    }
    .private-message-meta {
        font-size:9px;
        opacity:.72;
        margin-bottom:3px;
        color:#a8c4cc;
        text-transform:uppercase;
    }
    .private-compose {
        display:flex;
        flex-direction:column;
        gap:7px;
        margin-top:8px;
    }
    .private-compose input,
    .private-compose textarea {
        width:100%;
        border:1px solid rgba(0,242,255,0.18);
        background:rgba(0,0,0,0.35);
        color:#fff;
        border-radius:10px;
        padding:8px;
        font-size:12px;
        resize:vertical;
    }
    .private-compose .mini-action-btn {
        min-height:28px;
        height:28px;
        font-size:10px;
        display:flex;
        align-items:center;
        justify-content:center;
    }


    .quick-panel-actions.compact-actions { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
    .quick-panel-actions.compact-actions .mini-action-btn,
    .notification-actions .mini-action-btn { min-height:26px; height:26px; padding:0 9px; font-size:10px; line-height:1; border-radius:8px; }
    .message-thread-tools { display:flex; gap:6px; flex-wrap:wrap; margin:8px 0; }
    .message-thread-tools .mini-action-btn { min-height:28px; height:28px; padding:0 10px; font-size:10px; }
    .mini-action-btn.danger-soft { border-color:rgba(255,80,100,.45); color:#ff8894; }
    .mini-action-btn.danger-soft:hover { background:rgba(255,80,100,.12); }


    /* =========================
       Header Friends quick panel
       ========================= */
    .header-friends-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-height: 360px;
        overflow-y: auto;
        padding-right: 2px;
    }

    .header-friend-row,
    .header-friend-request-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        min-height: 48px;
        padding: 9px 10px;
        border-radius: 12px;
        border: 1px solid rgba(0, 242, 255, 0.14);
        background: rgba(255, 255, 255, 0.035);
        color: #dfeff4;
        cursor: pointer;
        text-transform: none;
    }

    .header-friend-row:hover,
    .header-friend-request-row:hover {
        border-color: rgba(0, 242, 255, 0.35);
        background: rgba(0, 242, 255, 0.06);
    }

    .header-friend-avatar {
        width: 34px;
        height: 34px;
        border-radius: 11px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(0, 242, 255, 0.22);
        background: radial-gradient(circle at 30% 30%, rgba(0, 242, 255, 0.16), rgba(255,255,255,0.035));
        font-size: 17px;
        flex: 0 0 auto;
    }

    .header-friend-main {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .header-friend-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
        font-weight: 900;
        color: #f2fbff;
        text-transform: uppercase;
    }

    .header-friend-meta {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #96aeb7;
        font-size: 10px;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .header-friend-menu-host .user-action-menu {
        width: 156px;
        z-index: var(--z-dropdown-top);
    }

    .header-friend-request-actions {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .header-friend-request-actions .square-action-btn {
        width: 30px;
        min-width: 30px;
        height: 30px;
        border-radius: 9px;
    }

    .header-friends-section-label {
        margin: 4px 0 0;
        color: var(--text-muted);
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 1.2px;
    }



    /* =========================
       Social UI v3 — compact rows + menus
       ========================= */
    .community-people-filter.single-row,
    .friends-filter-row.single-row,
    .leader-filter-row.single-row {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 10px;
        flex-wrap: nowrap;
    }

    .community-people-filter.single-row .filter-chip,
    .friends-filter-row.single-row .filter-chip,
    .leader-filter-row.single-row .filter-chip {
        min-width: 0;
        width: 100%;
        padding: 0 6px;
        font-size: 10px;
        white-space: nowrap;
    }

    .social-compact-row {
        min-height: 42px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
    }

    .social-compact-main {
        min-width: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }

    .social-compact-name {
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        color: #f2fbff;
        font-size: 12px;
        font-weight: 900;
    }

    .social-compact-meta {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        color: #96aeb7;
        font-size: 10px;
        letter-spacing: .04em;
        white-space: nowrap;
    }

    .user-action-host {
        position: relative;
        justify-self: end;
    }

    .user-kebab-btn {
        width: 30px;
        min-width: 30px;
        height: 30px;
        border-radius: 9px;
        border: 1px solid rgba(0,242,255,.16);
        background: rgba(255,255,255,.04);
        color: var(--neon);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 18px;
        line-height: 1;
        padding: 0;
    }

    .user-action-menu {
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        width: 148px;
        padding: 7px;
        border-radius: 12px;
        border: 1px solid rgba(0,242,255,.2);
        background: rgba(5, 14, 20, .98);
        box-shadow: 0 16px 30px rgba(0,0,0,.45), 0 0 18px rgba(0,242,255,.08);
        display: none;
        flex-direction: column;
        gap: 5px;
        z-index: 2200;
    }

    .user-action-host.menu-open .user-action-menu { display: flex; }

    .user-menu-item {
        min-height: 28px;
        height: 28px;
        padding: 0 9px;
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,.08);
        background: rgba(255,255,255,.04);
        color: #e6f6fb;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .04em;
        cursor: pointer;
        text-align: left;
    }

    .user-menu-item:hover { border-color: rgba(0,242,255,.32); background: rgba(0,242,255,.08); }
    .user-menu-item.danger { color: #ff8996; border-color: rgba(255,80,100,.28); }
    .user-menu-item:disabled { opacity: var(--disabled-opacity); cursor: default; }

    .private-thread-header-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        margin: 4px 0 6px;
    }

    .private-thread-header-row .quick-panel-title { margin: 0; }
    .message-thread-tools { justify-content: flex-end; margin: 0; }

    .players-table-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .player-table-row {
        display: grid;
        grid-template-columns: minmax(145px, 1.7fr) 62px 94px 88px 108px 42px 54px 52px;
        align-items: center;
        gap: 8px;
        padding: 9px 10px;
        min-height: 46px;
    }

    .player-table-row.header {
        min-height: 28px;
        padding: 0 10px;
        border: none;
        background: transparent;
        box-shadow: none;
        color: #8ea8b2;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .08em;
    }

    .player-cell-name {
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        cursor: pointer;
    }

    .player-stat-cell {
        font-size: 11px;
        font-weight: 900;
        color: #d8edf2;
        white-space: nowrap;
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .player-date-cell { color: #91a8b0; font-size: 10px; text-align: right; white-space: nowrap; }

    .player-row-btn {
        min-height: 30px;
        height: 30px;
        width: 100%;
        border-radius: 9px;
        padding: 0 6px;
        font-size: 10px;
        font-weight: 900;
    }

    @media (max-width: 1100px) {
        .player-table-row {
            grid-template-columns: minmax(130px, 1fr) 48px 72px 70px 42px 42px 42px;
        }
        .player-table-row .player-date-cell,
        .player-table-row.header .date-col { display: none; }
    }



    /* =========================
       Social UI v4 — overlap fixes + message actions
       ========================= */
    .social-compact-row .user-action-host {
        width: 30px;
        min-width: 30px;
        justify-self: end;
        align-self: center;
        display: inline-flex;
        justify-content: center;
    }

    .social-compact-row .user-kebab-btn,
    .private-thread-header-row .user-kebab-btn {
        width: 30px !important;
        min-width: 30px !important;
        height: 30px !important;
        padding: 0 !important;
        align-self: center !important;
    }

    .social-compact-row .user-action-menu .user-menu-item,
    .private-thread-header-row .user-action-menu .user-menu-item,
    .message-bubble-menu .user-menu-item {
        min-width: 0 !important;
        width: 100% !important;
        align-self: stretch !important;
        padding: 0 9px !important;
    }

    .players-table-list {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .player-table-row {
        grid-template-columns: minmax(140px, 1.7fr) 54px 82px 76px 96px 50px 64px 64px;
        min-width: 710px;
    }

    .player-table-row .player-row-btn,
    .friend-card.compact.player-table-row button {
        min-width: 0 !important;
        width: 100% !important;
        padding: 0 5px !important;
        align-self: center !important;
    }

    .private-message-bubble {
        position: relative;
        padding-right: 34px;
    }

    .private-message-actions {
        position: absolute;
        top: 6px;
        right: 6px;
    }

    .message-kebab-btn {
        width: 24px;
        min-width: 24px;
        height: 24px;
        border-radius: 8px;
        border: 1px solid rgba(0,242,255,.14);
        background: rgba(255,255,255,.04);
        color: var(--neon);
        cursor: pointer;
        line-height: 1;
        padding: 0;
        font-size: 15px;
    }

    .message-bubble-menu {
        position: absolute;
        top: 28px;
        right: 0;
        width: 120px;
        padding: 7px;
        border-radius: 12px;
        border: 1px solid rgba(0,242,255,.2);
        background: rgba(5, 14, 20, .98);
        box-shadow: 0 16px 30px rgba(0,0,0,.45), 0 0 18px rgba(0,242,255,.08);
        display: none;
        flex-direction: column;
        gap: 5px;
        z-index: 2300;
    }

    .private-message-actions.menu-open .message-bubble-menu { display: flex; }

    .private-message-body.deleted {
        opacity: .62;
        font-style: italic;
    }

    .edited-mark {
        opacity: .65;
        font-size: 9px;
        margin-left: 4px;
    }


/* =========================
   Admin / Control Tower v1
   ========================= */
/* Admin-only UI is hidden by default and enabled only after server entitlements are known. */
.admin-only { display: none !important; }
.admin-only.admin-visible:not(.menu-dropdown-panel) { display: inline-flex !important; }
.menu-dropdown-panel.admin-only.admin-visible { display: none !important; }
.menu-dropdown-panel.admin-only.admin-visible.active { display: flex !important; }
.mobile-burger-panel .admin-only.admin-visible { display: flex !important; }
.admin-toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.admin-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:14px; }
.admin-card { border:1px solid rgba(0,242,255,0.14); background:rgba(255,255,255,0.03); border-radius:14px; padding:14px; }
.admin-card-title { font-size:13px; font-weight:900; color:#fff; letter-spacing:1px; margin-bottom:8px; }
.admin-meta { font-size:11px; color:#b9ccd5; text-transform:none; line-height:1.55; }
.admin-kv { display:grid; grid-template-columns: 150px 1fr; gap:6px 10px; font-size:11px; color:#dbe8ed; text-transform:none; }
.admin-kv b { color:var(--neon); }
.admin-table-wrap { width:100%; overflow:auto; }
.admin-table { width:100%; min-width:900px; border-collapse:collapse; font-size:11px; }
.admin-table th, .admin-table td { padding:9px 10px; border-bottom:1px solid rgba(255,255,255,0.07); text-align:left; vertical-align:top; text-transform:none; }
.admin-table th { color:var(--neon); text-transform:uppercase; font-size:10px; letter-spacing:1px; }
.admin-input-row { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap:10px; margin-bottom:12px; }
.admin-input-row input, .admin-input-row select, .admin-input-row textarea { width:100%; padding:10px 12px; border-radius:10px; border:1px solid rgba(0,242,255,0.14); background:rgba(0,0,0,0.32); color:white; outline:none; box-sizing:border-box; text-transform:none; }
.admin-field { display:flex; flex-direction:column; gap:5px; min-width:0; }
.admin-field-label { color:#8da2ad; font-size:9px; font-weight:900; letter-spacing:1.1px; text-transform:uppercase; }
.admin-field-help { color:#9eb5bf; font-size:10px; line-height:1.25; text-transform:none; }
.admin-icon-select { font-size:14px; font-weight:900; }
.admin-inline-toggle { display:flex; align-items:center; justify-content:center; gap:8px; min-height:42px; padding:10px 12px; border-radius:10px; border:1px solid rgba(0,242,255,0.14); background:rgba(0,0,0,0.24); color:#d9e6eb; font-size:11px; font-weight:900; letter-spacing:0.8px; }
.admin-inline-toggle input { width:auto; min-width:auto; margin:0; accent-color: var(--neon); }
.admin-input-row textarea { min-height:42px; resize:vertical; }
.admin-publication-uploader {
    display:grid;
    grid-template-columns: minmax(220px, 0.9fr) auto minmax(220px, 1fr);
    gap:10px;
    align-items:center;
    margin-bottom:12px;
}
.admin-file-input {
    width:100%;
    min-height:40px;
    padding:8px 10px;
    border-radius:10px;
    border:1px solid rgba(0,242,255,0.14);
    background:rgba(0,0,0,0.32);
    color:#d9e9ef;
    box-sizing:border-box;
    text-transform:none;
}
.admin-file-input::file-selector-button {
    margin-right:10px;
    border:1px solid rgba(0,242,255,0.26);
    border-radius:8px;
    background:rgba(0,242,255,0.10);
    color:#f3fbff;
    font-weight:900;
    cursor:pointer;
    padding:7px 10px;
    text-transform:uppercase;
}
.admin-media-preview {
    min-height:48px;
    border-radius:12px;
    border:1px dashed rgba(0,242,255,0.18);
    background:rgba(255,255,255,0.025);
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px;
    color:#9fb6bf;
    font-size:11px;
    text-transform:none;
    overflow:hidden;
}
.admin-media-preview img,
.admin-media-cell img {
    width:64px;
    height:42px;
    object-fit:cover;
    border-radius:9px;
    border:1px solid rgba(0,242,255,0.16);
    background:#020608;
    flex:0 0 auto;
}
.admin-media-preview span,
.admin-media-cell span {
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.admin-media-cell {
    display:flex;
    align-items:center;
    gap:8px;
    max-width:260px;
}
.admin-danger { border-color:rgba(255,68,68,0.45) !important; color:#ffd6d6 !important; }
.admin-status-pill { display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; border:1px solid rgba(0,242,255,0.16); background:rgba(0,242,255,0.06); color:#eafcff; font-size:10px; font-weight:900; letter-spacing:.8px; }
.admin-status-pill.warn { border-color:rgba(255,215,0,.28); background:rgba(255,215,0,.08); color:#ffe7a1; }
.admin-status-pill.danger { border-color:rgba(255,68,68,.34); background:rgba(255,68,68,.08); color:#ffd6d6; }
.admin-help-box { border:1px solid rgba(0,242,255,0.12); background:rgba(0,242,255,0.045); border-radius:12px; padding:12px 14px; color:#cfe3eb; font-size:12px; line-height:1.55; text-transform:none; margin-bottom:12px; }
.admin-help-box b { color:var(--neon); text-transform:uppercase; }
.admin-mini-note { color:#9fb6bf; font-size:11px; line-height:1.45; text-transform:none; margin-top:6px; }
.admin-card-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.admin-card-actions .mini-action-btn { width:auto; min-width:118px; text-align:center; }
.admin-table button.mini-action-btn { width:auto; min-width:86px; padding:7px 9px; min-height:28px; }
.admin-table tr.is-revoked td { opacity:.62; }
.admin-table tr.is-active-mod td { background:rgba(255,215,0,0.035); }
.admin-action-running { opacity:.58; pointer-events:none; filter:saturate(.7); }
.admin-json-area { min-height: 120px !important; font-family: Consolas, monospace; font-size: 11px; }
.admin-warning-line { color:#ffd27a; font-size:10px; margin-top:4px; text-transform:none; line-height:1.35; }
.admin-mission-preview { border:1px solid rgba(255,215,0,.24); background:rgba(255,215,0,.055); border-radius:12px; padding:12px; margin-top:12px; color:#dbe8ed; font-size:12px; text-transform:none; }
.admin-mission-status-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

.gallery-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:14px; }
.gallery-card { position:relative; min-height:220px; border-radius:16px; border:1px solid rgba(0,242,255,0.14); overflow:visible; background:rgba(255,255,255,0.035); cursor:pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.gallery-card:hover { transform:translateY(-2px); border-color:rgba(0,242,255,0.34); background:rgba(0,242,255,0.055); }
.gallery-card-media { height:142px; background: radial-gradient(circle at top right, rgba(0,242,255,0.16), transparent 36%), linear-gradient(135deg, rgba(255,255,255,0.04), rgba(0,0,0,0.35)); display:flex; align-items:center; justify-content:center; color:#eafcff; font-weight:900; letter-spacing:1px; text-align:center; padding:12px; overflow:hidden; border-radius:16px 16px 0 0; }
.gallery-card-media img, .gallery-card-media video { width:100%; height:100%; object-fit:cover; display:block; }
.gallery-video-thumb { position:relative; width:100%; height:100%; display:block; }
.gallery-video-badge { position:absolute; left:10px; bottom:10px; padding:6px 10px; border-radius:999px; background:rgba(0,0,0,.68); border:1px solid rgba(0,242,255,.24); color:#eafcff; font-size:10px; font-weight:950; letter-spacing:1px; box-shadow:0 0 12px rgba(0,242,255,.16); }
.gallery-media-badges { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.gallery-media-badges .stat-chip { font-size:10px; padding:5px 8px; }
.gallery-card-body { padding:14px; }
.gallery-card-title { color:#fff; font-weight:900; font-size:13px; margin-bottom:6px; }
.gallery-card-meta { color:#91aab5; font-size:11px; margin-bottom:8px; }
.gallery-card-copy { color:#cfe0e7; font-size:12px; line-height:1.45; text-transform:none; }
.gallery-empty { min-height:220px; border:1px dashed var(--empty-border); border-radius:var(--section-radius); display:flex; align-items:center; justify-content:center; text-align:center; padding:24px; color:var(--empty-text); background:var(--empty-bg); text-transform:none; }

.gallery-album { border:1px solid rgba(0,242,255,0.14); border-radius:18px; background:rgba(255,255,255,0.025); overflow:visible; margin-bottom:14px; }
.gallery-album summary { cursor:pointer; list-style:none; padding:16px 18px; display:flex; justify-content:space-between; gap:12px; align-items:center; border-bottom:1px solid rgba(255,255,255,0.06); }
.gallery-album summary::-webkit-details-marker { display:none; }
.gallery-album-title { color:#fff; font-weight:950; letter-spacing:1px; }
.gallery-album-copy { margin-top:5px; color:#a8bbc3; font-size:12px; line-height:1.45; text-transform:none; }
.gallery-album-badges { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.gallery-album-body { padding:14px; overflow:visible; }
.gallery-card-actions { position:relative; z-index:80; display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; overflow:visible; padding-bottom:2px; align-items:center; }
.gallery-card-actions .mini-action-btn { width:auto; min-width:64px; min-height:28px; padding:7px 9px; font-size:10px; }
.gallery-more-menu { position:relative; margin-left:auto; flex:0 0 auto; overflow:visible; z-index:40; }
.gallery-more-menu summary { list-style:none; width:30px; min-width:30px; height:28px; min-height:28px; padding:0 !important; margin:0 !important; border-bottom:0 !important; border-radius:9px; display:flex; align-items:center; justify-content:center; cursor:pointer; border:1px solid rgba(0,242,255,0.16); background:rgba(255,255,255,0.04); color:#e8f7fb; font-weight:900; letter-spacing:1px; line-height:1; }
.gallery-more-menu summary::-webkit-details-marker { display:none; }
.gallery-more-menu[open] summary { border-color:rgba(0,242,255,0.42); background:rgba(0,242,255,0.10); }
.gallery-more-menu[open] { z-index:3200; }
.gallery-more-dropdown { position:absolute; right:0; bottom:calc(100% + 8px); z-index:3200; min-width:184px; display:flex; flex-direction:column; gap:7px; padding:9px; border-radius:12px; border:1px solid rgba(0,242,255,0.34); background:#071017; box-shadow:0 18px 42px rgba(0,0,0,0.62), 0 0 18px rgba(0,242,255,0.12); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); pointer-events:auto; }
.gallery-more-dropdown .mini-action-btn { width:100%; min-width:0; justify-content:flex-start; text-align:left; color:#eafcff !important; background:rgba(255,255,255,0.045); border:1px solid rgba(0,242,255,0.18); display:flex; align-items:center; }
.gallery-more-dropdown .danger { border-color:rgba(255,75,75,0.42); color:#ffb4b4; }
.gallery-more-dropdown .danger:hover { background:rgba(255,75,75,0.14); color:#fff; }
.gallery-lightbox { position:fixed; inset:0; z-index:var(--z-modal-high); display:none; align-items:center; justify-content:center; background:rgba(1,6,10,0.76); backdrop-filter:blur(10px); padding:22px; }
.gallery-lightbox.active { display:flex; }
.gallery-lightbox-card { position:relative; width:min(980px, calc(100vw - 28px)); max-height:calc(100dvh - 44px); overflow:auto; border-radius:22px; border:1px solid rgba(0,242,255,0.22); background:linear-gradient(180deg, rgba(8,16,22,.96), rgba(5,10,15,.94)); box-shadow:0 26px 70px rgba(0,0,0,.58), 0 0 24px rgba(0,242,255,.12); padding:18px; }
.gallery-lightbox-media { min-height:360px; border-radius:16px; overflow:hidden; display:flex; align-items:center; justify-content:center; background:#02080c; border:1px solid rgba(0,242,255,0.14); }
.gallery-lightbox-media img, .gallery-lightbox-media video { width:100%; max-height:70dvh; object-fit:contain; display:block; }
.gallery-lightbox-title { margin-top:14px; color:#fff; font-weight:950; font-size:18px; }
.gallery-lightbox-copy { margin-top:6px; color:#cfe0e7; font-size:13px; line-height:1.45; text-transform:none; }
.gallery-lightbox-actions { margin-top:14px; display:flex; gap:10px; flex-wrap:nowrap; align-items:center; overflow:visible; padding-bottom:2px; }
.gallery-lightbox-actions .mini-action-btn { width:auto; min-width:106px; flex:0 0 auto; }
.gallery-more-menu .gallery-more-dropdown { visibility:visible; opacity:1; }
.gallery-card .gallery-more-dropdown { bottom:auto; top:calc(100% + 8px); right:0; }
.gallery-card:has(.gallery-more-menu[open]),
.gallery-card:has(.gallery-more-menu[open]) .gallery-card-body,
.gallery-card:has(.gallery-more-menu[open]) .gallery-card-actions,
.gallery-album:has(.gallery-more-menu[open]),
.gallery-album-body:has(.gallery-more-menu[open]) { overflow:visible; z-index:3500; }
.gallery-more-dropdown button { opacity:1; visibility:visible; white-space:nowrap; }
.gallery-lightbox-actions .gallery-more-menu { margin-left:auto; }

/* Stage 5 — gallery social layer: like/comment counts, comments modal */
.gallery-like-btn.is-liked { border-color:rgba(255,77,148,0.55); color:#ff7ab0; background:rgba(255,77,148,0.12); }
.gallery-like-count, .gallery-comment-count { font-variant-numeric:tabular-nums; }
.community-showcase-card-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; align-items:center; }
.community-showcase-card-actions .mini-action-btn { width:auto; min-width:58px; min-height:28px; padding:7px 9px; font-size:10px; }
.gallery-comments-modal { position:fixed; inset:0; z-index:calc(var(--z-modal-high) + 2); display:none; align-items:center; justify-content:center; background:rgba(1,6,10,0.78); backdrop-filter:blur(10px); padding:22px; }
.gallery-comments-modal.active { display:flex; }
.gallery-comments-card { width:min(560px, calc(100vw - 28px)); max-height:calc(100dvh - 44px); display:flex; flex-direction:column; border-radius:20px; border:1px solid rgba(0,242,255,0.22); background:linear-gradient(180deg, rgba(8,16,22,.97), rgba(5,10,15,.95)); box-shadow:0 26px 70px rgba(0,0,0,.58); padding:16px; }
.gallery-comments-head { display:flex; align-items:center; justify-content:space-between; font-weight:950; letter-spacing:1px; color:#fff; margin-bottom:10px; }
.gallery-comments-list { flex:1 1 auto; overflow:auto; display:flex; flex-direction:column; gap:10px; min-height:120px; }
.gallery-comments-empty { color:#9fb3bd; font-size:13px; padding:14px 4px; text-align:center; }
.gallery-comment-item { border:1px solid rgba(0,242,255,0.12); border-radius:12px; padding:9px 11px; background:rgba(255,255,255,0.03); }
.gallery-comment-meta { font-size:11px; color:#bcd; display:flex; gap:7px; align-items:center; flex-wrap:wrap; }
.gallery-comment-when { color:#7f96a1; }
.gallery-comment-status { color:#ffb34d; font-weight:800; }
.gallery-comment-reports { color:#ff6b6b; font-weight:800; }
.gallery-comment-body { margin-top:5px; color:#e7f1f5; font-size:13px; line-height:1.4; white-space:pre-wrap; word-break:break-word; text-transform:none; }
.gallery-comment-actions { margin-top:8px; display:flex; gap:7px; flex-wrap:wrap; }
.gallery-comment-actions .mini-action-btn { width:auto; min-width:56px; min-height:26px; padding:6px 8px; font-size:10px; }
.gallery-comments-compose { margin-top:12px; display:flex; gap:8px; align-items:flex-end; }
.gallery-comments-compose textarea { flex:1 1 auto; resize:vertical; border-radius:12px; border:1px solid rgba(0,242,255,0.18); background:rgba(2,8,12,0.6); color:#eaf6fb; padding:9px 11px; font-size:13px; font-family:inherit; text-transform:none; }
.gallery-comments-compose .mini-action-btn { width:auto; min-width:74px; flex:0 0 auto; }
.gallery-comments-note { margin-top:8px; color:#7f96a1; font-size:11px; line-height:1.4; text-transform:none; }

/* Stage 5 feedback — toolbar (sort/filter/select), view chip, branded modals */
.gallery-toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin:10px 0 4px; }
.gallery-sort-pills, .gallery-filter-tabs { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.gallery-sort-label { font-size:10px; letter-spacing:1.5px; color:#7f96a1; align-self:center; margin-right:2px; }
.gallery-sort-pills .mini-action-btn, .gallery-filter-tabs .mini-action-btn { width:auto; min-width:62px; min-height:28px; padding:7px 10px; font-size:10px; }
.gallery-sort-pills .mini-action-btn.active, .gallery-filter-tabs .mini-action-btn.active { border-color:rgba(0,242,255,0.55); background:rgba(0,242,255,0.14); color:#cdfaff; }
.gallery-select-tools { display:flex; gap:8px; flex-wrap:wrap; margin-left:auto; }
.gallery-select-tools .mini-action-btn { width:auto; min-width:70px; min-height:28px; padding:7px 10px; font-size:10px; }
.gallery-view-chip { display:inline-flex; align-items:center; gap:3px; font-size:11px; color:#9fb3bd; padding:0 4px; align-self:center; font-variant-numeric:tabular-nums; }
.gallery-card { position:relative; }
.gallery-card.selected { outline:2px solid var(--neon-pink, #ff4d94); outline-offset:-2px; }
.gallery-select-box { position:absolute; top:8px; left:8px; z-index:90; width:30px; height:30px; border-radius:9px; border:1px solid rgba(0,242,255,0.4); background:rgba(2,8,12,0.82); color:#eaf6fb; font-size:16px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.gallery-select-box.checked { border-color:var(--neon-pink,#ff4d94); color:#ff7ab0; background:rgba(255,77,148,0.16); }
.gallery-select-hint { font-size:11px; color:#9fb3bd; align-self:center; }
/* SELECT/DONE sit inline in the album header, right after the ITEMS/PRIVATE badges. */
.gallery-album-badges { align-items:center; }
.gallery-album-badges .mini-action-btn { width:auto; min-width:auto; min-height:28px; padding:6px 12px; font-size:10px; text-align:center; }
.gallery-card-selectbar { display:flex; gap:8px; margin-bottom:8px; }
.gallery-card-selectbar .mini-action-btn { width:auto; min-width:84px; min-height:30px; padding:7px 10px; font-size:11px; }

/* Branded confirm modal */
.app-confirm-modal { position:fixed; inset:0; z-index:calc(var(--z-modal-high) + 6); display:none; align-items:center; justify-content:center; background:rgba(1,6,10,0.78); backdrop-filter:blur(10px); padding:22px; }
.app-confirm-modal.active { display:flex; }
.app-confirm-card { width:min(440px, calc(100vw - 28px)); border-radius:18px; border:1px solid rgba(0,242,255,0.24); background:linear-gradient(180deg, rgba(8,16,22,.98), rgba(5,10,15,.96)); box-shadow:0 26px 70px rgba(0,0,0,.6); padding:20px; }
.app-confirm-title { font-weight:950; letter-spacing:1px; color:#fff; font-size:16px; }
.app-confirm-body { margin-top:10px; color:#cfe0e7; font-size:13px; line-height:1.5; text-transform:none; }
.app-confirm-actions { margin-top:18px; display:flex; gap:10px; justify-content:flex-end; }
.app-confirm-actions .mini-action-btn { width:auto; min-width:96px; min-height:32px; }

/* Branded share modal */
.gallery-share-modal { position:fixed; inset:0; z-index:calc(var(--z-modal-high) + 4); display:none; align-items:center; justify-content:center; background:rgba(1,6,10,0.8); backdrop-filter:blur(10px); padding:22px; }
.gallery-share-modal.active { display:flex; }
.gallery-share-card { width:min(460px, calc(100vw - 28px)); border-radius:20px; border:1px solid rgba(0,242,255,0.24); background:linear-gradient(180deg, rgba(8,16,22,.98), rgba(5,10,15,.96)); box-shadow:0 26px 70px rgba(0,0,0,.6); padding:18px; }
.gallery-share-head { display:flex; align-items:center; justify-content:space-between; font-weight:950; letter-spacing:1.5px; color:#fff; margin-bottom:12px; }
.gallery-share-linkrow { display:flex; gap:8px; margin-bottom:14px; }
.gallery-share-link { flex:1 1 auto; border-radius:10px; border:1px solid rgba(0,242,255,0.18); background:rgba(2,8,12,0.6); color:#eaf6fb; padding:9px 11px; font-size:12px; text-transform:none; }
.gallery-share-linkrow .mini-action-btn { width:auto; min-width:64px; flex:0 0 auto; }
.gallery-share-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; }
.gallery-share-target { display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 6px; border-radius:12px; border:1px solid rgba(0,242,255,0.14); background:rgba(255,255,255,0.03); color:#dbe9ef; text-decoration:none; transition:border-color .15s, background .15s; }
.gallery-share-target:hover { border-color:rgba(0,242,255,0.45); background:rgba(0,242,255,0.08); }
.gallery-share-icon { width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:900; font-size:16px; color:#fff; background:#1b2733; }
.gallery-share-icon-twitter { background:#000; } .gallery-share-icon-facebook { background:#1877f2; } .gallery-share-icon-whatsapp { background:#25d366; }
.gallery-share-icon-telegram { background:#27a7e7; } .gallery-share-icon-reddit { background:#ff4500; }
.gallery-share-icon-tiktok { background:#000; } .gallery-share-icon-youtube { background:#ff0000; }
.gallery-share-icon-email { background:#5b6b7a; }
.gallery-share-target { cursor:pointer; font-family:inherit; }
button.gallery-share-target { border:1px solid rgba(0,242,255,0.14); }
.gallery-share-name { font-size:10px; letter-spacing:.5px; text-align:center; }
.gallery-share-native { width:100%; margin-top:14px; }
@media (max-width:520px){ .gallery-share-grid { grid-template-columns:repeat(3,1fr); } }

/* Watch live-feed watermark overlay (bottom-right, non-interactive) */
.live-video-frame { position:relative; }
.watch-watermark-logo { position:absolute; right:14px; bottom:14px; width:clamp(72px, 16%, 168px); height:auto; opacity:0.85; pointer-events:none; z-index:6; filter:drop-shadow(0 2px 6px rgba(0,0,0,0.55)); user-select:none; }
.gallery-lightbox-video-wrap { position:relative; display:flex; width:100%; }
.gallery-lightbox-video-wrap video { width:100%; max-height:70dvh; }
/* Higher specificity than ".gallery-lightbox-media img" (which forces width:100%)
   so the overlay logo stays a small bottom-right mark, not a full-screen image. */
.gallery-lightbox-video-wrap .watch-watermark-logo { width:clamp(80px, 18%, 200px); height:auto; max-height:none; right:16px; bottom:16px; z-index:8; object-fit:contain; }
.gallery-video-fs-btn { position:absolute; top:10px; left:10px; z-index:9; width:34px; height:34px; min-height:34px; padding:0; border-radius:8px; border:1px solid rgba(0,242,255,0.35); background:rgba(2,8,12,0.72); color:#eaf6fb; cursor:pointer; font-size:16px; line-height:1; display:flex; align-items:center; justify-content:center; }
.gallery-video-fs-btn:hover { border-color:rgba(0,242,255,0.6); background:rgba(0,242,255,0.12); }
/* Custom fullscreen on the WRAP keeps the watermark visible (native video FS hides siblings). */
.gallery-lightbox-video-wrap:fullscreen, .gallery-lightbox-video-wrap:-webkit-full-screen { width:100vw; height:100vh; align-items:center; justify-content:center; background:#000; }
.gallery-lightbox-video-wrap:fullscreen video, .gallery-lightbox-video-wrap:-webkit-full-screen video { width:100%; height:100%; max-height:100vh; object-fit:contain; }
.gallery-lightbox-video-wrap:fullscreen .watch-watermark-logo, .gallery-lightbox-video-wrap:-webkit-full-screen .watch-watermark-logo { right:26px; bottom:64px; width:clamp(96px, 15%, 240px); }

.content-feed-shell { display:flex; flex-direction:column; gap:16px; }
.content-feed-hero { position:relative; min-height:270px; border-radius:18px; overflow:hidden; border:1px solid rgba(0,242,255,0.18); background:radial-gradient(circle at top right, rgba(0,242,255,.18), transparent 36%), linear-gradient(135deg, rgba(255,255,255,.045), rgba(0,0,0,.42)); }
.content-feed-hero img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.88; }
.content-feed-hero-overlay { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:flex-end; padding:24px; background:linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.70)); }
.content-feed-kicker { font-size:11px; letter-spacing:2px; color:var(--neon); font-weight:900; margin-bottom:8px; }
.content-feed-title { font-size:clamp(24px, 3.4vw, 44px); line-height:1; color:#fff; font-weight:950; max-width:78%; text-shadow:0 0 18px rgba(0,0,0,.48); }
.content-feed-copy { margin-top:10px; max-width:72%; color:#d7e7ed; line-height:1.45; font-size:13px; text-transform:none; }
.content-feed-list { display:flex; flex-direction:column; gap:12px; }
.content-feed-item { border:1px solid rgba(0,242,255,.14); border-radius:16px; background:rgba(255,255,255,.026); overflow:hidden; }
.content-feed-item summary { cursor:pointer; list-style:none; padding:15px 17px; display:flex; justify-content:space-between; gap:12px; align-items:center; }
.content-feed-item summary::-webkit-details-marker { display:none; }
.content-feed-item-title { color:#fff; font-weight:950; letter-spacing:.7px; }
.content-feed-item-meta { margin-top:5px; color:#98adb7; font-size:11px; text-transform:none; }
.content-feed-item-body { display:grid; grid-template-columns:minmax(180px, 280px) 1fr; gap:14px; padding:0 17px 17px; border-top:1px solid rgba(255,255,255,.06); }
.content-feed-item-media { min-height:150px; border-radius:14px; border:1px solid rgba(0,242,255,.14); overflow:hidden; background:radial-gradient(circle at top right, rgba(0,242,255,.16), transparent 36%), rgba(0,0,0,.28); display:flex; align-items:center; justify-content:center; color:#eafcff; font-weight:900; text-align:center; padding:14px; }
.content-feed-item-media img { width:100%; height:100%; object-fit:cover; display:block; }
.content-feed-item-text { color:#cfe0e7; font-size:13px; line-height:1.5; text-transform:none; }
.content-feed-actions { margin-top:12px; display:flex; gap:8px; flex-wrap:wrap; }



/* Patch 4.7 — Community Showcase */
.community-showcase-hero {
    display:grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap:16px;
    align-items:stretch;
    margin-bottom:16px;
}
.community-showcase-intro {
    min-height:156px;
    border-radius:18px;
    border:1px solid rgba(0,242,255,0.16);
    background:
        radial-gradient(circle at top right, rgba(0,242,255,0.15), transparent 36%),
        linear-gradient(180deg, rgba(255,255,255,0.045), rgba(0,0,0,0.22));
    padding:18px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}
.community-showcase-title {
    color:#fff;
    font-weight:950;
    font-size:22px;
    letter-spacing:1.2px;
    margin-bottom:8px;
}
.community-showcase-copy {
    color:#cfe0e7;
    font-size:13px;
    line-height:1.5;
    text-transform:none;
    max-width:760px;
}
.community-showcase-note {
    min-height:156px;
    border-radius:18px;
    border:1px dashed rgba(255,215,0,0.24);
    background:linear-gradient(180deg, rgba(255,215,0,0.08), rgba(0,242,255,0.035));
    padding:18px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:10px;
}
.community-showcase-grid {
    display:grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap:14px;
}
.community-showcase-card {
    position:relative;
    min-height:236px;
    border-radius:18px;
    border:1px solid rgba(0,242,255,0.14);
    background:rgba(255,255,255,0.035);
    overflow:hidden;
    cursor:pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.community-showcase-card:hover {
    transform:translateY(-2px);
    border-color:rgba(0,242,255,0.34);
    background:rgba(0,242,255,0.055);
}
.community-showcase-media {
    height:150px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#eafcff;
    font-size:28px;
    font-weight:950;
    letter-spacing:1px;
    text-align:center;
    background:
        radial-gradient(circle at top right, rgba(0,242,255,0.18), transparent 36%),
        linear-gradient(135deg, rgba(255,255,255,0.04), rgba(0,0,0,0.35));
}
.community-showcase-media img,
.community-showcase-media video {
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
.community-showcase-card-body {
    padding:14px;
}
.community-showcase-card-title {
    color:#fff;
    font-weight:950;
    font-size:13px;
    margin-bottom:6px;
}
.community-showcase-card-meta {
    color:#91aab5;
    font-size:11px;
    margin-bottom:8px;
}
.community-showcase-card-copy {
    color:#cfe0e7;
    font-size:12px;
    line-height:1.42;
    text-transform:none;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}
.community-showcase-toolbar {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin:0 0 14px;
}
.community-showcase-empty {
    min-height:260px;
    border:1px dashed var(--empty-border);
    border-radius:var(--section-radius);
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:24px;
    color:var(--empty-text);
    background:var(--empty-bg);
    text-transform:none;
}
.community-showcase-card .gallery-video-badge {
    left:12px;
    bottom:12px;
}

@media (max-width: 1180px) {
    .community-showcase-hero { grid-template-columns: 1fr; }
    .community-showcase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .community-showcase-grid { grid-template-columns: 1fr; }
}

/* Patch 4.4 — Community News compact stream */
.community-news-stream {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.community-news-row {
    border: 1px solid rgba(0,242,255,.14);
    border-radius: 16px;
    background: rgba(255,255,255,.026);
    overflow: hidden;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.community-news-row:hover {
    border-color: rgba(0,242,255,.30);
    background: rgba(0,242,255,.045);
    transform: translateY(-1px);
}

.community-news-row summary {
    cursor: pointer;
    list-style: none;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
}

.community-news-row summary::-webkit-details-marker {
    display: none;
}

.community-news-thumb {
    width: 92px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,242,255,.16);
    background:
        radial-gradient(circle at top right, rgba(0,242,255,.18), transparent 36%),
        rgba(0,0,0,.34);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eafcff;
    font-size: 22px;
    font-weight: 900;
    flex: 0 0 auto;
}

.community-news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.community-news-row-main {
    min-width: 0;
}

.community-news-row-title {
    color: #fff;
    font-size: 14px;
    font-weight: 950;
    letter-spacing: .7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-news-row-excerpt {
    margin-top: 5px;
    color: #cfe0e7;
    font-size: 12px;
    line-height: 1.35;
    text-transform: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.community-news-row-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 96px;
}

.community-news-date {
    color: #98adb7;
    font-size: 11px;
    text-transform: none;
    white-space: nowrap;
}

.community-news-expanded {
    padding: 16px 18px 18px;
    border-top: 1px solid rgba(255,255,255,.06);
    color: #d4e4eb;
    font-size: 13px;
    line-height: 1.58;
    text-transform: none;
}

.community-news-expanded-head {
    margin-bottom: 12px;
}

.community-news-expanded-title {
    color: #fff;
    font-size: 20px;
    line-height: 1.15;
    font-weight: 950;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.community-news-expanded-meta {
    margin-top: 5px;
    color: #98adb7;
    font-size: 11px;
    text-transform: none;
}

.community-news-expanded-media {
    float: right;
    width: min(38%, 260px);
    min-width: 180px;
    height: 160px;
    margin: 0 0 12px 18px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0,242,255,.16);
    background:
        radial-gradient(circle at top right, rgba(0,242,255,.16), transparent 36%),
        rgba(0,0,0,.28);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eafcff;
    font-weight: 900;
    text-align: center;
    padding: 14px;
}

.community-news-expanded-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.community-news-expanded-copy {
    white-space: pre-line;
}

.community-news-expanded::after {
    content: '';
    display: block;
    clear: both;
}
.admin-user-actions-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin-top:12px; }
.admin-user-actions-grid .mini-action-btn { width:100%; min-height:36px; }
.admin-moderation-actions-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin-top:12px; }
.admin-moderation-actions-grid .mini-action-btn { width:100%; min-height:36px; }
.admin-governor-row { margin-top:8px; padding:9px 11px; border-radius:12px; border:1px solid rgba(255,215,0,.25); background:rgba(255,215,0,.06); display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; }
.admin-governor-row b { color:#ffe7a1; letter-spacing:1px; }
.admin-governor-row small { display:block; color:#c8d8de; text-transform:none; margin-top:2px; }
.admin-governor-value { font-size:18px; font-weight:950; color:#ffd86b; }
.admin-governor-breakdown { margin-top:8px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.admin-governor-chip { padding:8px 10px; border-radius:10px; border:1px solid rgba(0,242,255,.14); background:rgba(255,255,255,.035); font-size:10px; color:#cfe1e8; text-transform:none; }
.admin-governor-chip b { display:block; color:#fff; font-size:11px; letter-spacing:.8px; text-transform:uppercase; margin-bottom:2px; }
.admin-power-mode-grid .active { background:rgba(0,242,255,.20); border-color:rgba(0,242,255,.50); color:#fff; box-shadow:0 0 14px rgba(0,242,255,.16); }
.admin-car-tune-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:10px; }
.admin-tune-field { display:flex; flex-direction:column; gap:4px; }
.admin-tune-field label { font-size:9px; color:#91afba; letter-spacing:.7px; font-weight:900; }
.admin-tune-field input { width:100%; }
.admin-tune-field .hint { color:#7f98a3; font-size:9px; text-transform:none; line-height:1.25; }
.admin-tune-field.wide { grid-column:1 / -1; }
.hud-governor-chip { margin-top:8px; display:flex; flex-direction:column; gap:3px; align-self:flex-end; max-width:190px; padding:8px 10px; border-radius:12px; border:1px solid rgba(255,215,0,.30); background:rgba(255,215,0,.08); color:#ffe7a1; font-size:10px; font-weight:900; letter-spacing:.7px; text-align:right; }
.hud-governor-chip .reason { color:#d7e5ec; font-size:9px; font-weight:700; text-transform:none; }
.license-badge-inline { display:inline-flex; align-items:center; gap:6px; padding:5px 8px; border-radius:999px; border:1px solid rgba(0,242,255,.22); background:rgba(0,242,255,.08); color:#f5fdff; font-size:11px; font-weight:900; letter-spacing:.6px; }

.admin-power-mode-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:8px; margin-top:10px; }
.admin-power-mode-grid .mini-action-btn { width:100%; min-width:0; }
.admin-car-tune-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin-top:10px; }
.admin-car-tune-grid input { min-width:0; width:100%; padding:8px 9px; border-radius:9px; border:1px solid rgba(0,242,255,.14); background:rgba(0,0,0,.28); color:#fff; text-transform:none; }
.admin-car-tune-grid .wide { grid-column:1 / -1; }
.admin-driver-limit-row { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin-top:10px; }
.admin-driver-limit-row input { min-width:0; width:100%; padding:8px 9px; border-radius:9px; border:1px solid rgba(255,215,0,.18); background:rgba(0,0,0,.28); color:#fff; text-transform:none; }
.admin-voltage-row { margin-top:8px; padding:9px 11px; border-radius:12px; border:1px solid rgba(0,242,255,.22); background:rgba(0,242,255,.07); display:flex; justify-content:space-between; align-items:center; gap:10px; }
.admin-voltage-row b { color:#f4fbff; letter-spacing:1px; }
.admin-voltage-value { color:var(--neon); font-size:18px; font-weight:950; text-shadow:0 0 10px rgba(0,242,255,.28); }

@media (max-width: 1180px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .content-feed-item-body { grid-template-columns:1fr; } .community-news-expanded-media { width: min(44%, 240px); } }
@media (max-width: 720px) { .community-news-row summary { grid-template-columns: 76px minmax(0, 1fr); } .community-news-thumb { width:76px; height:56px; } .community-news-row-meta { grid-column: 2; align-items:flex-start; flex-direction:row; flex-wrap:wrap; min-width:0; } .community-news-row-title { white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; } .community-news-expanded-media { float:none; width:100%; height:180px; margin:0 0 14px 0; } .public-profile-hero { align-items:flex-start; } .public-profile-left-rail { flex-basis:132px; } .public-profile-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.user-settings-action-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.user-settings-action-row .mini-action-btn {
    width: auto;
    min-width: 150px;
    margin: 0;
}

.user-settings-diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

/* 3 columns get cramped on tablet/landscape widths; step down to 2 before the
   860px rule below collapses to 1. */
@media (max-width: 1180px) {
    .user-settings-diagnostic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.user-settings-diagnostic-item {
    border: 1px solid rgba(0,242,255,0.12);
    border-radius: 13px;
    background: rgba(0,0,0,0.18);
    padding: 10px 12px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.user-settings-diagnostic-item span {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .8px;
}

.user-settings-diagnostic-item strong {
    color: var(--text-main);
    font-size: 12px;
    letter-spacing: .6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-settings-note-box {
    border-left: 3px solid var(--neon);
    border-radius: 12px;
    background: rgba(0,242,255,0.055);
    color: var(--text-soft);
    padding: 12px 14px;
    margin-bottom: 14px;
    line-height: 1.45;
    text-transform: none;
    font-size: 12px;
}

@media (max-width: 860px) { .admin-user-actions-grid, .admin-moderation-actions-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); } .content-feed-title, .content-feed-copy { max-width:100%; } }
@media (max-width: 720px) { .gallery-grid { grid-template-columns: 1fr; } }

@media (max-width: 1180px) { .admin-grid, .admin-input-row, .admin-publication-uploader { grid-template-columns:1fr; } .admin-table { min-width:720px; } }



/* =========================
   PATCH v3.5.1 — HUD layout polish
   frontend-only visual cleanup
   ========================= */
#hud-view .top-left,
#hud-view .top-right,
#hud-view .mid-right,
.hud-v35-glass {
    background: linear-gradient(180deg, rgba(3, 10, 15, 0.36), rgba(3, 10, 15, 0.21)) !important;
    border-color: rgba(0, 242, 255, 0.11) !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.18), 0 0 14px rgba(0,242,255,0.045) !important;
    backdrop-filter: blur(9px) !important;
    -webkit-backdrop-filter: blur(9px) !important;
}

.hud-top-instruments {
    top: 16px !important;
    width: min(430px, calc(100vw - 520px)) !important;
    background: rgba(3, 10, 15, 0.22) !important;
    border-color: rgba(0, 242, 255, 0.10) !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.16), 0 0 14px rgba(0,242,255,0.04) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.hud-xp-panel {
    top: 128px !important;
    width: min(350px, calc(100vw - 60px)) !important;
    padding: 7px 10px !important;
    background: rgba(3, 10, 15, 0.20) !important;
    border-color: rgba(0, 242, 255, 0.12) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,0.15), 0 0 12px rgba(0,242,255,0.035) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.hud-pilot-name {
    position: absolute;
    top: 166px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 24;
    min-width: 180px;
    max-width: min(420px, calc(100vw - 70px));
    padding: 0 12px;
    color: rgba(235, 251, 255, 0.92);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 1.8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    text-shadow: 0 0 8px rgba(0,242,255,0.18), 0 0 12px rgba(0,0,0,0.70);
}

.bot-left,
.bot-right {
    bottom: 28px !important;
    width: 230px !important;
    padding: 12px 16px !important;
    border: 1px solid rgba(0, 242, 255, 0.12) !important;
    border-radius: 17px !important;
    background: rgba(3, 10, 15, 0.22) !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.16), 0 0 14px rgba(0,242,255,0.045) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.bot-left { left: 30px !important; }
.bot-right { right: 30px !important; }

.bot-left .label,
.bot-right .label {
    margin-bottom: 8px !important;
    font-size: 12px !important;
    letter-spacing: 1.15px !important;
}

.control-bar-bg,
.steer-bar-wrapper {
    height: 8px !important;
    margin-top: 8px !important;
    background: rgba(0, 0, 0, 0.24) !important;
    border-color: rgba(0, 242, 255, 0.88) !important;
}

.steer-cursor {
    width: 18px !important;
    height: 18px !important;
    top: -6px !important;
    box-shadow: 0 0 18px rgba(0,242,255,0.92) !important;
}

#joy-left {
    bottom: 210px !important;
    left: 92px !important;
}

#joy-right {
    bottom: 210px !important;
    right: 92px !important;
}

.joy-zone {
    background: rgba(0, 242, 255, 0.025) !important;
    border-color: rgba(0, 242, 255, 0.25) !important;
}

.joy-stick {
    background: rgba(0, 242, 255, 0.38) !important;
    box-shadow: 0 0 18px rgba(0,242,255,0.72) !important;
}

.hud-dock-card,
.hud-function-row,
.hud-fuel-block,
.hud-mini-row,
.hud-mini-chip,
.hud-governor-chip {
    background-color: rgba(3, 10, 15, 0.20) !important;
}

.hud-dock-card {
    background: linear-gradient(180deg, rgba(3, 10, 15, 0.36), rgba(3, 10, 15, 0.24)) !important;
    border-color: rgba(0, 242, 255, 0.11) !important;
    box-shadow: 0 14px 30px rgba(0,0,0,0.19), 0 0 16px rgba(0,242,255,0.045) !important;
}

.hud-fuel-block,
.hud-mini-row {
    border-color: rgba(255,255,255,0.065) !important;
}

.hud-governor-chip {
    max-width: 210px !important;
    background: rgba(255, 215, 0, 0.045) !important;
    border-color: rgba(255, 215, 0, 0.24) !important;
    box-shadow: 0 0 12px rgba(255,215,0,0.055) !important;
}

.hud-governor-chip .reason {
    font-size: 10px !important;
    color: rgba(245, 251, 255, 0.92) !important;
}

.hud-system-btn {
    background: rgba(255,255,255,0.024) !important;
    border-color: rgba(0, 242, 255, 0.16) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.025) !important;
}

.hud-system-btn.hud-primary-action {
    background: linear-gradient(180deg, rgba(0,242,255,0.075), rgba(255,255,255,0.018)) !important;
    border-color: rgba(0, 242, 255, 0.26) !important;
}

.hud-system-btn:hover {
    background: rgba(0,242,255,0.115) !important;
    border-color: rgba(0,242,255,0.58) !important;
    box-shadow: 0 0 16px rgba(0,242,255,0.18), inset 0 0 14px rgba(0,242,255,0.08) !important;
}

.hud-system-btn.active,
.hud-system-btn.hud-primary-action.active,
.hud-system-dock.expanded .hud-more-action {
    background: radial-gradient(circle at 50% 15%, rgba(0,242,255,0.34), rgba(0,242,255,0.13) 58%, rgba(255,255,255,0.035)) !important;
    border-color: rgba(0,242,255,0.92) !important;
    color: #ffffff !important;
    box-shadow:
        0 0 30px rgba(0,242,255,0.50),
        0 0 12px rgba(0,242,255,0.36),
        inset 0 0 20px rgba(0,242,255,0.16) !important;
    text-shadow: 0 0 12px rgba(0,242,255,0.60) !important;
}

.hud-system-btn.active .hud-btn-sub,
.hud-system-btn.hud-primary-action.active .hud-btn-sub {
    color: #ecfeff !important;
    text-shadow: 0 0 9px rgba(0,242,255,0.50) !important;
}

@media (max-width: 900px) {
    .hud-xp-panel { top: 76px !important; }
    .hud-pilot-name { top: 112px !important; font-size: 9px; min-width: 130px; }
    #joy-left { bottom: 160px !important; left: 48px !important; }
    #joy-right { bottom: 160px !important; right: 48px !important; }
    .bot-left { left: 14px !important; bottom: 72px !important; width: 150px !important; padding: 9px 10px !important; }
    .bot-right { right: 14px !important; bottom: 72px !important; width: 150px !important; padding: 9px 10px !important; }
}



/* =========================================================
   PATCH v3.6 — Mobile HUD Simplification
   Compact / mobile landscape HUD rules.
   Goal: keep compass visible, hide XP, collapse Drive Core,
   compact crew chat, and convert telemetry into lightweight chips.
   ========================================================= */
@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    /* Keep roll / compass / pitch visible on mobile/compact HUD. */
    #hud-view .hud-top-instruments.hide-on-mobile {
        display: flex !important;
        top: 8px !important;
        width: min(360px, calc(100vw - 20px)) !important;
        padding: 7px 10px !important;
        border-radius: 999px !important;
        background: rgba(3, 10, 15, 0.22) !important;
        border: 1px solid rgba(0, 242, 255, 0.12) !important;
        box-shadow: 0 10px 24px rgba(0,0,0,0.18), 0 0 14px rgba(0,242,255,0.06) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }

    #hud-view .hud-top-instruments .instrument-circle {
        min-width: 54px !important;
    }

    #hud-view .hud-top-instruments .instrument-label {
        font-size: 7.5px !important;
        letter-spacing: .8px !important;
        margin-bottom: 2px !important;
    }

    #hud-view .hud-top-instruments .circle-gauge {
        width: 32px !important;
        height: 32px !important;
        border-width: 2px !important;
        background: rgba(0,0,0,0.18) !important;
    }

    #hud-view .hud-top-instruments .circle-line {
        width: 22px !important;
    }

    #hud-view .hud-top-instruments .instrument-value {
        margin-top: 2px !important;
        font-size: 9px !important;
    }

    #hud-view .compass-box {
        width: 170px !important;
    }

    #hud-view .compass-line {
        width: 150px !important;
        height: 14px !important;
        margin-top: 1px !important;
    }

    #hud-view .compass-heading {
        margin-top: 0 !important;
        font-size: 16px !important;
        letter-spacing: 4px !important;
    }

    /* XP is too expensive on mobile: hide it and keep attitude instruments. */
    #hud-view .hud-xp-panel,
    #hud-view .hud-pilot-name {
        display: none !important;
    }

    /* Top corner readouts become lightweight. */
    #hud-view .top-left {
        top: 12px !important;
        left: 10px !important;
        min-width: 0 !important;
        max-width: 150px !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    #hud-view .trail-name {
        font-size: 12px !important;
        margin-bottom: 2px !important;
        border-bottom: none !important;
        color: rgba(255,255,255,0.72) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #hud-view .timer-display {
        font-size: 16px !important;
        margin: 0 0 3px !important;
    }

    #hud-view .video-quality-selector {
        transform: scale(.78) !important;
        transform-origin: left top !important;
    }

    #hud-view .top-right {
        top: 10px !important;
        right: 10px !important;
        min-width: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    #hud-view .points {
        font-size: 24px !important;
        line-height: .9 !important;
    }

    #hud-view .multiplier-tag {
        font-size: 11px !important;
        padding: 2px 7px !important;
        border-radius: 999px !important;
    }

    /* Right panel: only refuel + balance remain as a compact pit widget. */
    #hud-view .mid-right {
        top: auto !important;
        right: 8px !important;
        bottom: calc(76px + env(safe-area-inset-bottom)) !important;
        width: 128px !important;
        gap: 5px !important;
        padding: 8px !important;
        border-radius: 18px !important;
        background: rgba(3, 10, 15, 0.20) !important;
        border: 1px solid rgba(0,242,255,0.12) !important;
        box-shadow: 0 10px 24px rgba(0,0,0,0.18), 0 0 14px rgba(0,242,255,0.05) !important;
        backdrop-filter: blur(9px) !important;
        -webkit-backdrop-filter: blur(9px) !important;
    }

    #hud-view .mid-right > .label.hide-on-mobile,
    #hud-view .mid-right > .val.hide-on-mobile {
        display: none !important;
    }

    #hud-view .refuel-container {
        gap: 3px !important;
    }

    #hud-view .lightning-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 23px !important;
        margin: 0 auto !important;
        background: rgba(0,0,0,0.20) !important;
    }

    #hud-view .lightning-label {
        font-size: 9px !important;
        letter-spacing: 1.5px !important;
    }

    #hud-view .hud-energy-balance {
        margin-top: 1px !important;
        padding: 4px 5px !important;
        border-radius: 999px !important;
        background: rgba(0,0,0,0.16) !important;
        font-size: 9px !important;
        line-height: 1.15 !important;
        color: #f2fbff !important;
        white-space: normal !important;
    }

    /* Fuel / speed / distance move to small chips instead of a heavy panel. */
    #hud-view .hud-fuel-block {
        position: fixed !important;
        top: 74px !important;
        right: 8px !important;
        width: 108px !important;
        padding: 5px 8px !important;
        border-radius: 999px !important;
        background: rgba(3, 10, 15, 0.24) !important;
        border: 1px solid rgba(0,242,255,0.13) !important;
        box-shadow: 0 8px 18px rgba(0,0,0,0.16) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }

    #hud-view .hud-fuel-block .label {
        font-size: 8.5px !important;
        letter-spacing: .8px !important;
        margin: 0 !important;
        color: #dffaff !important;
    }

    #hud-view .fuel-bar-bg {
        height: 4px !important;
        margin-top: 3px !important;
        background: rgba(255,255,255,0.08) !important;
    }

    #hud-view .hud-telemetry-stack {
        position: fixed !important;
        top: 112px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 35 !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        width: auto !important;
        margin: 0 !important;
        pointer-events: none !important;
    }

    #hud-view .hud-mini-row {
        min-height: 24px !important;
        padding: 4px 8px !important;
        border-radius: 999px !important;
        background: rgba(3, 10, 15, 0.24) !important;
        border: 1px solid rgba(0,242,255,0.13) !important;
        box-shadow: 0 8px 18px rgba(0,0,0,0.14) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }

    #hud-view .hud-mini-row .label {
        display: none !important;
    }

    #hud-view .hud-mini-val {
        font-size: 9.5px !important;
        letter-spacing: .7px !important;
        color: #f3fdff !important;
    }

    #hud-view #refuel-link-chip,
    #hud-view .hud-governor-chip {
        display: none !important;
    }

    /* Mobile Drive Core: Cruise | +MORE | Action. */
    #hud-view .hud-system-dock {
        left: 50% !important;
        right: auto !important;
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
        width: min(360px, calc(100vw - 20px)) !important;
        transform: translateX(-50%) !important;
        z-index: 70 !important;
    }

    #hud-view .hud-dock-card {
        position: relative !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        padding: 6px !important;
        border-radius: 18px !important;
        background: rgba(3, 10, 15, 0.26) !important;
        border: 1px solid rgba(0,242,255,0.14) !important;
        box-shadow: 0 12px 28px rgba(0,0,0,0.22), 0 0 14px rgba(0,242,255,0.06) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    #hud-view .hud-dock-title-row {
        display: none !important;
    }

    #hud-view .hud-function-row.primary,
    #hud-view .hud-function-row.media {
        display: contents !important;
    }

    #hud-view .hud-function-row.secondary {
        display: none !important;
    }

    #hud-view .hud-system-dock.expanded .hud-function-row.secondary {
        display: contents !important;
    }

    #hud-view .hud-function-row.primary .hud-system-btn,
    #hud-view .hud-function-row.media .hud-system-btn,
    #hud-view .hud-function-row.secondary .hud-system-btn {
        min-height: 42px !important;
        border-radius: 14px !important;
        padding: 5px 6px !important;
    }

    #hud-view .hud-function-row.primary .hud-system-btn:not(#cruise-control-btn):not([data-system="context_action"]),
    #hud-view .hud-function-row.media .hud-media-action,
    #hud-view .hud-function-row.secondary .hud-system-btn {
        display: none !important;
    }

    #hud-view #cruise-control-btn {
        display: inline-flex !important;
        order: 1 !important;
    }

    #hud-view .hud-more-action {
        display: inline-flex !important;
        order: 2 !important;
    }

    #hud-view [data-system="context_action"] {
        display: inline-flex !important;
        order: 3 !important;
    }

    #hud-view .hud-system-dock.expanded .hud-function-row.primary .hud-system-btn,
    #hud-view .hud-system-dock.expanded .hud-function-row.media .hud-media-action,
    #hud-view .hud-system-dock.expanded .hud-function-row.secondary .hud-system-btn {
        display: inline-flex !important;
    }

    #hud-view .hud-transfer-btn { order: 4 !important; }
    #hud-view [data-system="lights_combo"] { order: 5 !important; }
    #hud-view [data-system="hazard"] { order: 6 !important; }
    #hud-view [data-action="capture-run-screenshot"] { order: 7 !important; }
    #hud-view [data-action="save-run-replay"] { order: 8 !important; }
    #hud-view [data-system="map"] { order: 9 !important; }
    #hud-view [data-system="horn"] { order: 10 !important; }
    #hud-view .track-pool-btn { order: 11 !important; }

    #hud-view .hud-system-btn .hud-btn-icon {
        display: none !important;
    }

    #hud-view .hud-system-btn .hud-btn-label {
        font-size: 9px !important;
        letter-spacing: .8px !important;
    }

    #hud-view .hud-system-btn .hud-btn-sub {
        display: none !important;
    }

    /* Compact chat: only last 1-2 messages + one-line input. */
    #hud-view #chat-container.chat-driver,
    #hud-view #chat-container.chat-passenger {
        top: 132px !important;
        left: 8px !important;
        right: auto !important;
        bottom: auto !important;
        width: min(270px, 46vw) !important;
        max-height: 84px !important;
        transform: none !important;
        opacity: .88 !important;
        border-radius: 14px !important;
        background: rgba(3, 10, 15, 0.24) !important;
        border: 1px solid rgba(0,242,255,0.12) !important;
        box-shadow: 0 10px 22px rgba(0,0,0,0.18), 0 0 12px rgba(0,242,255,0.05) !important;
        overflow: hidden !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }

    #hud-view #chat-container .btn-exit-new,
    #hud-view #crew-roster,
    #hud-view #party-room-card,
    #hud-view #crew-voice-toolbar,
    #hud-view #crew-voice-members {
        display: none !important;
    }

    #hud-view .chat-messages {
        flex: 0 0 auto !important;
        height: 38px !important;
        max-height: 38px !important;
        padding: 5px 7px !important;
        font-size: 9.5px !important;
        gap: 1px !important;
        overflow: hidden !important;
        background: transparent !important;
    }

    #hud-view .chat-messages > div:nth-last-child(n+3) {
        display: none !important;
    }

    #hud-view .chat-input-area {
        min-height: 32px !important;
        border-top: 1px solid rgba(0,242,255,0.14) !important;
        background: rgba(0,0,0,0.12) !important;
    }

    #hud-view .chat-input-area input {
        min-width: 0 !important;
        padding: 6px 7px !important;
        font-size: 10px !important;
    }

    #hud-view .chat-input-area button {
        width: 34px !important;
        min-width: 34px !important;
        padding: 0 !important;
        font-size: 12px !important;
    }

    /* Joysticks are still available, but they no longer fight with the dock. */
    #hud-view #joy-left {
        left: 32px !important;
        bottom: 116px !important;
    }

    #hud-view #joy-right {
        right: 32px !important;
        bottom: 116px !important;
    }

    #hud-view .joy-zone {
        width: 112px !important;
        height: 112px !important;
    }

    #hud-view .joy-stick {
        width: 48px !important;
        height: 48px !important;
    }

    #hud-view .bot-left,
    #hud-view .bot-right {
        bottom: 58px !important;
        width: 126px !important;
        padding: 7px 9px !important;
        border-radius: 13px !important;
        background: rgba(3, 10, 15, 0.20) !important;
        border-color: rgba(0,242,255,0.12) !important;
    }

    #hud-view .bot-left { left: 8px !important; }
    #hud-view .bot-right { right: 8px !important; }

    #hud-view .control-bar-bg,
    #hud-view .steer-bar-wrapper {
        height: 7px !important;
        margin-top: 9px !important;
    }

    #hud-view .steer-cursor {
        width: 14px !important;
        height: 16px !important;
    }
}

@media (max-width: 560px) {
    #hud-view #chat-container.chat-driver,
    #hud-view #chat-container.chat-passenger {
        width: calc(100vw - 20px) !important;
        top: auto !important;
        left: 10px !important;
        bottom: 128px !important;
    }

    #hud-view .hud-telemetry-stack {
        top: 102px !important;
        gap: 4px !important;
    }

    #hud-view .hud-mini-val {
        font-size: 8.5px !important;
    }
}



/* =========================================================
   PATCH v3.6.1 — Mobile HUD Space Cleanup
   Mobile-only spacing pass:
   - hide lower throttle/steering cards
   - push virtual joysticks lower
   - lift compact chat/refuel higher
   - shorten chat width to clear the video center
   ========================================================= */
@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    /* Remove bulky lower readout cards on mobile. The virtual sticks are enough. */
    #hud-view .bot-left,
    #hud-view .bot-right {
        display: none !important;
    }

    /* Put joysticks as low as possible without blocking the center dock. */
    #hud-view #joy-left {
        left: 18px !important;
        bottom: calc(26px + env(safe-area-inset-bottom)) !important;
        z-index: 62 !important;
    }

    #hud-view #joy-right {
        right: 18px !important;
        bottom: calc(26px + env(safe-area-inset-bottom)) !important;
        z-index: 62 !important;
    }

    #hud-view .joy-zone {
        width: 104px !important;
        height: 104px !important;
        background: rgba(0, 242, 255, 0.012) !important;
        border-color: rgba(0, 242, 255, 0.18) !important;
    }

    #hud-view .joy-stick {
        width: 46px !important;
        height: 46px !important;
        background: rgba(0, 242, 255, 0.34) !important;
    }

    /* Lift refuel / energy block above joystick area, keep it visible outside MORE. */
    #hud-view .mid-right {
        top: 116px !important;
        right: 8px !important;
        bottom: auto !important;
        width: 118px !important;
        max-height: 128px !important;
        gap: 4px !important;
        padding: 7px !important;
        border-radius: 16px !important;
    }

    #hud-view .lightning-btn {
        width: 46px !important;
        height: 46px !important;
        font-size: 21px !important;
    }

    #hud-view .lightning-label {
        font-size: 8px !important;
        letter-spacing: 1.3px !important;
    }

    #hud-view .hud-energy-balance {
        padding: 3px 5px !important;
        font-size: 8.5px !important;
        line-height: 1.1 !important;
    }

    /* Keep telemetry chips high and lightweight. */
    #hud-view .hud-fuel-block {
        top: 68px !important;
        right: 8px !important;
        width: 104px !important;
        padding: 4px 7px !important;
    }

    #hud-view .hud-telemetry-stack {
        top: 102px !important;
        gap: 5px !important;
    }

    #hud-view .hud-mini-row {
        min-height: 22px !important;
        padding: 3px 7px !important;
    }

    #hud-view .hud-mini-val {
        font-size: 8.8px !important;
        letter-spacing: .55px !important;
    }

    /* Compact chat: shorter and higher so it does not eat the center video. */
    #hud-view #chat-container.chat-driver,
    #hud-view #chat-container.chat-passenger {
        top: 88px !important;
        left: 8px !important;
        bottom: auto !important;
        width: clamp(190px, 34vw, 230px) !important;
        max-height: 70px !important;
        opacity: .84 !important;
        border-radius: 13px !important;
    }

    #hud-view .chat-messages {
        height: 30px !important;
        max-height: 30px !important;
        padding: 4px 6px !important;
        font-size: 8.8px !important;
        line-height: 1.15 !important;
    }

    #hud-view .chat-input-area {
        min-height: 28px !important;
    }

    #hud-view .chat-input-area input {
        padding: 5px 6px !important;
        font-size: 9px !important;
    }

    #hud-view .chat-input-area button {
        width: 30px !important;
        min-width: 30px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 560px) {
    #hud-view #joy-left {
        left: 12px !important;
        bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    }

    #hud-view #joy-right {
        right: 12px !important;
        bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    }

    #hud-view .joy-zone {
        width: 96px !important;
        height: 96px !important;
    }

    #hud-view .joy-stick {
        width: 42px !important;
        height: 42px !important;
    }

    #hud-view .mid-right {
        top: 102px !important;
        right: 6px !important;
        width: 106px !important;
        padding: 6px !important;
    }

    #hud-view .lightning-btn {
        width: 42px !important;
        height: 42px !important;
    }

    #hud-view #chat-container.chat-driver,
    #hud-view #chat-container.chat-passenger {
        top: 78px !important;
        left: 6px !important;
        bottom: auto !important;
        width: clamp(160px, 46vw, 220px) !important;
        max-height: 66px !important;
    }

    #hud-view .hud-telemetry-stack {
        top: 92px !important;
    }
}


/* =========================================================
   PATCH v3.6.2 — Mobile Refuel / Chat Polish
   Mobile-only micro-layout pass:
   - stack fuel above REFUEL inside the pit widget
   - move speed/distance chips under score/multiplier
   - lower joysticks a little more
   - move compact chat to mid-left, away from video quality/timer
   - restore FULL button in the mobile video quality block
   ========================================================= */
@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    /* Bring fullscreen back on mobile, but make it compact. */
    #hud-view .video-quality-selector #btn-FULL.hide-on-mobile,
    #hud-view .video-quality-selector .fs-button.hide-on-mobile {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 34px !important;
        height: 22px !important;
        padding: 0 6px !important;
        font-size: 8px !important;
        letter-spacing: .6px !important;
        border-radius: 999px !important;
    }

    #hud-view .video-quality-selector {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        transform: scale(.74) !important;
        transform-origin: left top !important;
    }

    /* Fuel belongs above the refuel button inside the compact pit widget. */
    #hud-view .mid-right {
        top: 98px !important;
        right: 7px !important;
        bottom: auto !important;
        width: 124px !important;
        max-height: none !important;
        padding: 8px 8px 9px !important;
        gap: 6px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #hud-view .hud-fuel-block {
        position: static !important;
        top: auto !important;
        right: auto !important;
        order: 1 !important;
        width: 100% !important;
        padding: 4px 7px !important;
        margin: 0 0 2px !important;
        border-radius: 999px !important;
        background: rgba(3, 10, 15, 0.20) !important;
        border: 1px solid rgba(0,242,255,0.14) !important;
        box-shadow: 0 6px 14px rgba(0,0,0,0.12) !important;
    }

    #hud-view .hud-fuel-block .label {
        text-align: center !important;
        font-size: 8px !important;
        line-height: 1 !important;
        letter-spacing: .8px !important;
        margin: 0 !important;
    }

    #hud-view .fuel-bar-bg {
        height: 4px !important;
        margin-top: 3px !important;
    }

    #hud-view .refuel-container {
        order: 2 !important;
        gap: 3px !important;
        align-items: center !important;
    }

    #hud-view .lightning-btn {
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
        margin: 0 auto !important;
    }

    #hud-view .lightning-label {
        font-size: 8px !important;
        line-height: 1 !important;
        letter-spacing: 1.4px !important;
    }

    #hud-view .hud-energy-balance {
        margin-top: 1px !important;
        padding: 3px 5px !important;
        font-size: 8px !important;
        line-height: 1.05 !important;
        text-align: center !important;
        white-space: normal !important;
    }

    /* Speed and distance move upward, under the score/multiplier area. */
    #hud-view .hud-telemetry-stack {
        position: fixed !important;
        top: 62px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        z-index: 42 !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 5px !important;
        width: auto !important;
        pointer-events: none !important;
        order: 3 !important;
    }

    #hud-view .hud-mini-row {
        min-height: 21px !important;
        padding: 3px 7px !important;
        border-radius: 999px !important;
    }

    #hud-view .hud-mini-val {
        font-size: 8.5px !important;
        letter-spacing: .5px !important;
    }

    /* Chat moves to the middle-left so it no longer collides with timer/quality. */
    #hud-view #chat-container.chat-driver,
    #hud-view #chat-container.chat-passenger {
        top: 48% !important;
        left: 7px !important;
        bottom: auto !important;
        width: clamp(155px, 30vw, 205px) !important;
        max-height: 62px !important;
        transform: translateY(-50%) !important;
        opacity: .82 !important;
    }

    #hud-view .chat-messages {
        height: 27px !important;
        max-height: 27px !important;
        padding: 3px 6px !important;
        font-size: 8.4px !important;
        line-height: 1.1 !important;
    }

    #hud-view .chat-input-area {
        min-height: 26px !important;
    }

    #hud-view .chat-input-area input {
        padding: 4px 6px !important;
        font-size: 8.6px !important;
    }

    #hud-view .chat-input-area button {
        width: 28px !important;
        min-width: 28px !important;
        font-size: 10px !important;
    }

    /* Give the refuel block more clearance by pushing sticks lower. */
    #hud-view #joy-left {
        left: 14px !important;
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    }

    #hud-view #joy-right {
        right: 14px !important;
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    }

    #hud-view .joy-zone {
        width: 96px !important;
        height: 96px !important;
    }

    #hud-view .joy-stick {
        width: 42px !important;
        height: 42px !important;
    }
}

@media (max-width: 560px) {
    #hud-view .mid-right {
        top: 104px !important;
        right: 5px !important;
        width: 116px !important;
        padding: 7px !important;
    }

    #hud-view .hud-telemetry-stack {
        top: 56px !important;
        gap: 4px !important;
    }

    #hud-view .hud-mini-row {
        padding: 3px 6px !important;
    }

    #hud-view .hud-mini-val {
        font-size: 8px !important;
    }

    #hud-view #chat-container.chat-driver,
    #hud-view #chat-container.chat-passenger {
        top: 50% !important;
        left: 5px !important;
        width: clamp(140px, 42vw, 180px) !important;
        max-height: 60px !important;
        transform: translateY(-50%) !important;
    }

    #hud-view #joy-left {
        left: 8px !important;
        bottom: calc(6px + env(safe-area-inset-bottom)) !important;
    }

    #hud-view #joy-right {
        right: 8px !important;
        bottom: calc(6px + env(safe-area-inset-bottom)) !important;
    }

    #hud-view .joy-zone {
        width: 90px !important;
        height: 90px !important;
    }

    #hud-view .joy-stick {
        width: 40px !important;
        height: 40px !important;
    }
}



/* =========================================================
   PATCH v3.6.3 — Mobile Refuel / Passenger Polish
   Mobile-only fixes:
   - speed/distance chips sit at the top of the refuel widget
   - fuel bar stays under chips and above REFUEL
   - balance stays below REFUEL
   - joysticks move slightly lower
   - compact chat moves half a line up and keeps two messages readable
   - passenger warning auto-hides; passenger sees current pilot name at top center
   ========================================================= */
#mobile-passenger-driver-name {
    display: none;
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 78;
    min-width: 110px;
    max-width: min(260px, calc(100vw - 24px));
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 242, 255, 0.18);
    background: rgba(3, 10, 15, 0.24);
    color: #f4fdff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.4px;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.32);
    box-shadow: 0 8px 20px rgba(0,0,0,0.18), 0 0 14px rgba(0,242,255,0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}

@media (max-width: 950px), (max-height: 820px) and (max-width: 1400px) {
    #mobile-passenger-driver-name.visible {
        display: block !important;
    }

    /* Refuel widget: speed/distance at the very top, then fuel, then REFUEL, then balance. */
    #hud-view .mid-right {
        top: 92px !important;
        right: 6px !important;
        width: 148px !important;
        padding: 7px 8px 9px !important;
        gap: 5px !important;
        overflow: visible !important;
    }

    #hud-view .hud-telemetry-stack {
        position: static !important;
        order: 0 !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 5px !important;
        width: 100% !important;
        margin: 0 0 2px !important;
        z-index: auto !important;
        pointer-events: none !important;
    }

    #hud-view .hud-mini-row {
        min-width: 0 !important;
        min-height: 21px !important;
        padding: 3px 4px !important;
        border-radius: 999px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(3, 10, 15, 0.28) !important;
        border: 1px solid rgba(0,242,255,0.16) !important;
    }

    #hud-view .hud-mini-val {
        font-size: 8px !important;
        letter-spacing: .35px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    #hud-view .hud-fuel-block {
        order: 1 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 4px 8px !important;
    }

    #hud-view .refuel-container {
        order: 2 !important;
        gap: 2px !important;
    }

    #hud-view .lightning-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 20px !important;
        margin-top: 1px !important;
    }

    #hud-view .hud-energy-balance {
        margin-top: 2px !important;
        font-size: 8px !important;
        line-height: 1.06 !important;
        padding: 2px 5px !important;
        background: transparent !important;
    }

    /* Move compact chat half a line upward and give messages a bit more room. */
    #hud-view #chat-container.chat-driver,
    #hud-view #chat-container.chat-passenger {
        top: 46% !important;
        max-height: 66px !important;
    }

    #hud-view .chat-messages {
        height: 31px !important;
        max-height: 31px !important;
        line-height: 1.15 !important;
    }

    #hud-view .chat-input-area {
        min-height: 27px !important;
    }

    /* Push joysticks down another small step. */
    #hud-view #joy-left,
    #hud-view #joy-right {
        bottom: calc(2px + env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 560px) {
    #mobile-passenger-driver-name {
        top: 52px !important;
        max-width: calc(100vw - 96px) !important;
        padding: 3px 10px !important;
        font-size: 9px !important;
        letter-spacing: 1.1px !important;
    }

    #hud-view .mid-right {
        top: 88px !important;
        right: 4px !important;
        width: 152px !important;
        padding: 7px !important;
    }

    #hud-view .hud-telemetry-stack {
        gap: 4px !important;
    }

    #hud-view .hud-mini-row {
        min-height: 20px !important;
        padding: 3px 3px !important;
    }

    #hud-view .hud-mini-val {
        font-size: 7.8px !important;
        letter-spacing: .25px !important;
    }

    #hud-view #chat-container.chat-driver,
    #hud-view #chat-container.chat-passenger {
        top: 47% !important;
        max-height: 66px !important;
    }

    #hud-view #joy-left,
    #hud-view #joy-right {
        bottom: calc(1px + env(safe-area-inset-bottom)) !important;
    }
}



/* Patch v3.7 mobile: keep state strip tiny and out of the driving path. */
@media (max-width: 760px), (max-height: 560px) {
    #hud-view .hud-state-strip {
        top: 66px;
        gap: 4px;
        padding: 3px 5px;
        max-width: calc(100vw - 12px);
        overflow: hidden;
        background: rgba(3, 10, 14, 0.16);
    }
    #hud-view .hud-state-pill {
        min-width: 0;
        padding: 4px 6px;
        font-size: 8px;
        letter-spacing: .45px;
    }
    #hud-view .hud-state-pill:nth-child(5) {
        display: none;
    }
}


/* ═════════ USER SETTINGS FOUNDATION ═════════ */
:root {
    --rctech-ui-scale: 1;
    --rctech-font-scale: 1;
    --hud-scale: 1;
}

body.theme-light {
    --glass: rgba(238, 245, 248, 0.76);
    --glass-strong: rgba(236, 244, 248, 0.96);
    --glass-soft: rgba(0, 0, 0, 0.035);
    --glass-border: rgba(0, 128, 160, 0.28);
    --glass-border-soft: rgba(0, 128, 160, 0.16);
    --text-main: #081116;
    --text-soft: #263b45;
    --text-muted: #53666f;
    background: #e9f1f4;
    color: #071116;
}

body.compact-ui .lobby-nav {
    padding-top: 8px;
    padding-bottom: 8px;
}

body.compact-ui .lobby-shell {
    padding: 12px 18px 12px;
    gap: 12px;
}

body.compact-ui .glass-panel,
body.compact-ui .panel-frame,
body.compact-ui .center-page-card {
    padding: 14px;
}

body.settings-high-contrast {
    --glass-border: rgba(0, 242, 255, 0.58);
    --glass-border-soft: rgba(0, 242, 255, 0.34);
    --text-soft: #e8fbff;
    --text-muted: #c8f5ff;
}

body.settings-reduce-motion *,
body.settings-reduce-motion *::before,
body.settings-reduce-motion *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}


/* ═════════ ACCESSIBILITY SETTINGS SECOND PASS ═════════ */
body {
    font-size: calc(16px * var(--rctech-font-scale));
}

body.settings-dyslexia-font {
    --font: Verdana, Tahoma, Arial, sans-serif;
    letter-spacing: 0.02em;
}

body.settings-focus-ring :is(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid #ffd27a !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(255, 210, 122, 0.18) !important;
}

body.settings-keyboard-hints [data-action]::after {
    content: attr(data-key-hint);
}

body.settings-high-contrast .glass-panel,
body.settings-high-contrast .panel-frame,
body.settings-high-contrast .panel-frame-strong,
body.settings-high-contrast .user-settings-card,
body.settings-high-contrast .quick-panel,
body.settings-high-contrast .menu-dropdown-panel {
    border-color: rgba(0, 242, 255, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(0, 242, 255, 0.16), 0 18px 42px rgba(0,0,0,0.52) !important;
}

body.settings-colorblind-hud {
    --neon: #3ba7ff;
    --neon-pink: #ffb000;
}

body.settings-colorblind-mode-mono_safe {
    --neon: #f2f7ff;
    --neon-pink: #cfd8dc;
    --glass-border: rgba(242, 247, 255, 0.38);
    --glass-border-soft: rgba(242, 247, 255, 0.22);
}

body.settings-colorblind-hud .online-dot,
body.settings-colorblind-hud .server-dot,
body.settings-colorblind-hud .hud-state-pill,
body.settings-colorblind-hud .live-meta-chip {
    border: 1px solid currentColor !important;
}

body.settings-alert-subtitles .hud-video-status,
body.settings-alert-subtitles .accessibility-settings-preview-alert {
    opacity: 1;
}

.accessibility-settings-preview {
    border-radius: 16px;
    border: 1px solid rgba(0,242,255,0.18);
    background:
        radial-gradient(circle at top right, rgba(0,242,255,0.14), transparent 38%),
        rgba(0,0,0,0.28);
    padding: 16px;
    min-height: 150px;
}

.accessibility-settings-preview-topline,
.accessibility-settings-status-grid,
.settings-action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.accessibility-settings-preview-pill,
.accessibility-settings-status-chip {
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid rgba(0,242,255,0.18);
    background: rgba(255,255,255,0.04);
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .8px;
}

.accessibility-settings-preview-title {
    margin-top: 14px;
    font-size: calc(16px * var(--rctech-font-scale));
    color: var(--text-main);
    font-weight: 950;
    letter-spacing: 1px;
}

.accessibility-settings-preview-copy {
    margin-top: 6px;
    color: var(--text-soft);
    font-size: calc(12px * var(--rctech-font-scale));
    line-height: 1.45;
    text-transform: none;
}

.accessibility-settings-preview-alert {
    margin-top: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,210,122,0.28);
    background: rgba(255,210,122,0.08);
    color: #ffe5aa;
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .8px;
    opacity: .42;
}

.accessibility-settings-status-grid {
    margin-top: 12px;
}

.accessibility-settings-status-chip.active {
    border-color: rgba(0,242,255,0.38);
    background: rgba(0,242,255,0.10);
    color: #fff;
}

.settings-action-row {
    margin-top: 12px;
}

body.settings-hide-hud-compass #hud-view .compass-box,
body.settings-hide-hud-pitch-roll #hud-view .hud-top-instruments .instrument-circle,
body.settings-hide-hud-score #hud-view .hud-overlay.top-right,
body.settings-hide-hud-connection #hud-view #hud-state-strip,
body.settings-hide-hud-crew #hud-view #crew-roster,
body.settings-hide-hud-chat #hud-view #chat-messages,
body.settings-hide-hud-chat #hud-view .chat-input-area,
body.settings-hide-hud-fuel #hud-view .hud-fuel-block,
body.settings-hide-hud-energy #hud-view .hud-energy-balance,
body.settings-hide-hud-speed #hud-view #speed-txt,
body.settings-hide-hud-speed #hud-view #distance-txt,
body.settings-hide-hud-queue #hud-view #queue-position,
body.settings-hide-hud-queue #hud-view .queue-position,
body.settings-hide-hud-queue #hud-view .hud-queue-position {
    display: none !important;
}

body.settings-hide-offline-cars .car-card.offline,
body.settings-hide-offline-cars .garage-card.offline {
    display: none !important;
}

body.settings-hide-garage-specs .car-stats,
body.settings-hide-garage-specs .garage-spec-grid,
body.settings-hide-garage-specs .garage-booking-note {
    display: none !important;
}

body.settings-garage-specs-compact .garage-spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
body.settings-garage-specs-compact .garage-spec {
    padding: 8px;
}
body.settings-garage-specs-compact .garage-spec-label {
    font-size: 9px;
}
body.settings-garage-specs-compact .garage-spec-value {
    font-size: 12px;
}

.garage-settings-favorites-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.garage-settings-favorite-chip {
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(0,242,255,0.16);
    background: rgba(255,255,255,0.04);
    color: #d8e9ef;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .8px;
    cursor: pointer;
}
.garage-settings-favorite-chip.active {
    border-color: rgba(255,215,0,.55);
    color: #ffe28a;
    background: rgba(255,215,0,.10);
    box-shadow: 0 0 12px rgba(255,215,0,.12);
}
.garage-settings-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.garage-settings-preview-item {
    border-radius: 12px;
    border: 1px solid rgba(0,242,255,0.14);
    background: rgba(255,255,255,0.035);
    padding: 10px;
}
.garage-settings-preview-item span {
    display: block;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
}
.garage-settings-preview-item strong {
    display: block;
    margin-top: 4px;
    color: #f6fbff;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.garage-favorite-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    margin-left: 6px;
    border-radius: 999px;
    border: 1px solid rgba(255,215,0,.42);
    color: #ffe28a;
    background: rgba(255,215,0,.10);
    font-size: 9px;
    font-weight: 900;
}

body.settings-hide-garage-3d .garage-model-stage {
    display: none !important;
}

#hud-view .hud-overlay,
#hud-view #chat-container,
#hud-view .hud-state-strip,
#hud-view .hud-system-dock {
    scale: var(--hud-scale);
}

#hud-view .hud-overlay.top-left { transform-origin: top left; }
#hud-view .hud-overlay.top-right { transform-origin: top right; }
#hud-view .hud-overlay.mid-right { transform-origin: right center; }
#hud-view .hud-overlay.bot-left { transform-origin: bottom left; }
#hud-view .hud-overlay.bot-right { transform-origin: bottom right; }
#hud-view #chat-container { transform-origin: left center; }
#hud-view .hud-system-dock { transform-origin: bottom center; }

/* ═════════ HUD SETTINGS SECOND PASS ═════════ */
body.hud-preset-compact #hud-view #chat-container {
    max-width: min(360px, 42vw);
    opacity: 0.92;
}

body.hud-preset-minimal #hud-view .hud-overlay.top-right,
body.hud-preset-minimal #hud-view .hud-overlay.mid-right,
body.hud-preset-minimal #hud-view #crew-roster,
body.hud-preset-minimal #hud-view #chat-container {
    display: none !important;
}

body.hud-preset-streamer #hud-view #chat-container {
    opacity: 0.72;
}

body.hud-preset-debug #hud-view #hud-state-strip,
body.hud-preset-debug #hud-view .hud-video-status {
    opacity: 1;
}

.hud-settings-preview-shell {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(220px, 0.7fr);
    gap: 14px;
    align-items: stretch;
}

.hud-settings-preview-stage {
    position: relative;
    min-height: 260px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(0,242,255,0.18);
    background:
        radial-gradient(circle at 20% 16%, rgba(0,242,255,0.16), transparent 28%),
        linear-gradient(160deg, rgba(3,9,14,0.98), rgba(1,3,6,0.92));
    box-shadow: inset 0 0 40px rgba(0,0,0,0.36);
}

.hud-settings-preview-track {
    position: absolute;
    inset: 42% -8% -14%;
    transform: rotate(-5deg);
    border-top: 1px solid rgba(255,255,255,0.12);
    background: linear-gradient(180deg, rgba(180,180,180,0.12), rgba(70,70,70,0.24));
}

.hud-settings-preview-car {
    position: absolute;
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
    font-size: 46px;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,.55));
}

.hud-settings-preview-element {
    position: absolute;
    padding: 7px 9px;
    border-radius: 10px;
    border: 1px solid rgba(0,242,255,0.20);
    background: rgba(3, 10, 14, 0.70);
    color: #e8fbff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .8px;
    box-shadow: 0 8px 22px rgba(0,0,0,.24);
}

.hud-settings-preview-element.hidden {
    opacity: 0.16;
    filter: grayscale(1);
}

.hud-settings-preview-compass { top: 12px; left: 12px; }
.hud-settings-preview-score { top: 12px; right: 12px; }
.hud-settings-preview-fuel { left: 12px; bottom: 12px; }
.hud-settings-preview-speed { right: 12px; bottom: 12px; }
.hud-settings-preview-pitch { left: 50%; top: 12px; transform: translateX(-50%); }
.hud-settings-preview-connection { left: 50%; bottom: 14px; transform: translateX(-50%); }
.hud-settings-preview-crew { top: 74px; right: 12px; }
.hud-settings-preview-chat { left: 12px; top: 74px; max-width: 180px; text-transform: none; }

.hud-settings-preview-meta {
    border-radius: 16px;
    border: 1px solid rgba(0,242,255,0.14);
    background: rgba(255,255,255,0.035);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hud-settings-preview-title {
    color: #f6fdff;
    font-size: 15px;
    font-weight: 950;
    letter-spacing: 1px;
}

.hud-settings-preview-copy {
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.45;
    text-transform: none;
}

.hud-settings-warning {
    display: none;
    border-radius: 12px;
    border: 1px solid rgba(255, 210, 122, 0.28);
    background: rgba(255, 210, 122, 0.07);
    color: #ffe4ad;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    text-transform: none;
}

.hud-settings-warning.active {
    display: block;
}

.hud-settings-preset-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hud-settings-preset-chip {
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid rgba(0,242,255,0.18);
    background: rgba(0,0,0,0.18);
    color: #d7edf5;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .7px;
}

.hud-settings-preset-chip.active {
    background: rgba(0,242,255,0.15);
    border-color: rgba(0,242,255,0.42);
    color: #fff;
}

@media (max-width: 900px) {
    .hud-settings-preview-shell {
        grid-template-columns: 1fr;
    }
}

/* ═════════ USER SETTINGS MODAL ═════════ */
.user-settings-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-high);
    background: rgba(1, 6, 10, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.user-settings-window {
    position: relative;
    width: min(1180px, calc(100vw - 32px));
    height: min(820px, calc(100dvh - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.user-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0,242,255,0.16);
    background: rgba(0,0,0,0.18);
}

.user-settings-kicker {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.user-settings-title {
    margin: 0;
    color: var(--text-main);
    font-size: 28px;
    font-weight: 950;
    letter-spacing: 1.2px;
}

.user-settings-header-left {
    min-width: 0;
}

.user-settings-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.user-settings-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(0,242,255,0.18);
    background: rgba(0,0,0,0.28);
}

.user-settings-mode-btn {
    min-height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .9px;
    text-transform: uppercase;
}

.user-settings-mode-btn.active {
    border-color: rgba(0,242,255,0.42);
    background: rgba(0,242,255,0.16);
    color: #fff;
    box-shadow: 0 0 12px rgba(0,242,255,0.14);
}

.user-settings-mode-btn:hover {
    color: #fff;
    background: rgba(0,242,255,0.09);
}

.user-settings-mode-banner {
    display: none;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0,242,255,0.16);
    background: linear-gradient(90deg, rgba(0,242,255,0.08), rgba(255,255,255,0.025));
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.45;
    text-transform: none;
}

.user-settings-mode-banner strong {
    color: var(--neon);
    text-transform: uppercase;
    letter-spacing: .7px;
}

body.settings-mode-simple .user-settings-mode-banner {
    display: block;
}

.settings-mode-hidden {
    display: none !important;
}

.user-settings-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.user-settings-sidebar {
    border-right: 1px solid rgba(0,242,255,0.14);
    padding: 18px;
    overflow-y: auto;
    background: rgba(0,0,0,0.16);
}

.user-settings-search {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(0,242,255,0.18);
    background: rgba(0,0,0,0.26);
    color: var(--text-main);
    padding: 0 12px;
    outline: none;
    text-transform: none;
    margin-bottom: 14px;
}

.user-settings-section-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font-weight: 850;
    letter-spacing: .8px;
    text-align: left;
    padding: 0 12px;
    margin-bottom: 6px;
    /* i18n: dictionary stores normal-case labels; keep the caps look via CSS. */
    text-transform: uppercase;
}

.user-settings-section-button:hover,
.user-settings-section-button.active {
    border-color: rgba(0,242,255,0.28);
    background: rgba(0,242,255,0.09);
    color: var(--text-main);
}

.user-settings-section-button.modified::after {
    content: '•';
    margin-left: auto;
    color: #ffd27a;
    text-shadow: 0 0 8px rgba(255,210,122,0.55);
    font-size: 18px;
    line-height: 1;
}

.user-settings-section-button.search-match {
    border-color: rgba(255,210,122,0.42);
    background: rgba(255,210,122,0.07);
}

.user-settings-search-meta {
    min-height: 18px;
    margin: -7px 0 10px;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.user-settings-save-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: .9px;
}

.user-settings-save-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 8px rgba(0,242,255,0.55);
}

.user-settings-save-status.unsaved::before { background: #ffd27a; box-shadow: 0 0 8px rgba(255,210,122,0.55); }
.user-settings-save-status.saving::before { background: #9ac8ff; box-shadow: 0 0 8px rgba(154,200,255,0.55); }
.user-settings-save-status.error::before { background: #ff5d5d; box-shadow: 0 0 8px rgba(255,93,93,0.55); }

.user-settings-content {

    padding: 22px 28px 28px;
    overflow-y: auto;
    min-width: 0;
    scroll-padding-bottom: 28px;
}

.user-settings-section {
    display: none;
    flex-direction: column;
    gap: 18px;
}

.user-settings-section.active {
    display: flex;
}

.user-settings-section h3 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 24px;
    letter-spacing: .8px;
}

.user-settings-subtitle {
    color: var(--text-soft);
    text-transform: none;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 8px;
}

.user-settings-card {
    border: 1px solid rgba(0,242,255,0.13);
    border-radius: 18px;
    background: rgba(255,255,255,0.035);
    padding: 18px;
}

.user-settings-card-title {
    font-size: 13px;
    color: var(--neon);
    font-weight: 950;
    letter-spacing: 1.4px;
    margin-bottom: 14px;
}

.user-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}

.user-settings-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(180px, 260px);
    align-items: center;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.user-settings-row:last-child {
    border-bottom: none;
}

.user-settings-row label,
.user-settings-label {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .8px;
}

.user-settings-help {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
    text-transform: none;
    margin-top: 4px;
}

.user-settings-control,
.user-settings-row select,
.user-settings-row input[type="text"],
.user-settings-row input[type="number"],
.user-settings-row input[type="email"],
.user-settings-row textarea {
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(0,242,255,0.16);
    background: rgba(0,0,0,0.28);
    color: var(--text-main);
    padding: 0 10px;
    outline: none;
    text-transform: none;
}

.user-settings-row textarea {
    min-height: 92px;
    padding: 10px;
    resize: vertical;
    line-height: 1.35;
}

.user-settings-row .user-settings-control-note,
.user-settings-control-note {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
    text-transform: none;
}

.user-settings-row input:disabled,
.user-settings-row select:disabled,
.user-settings-row textarea:disabled {
    opacity: var(--disabled-field-opacity);
    cursor: not-allowed;
}


.account-settings-security-grid,
.membership-settings-benefit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.account-settings-security-card,
.membership-settings-benefit-card {
    border: 1px solid rgba(0,242,255,0.13);
    border-radius: 14px;
    background: rgba(0,0,0,0.20);
    padding: 13px;
    min-height: 96px;
}

.account-settings-security-card strong,
.membership-settings-benefit-card strong {
    display: block;
    color: var(--text-main);
    font-size: 12px;
    letter-spacing: .8px;
    margin-bottom: 6px;
}

.account-settings-security-card span,
.membership-settings-benefit-card span {
    display: block;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.4;
    text-transform: none;
}

.account-settings-risk-list,
.membership-settings-entitlement-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.account-settings-risk-item,
.membership-settings-entitlement-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.025);
    padding: 10px 12px;
    color: var(--text-soft);
    font-size: 11px;
    text-transform: none;
}

.account-settings-risk-item strong,
.membership-settings-entitlement-item strong {
    color: var(--text-main);
    font-size: 11px;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.account-settings-risk-item.ok strong,
.membership-settings-entitlement-item.ok strong { color: var(--neon); }
.account-settings-risk-item.warn strong,
.membership-settings-entitlement-item.warn strong { color: #ffd27a; }

.membership-settings-plan-table {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) repeat(3, minmax(90px, .8fr));
    border: 1px solid rgba(0,242,255,0.12);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0,0,0,0.18);
}

.membership-settings-plan-table > div {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    border-right: 1px solid rgba(255,255,255,0.07);
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.35;
    text-transform: none;
}

.membership-settings-plan-table > div:nth-child(4n) { border-right: none; }
.membership-settings-plan-table > div:nth-last-child(-n + 4) { border-bottom: none; }
.membership-settings-plan-table .head {
    color: var(--neon);
    font-weight: 950;
    letter-spacing: .8px;
    text-transform: uppercase;
    background: rgba(0,242,255,0.06);
}
.membership-settings-plan-table .yes { color: var(--neon); font-weight: 900; }
.membership-settings-plan-table .soon { color: #ffd27a; font-weight: 900; }
.membership-settings-plan-table .no { color: var(--text-muted); }

.membership-settings-plan-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
    align-items: center;
}

.membership-settings-plan-preview .user-settings-row {
    grid-template-columns: minmax(160px, 1fr) minmax(160px, 220px);
}

@media (max-width: 760px) {
    .account-settings-security-grid,
    .membership-settings-benefit-grid,
    .account-settings-risk-list,
    .membership-settings-entitlement-list {
        grid-template-columns: 1fr;
    }
    .membership-settings-plan-preview {
        grid-template-columns: 1fr;
    }
    .membership-settings-plan-table {
        grid-template-columns: minmax(120px, 1fr) repeat(3, minmax(74px, .7fr));
        font-size: 10px;
    }
    .membership-settings-plan-table > div {
        padding: 9px 8px;
        font-size: 10px;
    }
}

.voice-settings-hotkey {
    display: inline-flex;
    min-width: 56px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(0,242,255,0.20);
    background: rgba(0,0,0,0.24);
    color: var(--neon);
    font-weight: 950;
    letter-spacing: .8px;
}

.email-settings-status {
    color: #ffd27a;
}


/* =========================
   Support diagnostics settings
   ========================= */
.support-settings-readiness-grid,
.support-settings-package-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.support-settings-readiness-card,
.support-settings-package-item {
    border: 1px solid rgba(0,242,255,0.13);
    border-radius: 14px;
    background: rgba(0,0,0,0.20);
    padding: 12px;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.4;
    text-transform: none;
}
.support-settings-readiness-card strong,
.support-settings-package-item strong {
    display: block;
    color: var(--text-main);
    font-size: 12px;
    letter-spacing: .7px;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.support-settings-readiness-card.ok strong { color: var(--neon); }
.support-settings-readiness-card.warn strong { color: #ffd27a; }
.support-settings-readiness-card.bad strong { color: #ff7c7c; }
.support-settings-draft-box {
    min-height: 122px;
    max-height: 240px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    text-transform: none;
    border: 1px solid rgba(0,242,255,0.12);
    border-radius: 14px;
    background: rgba(0,0,0,0.24);
    color: var(--text-soft);
    padding: 13px;
    font-size: 12px;
    line-height: 1.45;
}
.support-settings-draft-box.support-highlight {
    border-color: rgba(0,242,255,0.46);
    box-shadow: 0 0 18px rgba(0,242,255,0.18);
    background: rgba(0,242,255,0.06);
}
.support-settings-redaction-note {
    border: 1px solid rgba(255,210,122,0.20);
    border-radius: 14px;
    background: rgba(255,210,122,0.055);
    color: #ffe1a3;
    padding: 12px;
    text-transform: none;
    font-size: 12px;
    line-height: 1.45;
}
@media (max-width: 760px) {
    .support-settings-readiness-grid,
    .support-settings-package-grid { grid-template-columns: 1fr; }
}


/* =========================
   Social privacy settings
   ========================= */
.social-settings-preview {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(0,242,255,0.16);
    background: linear-gradient(135deg, rgba(0,242,255,0.06), rgba(255,255,255,0.03));
}
.social-settings-preview-avatar {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    border: 1px solid rgba(0,242,255,0.35);
    background: rgba(0,0,0,0.28);
    box-shadow: 0 0 18px rgba(0,242,255,0.12);
}
.social-settings-preview-body { min-width: 0; }
.social-settings-preview-name {
    color: #f7fdff;
    font-weight: 950;
    font-size: 17px;
    letter-spacing: 1px;
}
.social-settings-preview-meta {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 11px;
    text-transform: none;
}
.social-settings-preview-chips,
.social-settings-consistency-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.social-settings-chip {
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #d7e7ed;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .7px;
}
.social-settings-chip.on {
    border-color: rgba(0,242,255,0.30);
    color: var(--neon);
    background: rgba(0,242,255,0.08);
}
.social-settings-chip.off {
    border-color: rgba(255,93,93,0.24);
    color: #ffc7c7;
    background: rgba(255,93,93,0.06);
}
.social-private-value {
    color: var(--text-muted);
    font-style: italic;
}

.notification-settings-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.notification-settings-status-chip {
    border: 1px solid rgba(0,242,255,0.14);
    border-radius: 14px;
    background: rgba(0,0,0,0.22);
    padding: 10px 12px;
    min-height: 58px;
}

.notification-settings-status-chip span {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: .9px;
    margin-bottom: 5px;
}

.notification-settings-status-chip strong {
    color: var(--text-main);
    font-size: 12px;
    letter-spacing: .8px;
}

.notification-settings-matrix {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) 92px 112px;
    gap: 0;
    border: 1px solid rgba(0,242,255,0.12);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0,0,0,0.18);
}

.notification-settings-matrix-head,
.notification-settings-matrix-row {
    display: contents;
}

.notification-settings-matrix-head > div,
.notification-settings-matrix-row > div {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
}

.notification-settings-matrix-head > div {
    color: var(--neon);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 1.2px;
    background: rgba(0,242,255,0.06);
}

.notification-settings-matrix-row:last-child > div {
    border-bottom: none;
}

.notification-settings-matrix-row > div:nth-child(2),
.notification-settings-matrix-row > div:nth-child(3),
.notification-settings-matrix-head > div:nth-child(2),
.notification-settings-matrix-head > div:nth-child(3) {
    justify-content: center;
    border-left: 1px solid rgba(255,255,255,0.06);
}

.notification-settings-category {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.notification-settings-category strong {
    color: var(--text-main);
    font-size: 12px;
    letter-spacing: .8px;
}

.notification-settings-category span {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.3;
    text-transform: none;
}

.notification-settings-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

@media (max-width: 760px) {
    .notification-settings-status-grid { grid-template-columns: 1fr 1fr; }
    .notification-settings-matrix { grid-template-columns: minmax(140px, 1fr) 74px 84px; }
}


/* =========================
   User settings / controls second pass
   ========================= */
.controls-settings-range-wrap {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 54px;
    gap: 10px;
    align-items: center;
    width: min(280px, 100%);
}
.controls-settings-range-wrap span {
    color: var(--neon);
    font-size: 11px;
    font-weight: 900;
    text-align: right;
}
.controls-settings-sensitivity-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.controls-settings-sensitivity-preview > div,
.controls-settings-gamepad-row {
    border: 1px solid rgba(0,242,255,0.14);
    border-radius: 12px;
    background: rgba(255,255,255,0.035);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}
.controls-settings-sensitivity-preview span,
.controls-settings-gamepad-row span {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
}
.controls-settings-sensitivity-preview b,
.controls-settings-gamepad-row strong {
    color: var(--neon);
    font-size: 12px;
    letter-spacing: 1px;
}
.controls-settings-bindings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.controls-settings-binding-row {
    border: 1px solid rgba(0,242,255,0.14);
    border-radius: 12px;
    background: rgba(255,255,255,0.035);
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}
.controls-settings-binding-row.conflict {
    border-color: rgba(255,93,93,0.52);
    background: rgba(255,93,93,0.08);
}
.controls-settings-binding-title {
    color: #f5fbff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .6px;
}
.controls-settings-binding-copy {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: none;
    margin-top: 3px;
}
.controls-settings-key-btn {
    min-width: 92px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,242,255,0.24);
    background: rgba(0,0,0,0.32);
    color: var(--neon);
    font-weight: 950;
    cursor: pointer;
}
.controls-settings-key-btn.rebinding {
    color: #000;
    background: var(--neon);
    box-shadow: 0 0 14px rgba(0,242,255,0.32);
}
.controls-settings-conflict-box {
    margin-top: 12px;
    border: 1px solid rgba(0,242,255,0.14);
    border-radius: 12px;
    background: rgba(0,242,255,0.05);
    color: #d9eef5;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .9px;
}
.controls-settings-conflict-box.has-conflict {
    border-color: rgba(255,93,93,0.45);
    background: rgba(255,93,93,0.08);
    color: #ffd6d6;
}
.controls-settings-mobile-preview {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-top: 12px;
}
.controls-settings-phone-frame {
    position: relative;
    height: 220px;
    border-radius: 22px;
    border: 1px solid rgba(0,242,255,0.18);
    background: linear-gradient(180deg, rgba(0,242,255,0.09), rgba(0,0,0,0.34));
    overflow: hidden;
}
.controls-settings-phone-video {
    position: absolute;
    inset: 10px 10px 72px;
    border-radius: 14px;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 900;
}
.controls-settings-phone-joy {
    position: absolute;
    bottom: 16px;
    width: calc(52px * var(--mobile-joystick-scale, 1));
    height: calc(52px * var(--mobile-joystick-scale, 1));
    border-radius: 999px;
    border: 1px solid rgba(0,242,255,0.38);
    background: rgba(0,242,255,0.10);
    color: var(--neon);
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}
.controls-settings-phone-joy.left { left: 16px; }
.controls-settings-phone-joy.right { right: 16px; }
.controls-settings-phone-button {
    position: absolute;
    right: 16px;
    top: 86px;
    width: calc(42px * var(--mobile-button-scale, 1));
    height: calc(42px * var(--mobile-button-scale, 1));
    border-radius: 12px;
    background: rgba(255,0,127,0.18);
    border: 1px solid rgba(255,0,127,0.38);
    color: #ffd8eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
}
.controls-settings-mobile-preview.left-handed .controls-settings-phone-joy.left { right: 16px; left: auto; }
.controls-settings-mobile-preview.left-handed .controls-settings-phone-joy.right { left: 16px; right: auto; }
.controls-settings-mobile-preview.left-handed .controls-settings-phone-button { left: 16px; right: auto; }
.controls-settings-mobile-preview.spectator .controls-settings-phone-joy,
.controls-settings-mobile-preview.spectator .controls-settings-phone-button { opacity: .28; }
.controls-settings-gamepad-test {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}
.controls-settings-gamepad-meter {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .9px;
}
.controls-settings-gamepad-meter i {
    display: block;
    height: 12px;
    border-radius: 999px;
    border: 1px solid rgba(0,242,255,0.14);
    background: linear-gradient(90deg, rgba(0,242,255,0.75) var(--meter, 50%), rgba(255,255,255,0.06) var(--meter, 50%));
    box-shadow: inset 0 0 8px rgba(0,0,0,0.25);
}
@media (max-width: 900px) {
    .controls-settings-bindings,
    .controls-settings-sensitivity-preview,
    .controls-settings-mobile-preview { grid-template-columns: 1fr; }
}

.profile-settings-avatar-row {
    align-items: start;
}

.profile-settings-selected-avatar {
    min-height: 56px;
    border-radius: 14px;
    border: 1px solid rgba(0,242,255,0.18);
    background: rgba(0,0,0,0.22);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .8px;
}

.profile-settings-selected-avatar span {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(0,242,255,0.26);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: radial-gradient(circle at 30% 30%, rgba(0,242,255,0.18), rgba(0,0,0,0.24));
}

.profile-settings-avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.profile-settings-avatar-option {
    min-height: 94px;
    border-radius: 15px;
    border: 1px solid rgba(0,242,255,0.13);
    background: rgba(255,255,255,0.035);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 8px;
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.profile-settings-avatar-option:hover {
    transform: translateY(-1px);
    border-color: rgba(0,242,255,0.34);
    background: rgba(0,242,255,0.07);
}

.profile-settings-avatar-option.active {
    border-color: rgba(0,242,255,0.72);
    background: rgba(0,242,255,0.13);
    box-shadow: 0 0 16px rgba(0,242,255,0.14);
}

.profile-settings-avatar-option-icon {
    font-size: 30px;
    line-height: 1;
}

.profile-settings-avatar-option-label {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .7px;
    text-align: center;
    line-height: 1.15;
}

.profile-settings-avatar-option-tag {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: .6px;
}

.profile-settings-preview {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 14px;
    align-items: center;
    border: 1px solid rgba(0,242,255,0.14);
    border-radius: 16px;
    background: rgba(0,0,0,0.18);
    padding: 14px;
}

.profile-settings-preview-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    border: 1px solid rgba(0,242,255,0.34);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    background: radial-gradient(circle at 30% 30%, rgba(0, 242, 255, 0.18), rgba(0, 0, 0, 0.26));
}

.profile-settings-preview-title {
    font-size: 18px;
    font-weight: 950;
    color: var(--text-main);
    letter-spacing: 1px;
}

.profile-settings-preview-meta,
.profile-settings-preview-bio,
.profile-persona,
.public-profile-persona,
.public-profile-bio {
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.45;
    text-transform: none;
}

.profile-settings-preview-bio,
.public-profile-bio {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0,242,255,0.10);
    background: rgba(255,255,255,0.025);
}

.profile-persona {
    margin: -4px 0 12px;
    color: var(--text-soft);
    text-align: center;
}

.public-profile-persona {
    margin: -6px 0 14px;
    color: var(--text-soft);
}

.public-profile-bio {
    margin: 0 0 18px;
}

.user-settings-row input[type="checkbox"] {
    width: 42px;
    height: 22px;
    justify-self: start;
    accent-color: var(--neon);
}

.user-settings-row input[type="range"] {
    width: 100%;
    accent-color: var(--neon);
}

.user-settings-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px;
    border-top: 1px solid rgba(0,242,255,0.16);
    background: rgba(3, 10, 14, 0.96);
    backdrop-filter: blur(12px);
}

.user-settings-footer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
}

.user-settings-footer-actions .mini-action-btn {
    width: auto;
    min-width: 118px;
    margin: 0;
    white-space: nowrap;
}

.user-settings-dirty {
    color: #ffd27a;
    font-size: 11px;
    letter-spacing: 1px;
}

.user-settings-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-settings-pill {
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0,242,255,0.16);
    color: var(--text-soft);
    background: rgba(255,255,255,0.04);
    font-size: 11px;
    font-weight: 850;
}

@media (max-width: 860px) {
    .user-settings-layout {
        grid-template-columns: 1fr;
    }
    .user-settings-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(0,242,255,0.14);
        max-height: 220px;
    }
    .user-settings-header {
        align-items: flex-start;
    }
    .user-settings-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .user-settings-footer {
        align-items: stretch;
        gap: 10px;
    }
    .user-settings-footer-actions {
        flex: 1 1 auto;
        justify-content: flex-end;
    }
    .user-settings-footer-actions .mini-action-btn {
        flex: 0 1 auto;
        min-width: 92px;
        padding-left: 10px;
        padding-right: 10px;
        font-size: 9px;
    }
    .user-settings-grid,
    .user-settings-row,
    .user-settings-diagnostic-grid {
        grid-template-columns: 1fr;
    }
}




    /* =========================
       USER SETTINGS / VIDEO SECOND PASS
       ========================= */
    .video-settings-status-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin: 12px 0;
    }

    .video-settings-status-chip,
    .video-settings-mode-card {
        border-radius: 12px;
        border: 1px solid rgba(0, 242, 255, 0.15);
        background: rgba(255, 255, 255, 0.035);
        padding: 11px 12px;
        min-height: 58px;
    }

    .video-settings-status-chip span,
    .video-settings-mode-card span {
        display: block;
        font-size: 10px;
        color: var(--text-muted);
        letter-spacing: 1px;
        margin-bottom: 5px;
    }

    .video-settings-status-chip strong,
    .video-settings-mode-card strong {
        display: block;
        color: var(--neon);
        font-size: 12px;
        letter-spacing: 1px;
    }

    .video-settings-mode-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .video-settings-mode-card.active {
        border-color: rgba(0, 242, 255, 0.42);
        background: rgba(0, 242, 255, 0.08);
        box-shadow: 0 0 16px rgba(0, 242, 255, 0.1);
    }

    .video-settings-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 12px;
    }

    .hud-stream-stats-panel {
        position: absolute;
        left: 18px;
        bottom: 18px;
        z-index: 7;
        display: none;
        grid-template-columns: repeat(2, minmax(92px, auto));
        gap: 6px;
        max-width: min(460px, calc(100% - 36px));
        padding: 10px;
        border-radius: 14px;
        border: 1px solid rgba(0, 242, 255, 0.18);
        background: rgba(3, 10, 14, 0.72);
        color: #e9f8ff;
        font-size: 10px;
        font-weight: 850;
        letter-spacing: 0.8px;
        pointer-events: none;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    body.settings-video-stats .hud-stream-stats-panel {
        display: grid;
    }

    .hud-stream-stats-panel span {
        display: inline-flex;
        justify-content: space-between;
        gap: 8px;
        padding: 5px 7px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.045);
        border: 1px solid rgba(255, 255, 255, 0.06);
        white-space: nowrap;
    }

    body.settings-video-health-hidden .hud-video-status {
        display: none !important;
    }

    body.settings-video-connection-warning-off .hud-state-strip .hud-state-pill.bad,
    body.settings-video-connection-warning-off .hud-state-strip .hud-state-pill.warn {
        box-shadow: none;
    }

    @media (max-width: 860px) {
        .video-settings-status-grid,
        .video-settings-mode-grid {
            grid-template-columns: 1fr;
        }
        .hud-stream-stats-panel {
            left: 10px;
            bottom: 10px;
            grid-template-columns: 1fr;
        }
    }


/* Patch 4.10 — second stabilization pass */
.lobby-news-item {
    min-height: 92px;
    padding: 9px;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
}
.lobby-news-thumb {
    width: 108px;
    height: 78px;
}
.lobby-news-item-title {
    font-size: 13px;
    line-height: 1.2;
}
#center-view-lobby,
#center-view-lobby.active {
    grid-template-rows: minmax(360px, 1fr) minmax(122px, auto) minmax(160px, auto);
}
.community-news-row.selected-news-row {
    border-color: rgba(0,242,255,.44);
    box-shadow: 0 0 18px rgba(0,242,255,.10);
}
.community-news-expanded-media {
    float: left;
    margin: 0 18px 12px 0;
}
.profile-identity-license-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.9fr);
    gap: 12px;
    align-items: start;
    margin-bottom: 14px;
}
.profile-identity-block {
    min-width: 0;
}
.profile-identity-license-row .profile-avatar {
    margin-bottom: 12px;
}
.profile-identity-license-row .profile-license-card {
    margin-top: 0;
}
.public-profile-hero {
    justify-content: space-between;
    align-items: flex-start;
}
.public-profile-identity-block {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}
.public-profile-license-card {
    width: min(260px, 40%);
    flex: 0 0 auto;
}
@media (max-width: 1180px) {
    #center-view-lobby,
    #center-view-lobby.active {
        grid-template-rows: minmax(320px, 1fr) minmax(210px, auto) minmax(160px, auto);
    }
    .lobby-news-item {
        min-height: 92px;
    }
}
@media (max-width: 950px) {
    .server-status-pill {
        display: none !important;
    }
    .profile-identity-license-row {
        grid-template-columns: 1fr;
    }
    .public-profile-hero,
    .public-profile-identity-block {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .public-profile-license-card {
        width: 100%;
    }
}
@media (max-width: 720px) {
    .lobby-grid {
        grid-template-columns: 1fr;
    }
    .leaderboard-card,
    .offers-card {
        display: none !important;
    }
    .lobby-footer .footer-card {
        display: none !important;
    }
    .lobby-footer {
        flex: 0 0 auto;
        gap: 0;
    }
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 0;
    }
    .footer-banner-card {
        min-height: 54px;
        padding: 8px 10px;
    }
    .footer-banner-body {
        min-height: 42px;
        width: 100%;
        padding: 10px 12px;
        font-size: 10px;
    }
    #center-view-lobby,
    #center-view-lobby.active {
        grid-template-rows: minmax(280px, auto) auto minmax(150px, auto);
    }
    .lobby-news-grid {
        grid-template-columns: 1fr;
    }
    .lobby-news-item {
        min-height: 92px;
        grid-template-columns: 108px minmax(0, 1fr);
    }
    .community-news-expanded-media {
        float: none;
        width: 100%;
        height: 180px;
        margin: 0 0 14px 0;
    }
}


/* Patch 5.2 — compact Announcements v2 feed + right sponsor slot + premium footer collapse */
.lobby-left-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    height: 100%;
    max-width: none;
    overflow: hidden;
}

.lobby-rides-card {
    flex: 1 1 0;
    min-height: 150px;
    overflow: hidden;
}

.lobby-rides-card #lobby-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.lobby-left-offers-card {
    flex: 0 0 auto;
    min-height: 0;
    overflow: hidden;
    padding: 14px;
}

.lobby-left-offers-card .panel-title {
    margin-bottom: 8px;
    padding-bottom: 8px;
    line-height: 1.1;
}

.lobby-left-offers-card .offer-list {
    max-height: none;
    overflow: hidden;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lobby-left-offers-card .offer-item {
    min-height: 42px;
    max-height: 42px;
    padding: 7px 10px;
    font-size: 11px;
    line-height: 1.12;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lobby-left-offers-card .offer-item-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,242,255,0.18);
    background: rgba(0,242,255,0.07);
    color: var(--neon);
    font-size: 15px;
    box-shadow: 0 0 10px rgba(0,242,255,0.10);
}

.lobby-left-offers-card .offer-item-title {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
    color: #f4fbff;
    font-weight: 900;
    letter-spacing: .45px;
    text-transform: uppercase;
}

.lobby-left-offers-card .offer-item-meta {
    display: none;
}

.lobby-side-sponsor-card {
    flex: 0 0 250px;
    min-height: 0;
    overflow: hidden;
}

.lobby-side-sponsor-card .panel-title {
    margin-bottom: 10px;
}

.side-sponsor-body {
    min-height: 178px;
    height: 100%;
    font-size: 12px;
    line-height: 1.35;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(255,215,0,0.07), rgba(0,242,255,0.05));
}

/* Premium collapses ad placements and uses the left announcement block as taller Premium Stats. */
body.premium-ad-free #lobby-footer {
    display: none !important;
}

body.premium-ad-free #lobby-side-sponsor-card {
    display: none !important;
}

body.premium-ad-free .lobby-left-offers-card {
    flex-basis: 374px;
}

body.premium-ad-free #center-view-lobby,
body.premium-ad-free #center-view-lobby.active {
    grid-template-rows: clamp(340px, 32vh, 410px) minmax(96px, auto) minmax(240px, 1fr);
}

body.premium-ad-free .global-chat-messages {
    max-height: none;
    min-height: 176px;
}

body.premium-ad-free .premium-stats-card.compact {
    gap: 10px;
}

body.premium-ad-free .premium-stats-card.compact .premium-stat-row {
    min-height: 38px;
}

@media (max-width: 1280px) {
    .lobby-left-offers-card {
        flex-basis: auto;
    }
    body.premium-ad-free .lobby-left-offers-card {
        flex-basis: 344px;
    }
    .lobby-side-sponsor-card {
        flex-basis: 226px;
    }
    .side-sponsor-body {
        min-height: 156px;
    }
}

@media (max-width: 950px) {
    .lobby-left-stack {
        max-width: 100%;
        overflow: visible;
    }
    .lobby-rides-card,
    .lobby-left-offers-card,
    .lobby-side-sponsor-card {
        flex: 0 0 auto;
    }
    .lobby-left-offers-card .offer-list {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 720px) {
    .lobby-left-offers-card,
    .lobby-side-sponsor-card {
        display: none !important;
    }
}


/* Patch 4.11 — stabilization microfixes after visual QA */
/* Personal profile: licence plate returns below avatar/name. Public profile keeps side-by-side layout. */
.profile-identity-license-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
}
.profile-identity-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.profile-identity-license-row .profile-license-card {
    width: 100%;
    margin: 0 0 2px !important;
}

/* Public profile: avatar/identity block visually balances the licence plate height. */
.public-profile-identity-block {
    min-height: 112px;
    align-items: center;
}
.public-profile-avatar {
    width: 108px;
    height: 108px;
    font-size: 50px;
}
.public-profile-license-card {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* User Settings: mode switch is shifted left from the absolute close button. */
.user-settings-header-actions .user-settings-mode-toggle {
    margin-right: 58px;
}
@media (max-width: 720px) {
    .user-settings-header-actions .user-settings-mode-toggle {
        margin-right: 48px;
    }
}

/* Lobby News: larger thumbnail and slightly taller card. */
.lobby-news-item {
    min-height: 112px !important;
    padding: 10px !important;
    grid-template-columns: 136px minmax(0, 1fr) !important;
    gap: 14px !important;
}
.lobby-news-thumb {
    width: 136px !important;
    height: 92px !important;
    border-radius: 12px !important;
}
/* Banner row is a FIXED (clamp) track, not 1fr — so the chat row (1fr) absorbs
   the extra vertical space premium gets from the hidden footer instead of the
   banner shrinking. Keeps the promo rotator the same height for free/guest and
   premium (was: premium chat ballooned and squeezed the banner → bottom crop). */
#center-view-lobby,
#center-view-lobby.active {
    grid-template-rows: clamp(340px, 32vh, 410px) minmax(144px, auto) minmax(160px, 1fr) !important;
}
@media (max-width: 1180px) {
    #center-view-lobby,
    #center-view-lobby.active {
        grid-template-rows: clamp(300px, 30vh, 380px) minmax(236px, auto) minmax(160px, 1fr) !important;
    }
}
@media (max-width: 720px) {
    .lobby-news-item {
        min-height: 104px !important;
        grid-template-columns: 126px minmax(0, 1fr) !important;
        gap: 12px !important;
    }
    .lobby-news-thumb {
        width: 126px !important;
        height: 86px !important;
    }
    #center-view-lobby,
    #center-view-lobby.active {
        grid-template-rows: minmax(270px, auto) auto minmax(150px, auto) !important;
    }
}

/* Expanded Community News: image stays left and grows about 20%. */
.community-news-expanded-media {
    float: left !important;
    width: min(46%, 312px) !important;
    min-width: 216px !important;
    height: 192px !important;
    margin: 0 20px 14px 0 !important;
}
@media (max-width: 720px) {
    .community-news-expanded-media {
        float: none !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 216px !important;
        margin: 0 0 14px 0 !important;
    }
}


