  @import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;0,700;0,800;0,900;1,700;1,900&family=Chakra+Petch:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700;800&display=swap');

  :root {
    --font-display: 'Barlow Condensed', 'Chakra Petch', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --bg-scrim: linear-gradient(90deg, rgba(6, 6, 8, 0.95) 0%, rgba(6, 6, 8, 0.75) 22%, rgba(6, 6, 8, 0.25) 42%, rgba(6, 6, 8, 0) 65%);
    --plate-bg: rgba(9, 9, 11, 0.85);
    --plate-border: rgba(255, 255, 255, 0.12);
  }

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

  html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    background: #060608;
    color: #ffffff;
    font-family: var(--font-body);
    touch-action: none;
    -webkit-touch-callout: none;
  }

  /* Screen Reader & SEO Semantic Accessibility */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  canvas {
    display: block;
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 0;
    touch-action: none;
  }

  /* Cinematic Vignette */
  #vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(circle at center, transparent 60%, rgba(6, 6, 8, 0.5) 100%);
  }

  /* Hide HUD when in menus */
  body.in-menu #navHeader,
  body.in-menu #scoreBadge,
  body.in-menu #speedometer,
  body.in-menu #raceBanner,
  body.in-menu #liftPrompt,
  body.in-menu #touchControls {
    display: none !important;
  }

  /* ==========================================================================
     READY OR NOT / BEAMNG MAIN MENU
     ========================================================================== */
  #mainMenu {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    display: flex;
  }

  /* Left Gradient Scrim (No boxed sidebar, smooth fade to 3D background) */
  .menu-scrim {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    pointer-events: none;
    z-index: 10;
    background: var(--bg-scrim);
  }

  /* Left-Aligned Vertical Navigation Column */
  .menu-nav-col {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: clamp(36px, 6vw, 84px);
    width: min(520px, 92vw);
    pointer-events: auto;
  }

  .menu-brand {
    margin-bottom: clamp(24px, 4vh, 40px);
  }
  .brand-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 6px;
    text-transform: uppercase;
  }
  .brand-title {
    margin: 0 0 4px 0;
    font-family: var(--font-display);
    font-size: clamp(52px, 6.5vw, 76px);
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 0.95;
    color: #ffffff;
    text-transform: uppercase;
  }
  .brand-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
  }
  .brand-sub .brand-author,
  .brand-sub .brand-author-link {
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.12s ease, text-shadow 0.12s ease;
    cursor: pointer;
  }
  .brand-sub .brand-author-link:hover {
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  }
  .brand-sub .brand-author-link .ext-icon {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.12s ease, opacity 0.12s ease;
  }
  .brand-sub .brand-author-link:hover .ext-icon {
    opacity: 1;
    transform: translate(1px, -1px);
  }

  /* Vertical Menu List */
  .menu-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .menu-item {
    background: transparent;
    border: none;
    outline: none;
    border-left: 4px solid transparent;
    padding: 10px 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    transition: all 100ms ease-out;
    transform: translateX(0);
    width: 100%;
    text-decoration: none !important;
    color: inherit;
    box-sizing: border-box;
  }
  .menu-item:hover, .menu-item:focus, .menu-item:visited, .menu-item:active {
    text-decoration: none !important;
  }

  .menu-item-text {
    font-family: var(--font-display);
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.1;
    transition: color 100ms ease-out;
  }

  .menu-item-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 3px;
    transition: color 100ms ease-out;
  }

  /* Hover & Active snap state */
  .menu-item:hover, .menu-item.active, .menu-item:focus-visible {
    border-left: 4px solid #ffffff;
    padding-left: 16px;
    transform: translateX(8px);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 100%);
  }
  .menu-item:hover .menu-item-text,
  .menu-item.active .menu-item-text,
  .menu-item:focus-visible .menu-item-text {
    color: #ffffff;
  }
  .menu-item:hover .menu-item-sub,
  .menu-item.active .menu-item-sub,
  .menu-item:focus-visible .menu-item-sub {
    color: rgba(255, 255, 255, 0.7);
  }

  /* Prevent dual highlights: if mouse is hovering over an item, do not highlight unhovered active item */
  .menu-list:hover .menu-item.active:not(:hover) {
    border-left-color: transparent !important;
    padding-left: 0 !important;
    transform: translateX(0) !important;
    background: transparent !important;
  }
  .menu-list:hover .menu-item.active:not(:hover) .menu-item-text {
    color: rgba(255, 255, 255, 0.6) !important;
  }
  .menu-list:hover .menu-item.active:not(:hover) .menu-item-sub {
    color: rgba(255, 255, 255, 0.3) !important;
  }

  /* Gamepad Focus Ring for Sub-Screen Rows */
  .thps-row.pad-focused,
  .thps-tile.pad-focused,
  .credits-linkedin-btn.pad-focused,
  .credits-paypal-btn.pad-focused,
  .credits-discord-btn.pad-focused {
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 1px #38bdf8 inset, 0 4px 16px rgba(0, 0, 0, 0.5) !important;
  }
  .sub-action-btn.pad-focused {
    outline: 2px solid #ffffff !important;
    outline-offset: 2px !important;
  }
  .credits-author-link.pad-focused {
    color: #38bdf8 !important;
    outline: 2px solid #38bdf8 !important;
    outline-offset: 4px !important;
  }

  /* Asymmetric Bottom-Right Telemetry Plate */
  .menu-telemetry-plate {
    position: absolute;
    right: clamp(28px, 4vw, 56px);
    bottom: clamp(28px, 4vw, 56px);
    z-index: 20;
    pointer-events: auto;
    max-width: 360px;
    width: 100%;
    background: var(--plate-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--plate-border);
    border-radius: 2px;
    padding: 18px 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  }
  .plate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 14px;
  }
  .plate-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
  }
  .plate-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.45);
  }
  .plate-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
  .plate-stat-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    padding: 10px 12px;
  }
  .plate-stat-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
  }
  .plate-stat-val {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
  }
  .plate-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .plate-hint {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.06em;
  }
  .plate-hint span {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
  }

  /* ==========================================================================
     RUN STATE VARIANTS — MAIN MENU SHOWCASE VS IN-RUN PAUSE
     ========================================================================== */
  .menu-pause-only { display: none !important; }
  body.state-paused .menu-pause-only { display: flex !important; }
  body.state-paused .menu-main-only { display: none !important; }

  .pause-menu-head {
    display: none;
    margin-bottom: clamp(24px, 4vh, 40px);
  }
  body.state-paused .pause-menu-head { display: block; }
  .pause-kicker {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 5px;
  }
  .pause-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(42px, 5vw, 60px);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 0.04em;
    color: #ffffff;
    text-transform: uppercase;
  }
  .pause-sub {
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.38);
  }

  body.state-paused .menu-brand,
  body.state-paused .menu-top-actions,
  body.state-paused .menu-telemetry-plate,
  body.state-paused #mpMenuPanel {
    display: none !important;
  }
  body.state-paused .menu-scrim {
    background: linear-gradient(90deg, rgba(6, 6, 8, 0.96) 0%, rgba(6, 6, 8, 0.82) 24%, rgba(6, 6, 8, 0.28) 52%, rgba(6, 6, 8, 0.06) 100%);
  }
  .menu-item-danger:hover,
  .menu-item-danger.active,
  .menu-item-danger:focus-visible {
    border-left-color: #ef4444 !important;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.16) 0%, rgba(239, 68, 68, 0) 100%) !important;
  }

  /* ==========================================================================
     LOCKER / APPEARANCE PANEL
     ========================================================================== */
  .locker-panel {
    position: absolute;
    top: clamp(20px, 2.8vh, 30px);
    right: clamp(24px, 3vw, 44px);
    z-index: 70;
    width: min(400px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    display: none;
    flex-direction: column;
    pointer-events: auto;
    background: linear-gradient(180deg, #121417, #090a0c);
    border: 1px solid #2a2d32;
    border-radius: 2px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
  }
  body.customizer-open .locker-panel { display: flex; }
  body.customizer-open #mpMenuPanel,
  body.customizer-open .menu-telemetry-plate,
  body.customizer-open .menu-top-actions {
    display: none !important;
  }
  body.customizer-open .menu-nav-col { opacity: 0.9; }

  .locker-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px 11px;
    border-bottom: 1px solid #2a2d32;
    background: rgba(255, 255, 255, 0.02);
  }
  .locker-kicker {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.38);
    margin-bottom: 3px;
  }
  .locker-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #ffffff;
    text-transform: uppercase;
  }
  .locker-close {
    background: transparent;
    border: 1px solid #2a2d32;
    color: rgba(255, 255, 255, 0.7);
    width: 30px;
    height: 30px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: all 100ms ease-out;
  }
  .locker-close:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.08);
  }
  .locker-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 2px 16px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  }
  .locker-body::-webkit-scrollbar { width: 4px; }
  .locker-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }
  .locker-part {
    padding: 6px 0 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .locker-part:last-child { border-bottom: none; }
  .locker-part-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }
  .locker-part-head > div {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
  }
  .locker-part-name {
    flex: none;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #ffffff;
    text-transform: uppercase;
  }
  .locker-part-sub {
    display: inline;
    font-family: var(--font-mono);
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 0.13em;
    color: rgba(255, 255, 255, 0.32);
    margin-top: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .locker-part-code {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.48);
    text-transform: uppercase;
  }
  .locker-swatches {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    margin: 4px 0;
  }
  .locker-swatch {
    height: 16px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: transform 90ms ease-out, border-color 90ms ease-out;
  }
  .locker-swatch:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.7); }
  .locker-swatch.is-active { border-color: #ffffff; box-shadow: 0 0 0 1px #ffffff inset; }
  .locker-controls {
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .locker-color-input {
    width: 34px;
    height: 22px;
    padding: 0;
    border: 1px solid #2a2d32;
    background: #0b0d0f;
    cursor: pointer;
    flex: none;
  }
  .locker-hex-input {
    min-width: 0;
    flex: 1;
    height: 22px;
    padding: 0 8px;
    background: #0b0d0f;
    border: 1px solid #2a2d32;
    color: #e5e7eb;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    outline: none;
  }
  .locker-hex-input:focus { border-color: rgba(255, 255, 255, 0.45); }
  .locker-mini-btn {
    height: 22px;
    flex: none;
    padding: 0 8px;
    background: transparent;
    border: 1px solid #2a2d32;
    color: rgba(255, 255, 255, 0.62);
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 100ms ease-out;
  }
  .locker-mini-btn:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.06);
  }
  .locker-footer {
    display: flex;
    gap: 8px;
    padding: 10px 16px 12px;
    border-top: 1px solid #2a2d32;
    background: rgba(255, 255, 255, 0.02);
  }
  .locker-action {
    flex: 1;
    height: 34px;
    border: 1px solid #2a2d32;
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 100ms ease-out;
  }
  .locker-action:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.07);
  }
  .locker-action-primary {
    background: #ffffff;
    border-color: #ffffff;
    color: #060608;
  }
  .locker-action-primary:hover {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #060608;
  }

  /* ==========================================================================
     LOBBY SETTINGS / CREATE PANEL
     ========================================================================== */
  .lobby-setup-panel {
    position: absolute;
    top: 50%;
    right: clamp(24px, 33vw, 560px);
    z-index: 72;
    transform: translateY(-50%);
    width: min(400px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    display: none;
    flex-direction: column;
    pointer-events: auto;
    background: linear-gradient(180deg, #121417, #090a0c);
    border: 1px solid #2a2d32;
    border-radius: 2px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
  }
  body.lobby-setup-open .lobby-setup-panel { display: flex; }
  body.lobby-setup-open #mpMenuPanel,
  body.lobby-setup-open .menu-telemetry-plate,
  body.lobby-setup-open .menu-top-actions {
    display: none !important;
  }
  .lobby-setup-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px 11px;
    border-bottom: 1px solid #2a2d32;
    background: rgba(255, 255, 255, 0.02);
  }
  .lobby-setup-kicker {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.38);
    margin-bottom: 3px;
  }
  .lobby-setup-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #ffffff;
    text-transform: uppercase;
  }
  .lobby-setup-close {
    flex: none;
  }
  .lobby-setup-note {
    margin: 0;
    padding: 10px 16px 0;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.42);
  }
  .lobby-setup-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 16px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  }
  .lobby-setup-body::-webkit-scrollbar { width: 4px; }
  .lobby-setup-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }
  .lobby-setup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .lobby-setup-row:last-child { border-bottom: none; }
  .lobby-setting-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
  }
  .lobby-setting-label {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #ffffff;
    text-transform: uppercase;
  }
  .lobby-setting-note {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.34);
  }
  .lobby-setting-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
  }
  .lobby-step-btn {
    width: 30px;
    height: 26px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #2a2d32;
    border-radius: 2px;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, opacity 0.12s ease;
  }
  .lobby-step-btn:hover:not(:disabled) {
    background: #ffffff;
    border-color: #ffffff;
    color: #060608;
  }
  .lobby-step-btn:disabled { opacity: 0.35; cursor: default; }
  .lobby-step-value {
    min-width: 36px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
  }
  .lobby-setup-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px 14px;
    border-top: 1px solid #2a2d32;
    background: rgba(255, 255, 255, 0.02);
  }
  .lobby-setup-footer .locker-action { flex: 1; }

  /* ==========================================================================
     MODERNIZED THPS 1+2 SUB-SCREENS & OVERLAYS
     ========================================================================== */
  .sub-screen-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    pointer-events: auto;
  }
  .sub-screen-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(6, 6, 8, 0.96) 0%, rgba(6, 6, 8, 0.85) 45%, rgba(6, 6, 8, 0.35) 75%, rgba(6, 6, 8, 0.08) 100%);
    z-index: 0;
  }
  .sub-screen-container {
    position: relative;
    z-index: 10;
    margin-left: clamp(32px, 5vw, 84px);
    width: min(720px, 92vw);
    height: var(--sub-screen-height, auto);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: rgba(9, 9, 11, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--plate-border);
    border-radius: 2px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
    overflow: hidden;
  }

  /* Top Tab Bar (THPS 1+2) */
  .sub-tab-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 20px 10px;
    background: rgba(255, 255, 255, 0.02);
  }
  .sub-tab-group {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .sub-tab-btn {
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 75ms ease-out;
  }
  .sub-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
  }
  .sub-tab-btn.active {
    background: #ffffff;
    color: #000000;
    font-weight: 900;
  }

  .sub-close-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-mono);
    font-size: 14px;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 2px;
    transition: all 75ms ease-out;
  }
  .sub-close-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
  }

  /* Sub-Panel Content */
  .sub-tab-bar {
    flex-shrink: 0;
  }
  .sub-tab-panel {
    flex: 1 1 auto;
    min-height: 0;
    padding: 22px 24px 32px;
    overflow-y: auto;
  }
  .sub-tab-panel::-webkit-scrollbar { width: 4px; }
  .sub-tab-panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }
  .sub-panel-footer {
    flex-shrink: 0;
  }

  .thps-section-header {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin: 18px 0 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .thps-section-header:first-of-type { margin-top: 0; }

  .thps-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    padding: 12px 16px;
    margin-bottom: 8px;
    gap: 12px;
    transition: all 75ms ease-out;
  }
  .thps-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
  }
  .thps-row-label {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
  }
  .thps-row-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
  }
  .thps-row input[type=range] {
    flex: 1;
    max-width: 180px;
    accent-color: #ffffff;
  }

  .thps-pill-group {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
  }
  .thps-pill {
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 75ms ease-out;
  }
  .thps-pill:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
  }
  .thps-pill.active {
    background: #ffffff;
    color: #000000;
    font-weight: 900;
  }

  .thps-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 75ms ease-out;
  }
  .thps-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
  }
  .thps-btn.active {
    background: #ffffff;
    color: #000000;
    font-weight: 900;
  }
  .thps-btn.muted {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
  }

  .thps-btn-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 75ms ease-out;
  }
  .thps-btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
  }

  /* THPS Controls & Tricks Grid */
  .thps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
  }
  .thps-tile {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    padding: 16px;
    box-sizing: border-box;
    transition: border-color 75ms ease-out, background 75ms ease-out;
  }
  .thps-tile:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 1px #ffffff inset;
  }
  .thps-tile-header {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 12px;
  }
  .thps-key-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  .thps-key-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
  }
  .thps-key-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 2px 7px;
    border-radius: 2px;
  }
  .thps-key-action {
    font-family: var(--font-body);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
  }

  .sub-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.02);
  }
  .sub-panel-credit {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
  }
  .sub-panel-credit b { color: #ffffff; }
  .sub-panel-credit .sub-credit-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.12s ease;
  }
  .sub-panel-credit .sub-credit-link:hover,
  .sub-panel-credit .sub-credit-link:hover b {
    color: #38bdf8;
  }

  .credits-author-link {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 42px);
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    line-height: 1;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.12s ease, text-shadow 0.12s ease;
    cursor: pointer;
  }
  .credits-author-link:hover {
    color: #38bdf8;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
  }
  .credits-linkedin-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 6px 14px;
    border-radius: 2px;
    text-decoration: none;
    transition: all 0.12s ease;
    cursor: pointer;
  }
  .credits-linkedin-btn:hover {
    background: #0077b5;
    border-color: #0077b5;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 119, 181, 0.5);
    transform: translateY(-1px);
  }
  .credits-paypal-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 6px 14px;
    border-radius: 2px;
    text-decoration: none;
    transition: all 0.12s ease;
    cursor: pointer;
  }
  .credits-paypal-btn:hover {
    background: #0070ba;
    border-color: #0070ba;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 112, 186, 0.5);
    transform: translateY(-1px);
  }
  .credits-discord-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 6px 14px;
    border-radius: 2px;
    text-decoration: none;
    transition: all 0.12s ease;
    cursor: pointer;
  }
  .credits-discord-btn:hover {
    background: #5865F2;
    border-color: #5865F2;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(88, 101, 242, 0.5);
    transform: translateY(-1px);
  }
  .sub-action-btn {
    background: #ffffff;
    color: #000000;
    border: none;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 7px 18px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 75ms;
  }
  .sub-action-btn:hover { background: rgba(255, 255, 255, 0.85); }

  .sub-right-hint {
    position: absolute;
    right: clamp(28px, 4vw, 56px);
    bottom: clamp(28px, 4vw, 56px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
  }
  .sub-right-hint .hint-line {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.08em;
  }
  .sub-right-hint .hint-line span { color: #ffffff; font-weight: 700; }

  /* ==========================================================================
     TOP-RIGHT MAIN MENU ACTIONS (DISCORD & DONATE)
     ========================================================================== */
  .menu-top-actions {
    position: absolute;
    top: clamp(20px, 3vh, 36px);
    right: clamp(24px, 4vw, 56px);
    z-index: 50;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .menu-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none !important;
    padding: 6px 14px;
    border-radius: 2px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: all 0.12s ease;
    cursor: pointer;
  }
  .menu-top-btn svg {
    flex-shrink: 0;
  }
  .menu-top-btn:hover {
    color: #ffffff;
    transform: translateY(-1px);
  }
  .menu-top-btn-discord:hover {
    background: #5865F2;
    border-color: #5865F2;
    box-shadow: 0 0 14px rgba(88, 101, 242, 0.5);
  }
  .menu-top-btn-donate:hover {
    background: #0070ba;
    border-color: #0070ba;
    box-shadow: 0 0 14px rgba(0, 112, 186, 0.5);
  }
  .menu-top-btn:active {
    transform: translateY(0);
  }

  /* ==========================================================================
     IN-GAME HUD & TELEMETRY
     ========================================================================== */
  #navHeader {
    position: fixed;
    top: 14px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 95;
    gap: 8px;
  }
  .nav-left, .nav-right {
    display: flex;
    gap: 6px;
    align-items: center;
    pointer-events: auto;
  }
  .nav-btn {
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 75ms ease-out;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  }
  .nav-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
  }

  /* Score & Combo Widget (Top-Left) */
  #scoreBadge {
    position: fixed;
    top: 58px;
    left: 16px;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    padding: 10px 16px;
    min-width: 150px;
    z-index: 85;
    pointer-events: none;
  }
  .badge-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
  }
  .badge-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
  }
  .badge-num {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
  }
  .badge-combo {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 800;
    color: #facc15;
  }
  .badge-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.04em;
    margin-top: 3px;
  }

  /* Slalom Race Banner (Top-Right) */
  #raceBanner {
    position: fixed;
    top: 58px;
    right: 16px;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    padding: 10px 18px;
    text-align: right;
    display: none;
    z-index: 85;
  }
  #raceTimer {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
  }
  #raceGates, #raceBest {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
  }

  /* Park Trick Popup Banner */
  #trickBanner {
    position: fixed;
    left: 50%;
    top: 18%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    display: none;
    z-index: 80;
    animation: popIn 0.14s ease-out;
  }
  @keyframes popIn {
    0% { transform: translateX(-50%) scale(0.9); opacity: 0; }
    100% { transform: translateX(-50%) scale(1.0); opacity: 1; }
  }
  #trickName {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 46px);
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.8);
  }
  #trickScore {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 800;
    color: #facc15;
    margin-top: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  }
  #comboMeter {
    display: inline-block;
    padding: 4px 14px;
    background: #ffffff;
    color: #000000;
    border-radius: 2px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 6px;
  }

  /* Chairlift Fast-Forward & Skip HUD Prompt (Clean Main-Menu Plate Style) */
  #liftPrompt {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 84px;
    transform: translateX(-50%);
    background: var(--plate-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--plate-border);
    border-radius: 2px;
    padding: 7px 18px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    z-index: 90;
    pointer-events: none;
    white-space: nowrap;
  }
  #liftPrompt #liftPromptContent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  #liftPrompt .key-badge,
  #liftPrompt .key-badge-yellow {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 3px 8px;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    margin: 0 2px;
    display: inline-block;
  }
  #liftPrompt .prompt-sep {
    color: rgba(255, 255, 255, 0.2);
    margin: 0 6px;
    font-weight: 400;
  }

  /* Wipeout / Message Overlay */
  #msg {
    position: fixed;
    left: 50%;
    top: 36%;
    transform: translateX(-50%);
    padding: 16px 26px;
    background: rgba(9, 9, 11, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-left: 4px solid #ef4444;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    display: none;
    text-align: center;
    pointer-events: none;
    z-index: 95;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
  }

  /* Real Arcade Speedometer (Bottom-Right) */
  #speedometer {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 130px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 85;
    pointer-events: none;
    background: radial-gradient(circle, rgba(9, 9, 11, 0.9) 0%, rgba(6, 6, 8, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .speed-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(140deg);
  }
  .speed-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 6;
    stroke-dasharray: 245.04;
    stroke-linecap: round;
  }
  .speed-bar {
    fill: none;
    stroke: #ffffff;
    stroke-width: 6;
    stroke-dasharray: 245.04;
    stroke-dashoffset: 245.04;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.08s ease-out, stroke 0.2s;
  }
  .speed-center {
    position: relative;
    text-align: center;
    margin-top: -6px;
  }
  #speedVal {
    font-family: var(--font-mono);
    font-size: 34px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
  }
  #speedUnit {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
    margin-top: 2px;
  }


  /* ==========================================================================
     ALIGNED ALPINE SYSTEM LOADER (MATCHING MAIN MENU READY OR NOT AESTHETIC)
     ========================================================================== */
  #loader {
    position: fixed;
    inset: 0;
    background: #060608;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    pointer-events: auto;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
    user-select: none;
    -webkit-user-select: none;
  }
  .loader-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(18, 18, 24, 0.5) 0%, rgba(6, 6, 8, 0.98) 100%);
    z-index: 1;
  }
  .loader-content,
  .loader-nav-col {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(480px, 100%);
    box-sizing: border-box;
    margin: 0 auto;
  }
  .loader-brand {
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .loader-brand .brand-tag {
    text-align: center;
  }
  .loader-brand .brand-title {
    text-align: center;
    font-size: clamp(42px, 5.5vw, 64px);
    letter-spacing: 0.04em;
  }
  .loader-brand .brand-sub {
    text-align: center;
  }
  .loader-plate {
    background: var(--plate-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--plate-border);
    border-radius: 2px;
    padding: 22px 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
    width: 100%;
    box-sizing: border-box;
  }
  .loader-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    margin: 12px 0 10px;
  }
  .loader-bar {
    height: 100%;
    width: 12%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    transition: width 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .loader-detail {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 14px;
  }
  .loader-subsystems {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
  }
  .subsys-tag {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    color: rgba(255, 255, 255, 0.35);
    transition: all 0.2s ease;
  }
  .subsys-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }
  .subsys-tag.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
  }
  .subsys-tag.active .subsys-dot {
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  }

  /* WebGL Error Banner */
  #webglError {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 440px;
    padding: 28px;
    text-align: center;
    z-index: 10000;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 2px;
  }
  #webglError h2 {
    font-family: var(--font-display);
    font-size: 24px;
    margin: 0 0 10px;
    color: #f87171;
  }
  #webglError p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0 0 10px;
  }

  /* Mobile Touch Controls */
  #touchControls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    pointer-events: none;
    z-index: 92;
    display: none;
  }
  #touchStickZone {
    position: absolute;
    left: 20px;
    bottom: 20px;
    width: 120px;
    height: 120px;
    background: rgba(9, 9, 11, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    pointer-events: auto;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #touchStickKnob {
    width: 48px;
    height: 48px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    pointer-events: none;
    transition: transform 0.04s ease-out;
  }
  #touchActionCluster {
    position: absolute;
    right: 155px;
    bottom: 20px;
    display: grid;
    grid-template-columns: repeat(2, 54px);
    grid-template-rows: repeat(2, 54px);
    gap: 10px;
    pointer-events: auto;
    touch-action: none;
  }
  .touch-btn {
    width: 54px;
    height: 54px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(9, 9, 11, 0.8);
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 75ms ease-out;
  }
  .touch-btn:active, .touch-btn.active {
    background: #ffffff;
    color: #000000;
  }

  /* Tuning panel (Tab) */
  #panel {
    position: fixed;
    right: 16px;
    top: 56px;
    bottom: 16px;
    width: 340px;
    overflow: auto;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(16px);
    color: #ffffff;
    font-size: 11px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    display: none;
    z-index: 99;
  }
  #panel .row {
    display: grid;
    grid-template-columns: 140px 1fr 52px;
    gap: 8px;
    align-items: center;
    margin: 4px 0;
  }
  #panel input { width: 100%; accent-color: #ffffff; }
  #panel h4 {
    margin: 14px 0 6px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  @media (max-width: 768px) {
    .menu-nav-col {
      padding-left: 24px;
      width: calc(100% - 48px);
    }
    .menu-top-actions {
      top: 14px;
      right: 16px;
      gap: 6px;
    }
    .menu-top-btn {
      padding: 5px 10px;
      font-size: 10px;
    }
    .menu-telemetry-plate {
      display: none;
    }
    .locker-panel {
      top: auto;
      right: 16px;
      bottom: 16px;
      left: 16px;
      width: auto;
      max-height: 62vh;
    }
    .locker-swatches {
      grid-template-columns: repeat(8, minmax(0, 1fr));
    }
    .sub-screen-container {
      margin-left: 16px;
      width: calc(100% - 32px);
    }
    .sub-right-hint { display: none; }
    #speedometer {
      width: 100px;
      height: 100px;
      right: 12px;
      bottom: 12px;
    }
    #speedVal { font-size: 24px; }
    #touchActionCluster { right: 118px; bottom: 12px; }
    .nav-btn .nav-text { display: none; }
  }

  /* Screen-Space Peripheral Speed Motion Blur & Radial Streak Canvas */
  #speedBlurCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 20;
    mix-blend-mode: screen;
  }

  /* ==========================================================================
     IN-WORLD SPONSORSHIP REAL ESTATE MODAL (CanIVibeCodeIt / Main Menu Style)
     ========================================================================== */
  .sponsor-modal-overlay,
  .ad-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
  }
  .sponsor-modal-scrim,
  .ad-modal-scrim {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(6, 6, 8, 0.88) 0%, rgba(6, 6, 8, 0.98) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 0;
  }
  .sponsor-modal-container,
  .ad-modal-container {
    position: relative;
    z-index: 10;
    width: min(1140px, 94vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: rgba(9, 10, 14, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--plate-border);
    border-radius: 4px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85);
    overflow: hidden;
  }

  /* Header */
  .sponsor-modal-header,
  .ad-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
  }
  .sponsor-modal-tag,
  .ad-modal-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
  }
  .sponsor-modal-title,
  .ad-modal-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #ffffff;
    margin: 2px 0;
    text-transform: uppercase;
  }
  .sponsor-modal-sub,
  .ad-modal-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.04em;
  }
  .sponsor-close-btn,
  .ad-close-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-mono);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 2px;
    transition: all 75ms ease-out;
  }
  .sponsor-close-btn:hover,
  .ad-close-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
  }

  /* Body Split Layout */
  .sponsor-modal-body,
  .ad-modal-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.01);
  }

  /* Left Column: 8 Packages Catalog */
  .sponsor-packages-col,
  .ad-packages-col {
    flex: 1.15;
    min-width: 0;
    overflow-y: auto;
    padding: 20px 24px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }
  .sponsor-packages-col::-webkit-scrollbar,
  .ad-packages-col::-webkit-scrollbar { width: 5px; }
  .sponsor-packages-col::-webkit-scrollbar-thumb,
  .ad-packages-col::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }

  .sponsor-section-hdr,
  .ad-section-hdr {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin: 22px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .sponsor-section-hdr:first-of-type,
  .ad-section-hdr:first-of-type { margin-top: 0; }
  .sponsor-section-meta,
  .ad-section-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
  }

  .sponsor-package-card,
  .ad-package-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: all 100ms ease;
  }
  .sponsor-package-card:hover,
  .ad-package-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
  }
  .sponsor-package-card.active-selected,
  .ad-package-card.active-selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.06);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
  }

  .sponsor-card-top-row,
  .ad-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .sponsor-card-title,
  .ad-card-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
  }
  .sponsor-card-badges,
  .ad-card-badges {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .sponsor-badge-ratio,
  .ad-badge-ratio {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }
  .sponsor-badge-gate-takeover,
  .ad-badge-gate-takeover {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 2px;
    background: rgba(2, 132, 199, 0.22);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #38bdf8;
  }

  .sponsor-card-desc,
  .ad-card-desc {
    font-family: var(--font-body);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 12px;
    line-height: 1.4;
  }

  .sponsor-card-action-bar,
  .ad-card-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .sponsor-card-price,
  .ad-card-price {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
  }
  .sponsor-card-price span,
  .ad-card-price span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: normal;
  }

  /* Open Slot CTA Button (High Contrast Green) */
  .sponsor-btn-open-slot,
  .ad-btn-open-slot {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #34d399;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 120ms ease;
    white-space: nowrap;
  }
  .sponsor-btn-open-slot:hover,
  .ad-btn-open-slot:hover {
    background: #10b981;
    color: #022c22;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
  }

  /* Occupied Slot Badge */
  .sponsor-occupied-state,
  .ad-occupied-state {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
  }
  .sponsor-dot-active,
  .ad-dot-active {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.7);
    flex-shrink: 0;
  }
  .sponsor-occupied-link,
  .ad-occupied-link {
    color: #38bdf8;
    text-decoration: none;
    font-weight: bold;
  }
  .sponsor-occupied-link:hover,
  .ad-occupied-link:hover {
    text-decoration: underline;
  }

  /* Right Column: Checkout & Live Preview Drawer */
  .sponsor-checkout-col,
  .ad-checkout-col {
    flex: 1;
    min-width: 360px;
    overflow-y: auto;
    padding: 22px 24px;
    background: rgba(13, 14, 19, 0.7);
  }
  .sponsor-checkout-col::-webkit-scrollbar,
  .ad-checkout-col::-webkit-scrollbar { width: 5px; }
  .sponsor-checkout-col::-webkit-scrollbar-thumb,
  .ad-checkout-col::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }

  .sponsor-drawer-empty,
  .ad-drawer-empty {
    text-align: center;
    padding: 36px 16px;
  }
  .sponsor-empty-icon,
  .ad-empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
  }
  .sponsor-empty-title,
  .ad-empty-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 8px;
  }
  .sponsor-empty-text,
  .ad-empty-text {
    font-family: var(--font-body);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 24px;
  }
  .sponsor-empty-perks,
  .ad-empty-perks {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .sponsor-perk-row,
  .ad-perk-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
  }
  .sponsor-perk-check,
  .ad-perk-check {
    color: #10b981;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 14px;
  }

  /* Form Elements */
  .sponsor-form-top,
  .ad-form-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .sponsor-form-pill,
  .ad-form-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    color: #ffffff;
    display: inline-block;
  }
  .sponsor-form-name,
  .ad-form-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    color: #ffffff;
    margin: 4px 0 2px;
    letter-spacing: 0.04em;
  }
  .sponsor-form-pricing,
  .ad-form-pricing {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: #34d399;
  }
  .sponsor-form-cancel-btn,
  .ad-form-cancel-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 2px;
    transition: all 75ms ease;
  }
  .sponsor-form-cancel-btn:hover,
  .ad-form-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }

  .sponsor-gate-notice,
  .ad-gate-notice {
    display: flex;
    gap: 10px;
    background: rgba(2, 132, 199, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.45);
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-family: var(--font-body);
    font-size: 12px;
    line-height: 1.4;
    color: #e0f2fe;
  }
  .sponsor-gate-star,
  .ad-gate-star {
    font-size: 16px;
    color: #38bdf8;
    line-height: 1;
  }

  .sponsor-field,
  .ad-field {
    margin-bottom: 14px;
  }
  .sponsor-label-row,
  .ad-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
  }
  .sponsor-label,
  .ad-label {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
  }
  .sponsor-req,
  .ad-req {
    color: #ef4444;
  }
  .sponsor-rec-dims,
  .ad-rec-dims {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
  }
  .sponsor-input,
  .ad-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 9px 12px;
    font-family: var(--font-body);
    font-size: 13px;
    border-radius: 3px;
    outline: none;
    transition: border 100ms ease;
  }
  .sponsor-input:focus,
  .ad-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
  }
  .sponsor-field-desc,
  .ad-field-desc {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    display: block;
  }

  /* File Dropzone */
  .sponsor-dropzone,
  .ad-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    padding: 16px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 120ms ease;
  }
  .sponsor-dropzone:hover,
  .sponsor-dropzone.drag-active,
  .ad-dropzone:hover,
  .ad-dropzone.drag-active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
  }
  .sponsor-drop-prompt,
  .ad-drop-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  .sponsor-drop-icon,
  .ad-drop-icon {
    font-size: 24px;
  }
  .sponsor-drop-main,
  .ad-drop-main {
    font-family: var(--font-body);
    font-size: 12px;
    color: #ffffff;
  }
  .sponsor-drop-sub,
  .ad-drop-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
  }

  .sponsor-drop-preview,
  .ad-drop-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .sponsor-drop-preview img,
  .ad-drop-preview img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #000000;
    border-radius: 2px;
  }
  .sponsor-preview-actions,
  .ad-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 320px;
  }
  .sponsor-preview-dims,
  .ad-preview-dims {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
  }
  .sponsor-btn-change-file,
  .ad-btn-change-file {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 2px;
    cursor: pointer;
  }
  .sponsor-btn-change-file:hover,
  .ad-btn-change-file:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
  }

  /* Live 3D Mountain Preview Status */
  .sponsor-preview-status,
  .ad-preview-status {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid #10b981;
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 16px;
  }
  .sponsor-preview-header,
  .ad-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
  }
  .sponsor-status-dot-pulse,
  .ad-status-dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: adPulse 1.8s infinite;
  }
  @keyframes adPulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #10b981; }
    100% { transform: scale(0.9); opacity: 0.8; }
  }
  .sponsor-status-headline,
  .ad-status-headline {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #34d399;
    text-transform: uppercase;
  }
  .sponsor-preview-desc,
  .ad-preview-desc {
    font-family: var(--font-body);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 8px 0;
  }
  .sponsor-btn-revert-preview,
  .ad-btn-revert-preview {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 2px;
    cursor: pointer;
  }
  .sponsor-btn-revert-preview:hover,
  .ad-btn-revert-preview:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
  }

  /* Stripe Checkout Button */
  .sponsor-action-wrap,
  .ad-action-wrap {
    margin-top: 18px;
  }
  .sponsor-stripe-checkout-btn,
  .ad-stripe-checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #635bff 0%, #7a73ff 100%);
    color: #ffffff;
    border: none;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 13px 20px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(99, 91, 255, 0.35);
    transition: all 120ms ease;
  }
  .sponsor-stripe-checkout-btn:hover:not(:disabled),
  .ad-stripe-checkout-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7a73ff 0%, #908aff 100%);
    box-shadow: 0 6px 24px rgba(99, 91, 255, 0.55);
    transform: translateY(-1px);
  }
  .sponsor-stripe-checkout-btn:disabled,
  .ad-stripe-checkout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
  }
  .sponsor-stripe-footnote,
  .ad-stripe-footnote {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 8px;
    line-height: 1.4;
  }

  .sponsor-promo-hint {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    margin-top: 4px;
    line-height: 1.4;
    letter-spacing: 0.02em;
  }

  /* Footer */
  .sponsor-modal-footer,
  .ad-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
  }
  .sponsor-footer-info,
  .ad-footer-info {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.04em;
  }
  .sponsor-footer-close-btn,
  .ad-footer-close-btn {
    background: #ffffff;
    border: none;
    color: #000000;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 6px 16px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 75ms ease;
  }
  .sponsor-footer-close-btn:hover,
  .ad-footer-close-btn:hover {
    background: rgba(255, 255, 255, 0.85);
  }

  /* Top menu button for ads */
  .menu-top-btn-ad {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
  }
  .menu-top-btn-ad:hover {
    background: #10b981;
    color: #022c22;
    border-color: #10b981;
  }

  /* ==========================================================================
     CANIVIBECODEIT.COM HYBRID CARD BUILDER
     ========================================================================== */
  .vibe-builder-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 4px;
  }
  .vibe-builder-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 3px 6px;
    background: #22c55e;
    color: #060911;
    border-radius: 2px;
    flex-shrink: 0;
  }
  .vibe-builder-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-transform: uppercase;
  }
  .vibe-builder-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
  }

  /* Mode switch tabs */
  .vibe-mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
  }
  .vibe-mode-tab {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.65);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 100ms ease;
  }
  .vibe-mode-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }
  .vibe-mode-tab.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #4ade80;
  }

  /* Logo & Monogram selector */
  .vibe-logo-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }
  .vibe-logo-dropzone {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    transition: border 100ms ease;
  }
  .vibe-logo-dropzone:hover {
    border-color: #22c55e;
  }
  .vibe-logo-preview {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #181b20;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 16px;
    color: #22c55e;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  .vibe-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .vibe-logo-text {
    font-family: var(--font-body);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
  }
  .vibe-monogram-input-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  .vibe-monogram-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.05em;
  }
  .vibe-monogram-input {
    width: 52px;
    height: 36px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 900;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    color: #ffffff;
    outline: none;
    transition: border 100ms ease;
  }
  .vibe-monogram-input:focus {
    border-color: #22c55e;
  }
  .vibe-clear-logo-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 6px 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 80ms ease;
  }
  .vibe-clear-logo-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
  }

  /* Style toggle buttons for background gradient vs solid */
  .vibe-style-toggle-row {
    display: flex;
    gap: 4px;
  }
  .vibe-style-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.65);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 80ms ease;
  }
  .vibe-style-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }
  .vibe-style-btn.active {
    background: #22c55e;
    color: #060911;
    border-color: #22c55e;
  }

  /* Color picker & Swatches */
  .vibe-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
  }
  .vibe-color-picker-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
  }
  .vibe-color-picker-input::-webkit-color-swatch-wrapper { padding: 0; }
  .vibe-color-picker-input::-webkit-color-swatch { border: none; border-radius: 3px; }
  .vibe-swatch-btn,
  .vibe-bg-swatch-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 80ms ease;
  }
  .vibe-swatch-btn:hover,
  .vibe-bg-swatch-btn:hover {
    transform: scale(1.15);
  }
  .vibe-swatch-btn.active,
  .vibe-bg-swatch-btn.active {
    box-shadow: 0 0 0 2px #ffffff;
  }

  /* Preview Header Button */
  .sponsor-btn-preview-modal {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 80ms ease;
  }
  .sponsor-btn-preview-modal:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
  }

  /* Dual Preview for Start Gates */
  .vibe-gate-previews {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    align-items: flex-end;
  }
  .vibe-preview-top-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .vibe-preview-pillar-box {
    width: 105px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
  }
  .vibe-preview-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
  }
  .vibe-preview-img-frame {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: #000000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .vibe-preview-img-frame img {
    max-width: 100%;
    display: block;
  }

  /* Empty state badge */
  .sponsor-empty-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 4px 10px;
    border-radius: 2px;
    margin-bottom: 12px;
  }

  /* Interactive Image Cropper */
  .ad-crop-workspace {
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 12px;
  }
  .ad-crop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }
  .ad-crop-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-transform: uppercase;
  }
  .ad-crop-viewport {
    position: relative;
    width: 100%;
    height: 220px;
    background: #07080a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #adCropCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: grab;
    cursor: -webkit-grab;
    touch-action: none;
  }
  #adCropCanvas.grabbing {
    cursor: grabbing;
    cursor: -webkit-grabbing;
  }
  .ad-crop-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px dashed rgba(255, 255, 255, 0.15);
  }
  .ad-crop-toolbar {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .ad-crop-zoom-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .ad-crop-zoom-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
  }
  #adCropZoomInput {
    flex: 1;
    accent-color: #10b981;
    cursor: pointer;
  }
  .ad-crop-zoom-val {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #ffffff;
    min-width: 32px;
  }
  .ad-crop-btn-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
  }
  .ad-crop-mode-btn,
  .ad-crop-reset-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 80ms ease;
  }
  .ad-crop-mode-btn.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
  }
  .ad-crop-hint {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 6px;
  }

  /* Full Preview Lightbox Modal */
  .ad-full-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
  }
  .ad-full-preview-scrim {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(6, 6, 8, 0.94) 0%, rgba(6, 6, 8, 0.99) 100%);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
  }
  .ad-full-preview-dialog {
    position: relative;
    z-index: 10;
    width: min(1080px, 94vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: rgba(10, 11, 15, 0.96);
    border: 1px solid var(--plate-border);
    border-radius: 4px;
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.9);
    overflow: hidden;
  }
  .ad-full-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
  }
  .ad-full-preview-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .ad-full-preview-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #ffffff;
    margin: 2px 0;
    text-transform: uppercase;
  }
  .ad-full-preview-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
  }
  .ad-full-preview-stage {
    flex: 1;
    min-height: 320px;
    max-height: 64vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.3) 0%, rgba(6, 8, 12, 0.8) 100%);
    overflow: auto;
  }
  .ad-full-preview-billboard-truss {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 920px;
  }
  .ad-full-preview-truss-top {
    display: flex;
    justify-content: space-around;
    width: 90%;
    height: 16px;
    margin-bottom: 6px;
  }
  .ad-full-preview-lamp {
    width: 24px;
    height: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.5);
  }
  .ad-full-preview-billboard-screen {
    border: 6px solid #14171f;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.15);
    overflow: hidden;
    background: #000000;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .ad-full-preview-billboard-screen img {
    width: 100%;
    max-height: 52vh;
    object-fit: contain;
    display: block;
  }
  .ad-full-preview-truss-bottom {
    display: flex;
    justify-content: space-between;
    width: 70%;
    height: 28px;
    margin-top: 4px;
  }
  .ad-full-preview-frame-leg {
    width: 18px;
    height: 100%;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }
  .ad-full-preview-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
  }
  .ad-full-preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
  }
  .ad-full-preview-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .ad-btn-test-link {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid #38bdf8;
    color: #38bdf8;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 2px;
    text-decoration: none;
    transition: all 80ms ease;
  }
  .ad-btn-test-link:hover {
    background: #38bdf8;
    color: #022030;
  }

  @media (max-width: 860px) {
    .sponsor-modal-body,
    .ad-modal-body {
      flex-direction: column;
      overflow-y: auto;
    }
    .sponsor-packages-col,
    .ad-packages-col {
      border-right: none;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      flex: none;
      max-height: 50vh;
    }
    .sponsor-checkout-col,
    .ad-checkout-col {
      min-width: 0;
      flex: none;
    }
  }


  /* ==========================================================================
     MULTIPLAYER — MAIN MENU PANEL, LEADERBOARD, CHAT, NAMETAGS
     ========================================================================== */
  .mp-menu-panel {
    position: absolute;
    top: clamp(74px, 9vh, 96px);
    right: clamp(24px, 4vw, 56px);
    z-index: 60;
    width: min(348px, calc(100vw - 48px));
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    pointer-events: auto;
    background: rgba(9, 9, 11, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 2px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.62);
    padding: 16px 18px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.22) transparent;
  }
  .mp-menu-panel::-webkit-scrollbar { width: 4px; }
  .mp-menu-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

  .mp-menu-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    margin-bottom: 12px;
  }
  .mp-menu-kicker {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: rgba(255,255,255,0.38);
    text-transform: uppercase;
    margin-bottom: 2px;
  }
  .mp-menu-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    color: #ffffff;
    text-transform: uppercase;
  }
  .mp-menu-status {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    padding: 4px 6px;
    white-space: nowrap;
    text-transform: uppercase;
  }

  .mp-menu-section { margin-bottom: 10px; }
  .mp-field { display: flex; flex-direction: column; gap: 4px; }
  .mp-field-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.5);
  }
  .mp-input,
  .mp-code-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 2px;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 8px 10px;
    outline: none;
    transition: border-color 0.12s ease, background 0.12s ease;
    user-select: text;
    -webkit-user-select: text;
  }
  .mp-input:focus,
  .mp-code-input:focus {
    border-color: #38bdf8;
    background: rgba(56,189,248,0.08);
    box-shadow: 0 0 0 1px rgba(56,189,248,0.35);
  }

  .mp-colors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
  }
  .mp-color-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.48);
  }
  .mp-color-field input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
  }
  .mp-color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
  .mp-color-field input[type="color"]::-webkit-color-swatch { border: none; }

  .mp-btn {
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.07);
    color: #ffffff;
    border-radius: 2px;
    padding: 9px 12px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    line-height: 1.15;
  }
  .mp-btn:hover:not(:disabled) {
    background: #ffffff;
    color: #060608;
    border-color: #ffffff;
  }
  .mp-btn:disabled { opacity: 0.45; cursor: wait; }
  .mp-btn small {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.1em;
    opacity: 0.55;
  }
  .mp-btn-primary {
    width: 100%;
    background: #ffffff;
    border-color: #ffffff;
    color: #060608;
  }
  .mp-btn-primary:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #060608;
  }
  .mp-btn-primary small { opacity: 0.7; }
  .mp-btn-half { flex: 1; }
  .mp-btn-danger {
    width: 100%;
    margin-top: 6px;
    border-color: rgba(248,113,113,0.45);
    color: #fca5a5;
    background: rgba(248,113,113,0.08);
  }
  .mp-btn-danger:hover:not(:disabled) {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
  }

  .mp-create-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
  }
  .mp-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
    flex: 0 0 auto;
  }
  .mp-switch input { position: absolute; opacity: 0; pointer-events: none; }
  .mp-switch-track {
    width: 30px;
    height: 16px;
    border-radius: 9px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    transition: background 0.12s ease;
  }
  .mp-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.12s ease;
  }
  .mp-switch input:checked + .mp-switch-track { background: #ffffff; border-color: #ffffff; }
  .mp-switch input:checked + .mp-switch-track .mp-switch-thumb {
    transform: translateX(14px);
    background: #060608;
  }
  .mp-switch-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.62);
  }
  .mp-switch.is-private .mp-switch-track { background: rgba(248,113,113,0.35); border-color: rgba(248,113,113,0.5); }

  .mp-join-code {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  .mp-code-input {
    text-align: center;
    font-size: 17px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 8px 6px;
  }
  .mp-join-code .mp-btn { padding: 8px 10px; }

  .mp-room-line {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    padding: 7px 8px;
    border: 1px solid rgba(56,189,248,0.35);
    background: rgba(56,189,248,0.08);
    color: #7dd3fc;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    border-radius: 2px;
    text-transform: uppercase;
  }
  .mp-panel-status {
    margin-top: 9px;
    font-family: var(--font-mono);
    font-size: 9px;
    line-height: 1.45;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.03em;
    min-height: 13px;
  }
  .mp-menu-panel.is-busy .mp-panel-status { color: #7dd3fc; }

  /* Live leaderboard HUD */
  .mp-leaderboard {
    position: fixed;
    top: 58px;
    right: 16px;
    width: 304px;
    max-height: min(58vh, 520px);
    z-index: 86;
    display: none;
    flex-direction: column;
    background: rgba(9, 9, 11, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 2px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.55);
    overflow: hidden;
    pointer-events: auto;
  }
  .mp-leaderboard.visible { display: flex; }
  body.in-menu .mp-leaderboard { display: none !important; }

  .mp-lb-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .mp-lb-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .mp-lb-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #ffffff;
    text-transform: uppercase;
  }
  .mp-lb-room {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: #7dd3fc;
  }
  .mp-lb-count-wrap { display: inline-flex; align-items: center; gap: 5px; }
  .mp-lb-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #84cc16;
    box-shadow: 0 0 7px rgba(132,204,22,0.8);
    animation: mpLivePulse 1.8s ease-in-out infinite;
  }
  @keyframes mpLivePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
  }
  .mp-lb-count {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
  }
  .mp-lb-status {
    padding: 5px 12px;
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.36);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-transform: uppercase;
  }
  .mp-lb-list {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
  }
  .mp-lb-list::-webkit-scrollbar { width: 4px; }
  .mp-lb-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

  .mp-lb-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.12s ease;
  }
  .mp-lb-row.is-local { background: rgba(56,189,248,0.1); }
  .mp-lb-row.is-host .mp-lb-name { color: #fde68a; }
  .mp-lb-rank {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    width: 16px;
    flex: 0 0 auto;
  }
  .mp-lb-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,0.3);
  }
  .mp-lb-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
  }
  .mp-lb-name {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mp-lb-combo {
    font-family: var(--font-mono);
    font-size: 8px;
    color: rgba(255,255,255,0.38);
    letter-spacing: 0.06em;
  }
  .mp-lb-score {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
  }
  .mp-lb-kick {
    flex: 0 0 auto;
    margin-left: 2px;
    padding: 3px 5px;
    font-family: var(--font-display);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fca5a5;
    background: rgba(248,113,113,0.1);
    border: 1px solid rgba(248,113,113,0.38);
    border-radius: 2px;
    cursor: pointer;
  }
  .mp-lb-kick:hover { background: #ef4444; border-color: #ef4444; color: #ffffff; }
  .mp-lb-empty {
    padding: 16px 12px;
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(255,255,255,0.35);
    text-align: center;
  }
  .mp-lb-footer {
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.25);
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: right;
  }

  /* Bottom-left chat */
  .mp-chat {
    position: fixed;
    left: 16px;
    bottom: 18px;
    width: min(348px, calc(100vw - 32px));
    z-index: 86;
    display: none;
    flex-direction: column;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 2px;
    box-shadow: 0 14px 36px rgba(0,0,0,0.5);
    overflow: hidden;
    pointer-events: auto;
  }
  .mp-chat.visible { display: flex; }
  body.in-menu .mp-chat { display: none !important; }

  .mp-chat-log {
    height: 126px;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
    background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(0,0,0,0.05));
  }
  .mp-chat-log::-webkit-scrollbar { width: 4px; }
  .mp-chat-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }
  .mp-chat-line {
    font-family: var(--font-body);
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255,255,255,0.82);
    word-break: break-word;
    display: flex;
    gap: 5px;
    align-items: baseline;
  }
  .mp-chat-time {
    font-family: var(--font-mono);
    font-size: 8px;
    color: rgba(255,255,255,0.28);
    flex: 0 0 auto;
  }
  .mp-chat-name {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #7dd3fc;
    flex: 0 0 auto;
  }
  .mp-chat-text { color: rgba(255,255,255,0.85); }
  .mp-chat-line.is-local .mp-chat-name { color: #a3e635; }
  .mp-chat-line.is-system {
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(255,255,255,0.35);
    text-align: center;
    padding: 1px 0;
  }
  .mp-chat-line.is-system .mp-chat-text { color: rgba(255,255,255,0.35); }

  .mp-chat-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 6px 8px;
    background: rgba(255,255,255,0.035);
  }
  .mp-chat-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 11px;
    padding: 4px 2px;
    user-select: text;
    -webkit-user-select: text;
  }
  .mp-chat-input::placeholder { color: rgba(255,255,255,0.3); }
  .mp-chat-hint {
    font-family: var(--font-mono);
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.25);
    white-space: nowrap;
  }
  .mp-chat.typing { border-color: rgba(56,189,248,0.65); box-shadow: 0 0 0 1px rgba(56,189,248,0.35), 0 14px 36px rgba(0,0,0,0.5); }
  .mp-chat.typing .mp-chat-hint { color: #7dd3fc; }

  /* Floating HTML nametags */
  #mpNameTags {
    position: fixed;
    inset: 0;
    z-index: 70;
    pointer-events: none;
    overflow: hidden;
  }
  .mp-nametag {
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 3px 7px;
    background: rgba(9, 9, 11, 0.72);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 2px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    white-space: nowrap;
    will-change: transform, opacity;
    transform-origin: 50% 100%;
  }
  .mp-nametag-name {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-transform: uppercase;
    line-height: 1.1;
  }
  .mp-nametag-meta {
    font-family: var(--font-mono);
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #a3e635;
    line-height: 1.1;
  }
  .mp-nametag-trick {
    display: none;
    font-family: var(--font-mono);
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #7dd3fc;
    text-transform: uppercase;
    line-height: 1.1;
  }

  /* Toast */
  #mpToast {
    position: fixed;
    left: 50%;
    bottom: 52px;
    transform: translate(-50%, 14px);
    z-index: 210;
    padding: 9px 16px;
    background: rgba(9, 9, 11, 0.92);
    border: 1px solid rgba(255,255,255,0.2);
    border-left: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    box-shadow: 0 12px 34px rgba(0,0,0,0.55);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: center;
    max-width: min(460px, calc(100vw - 32px));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  #mpToast.visible { opacity: 1; transform: translate(-50%, 0); }

  @media (max-width: 980px) {
    .mp-menu-panel {
      top: 70px;
      right: 16px;
      width: min(320px, calc(100vw - 32px));
      max-height: calc(100vh - 150px);
    }
  }
  @media (max-width: 760px) {
    .mp-menu-panel {
      top: auto;
      bottom: 12px;
      right: 12px;
      left: 12px;
      width: auto;
      max-height: 48vh;
    }
    .mp-chat { width: calc(100vw - 24px); left: 12px; bottom: 12px; }
    .mp-chat-log { height: 100px; }
    .mp-leaderboard { width: min(290px, calc(100vw - 24px)); right: 12px; top: 52px; max-height: 52vh; }
    .mp-nametag { transform-origin: 50% 100%; }
  }

  /* ==========================================================================
     DEDICATED MENU SUB-VIEWS — HOME / MULTIPLAYER / CUSTOMIZE
     ========================================================================== */
  .menu-subview-header {
    position: absolute;
    top: clamp(22px, 4vh, 42px);
    left: clamp(36px, 6vw, 84px);
    z-index: 90;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    pointer-events: none;
  }
  body.menu-view-multiplayer .menu-subview-header,
  body.customizer-open .menu-subview-header {
    display: flex;
  }
  .menu-subview-back {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 8px 12px;
    background: #121417;
    border: 1px solid #2a2d32;
    border-radius: 2px;
    color: rgba(255, 255, 255, 0.86);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
  }
  .menu-subview-back:hover,
  .menu-subview-back:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
  }
  .menu-subview-back-arrow {
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--font-mono);
    font-size: 16px;
    line-height: 1;
  }
  .menu-subview-back-key {
    color: rgba(255, 255, 255, 0.42);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
  }
  .menu-subview-title-wrap {
    padding-left: 2px;
  }
  .menu-subview-kicker {
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.45);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }
  .menu-subview-title {
    margin: 0;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: clamp(22px, 2.5vw, 30px);
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
  }
  .menu-orbit-hint {
    position: absolute;
    left: clamp(36px, 6vw, 84px);
    bottom: clamp(28px, 4vh, 48px);
    z-index: 74;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    background: rgba(18, 20, 23, 0.82);
    border: 1px solid #2a2d32;
    border-radius: 2px;
    color: rgba(255, 255, 255, 0.42);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    pointer-events: none;
  }
  body.customizer-open .menu-orbit-hint { display: flex; }
  .menu-orbit-hint-key {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 700;
  }
  body.customizer-open canvas { cursor: grab; }
  body.customizer-open canvas.is-dragging { cursor: grabbing; }

  body.menu-view-multiplayer .menu-nav-col,
  body.menu-view-multiplayer .menu-telemetry-plate,
  body.menu-view-multiplayer .menu-top-actions,
  body.customizer-open .menu-nav-col,
  body.customizer-open .menu-telemetry-plate,
  body.customizer-open .menu-top-actions,
  body.customizer-open #mpMenuPanel {
    display: none !important;
  }
  body.menu-view-multiplayer .menu-scrim {
    background: linear-gradient(90deg, rgba(6, 6, 8, 0.96) 0%, rgba(6, 6, 8, 0.88) 32%, rgba(6, 6, 8, 0.5) 70%, rgba(6, 6, 8, 0.16) 100%);
  }
  body.customizer-open .menu-scrim {
    background: linear-gradient(90deg, rgba(6, 6, 8, 0.94) 0%, rgba(6, 6, 8, 0.74) 30%, rgba(6, 6, 8, 0.2) 65%, rgba(6, 6, 8, 0.02) 100%);
  }

  /* Home hides the old floating multiplayer widget completely. */
  .mp-menu-panel { display: none; }

  /* Dedicated MULTIPLAYER view */
  body.menu-view-multiplayer #mpMenuPanel {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: clamp(136px, 18vh, 174px);
    left: clamp(36px, 6vw, 84px);
    right: clamp(28px, 4vw, 56px);
    bottom: clamp(24px, 3.5vh, 44px);
    width: auto;
    max-height: none;
    overflow-y: auto;
    padding: 20px 22px 18px;
    background: linear-gradient(180deg, rgba(18, 20, 23, 0.97), rgba(9, 10, 12, 0.97));
    border: 1px solid #2a2d32;
    border-radius: 2px;
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.7);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  }
  body.menu-view-multiplayer #mpMenuPanel::-webkit-scrollbar { width: 4px; }
  body.menu-view-multiplayer #mpMenuPanel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }
  body.menu-view-multiplayer .mp-menu-head {
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #2a2d32;
  }
  body.menu-view-multiplayer .mp-menu-title { font-size: 28px; }
  body.menu-view-multiplayer .mp-menu-status {
    padding: 5px 8px;
    font-size: 9px;
  }
  .mp-identity-bar {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(210px, 300px) auto;
    gap: 14px;
    align-items: end;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid #2a2d32;
    border-radius: 2px;
  }
  .mp-identity-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }
  .mp-identity-kicker {
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
  }
  .mp-identity-note {
    color: rgba(255, 255, 255, 0.38);
    font-family: var(--font-mono);
    font-size: 9px;
    line-height: 1.4;
    letter-spacing: 0.04em;
  }
  .mp-identity-field { min-width: 0; }
  .mp-identity-customize {
    width: auto;
    min-height: 38px;
    white-space: nowrap;
  }
  .mp-view-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 14px;
    margin-top: 14px;
  }
  .mp-lower-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
    gap: 14px;
    margin-top: 14px;
  }
  .mp-quick-card {
    min-height: 174px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 6px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    color: #ffffff;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
  }
  .mp-quick-card:hover:not(:disabled) {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 1px #ffffff inset;
    transform: translateY(-1px);
  }
  .mp-quick-card:disabled { opacity: 0.5; cursor: wait; }
  .mp-quick-kicker {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.45);
  }
  .mp-quick-title {
    max-width: 460px;
    font-family: var(--font-display);
    font-size: clamp(22px, 2.6vw, 34px);
    font-weight: 900;
    letter-spacing: 0.035em;
    line-height: 0.98;
    text-transform: uppercase;
  }
  .mp-quick-meta {
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: rgba(255, 255, 255, 0.55);
  }
  .mp-view-card {
    min-width: 0;
    padding: 15px 16px 14px;
    background: #121417;
    border: 1px solid #2a2d32;
    border-radius: 2px;
  }
  .mp-view-card .mp-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .mp-card-kicker {
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.38);
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.18em;
  }
  .mp-card-title {
    margin: 0;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .mp-card-index,
  .mp-card-badge {
    flex: none;
    color: rgba(255, 255, 255, 0.42);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .mp-card-badge {
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 6px;
  }
  .mp-card-note {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.35);
    font-family: var(--font-mono);
    font-size: 9px;
    line-height: 1.45;
    letter-spacing: 0.03em;
  }
  .mp-view-card .mp-create-row {
    margin-top: 14px;
    gap: 14px;
  }
  .mp-create-btn {
    flex: 1;
    min-height: 38px;
  }
  .mp-join-card .mp-join-code {
    grid-template-columns: minmax(110px, 1fr) auto;
    gap: 10px;
    margin-top: 14px;
  }
  .mp-join-card .mp-code-input {
    min-height: 42px;
    font-size: 20px;
    letter-spacing: 0.34em;
    padding-left: 14px;
  }
  .mp-join-code-btn {
    min-height: 42px;
    padding: 8px 14px;
    white-space: nowrap;
  }
  .mp-public-lobbies {
    margin-top: 8px;
    min-height: 42px;
  }
  .mp-lobby-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    min-height: 42px;
    padding: 7px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }
  .mp-lobby-row:last-child { border-bottom: none; }
  .mp-lobby-code {
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.1em;
  }
  .mp-lobby-host {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }
  .mp-lobby-players {
    color: rgba(255, 255, 255, 0.38);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
  }
  .mp-lobby-join {
    min-height: 28px;
    padding: 4px 9px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    color: rgba(255, 255, 255, 0.82);
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
  }
  .mp-lobby-join:hover:not(:disabled) {
    background: #ffffff;
    border-color: #ffffff;
    color: #060608;
  }
  .mp-lobby-join:disabled { opacity: 0.45; cursor: default; }
  .mp-lobby-empty {
    padding: 16px 4px 8px;
    color: rgba(255, 255, 255, 0.28);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-align: center;
  }
  body.menu-view-multiplayer .mp-room-line { margin-top: 14px; }
  body.menu-view-multiplayer #mpLeaveBtn { max-width: 280px; margin-top: 10px; }
  body.menu-view-multiplayer .mp-panel-status {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  body.menu-view-multiplayer #mpMenuPanel.in-room .mp-identity-bar { margin-bottom: 14px; }

  /* Locker right rail in the dedicated CUSTOMIZE view. */
  body.customizer-open .locker-panel {
    top: clamp(136px, 18vh, 174px);
    right: clamp(24px, 3vw, 44px);
    max-height: calc(100vh - clamp(164px, 22vh, 206px));
  }
  body.customizer-open .locker-head {
    border-bottom: 1px solid #2a2d32;
  }
  body.customizer-open .locker-part {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 0.9fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 5px 0 6px;
  }
  body.customizer-open .locker-part-head {
    grid-column: 1 / -1;
  }
  body.customizer-open .locker-swatches {
    grid-column: 1;
    margin: 2px 0 0;
  }
  body.customizer-open .locker-controls {
    grid-column: 2;
    margin-top: 2px;
  }
  body.customizer-open .locker-swatch {
    height: 15px;
  }
  .locker-identity {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #2a2d32;
    background: rgba(255, 255, 255, 0.015);
  }
  .locker-identity-field {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
  }
  .locker-identity-label {
    color: rgba(255, 255, 255, 0.45);
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.14em;
  }
  .locker-nickname-input {
    width: 100%;
    height: 30px;
    padding: 0 9px;
    background: #0b0d0f;
    border: 1px solid #2a2d32;
    border-radius: 2px;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    outline: none;
  }
  .locker-nickname-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
  }
  .locker-identity-note {
    flex: none;
    padding-bottom: 8px;
    color: rgba(255, 255, 255, 0.26);
    font-family: var(--font-mono);
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 0.12em;
  }

  @media (max-width: 1050px) {
    .mp-view-grid,
    .mp-lower-grid {
      grid-template-columns: 1fr;
    }
    .mp-identity-bar {
      grid-template-columns: 1fr minmax(180px, 260px);
    }
    .mp-identity-customize {
      grid-column: 1 / -1;
      justify-self: start;
    }
  }
  @media (max-width: 768px) {
    .menu-subview-header {
      top: 16px;
      left: 16px;
      right: 16px;
    }
    .menu-subview-title { font-size: 20px; }
    .menu-orbit-hint {
      left: 16px;
      bottom: 8px;
    }
    body.customizer-open .menu-orbit-hint { display: none; }
    body.menu-view-multiplayer #mpMenuPanel {
      top: 116px;
      left: 16px;
      right: 16px;
      bottom: 12px;
      padding: 16px;
    }
    body.lobby-setup-open .lobby-setup-panel {
      top: auto;
      right: 12px;
      bottom: 12px;
      transform: none;
      width: calc(100vw - 24px);
      max-height: 66vh;
    }
    .lobby-setup-title { font-size: 18px; }
    .mp-identity-bar {
      grid-template-columns: 1fr;
      align-items: stretch;
    }
    .mp-identity-customize { grid-column: auto; width: 100%; }
    .mp-quick-card { min-height: 150px; padding: 16px; }
    .mp-quick-title { font-size: 22px; }
    .mp-lobby-row {
      grid-template-columns: 46px minmax(0, 1fr) auto auto;
      gap: 8px;
    }
    .mp-lobby-code { font-size: 16px; }
    .mp-lobby-players { font-size: 8px; }
    body.customizer-open .locker-panel {
      top: auto;
      left: 12px;
      right: 12px;
      bottom: 12px;
      width: auto;
      max-height: 62vh;
    }
  }
