﻿:root {
    /* Standard-Theme (Cyberpunk) */
    --theme-primary: #00ffff;
    --theme-primary-rgb: 0, 255, 255;
    --theme-secondary: #ff00ff;
    --theme-secondary-rgb: 255, 0, 255;
    --bg-color: #070810;

    /* Sanfte Übergänge für Theme-Farben */
    --theme-transition: background 0.8s ease, border-color 0.8s ease, box-shadow 0.8s ease, color 0.8s ease;
}

/* AUTH & PRELOADER (Global) */
.auth-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color, #070810);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.6s ease;
    pointer-events: auto;
}

.auth-prompt {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 320px;
    box-sizing: border-box;
}

.auth-title {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 4px;
    margin-bottom: 5px;
}

.auth-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.auth-input {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #00ffff;
    color: #ffffff;
    width: 100%;
    border-radius: 8px;
    outline: none;
    text-align: center;
    font-family: monospace;
    font-size: 16px;
    box-sizing: border-box;
}

.auth-btn {
    padding: 12px;
    background: #00ffff;
    border: none;
    color: #000000;
    font-weight: bold;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    box-sizing: border-box;
}

#pwError {
    color: #ff3131;
    font-size: 12px;
    height: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Alt-Design (Legacy fallback) */
body:not(.theme-survival):not(.use-new-orb) #preloaderContainer {
    display: none;
    position: relative;
    width: 180px;
    height: 180px;
    justify-content: center;
    align-items: center;
}

body:not(.theme-survival):not(.use-new-orb) #preloaderSpinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

body:not(.theme-survival):not(.use-new-orb) #preloaderLogo {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    font-family: sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
}

body:not(.theme-survival):not(.use-new-orb) #preloaderLogo .preloader-logo-line:first-child {
    font-size: 20px;
    letter-spacing: 1px;
}

body:not(.theme-survival):not(.use-new-orb) #preloaderLogo .preloader-logo-line:last-child {
    font-size: 20px;
    letter-spacing: 1.2px;
}

/* Neu-Design (Orb) */
body.theme-survival #preloaderContainer,
body.use-new-orb #preloaderContainer {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#preloaderLoadingLabel {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 3px;
    padding-left: 3px;
    font-family: monospace;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    opacity: 0.6;
}

.preloader-orb {
    position: relative;
    width: 100px;
    height: 100px;
}

#preloaderArc1 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    animation: spin-reverse 1.1s linear infinite;
}

#preloaderArc2 {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: spin 0.85s linear infinite;
}

#preloaderDomain {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 2px;
    padding-left: 3px;
    font-family: monospace;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    opacity: 0.5;
}

/* UI MODULE SETTINGS BUTTONS */
#openThemePickerBtn {
    padding: 6px 12px;
    font-size: 11px;
    width: auto;
    min-width: 120px;
    max-width: 140px;
    margin-bottom: 5px;
}

#themeAutoCycleBtn {
    margin-right: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 14px;
}

/* DynaPuff (Rund & Jelly) */
@font-face {
    font-family: 'DynaPuff';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/dynapuff-v9-latin-600.woff2') format('woff2');
}

@font-face {
    font-family: 'DynaPuff';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/dynapuff-v9-latin-700.woff2') format('woff2');
}

/* Fredoka (Sauber & Modern) */
@font-face {
    font-family: 'Fredoka';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/fredoka-v17-latin-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Fredoka';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/fredoka-v17-latin-700.woff2') format('woff2');
}

/* Bungee Inline (Arcade & Cyberpunk) */
@font-face {
    font-family: 'Bungee Inline';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/bungee-inline-v19-latin-regular.woff2') format('woff2');
}


/* ================================================================
 * 2. BASIS-SETUP & SCROLLBAR
 * ================================================================ */
body,
html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    background-color: #070810;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    transition: background-color 0.5s ease;
}

html.outer-bg-active,
body.outer-bg-active {
    background-color: transparent !important;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

#gameCanvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background-color: transparent !important;
}

#bgWebGLCanvas,
#bgRainCanvas {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5;
    pointer-events: none;
    display: none;
}

#uiLayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

.hidden {
    display: none !important;
}


/* ================================================================
 * 3. HUD & STATUS (Score, Ping, FPS, Toggles)
 * ================================================================ */
.score-board {
    position: fixed;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.8);
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 10px;
    border-radius: 10px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4);
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.2);
    transition: var(--theme-transition);
    z-index: 50;
}

#debugToggleBtn,
#feedToggleBtn,
#lagSmoothingToggleBtn,
#gfxSelectMainWrapper,
.low-graphics-toggle,
.ui-toggle-btn {
    position: absolute;
    left: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4);
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.8s ease-in-out, background 0.2s;
    z-index: 110;
    line-height: normal;
    white-space: nowrap;
}

.ui-toggle-btn {
    padding-bottom: 5px;
}

/* Korrektur für Augen-Icon Baseline */
#debugToggleBtn:hover,
#feedToggleBtn:hover,
#lagSmoothingToggleBtn:hover,
#gfxSelectMainWrapper:hover,
.low-graphics-toggle:hover,
.ui-toggle-btn:hover {
    background: rgba(var(--theme-primary-rgb), 0.2);
}

#debugToggleBtn input,
#feedToggleBtn input,
#lagSmoothingToggleBtn input,
.low-graphics-toggle input[type="checkbox"],
.ui-toggle-btn input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--theme-primary);
    width: 16px;
    height: 16px;
    margin: 0;
}

#debugToggleBtn span,
#feedToggleBtn span,
#lagSmoothingToggleBtn span,
#gfxSelectMainWrapper span,
.low-graphics-toggle span,
.ui-toggle-btn span {
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#debugHudStack {
    position: absolute;
    top: 76px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    z-index: 110;
    pointer-events: none;
}

#debugHudStack #debugToggleBtn,
#debugHudStack #feedToggleBtn,
#debugHudStack #lagSmoothingToggleBtn,
#debugHudStack #gfxSelectMainWrapper,
#debugHudStack #debugOverlay {
    position: static;
    top: auto;
    left: auto;
}

#debugHudStack #debugToggleBtn,
#debugHudStack #lagSmoothingToggleBtn,
#debugHudStack #gfxSelectMainWrapper {
    pointer-events: auto;
}

#debugToggleBtn {
    top: 68px;
}

.low-graphics-toggle {
    top: 83px;
}

#gfxSelectMainWrapper {
    top: 95px;
    padding: 2px 8px;
}

.gfx-select-label {
    margin-right: 5px;
}

#gfxSelectMain {
    background: transparent;
    color: var(--theme-primary);
    border: none;
    font-weight: bold;
    outline: none;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-family: inherit;
    padding: 0;
}

#gfxSelectMain option {
    background: #0d0d1a;
    color: white;
}

#debugOverlay {
    position: absolute;
    top: 130px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 10;
    pointer-events: none;
}

#pingDisplay,
#statsDisplay,
#uptimeDisplay {
    font-size: 12px;
    font-family: monospace;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: none;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 9px;
    border-radius: 9px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.45);
    box-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.9);
    transition: opacity 0.8s ease-in-out;
    white-space: nowrap;
}

#uptimeDisplay {
    color: var(--theme-primary);
}

.prof-phase {
    font-size: 11px;
    font-family: monospace;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 9px;
    border-radius: 9px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.45);
    box-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.9);
    transition: opacity 0.8s ease-in-out;
    white-space: nowrap;
}

.prof-subphase {
    padding-left: 20px !important;
    font-size: 10px !important;
}

.prof-frame-main {
    color: #ffaa00;
}

.prof-spike-log {
    color: #ff5555;
}

.fps-display {
    display: none;
}

.status-good {
    color: #39ff14 !important;
}

.status-ok {
    color: #ccff00 !important;
}

.status-bad {
    color: #ff3131 !important;
}

.status-none {
    color: rgba(255, 255, 255, 0.8) !important;
}

#fpsToast {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff3300, #ff8800);
    color: #fff;
    padding: 12px 20px;
    border-radius: 25px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(255, 50, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: top 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    pointer-events: auto;
}

#fpsToast.show {
    top: 20px;
}

#fpsToast .close-btn {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    line-height: 1;
}

#fpsToast .close-btn:hover {
    background: rgba(0, 0, 0, 0.4);
}

#broadcastBanner {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 140, 0, 0.93);
    color: #fff;
    padding: 8px 28px;
    border-radius: 0 0 12px 12px;
    font-family: Arial, sans-serif;
    font-size: 15px;
    font-weight: bold;
    z-index: 9999;
    text-align: center;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    letter-spacing: 0.02em;
}

#reconnectOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    text-align: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(var(--theme-primary-rgb), 0.1);
    border-top: 5px solid var(--theme-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(var(--theme-primary-rgb), 0.5);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

.reconnect-title {
    color: var(--theme-primary);
    text-shadow: 0 0 10px var(--theme-primary);
    font-size: 24px;
    margin-bottom: 10px;
    margin-top: 0;
}

.reconnect-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    margin: 0;
}

#debugConsole {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 250px;
    max-width: 50vw;
    height: 110px;
    background: rgba(0, 0, 0, 0.5);
    color: #39ff14;
    font-family: monospace;
    font-size: 10px;
    z-index: 9999;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(57, 255, 20, 0.2);
    border-radius: 5px;
    pointer-events: none;
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.1);
    display: none;
}

.debug-time {
    color: #aaaaaa;
}

.debug-info {
    color: #39ff14;
}

.debug-warn {
    color: #ffcc00;
}

.debug-err {
    color: #ff3131;
    font-weight: bold;
}

.version-label {
    position: absolute;
    bottom: 0px;
    right: 0px;
    background-color: rgba(0, 0, 0, 0.75);
    color: rgba(255, 255, 255, 0.65);
    font-family: monospace;
    font-weight: bold;
    font-size: 11px;
    height: 18px;
    line-height: 18px;
    padding: 0 6px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10 !important;
}

.legal-footer {
    position: static;
    width: 100%;
    margin: 14px 0 0 0;
    padding: 0 10px;
    font-size: 10px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.4);
}

.legal-footer a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: color 0.2s;
    margin: 0 1px;
}

.legal-footer a:hover {
    color: var(--theme-primary);
    text-shadow: 0 0 5px rgba(var(--theme-primary-rgb), 0.5);
}

.legal-footer-copy {
    margin: 0 auto;
    max-width: none;
    width: 100%;
    padding: 0;
    font-size: 10px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.52);
    text-align: justify;
    text-align-last: center;
    hyphens: auto;
}


/* ================================================================
 * 4. LEADERBOARD & MINIMAP
 * ================================================================ */
.leaderboard {
    position: fixed;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 5px;
    border-radius: 10px;
    min-width: 215px;
    max-width: 35vw;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4);
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.2);
    pointer-events: auto;
    box-sizing: border-box;
}

.leaderboard .panel-header {
    border-bottom: none;
    padding-bottom: 2px;
    margin-bottom: 6px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.leaderboard .panel-title {
    font-size: 13px;
    display: block;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 5px rgba(var(--theme-primary-rgb), 0.8);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 24px;
    box-sizing: border-box;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1px;
    padding: 1px 10px;
    border-radius: 4px;
    line-height: 18px;
    overflow: hidden;
    transition: background 0.2s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.leaderboard-row-left {
    display: flex;
    align-items: center;
    overflow: hidden;
    flex-grow: 1;
}

.leaderboard-rank {
    display: inline-block;
    flex-shrink: 0;
    color: inherit;
    margin-right: 2px;
}

.leaderboard-icon {
    font-size: 12px;
    line-height: 1;
    min-width: 1em;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
    margin-right: 1px;
    margin-left: -2px;
}

.leaderboard-name-txt {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-score {
    margin-left: 8px;
    pointer-events: none;
    flex-shrink: 0;
}

.toggle-leaderboard-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    font-size: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
    transition: opacity 0.2s;
    line-height: 1;
    z-index: 5;
}

.toggle-leaderboard-btn:hover {
    opacity: 0.8;
}

/* ── Survival Feed Panel ─────────────────────────────────────── */
.survival-feed {
    position: fixed;
    right: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 5px;
    border-radius: 10px;
    width: 215px;
    min-width: 215px;
    max-width: 215px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4);
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.2);
    pointer-events: auto;
    transition: top 0.2s, width 0.2s, max-width 0.2s;
    box-sizing: border-box;
}

.survival-feed.console-expanded {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
}

.survival-feed .panel-header {
    border-bottom: none;
    padding-bottom: 1px;
    margin-bottom: 2px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.survival-feed .panel-title {
    font-size: 13px;
    display: block;
    width: 100%;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 5px rgba(var(--theme-primary-rgb), 0.8);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0;
    box-sizing: border-box;
}

.toggle-survivalfeed-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    font-size: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
    transition: opacity 0.2s;
    line-height: 1;
    z-index: 5;
    color: rgba(255, 255, 255, 0.9);
}

.toggle-survivalfeed-btn:hover {
    opacity: 0.8;
}

.sf-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    font-size: 12px;
    transition: background 0.2s, opacity 0.4s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.sf-entry.sf-full {
    opacity: 0.45;
}

.sf-badge {
    font-size: 10px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    flex-shrink: 0;
}

.sf-info {
    flex: 1;
    text-align: center;
}

.sf-timer {
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
}

.sf-join-btn {
    background: rgba(57, 255, 20, 0.18);
    border: 1px solid rgba(57, 255, 20, 0.5);
    color: #39ff14;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}

.sf-join-btn:hover {
    background: rgba(57, 255, 20, 0.35);
}

.sf-join-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.sf-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    padding: 6px 0 2px;
}

/* Leaderboard Hover & Click (Immer aktiv) */
.leaderboard-entry {
    cursor: pointer;
    pointer-events: auto !important;
}

.leaderboard-entry:hover {
    background: rgba(var(--theme-primary-rgb), 0.2) !important;
}

/* Phasen-Countdown */
.phase-countdown {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Bungee Inline', 'Fredoka', cursive;
    font-size: 120px;
    font-weight: 900;
    color: #ff3131;
    text-shadow: 0 0 30px rgba(255, 49, 49, 0.8), 0 0 10px #ffffff;
    z-index: 50000;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dangerBlink {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes iconPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px red);
    }

    50% {
        transform: scale(1.3);
        filter: drop-shadow(0 0 8px red);
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px red);
    }
}

@keyframes bombCriticalPulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 5px #ff0000;
        filter: drop-shadow(0 0 2px #ff0000);
        color: #fff;
    }

    50% {
        transform: scale(1.5);
        text-shadow: 0 0 15px #ff0000, 0 0 25px #ff3131;
        filter: drop-shadow(0 0 10px #ff0000);
        color: #ff3131;
    }

    100% {
        transform: scale(1);
        text-shadow: 0 0 5px #ff0000;
        filter: drop-shadow(0 0 2px #ff0000);
        color: #fff;
    }
}

.bomb-critical {
    animation: bombCriticalPulse 0.5s infinite !important;
}

.minimap-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    aspect-ratio: 1 / 1;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(var(--theme-primary-rgb), 0.3);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
    z-index: 50;
    pointer-events: auto;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#minimap {
    display: block;
    width: 100%;
    height: 100%;
}

.minimap-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 50;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

.minimap-wrapper .minimap-container {
    position: relative;
    bottom: 0;
    right: 0;
}

.toggle-minimap-btn {
    position: absolute;
    top: 0;
    right: 2px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    z-index: 55;
    pointer-events: auto;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

body:not(.is-playing) .minimap-container {
    cursor: crosshair;
}

body:not(.is-playing) .minimap-container:hover {
    border-color: rgba(var(--theme-primary-rgb), 0.8);
    box-shadow: 0 0 20px rgba(var(--theme-primary-rgb), 0.5);
}


/* ================================================================
 * 5. SPECTATOR UI
 * ================================================================ */
.spectator-ui {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.95);
    padding: 5px 10px;
    border-radius: 15px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    pointer-events: auto;
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.2);
    z-index: 50;
    width: 260px;
    box-sizing: border-box;
}

.spectator-ui .panel-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    border-bottom: none;
    padding-bottom: 1px;
    margin-bottom: 2px;
    position: relative;
    min-height: 26px;
}

.spec-header-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.spec-header-left .spec-header-btn {
    position: static;
    margin: 0;
}

.spec-header-btn {
    position: absolute;
    top: 0;
    bottom: 0;
    margin: auto;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#specPinBtn {
    font-size: 14px;
}

#specSoundBtn {
    font-size: 14px;
}

.spec-sound-btn {
    letter-spacing: 0;
    line-height: 1;
}

#specClose {
    right: 0;
    font-size: 18px !important;
    line-height: 1 !important;
    margin-right: 0px !important;
}

.spectator-ui .panel-title {
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(var(--theme-primary-rgb), 0.8);
    margin: 0;
    text-align: center;
    width: 100%;
    padding: 0 56px;
    box-sizing: border-box;
    display: inline-block;
}


.spectator-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
}

.spectator-controls .design-btn {
    width: 26px;
    height: 26px;
    font-size: 12px;
    flex-shrink: 0;
}

#spectatorTargetName {
    color: white;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    text-shadow: 1px 1px 3px black;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    margin: 0 5px;
    flex-grow: 1;
}

.spectator-zoom-ui {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.95);
    padding: 5px 10px;
    border-radius: 15px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4);
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    z-index: 50;
    height: 34px;
    width: 260px;
    box-sizing: border-box;
}

.spectator-zoom-ui .design-btn {
    width: 26px;
    height: 26px;
    font-size: 16px;
    flex-shrink: 0;
}

input[type=range] {
    accent-color: var(--theme-primary);
    width: 100%;
    max-width: 140px;
    margin: 0 10px;
    cursor: pointer;
    height: 4px;
}

/* ================================================================
 * 5.5. THEME PICKER OVERLAY (STRIP LAYOUT)
 * ================================================================ */
.theme-picker-overlay {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.96);
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    pointer-events: auto;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8), 0 0 10px rgba(var(--theme-primary-rgb), 0.2);
    z-index: 30000;
    /* Sicherstellen, dass es über dem settingsModal (20000) liegt */
    width: 90vw;
    max-width: 600px;
    box-sizing: border-box;
    backdrop-filter: blur(12px);
}

.theme-picker-overlay .panel-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.3);
    padding-bottom: 4px;
    margin-bottom: 4px;
    position: relative;
    min-height: 22px;
}

.theme-picker-overlay .panel-title {
    color: var(--theme-primary);
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.6);
}

.theme-picker-overlay .close-btn {
    position: absolute;
    right: -5px;
    top: -5px;
}

.theme-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    overflow-x: auto;
    padding: 5px 2px;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.theme-tile {
    flex: 0 0 64px;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

.theme-tile:hover {
    background: rgba(var(--theme-primary-rgb), 0.1);
    border-color: var(--theme-primary);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.3);
}

.theme-tile.active {
    background: rgba(var(--theme-primary-rgb), 0.15);
    border-color: var(--theme-primary);
    box-shadow: 0 0 15px rgba(var(--theme-primary-rgb), 0.4);
}

.theme-tile-name {
    font-size: 8px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 2;
    text-shadow: 1px 1px 2px black;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.theme-tile-preview {
    display: flex;
    width: 100%;
    height: 10px;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-tile-color {
    flex: 1;
    height: 100%;
}

.theme-grid::-webkit-scrollbar {
    height: 3px;
}

.theme-grid::-webkit-scrollbar-thumb {
    background: var(--theme-primary);
    border-radius: 10px;
}

@media (max-width: 600px) {
    .theme-picker-overlay {
        top: 10px;
        padding: 6px 10px;
        border-radius: 10px;
    }

    .theme-tile {
        flex: 0 0 80px;
        height: 50px;
    }

    .theme-tile-name {
        font-size: 8px;
    }
}


/* ================================================================
 * 6. HAUPTMENÜ & LOGO
 * ================================================================ */
#menuScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 20, 0.95);
    padding: 15px 25px 18px 25px;
    border-radius: 20px;
    text-align: center;
    color: white;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 40px rgba(var(--theme-primary-rgb), 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.95);
    border: 2px solid var(--theme-primary);
    transition: opacity 0.3s ease-in-out, box-shadow 0.5s, border-color 0.5s;
    z-index: 100;
    max-height: 95vh;
    overflow-y: auto;
    overflow-x: hidden;
    width: 90%;
    max-width: 380px !important;
    box-sizing: border-box;
}

.neon-title {
    margin: 5px 0 20px 0;
    font-size: 80px;
    font-weight: bold;
    background: linear-gradient(45deg, var(--theme-secondary), var(--theme-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(var(--theme-secondary-rgb), 0.5);
}

.super-neon-logo {
    margin: 10px auto 8px auto;
    padding: 5px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 310px !important;
    line-height: 0.9;
    user-select: none;
    mix-blend-mode: screen;
}

.mode-badge {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.55);
    font-family: 'Fredoka', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 14px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    margin: 0 auto 15px auto;
    box-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.35);
    transition: var(--theme-transition);
}

.mode-badge .badge-word {
    color: #b8b8cc;
    font-weight: 700;
}

.mode-badge .badge-separator {
    color: rgba(var(--theme-primary-rgb), 0.7);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}

.logo-super {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: min(35px, 8.5vw) !important;
    font-family: 'DynaPuff', 'Courier New', Courier, monospace;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.logo-super .spacer {
    width: 0.8em;
}

.logo-worms {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: min(75px, 18vw) !important;
    font-family: 'DynaPuff', 'Courier New', Courier, monospace;
    font-weight: 900;
    letter-spacing: 0px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.jelly-letter {
    display: inline-block;
    transform-origin: center bottom;
    animation: random-wobble var(--dur, 3s) infinite ease-in-out alternate;
    animation-delay: var(--del, 0s);
    font-family: 'DynaPuff', sans-serif !important;
    font-weight: 700 !important;
    transition: text-shadow 0.5s;
}

@keyframes random-wobble {
    0% {
        transform: scale(1, 1) translate(0, 0) rotate(0deg);
    }

    33% {
        transform: scale(1.06, 0.94) translate(0, -3px) rotate(3deg);
    }

    66% {
        transform: scale(0.94, 1.06) translate(0, 3px) rotate(-3deg);
    }

    100% {
        transform: scale(1.02, 0.98) translate(0, -1px) rotate(1deg);
    }
}

/* REVERTIERT: Originaler Jelly-Button Effekt (Hit-Area Fix sorgt jetzt für Stabilität) */
@keyframes jelly-bounce {
    0% {
        transform: scale(1, 1);
    }

    25% {
        transform: scale(1.1, 0.9);
    }

    50% {
        transform: scale(0.95, 1.05);
    }

    75% {
        transform: scale(1.02, 0.98);
    }

    100% {
        transform: scale(1, 1);
    }
}

/* ================================================================
 * UNIVERSALES LOGO (Glossy/Glass Effekt)
 * ================================================================ */
.logo-super .jelly-letter {
    background:
        radial-gradient(ellipse at 35% 15%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.9) 10%, transparent 12%),
        radial-gradient(ellipse at 50% 22%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.5) 25%, transparent 28%),
        linear-gradient(180deg, rgba(var(--theme-primary-rgb), 0.4) 0%, rgba(var(--theme-primary-rgb), 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 2px var(--theme-primary) !important;
    filter: drop-shadow(0px 0px 15px rgba(var(--theme-primary-rgb), 0.8));
    text-shadow: none !important;
}

.logo-worms .jelly-letter {
    background:
        radial-gradient(ellipse at 35% 15%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.9) 10%, transparent 12%),
        radial-gradient(ellipse at 50% 22%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.5) 25%, transparent 28%),
        linear-gradient(180deg, rgba(var(--theme-secondary-rgb), 0.4) 0%, rgba(var(--theme-secondary-rgb), 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 2px var(--theme-secondary) !important;
    filter: drop-shadow(0px 0px 15px rgba(var(--theme-secondary-rgb), 0.8));
    text-shadow: none !important;
}

body.low-gfx .jelly-letter {
    animation: none !important;
    transform: scale(1, 1) translate(0, 0) rotate(0deg) !important;
}

/* DIVERSE MENÜ-ELEMENTE */
.status-dropdown {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 153, 0, 0.8);
    color: #ff9900;
    padding: 10px 15px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: normal;
    letter-spacing: 0.5px;
    margin-bottom: 13px;
    cursor: pointer;
    outline: none;
    appearance: auto;
    -webkit-appearance: auto;
    text-align: center;
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.15);
    transition: all 0.3s;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
}

.status-dropdown.connected {
    border-color: rgba(57, 255, 20, 0.8);
    color: #39ff14;
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.15);
}

.status-dropdown.error {
    border-color: rgba(255, 49, 49, 0.8);
    color: #ff3131;
    box-shadow: 0 0 8px rgba(255, 49, 49, 0.15);
}

.status-dropdown option {
    background: #0d0d1a;
    color: white;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 5px rgba(204, 255, 0, 0.3);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 12px rgba(204, 255, 0, 0.6);
        transform: scale(1.01);
    }

    100% {
        box-shadow: 0 0 5px rgba(204, 255, 0, 0.3);
        transform: scale(1);
    }
}

.waking-up {
    animation: pulse-glow 1.5s infinite;
    border-color: rgba(204, 255, 0, 0.8) !important;
    color: #ccff00 !important;
}

#nicknameInput {
    padding: 12px 20px;
    font-size: 20px;
    border-radius: 10px;
    border: 2px solid var(--theme-primary);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    margin-top: 15px;
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
    box-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.2);
    transition: all 0.3s;
}

#nicknameInput:focus {
    border-color: var(--theme-secondary);
    box-shadow: 0 0 15px rgba(var(--theme-secondary-rgb), 0.4);
}

#nicknameInput:-webkit-autofill,
#nicknameInput:-webkit-autofill:hover,
#nicknameInput:-webkit-autofill:focus,
#nicknameInput:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #0a0a14 inset !important;
    -webkit-text-fill-color: white !important;
    caret-color: white;
    border: 2px solid var(--theme-primary) !important;
}

#gameOverText {
    font-size: 20px;
    color: #ff3131;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: bold;
    text-shadow: 0 0 10px #ff3131;
}

#nameError {
    color: #ff3131;
    font-weight: bold;
    margin-bottom: 10px;
    display: none;
    text-shadow: 0 0 5px rgba(255, 49, 49, 0.5);
}

#personalHighScoreDisplay {
    display: none;
    font-size: 14px;
    font-weight: bold;
    color: #ffcc00;
    margin-top: 0;
    margin-bottom: 15px;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.4);
}

#savedScoreNotification {
    display: none;
    background: rgba(57, 255, 20, 0.1);
    border: 1px solid rgba(57, 255, 20, 0.4);
    padding: 10px 15px;
    border-radius: 10px;
    margin-top: 0;
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.1);
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
}

#savedScoreTitle {
    color: #39ff14;
    font-weight: bold;
    font-size: 15px;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
    margin-bottom: 4px;
}

.saved-score-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

#savedScoreDisplay {
    color: #ccff00;
    font-size: 16px;
}

/* WURM-DESIGNER */
.preview-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 0px;
    box-sizing: border-box;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

.cat-btn {
    background: rgba(20, 20, 40, 0.5);
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 9px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cat-btn:hover {
    background: rgba(50, 50, 90, 0.5);
    color: #ddd;
}

.cat-btn.active {
    background: rgba(138, 43, 226, 0.3);
    color: #fff;
    border-color: #8a2be2;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

.skin-picker-wrapper {
    margin-bottom: 15px;
}

.dual-picker-container {
    flex: 1;
    min-width: 0;
    max-width: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.live-preview-container {
    flex: 1;
    min-width: 0;
    height: auto;
    padding: 0;
    background: radial-gradient(ellipse, rgba(26, 26, 46, 0.6) 0%, rgba(10, 10, 20, 0) 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    overflow: hidden;
}

#previewCanvas {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    display: block;
}

.design-label {
    font-size: 11px;
    color: var(--theme-primary);
    font-weight: bold;
    margin-bottom: -5px;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(var(--theme-primary-rgb), 0.5);
    transition: color 0.5s, text-shadow 0.5s;
}

.dual-picker-wrapper {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 20px;
    width: 100%;
}

.no-margin-bottom {
    margin-bottom: 0 !important;
}

.picker-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.picker-label {
    font-size: 10px;
    color: var(--theme-primary);
    text-shadow: 0 0 5px rgba(var(--theme-primary-rgb), 0.5);
    position: absolute;
    bottom: -18px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    transition: color 0.5s, text-shadow 0.5s;
}

.color-picker-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.design-btn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 49%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.4) 100%);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--theme-primary);
    font-size: 18px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.4), 0 4px 8px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.design-btn:hover {
    background: linear-gradient(180deg, rgba(var(--theme-primary-rgb), 0.4) 0%, rgba(var(--theme-primary-rgb), 0.1) 49%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.6) 100%);
    border-color: #fff;
    color: #fff;
    animation: jelly-bounce 0.4s ease-out;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.6), 0 6px 12px rgba(var(--theme-primary-rgb), 0.5);
}

.design-btn:active {
    transform: scale(0.85);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
    animation: none;
}

/* * WÜRFEL & ZAHNRAD STYLES UND ANIMATIONEN
 * ================================================================ 
 */
#randomizeBtn {
    margin-left: 5px;
}

#settingsBtn {
    margin-right: 5px;
}

#randomizeBtn,
#settingsBtn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 49%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.5) 100%);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.4), 0 4px 10px rgba(0, 0, 0, 0.6);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    padding: 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Wackel-Animation beim Hover über Würfel & Zahnrad */
#randomizeBtn:hover,
#settingsBtn:hover {
    background: linear-gradient(180deg, rgba(var(--theme-primary-rgb), 0.5) 0%, rgba(var(--theme-primary-rgb), 0.2) 49%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.6) 100%);
    border-color: #fff;
    animation: jelly-bounce 0.4s ease-out;
    box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.7), 0 8px 15px rgba(var(--theme-primary-rgb), 0.6);
}

#settingsBtn:active,
#randomizeBtn:active {
    transform: scale(0.85);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.9);
    animation: none;
}

.color-btn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 49%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.4) 100%);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--theme-primary);
    font-size: 10px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.3), 0 2px 5px rgba(0, 0, 0, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.color-btn:hover {
    background: linear-gradient(180deg, rgba(var(--theme-primary-rgb), 0.4) 0%, rgba(var(--theme-primary-rgb), 0.1) 49%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.6) 100%);
    border-color: #fff;
    color: #fff;
    animation: jelly-bounce 0.4s ease-out;
    box-shadow: inset 0 1px 5px rgba(255, 255, 255, 0.6), 0 4px 8px rgba(var(--theme-primary-rgb), 0.5);
}

.color-btn:active {
    transform: scale(0.85);
    animation: none;
}

.color-preview {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin: 0 12px;
    border: 2px solid white;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Würfel-Spin über JS-Klasse getriggert beim Anklicken */
#randomizeBtn.spin-anim {
    animation: dice-spin 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}

@keyframes dice-spin {
    0% {
        transform: rotate(0deg) scale(0.85);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* ACTION BUTTONS */
.action-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 320px;
    margin: 10px auto 0 auto;
    box-sizing: border-box;
}

.primary-btn {
    background: linear-gradient(180deg, rgba(var(--theme-primary-rgb), 0.5) 0%, rgba(var(--theme-primary-rgb), 0.2) 49%, rgba(var(--theme-primary-rgb), 0.1) 50%, rgba(var(--theme-primary-rgb), 0.4) 100%);
    color: #ffffff;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.6);
    border-top: 2px solid rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid rgba(var(--theme-primary-rgb), 0.9);
    padding: 15px 25px;
    font-size: 22px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 900;
    font-family: 'Fredoka', sans-serif;
    box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.6), 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(var(--theme-primary-rgb), 0.3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.primary-btn:hover {
    background: linear-gradient(180deg, rgba(var(--theme-primary-rgb), 0.7) 0%, rgba(var(--theme-primary-rgb), 0.3) 49%, rgba(var(--theme-primary-rgb), 0.2) 50%, rgba(var(--theme-primary-rgb), 0.6) 100%);
    animation: jelly-bounce 0.4s ease-out;
    box-shadow: inset 0 2px 12px rgba(255, 255, 255, 0.8), 0 12px 25px rgba(0, 0, 0, 0.7), 0 0 25px rgba(var(--theme-primary-rgb), 0.6);
}

.primary-btn:active {
    transform: scale(0.92);
    box-shadow: inset 0 2px 15px rgba(0, 0, 0, 0.9), 0 2px 5px rgba(0, 0, 0, 0.8);
    animation: none;
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.secondary-btn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 49%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.6) 100%);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.4), 0 5px 12px rgba(0, 0, 0, 0.5);
    padding: 10px 10px;
    font-size: 13px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.secondary-btn:hover {
    border-color: #fff;
    color: #fff;
    background: linear-gradient(180deg, rgba(var(--theme-primary-rgb), 0.5) 0%, rgba(var(--theme-primary-rgb), 0.15) 49%, rgba(var(--theme-primary-rgb), 0.1) 50%, rgba(var(--theme-primary-rgb), 0.3) 100%);
    box-shadow: inset 0 1px 8px rgba(255, 255, 255, 0.7), 0 8px 18px rgba(0, 0, 0, 0.6), 0 0 15px rgba(var(--theme-primary-rgb), 0.4);
    animation: jelly-bounce 0.4s ease-out;
}

.secondary-btn:active {
    transform: scale(0.92);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.8);
    animation: none;
}

.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}


/* ================================================================
 * 7. MODALS & SETTINGS
 * ================================================================ */
#legalModal,
#settingsModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999 !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 20px;
    box-sizing: border-box;
    pointer-events: auto;
}

#settingsModal {
    background: rgba(var(--theme-primary-rgb), 0.15) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.legal-modal-content {
    width: 100%;
    max-width: 850px;
    height: 90%;
    background: #f4f6f8;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(var(--theme-primary-rgb), 0.2);
    border: 2px solid var(--theme-primary);
    transition: border-color 0.5s, box-shadow 0.5s;
}

.legal-modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #f4f6f8;
}

.settings-modal-content {
    width: 90%;
    max-width: 420px;
    background: rgba(10, 10, 20, 0.95);
    border-radius: 20px;
    position: relative;
    padding: 20px 25px;
    box-shadow: 0 0 40px rgba(var(--theme-primary-rgb), 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.95);
    border: 2px solid var(--theme-primary);
    color: white;
    text-align: left;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 95vh;
    box-sizing: border-box;
    transition: border-color 0.5s, box-shadow 0.5s;
}

.settings-modal-content h2 {
    margin-top: 0;
    color: var(--theme-primary);
    text-align: center;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.3);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 20px;
    transition: color 0.5s, border-color 0.5s;
}

#module-settings-modal {
    display: contents;
}

#module-settings-modal .settings-modal-content,
#settingsModal .settings-modal-content {
    max-width: 380px !important;
    margin: 0 auto;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s, var(--theme-transition);
}

.setting-row:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.setting-label {
    font-size: 14px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    transition: var(--theme-transition);
}

.setting-toggle input[type="checkbox"] {
    accent-color: var(--theme-primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-select:focus,
.setting-select:hover {
    border-color: var(--theme-primary);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 12px rgba(var(--theme-primary-rgb), 0.4);
}

.setting-select option {
    background: #0d0d1a;
    color: white;
}

.lang-btn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 49%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.4), 0 2px 5px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    margin-left: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.lang-btn:hover {
    background: linear-gradient(180deg, rgba(var(--theme-primary-rgb), 0.4) 0%, rgba(var(--theme-primary-rgb), 0.1) 49%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.6) 100%);
    border-color: #fff;
    animation: jelly-bounce 0.4s ease-out;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.6), 0 4px 10px rgba(var(--theme-primary-rgb), 0.5);
}

.lang-btn:active {
    transform: scale(0.9);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
    animation: none;
}

.close-btn {
    position: relative;
    background: linear-gradient(180deg, #ff5555 0%, #cc0000 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50% !important;
    width: 34px !important;
    height: 34px !important;
    font-size: 20px !important;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 4px 10px rgba(255, 49, 49, 0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding-bottom: 2px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1 !important;
}

.close-btn:hover {
    background: linear-gradient(180deg, #ff7777 0%, #ee0000 100%);
    animation: jelly-bounce 0.4s ease-out;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.7), 0 6px 15px rgba(255, 0, 0, 0.7);
}

.close-btn:active {
    transform: scale(0.85);
    animation: none;
}

/* Small version for overlays */
.close-btn-sm {
    width: 24px !important;
    height: 24px !important;
    font-size: 14px !important;
    padding-bottom: 1px !important;
}

#legalModal .close-btn,
#settingsModal .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
}


/* ================================================================
 * 8. IDLE HIDING
 * ================================================================ */
.spectator-ui,
.spectator-zoom-ui,
.leaderboard,
.survival-feed,
.minimap-container,
.toggle-minimap-btn,
.toggle-leaderboard-btn,
#debugOverlay,
#pingDisplay,
#statsDisplay,
#uptimeDisplay,
.ping-display,
.uptime-display,
.stats-display,
.fps-display,
#debugToggleBtn,
#feedToggleBtn,
#lagSmoothingToggleBtn,
#gfxSelectMainWrapper,
.low-graphics-toggle,
.ui-toggle-btn,
.prof-phase,
.score-board,
.legal-footer,
.version-label,
#replayTopOverlay,
#replayBottomOverlay {
    transition: opacity 0.8s ease-in-out, transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

body.idle-hidden,
body.idle-hidden * {
    cursor: none !important;
}

body.idle-hidden .spectator-ui,
body.idle-hidden .spectator-zoom-ui,
body.idle-hidden .leaderboard,
body.idle-hidden .survival-feed,
body.idle-hidden .minimap-container,
body.idle-hidden .toggle-minimap-btn,
body.idle-hidden .toggle-leaderboard-btn,
body.idle-hidden .ping-display,
body.idle-hidden .uptime-display,
body.idle-hidden .stats-display,
body.idle-hidden .fps-display,
body.idle-hidden .prof-phase,
body.idle-hidden .score-board,
body.idle-hidden #debugToggleBtn,
body.idle-hidden #lagSmoothingToggleBtn,
body.idle-hidden #feedToggleBtn,
body.idle-hidden #gfxSelectMainWrapper,
body.idle-hidden .low-graphics-toggle,
body.idle-hidden .ui-toggle-btn,
body.idle-hidden #menuScreen,
body.idle-hidden .legal-footer,
body.idle-hidden .version-label,
body.idle-hidden #perfGraphEye,
body.idle-hidden #perfGraphBox {
    opacity: 0 !important;
    pointer-events: none !important;
}


/* ================================================================
 * 9. SURVIVAL & SPECIAL THEMES
 * ================================================================ */
/* SURVIVAL & SPECIAL THEMES Override - Jetzt konsistent mit Menü */
.mode-badge {
    font-family: 'Fredoka', sans-serif;
    font-size: 12px;
    margin-top: -10px;
    margin-bottom: 20px;
    transition: border-color 0.5s, background 0.5s, box-shadow 0.5s;
}

.empty-list-message {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 50px;
}

.room-list-container {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.5);
    border-radius: 10px;
    width: 100%;
    max-width: 320px;
    height: 135px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 5px;
    box-sizing: border-box;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    transition: border-color 0.5s;
}

.room-list-container::-webkit-scrollbar {
    width: 6px;
}

.room-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.room-list-container::-webkit-scrollbar-thumb {
    background: rgba(var(--theme-primary-rgb), 0.5);
    border-radius: 10px;
    transition: background 0.5s;
}

.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 2px 12px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    line-height: 1.1;
}

.room-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.room-item.selected {
    background: rgba(var(--theme-primary-rgb), 0.15);
    border-color: var(--theme-primary);
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.3);
}

.room-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green {
    background: #39ff14;
    box-shadow: 0 0 6px #39ff14;
}

.dot-yellow {
    background: #ffcc00;
    box-shadow: 0 0 6px #ffcc00;
    animation: blink 1s infinite alternate;
}

.dot-red {
    background: #ff3131;
    box-shadow: 0 0 6px #ff3131;
}

@keyframes blink {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.room-name {
    color: white;
    font-weight: bold;
}

.room-info {
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
    font-size: 11px;
}

.room-timer {
    color: #ffcc00;
    font-weight: bold;
}

.empty-list-message.is-error {
    color: #ff3131;
}

.room-item-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
}

.room-left-compact {
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-grow: 1;
}

.status-dot-compact {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
}

.room-name-compact {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    color: #ffffff;
}

.room-info-compact {
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 2px;
}

.room-status {
    display: flex;
    align-items: center;
    gap: 3px;
    justify-content: flex-end;
    font-size: 11px;
}

.room-status-separator {
    color: rgba(255, 255, 255, 0.2);
}

.room-stat-ping {
    width: 28px;
    text-align: right;
    display: inline-block;
}

.room-stat-players {
    width: 28px;
    text-align: center;
    display: inline-block;
    color: rgba(255, 255, 255, 0.8);
}

.room-status-value {
    width: 55px;
    text-align: right;
    display: inline-block;
}

.room-status-live {
    width: 55px;
    text-align: right;
    display: inline-block;
    color: #ff3131;
    font-size: 10px;
}

.btn-survival-start {
    background: rgba(var(--theme-primary-rgb), 0.15) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-primary) !important;
    box-shadow: 0 0 15px rgba(var(--theme-primary-rgb), 0.3) !important;
    transition: all 0.5s;
}

.btn-survival-start:hover {
    background: rgba(var(--theme-primary-rgb), 0.3) !important;
    box-shadow: 0 0 20px rgba(var(--theme-primary-rgb), 0.5) !important;
}

.purple-btn {
    color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    transition: color 0.5s, border-color 0.5s;
}

.purple-btn:hover {
    background: rgba(var(--theme-primary-rgb), 0.2) !important;
}

.purple-text {
    color: var(--theme-primary) !important;
    text-shadow: 0 0 5px rgba(var(--theme-primary-rgb), 0.5) !important;
    transition: color 0.5s, text-shadow 0.5s;
}

#centerAnnouncement {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.5s;
    width: 100%;
}

#announceTitle {
    font-size: 50px;
    margin: 0;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
}

#announceSub {
    font-size: 24px;
    margin: 5px 0 0 0;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
}

#winnerAnnouncement {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    pointer-events: none;
    animation: popInWinner 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    width: 100%;
}

.winner-title {
    font-size: 55px;
    color: #ffcc00;
    text-shadow: 0 0 30px #ffcc00, 0 0 10px #ffffff;
    margin: 0;
    text-transform: uppercase;
    line-height: 1.1;
    border: none !important;
    padding: 0 !important;
}

#winnerName {
    font-size: 45px;
    color: #ffffff;
    text-shadow: 0 0 20px #ffffff;
    margin-top: 10px;
    font-weight: 900;
}

@keyframes popInWinner {
    0% {
        transform: translate(-50%, -50%) scale(0.1);
        opacity: 0;
    }

    80% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Diese spezifischen Overrides können vorerst bleiben. Sie werden durch die JS-Logik später hinfällig, sind aber für die Rückwärtskompatibilität gut. */
body.theme-survival #menuScreen {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 40px rgba(var(--theme-primary-rgb), 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.95) !important;
}


/* ================================================================
 * 10. MEDIA QUERIES (Mobile Anpassungen)
 * ================================================================ */
@media (max-width: 1024px),
(max-height: 500px) {
    .score-board {
        top: 10px;
        left: 10px;
        font-size: 13px;
        padding: 2px 4px;
        border-radius: 6px;
    }

    #debugToggleBtn,
    #feedToggleBtn,
    #lagSmoothingToggleBtn,
    #gfxSelectMainWrapper,
    .low-graphics-toggle,
    .ui-toggle-btn {
        left: 10px;
        font-size: 11px;
        padding: 2px 4px;
        border-radius: 6px;
        gap: 5px;
    }

    #debugToggleBtn input,
    #feedToggleBtn input,
    #lagSmoothingToggleBtn input,
    .low-graphics-toggle input[type="checkbox"],
    .ui-toggle-btn input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }

    #debugToggleBtn {
        top: 35px;
    }

    #debugHudStack {
        top: 40px;
        left: 10px;
        gap: 5px;
    }

    .low-graphics-toggle,
    #gfxSelectMainWrapper {
        top: 57px;
    }

    #debugOverlay {
        top: 79px;
        left: 10px;
        gap: 0;
    }

    #debugHudStack #debugOverlay {
        gap: 0;
    }

    #pingDisplay,
    #statsDisplay,
    #uptimeDisplay {
        font-size: 9px;
        padding: 2px 5px;
        border-radius: 6px;
    }

    .spectator-ui {
        top: 10px;
        padding: 4px 8px;
        width: 220px;
        min-width: unset;
        gap: 4px;
        border-radius: 8px;
    }

    .spectator-ui .panel-header {
        padding-bottom: 1px;
        margin-bottom: 2px;
    }

    .spectator-ui .panel-title {
        font-size: 12px;
    }

    #specClose {
        top: -5px;
        right: -5px;
    }

    #spectatorTargetName {
        font-size: 13px;
        max-width: 110px;
        margin: 0 5px;
    }

    .spectator-controls .design-btn {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .spectator-zoom-ui {
        bottom: 15px;
        padding: 3px 8px;
        width: 220px;
        height: 30px;
        gap: 6px;
    }

    .spectator-zoom-ui .design-btn {
        width: 22px;
        height: 22px;
        font-size: 14px;
    }

    input[type=range] {
        width: 100%;
        max-width: 110px;
        margin: 0 6px;
    }

    .leaderboard {
        top: 10px;
        right: 10px;
        font-size: 10px;
        padding: 4px 2px;
        min-width: 115px;
        max-width: 35vw;
        border-radius: 6px;
    }

    .leaderboard .panel-title {
        font-size: 11px;
        margin-bottom: 2px;
        padding-bottom: 2px;
        padding-left: 20px;
        padding-right: 20px;
        box-sizing: border-box;
    }

    .survival-feed {
        right: 10px;
        padding: 4px 3px;
    }

    .survival-feed .panel-header {
        min-height: 22px;
        margin-bottom: 1px;
    }

    .survival-feed .panel-title {
        font-size: 11px;
        letter-spacing: 0.35px;
        padding: 0 48px;
    }

    .toggle-survivalfeed-btn {
        width: 20px;
        height: 20px;
        font-size: 13px;
    }

    .console-btn-pos-l1 {
        left: 3px;
    }

    .console-btn-pos-l2 {
        left: 24px;
    }

    .console-btn-pos-r1 {
        right: 45px;
    }

    .console-btn-pos-r2 {
        right: 24px;
    }

    .leaderboard-entry {
        margin-bottom: 1px;
        padding: 1px 4px;
        height: 13px;
        font-size: 10px;
        line-height: 13px;
        overflow: hidden;
    }

    .leaderboard-icon {
        font-size: 12px;
        margin-right: 2px;
    }

    #menuScreen,
    .settings-modal-content {
        padding: 8px 15px 40px 15px;
        width: 95%;
        max-width: 340px !important;
        border-radius: 12px;
        box-sizing: border-box;
    }

    .status-dropdown {
        font-size: 11px;
        padding: 6px 10px;
        margin-bottom: 11px;
        width: 100%;
        max-width: 280px;
        box-sizing: border-box;
    }

    #nicknameInput {
        font-size: 14px;
        padding: 8px;
        margin-bottom: 10px;
        border-radius: 6px;
        width: 100%;
        max-width: 280px;
        box-sizing: border-box;
    }

    #savedScoreNotification {
        width: 100%;
        max-width: 280px;
        box-sizing: border-box;
    }

    .room-list-container {
        max-width: 280px !important;
        margin: 0 auto 15px auto;
    }

    .action-buttons-container {
        max-width: 280px !important;
    }

    .primary-btn {
        font-size: 16px;
        padding: 12px 15px;
        border-radius: 30px;
    }

    .secondary-btn {
        font-size: 11px;
        padding: 8px;
        border-radius: 30px;
    }

    .preview-wrapper {
        gap: 5px;
        max-width: 280px !important;
        margin: 0 auto;
    }

    .dual-picker-container {
        max-width: none !important;
    }

    #previewCanvas {
        width: 100% !important;
        max-width: 100% !important;
    }

    .design-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    #randomizeBtn,
    #settingsBtn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .dual-picker-wrapper {
        gap: 15px;
        margin-bottom: 10px;
    }

    .color-preview,
    .color-btn {
        width: 14px;
        height: 14px;
        font-size: 8px;
        margin: 0 6px;
        border-width: 1px;
    }

    .picker-label {
        font-size: 8px;
        bottom: -14px;
    }

    .version-label {
        font-size: 9px;
        bottom: 0;
        right: 0;
        padding: 0 4px;
        height: 14px;
        line-height: 14px;
    }

    .logo-super {
        margin-bottom: 3px !important;
        font-size: min(28px, 8.5vw) !important;
    }

    .logo-worms {
        margin-top: 5px !important;
        margin-bottom: 5px !important;
        font-size: min(60px, 18vw) !important;
    }

    #winnerAnnouncement {
        top: 55%;
    }

    .minimap-container {
        width: 75px !important;
        height: 75px !important;
    }

    .minimap-wrapper {
        right: 10px;
        bottom: 18px;
    }

    .toggle-minimap-btn {
        right: 0;
    }
}

@media (max-width: 800px) {
    #announceTitle {
        font-size: 32px;
    }

    #announceSub {
        font-size: 18px;
    }

    #phaseHud {
        font-size: 12px;
        padding: 4px 10px;
        top: 10px;
    }

    #phaseHud span.time {
        font-size: 14px;
    }

    #winnerTitleText {
        font-size: 35px !important;
    }

    #winnerName {
        font-size: 55px !important;
    }
}

@media (max-width: 768px) {
    #menuScreen {
        width: calc(100% - 60px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Survival Leaderboard Styles (Dead/At-Risk) */
.leaderboard-entry.dead {
    background: rgba(255, 40, 40, 0.35) !important;
    /* Kräftigeres Rot */
    transition: all 1.5s ease;
}

.leaderboard-entry.dead-faded {
    background: rgba(50, 20, 20, 0.3) !important;
    /* Dunkleres, dezenteres Rot */
    opacity: 0.6;
    filter: grayscale(0.4);
}

.leaderboard-entry.at-risk {
    background: rgba(255, 220, 0, 0.35) !important;
    /* Kräftigeres Gelb */
}

.leaderboard-entry.winner {
    background: rgba(57, 255, 20, 0.45) !important;
    /* Kräftiges Grün für den Gewinner */
    border: 1px solid rgba(57, 255, 20, 0.6);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

.leaderboard-entry.is-spectated {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.leaderboard-entry.is-spectated .leaderboard-name-txt::after {
    content: " \1F441";
    /* 👁️ */
    opacity: 0.8;
    font-size: 13px;
    margin-left: 2px;
}

@keyframes iconPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ================================================================
 * EXTRACTED INLINE STYLES FROM HTML FILES
 * ================================================================ */

/* ── Feed Console Panel (from index.html) ─────────────────── */
#feedConsolePanel {
    display: none;
    padding: 8px;
    box-sizing: border-box;
    width: 100%;
}

#feedClipBrowserPanel {
    display: none;
    padding: 8px;
    box-sizing: border-box;
    width: 100%;
}

#feedClipBrowserBtn {
    display: none;
}

#feedConsoleLog {
    height: 144px;
    overflow-y: auto;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: monospace;
    font-size: 12px;
    color: #d8fff4;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.22);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 8px;
}

#feedConsoleHelp {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    white-space: normal;
}

#feedConsoleInput {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.35);
    border-radius: 8px;
    padding: 6px 10px;
    font-family: monospace;
    font-size: 12px;
}

#feedConsoleAdminBar {
    display: none;
    margin-top: 7px;
    gap: 3px;
    flex-wrap: wrap;
}

#feedClipBrowserList {
    height: 184px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.clip-browser-empty {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.74);
    font-size: 11px;
    font-family: monospace;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.18);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
}

.clip-browser-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.22);
    background: rgba(0, 0, 0, 0.34);
}

.survival-feed.clip-save-preview {
    border-color: rgba(57, 255, 20, 0.72) !important;
    box-shadow: 0 0 18px rgba(57, 255, 20, 0.32), 0 0 8px rgba(var(--theme-primary-rgb), 0.22) !important;
    animation: clipSavePanelIn 0.28s ease-out;
}

.clip-browser-item.is-new {
    border-color: rgba(57, 255, 20, 0.55);
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.18);
    background: linear-gradient(90deg, rgba(57, 255, 20, 0.20), rgba(0, 0, 0, 0.34) 70%);
    animation: clipBrowserItemSaved 1.1s ease-out;
}

.clip-browser-main {
    min-width: 0;
    flex: 1 1 auto;
}

.clip-browser-title {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-browser-meta,
.clip-browser-date {
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-browser-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.clip-browser-btn {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 7px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.35);
    background: rgba(var(--theme-primary-rgb), 0.12);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.clip-browser-btn:hover {
    background: rgba(var(--theme-primary-rgb), 0.2);
}

.clip-browser-btn--danger {
    border-color: rgba(255, 112, 112, 0.35);
    background: rgba(255, 112, 112, 0.12);
}

@keyframes clipSavePanelIn {
    from {
        transform: translateY(-8px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes clipBrowserItemSaved {
    0% {
        transform: translateX(10px);
        background: rgba(57, 255, 20, 0.34);
    }
    100% {
        transform: translateX(0);
    }
}

/* Shared admin-bar button — DRY, color variants override background/border */
.feed-admin-btn {
    padding: 1px 5px;
    color: #fff;
    border-radius: 4px;
    font-size: 9px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    background: rgba(var(--theme-primary-rgb), 0.14);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.35);
}

.feed-admin-btn--green {
    background: rgba(57, 255, 20, 0.12);
    border-color: rgba(57, 255, 20, 0.32);
}

.feed-admin-btn--yellow {
    background: rgba(255, 210, 74, 0.12);
    border-color: rgba(255, 210, 74, 0.32);
}

.feed-admin-btn--red {
    background: rgba(255, 112, 112, 0.12);
    border-color: rgba(255, 112, 112, 0.32);
}

.feed-admin-btn--cyan {
    background: rgba(124, 247, 255, 0.12);
    border-color: rgba(124, 247, 255, 0.32);
}

.feed-admin-btn--purple {
    background: rgba(183, 139, 255, 0.12);
    border-color: rgba(183, 139, 255, 0.32);
}

.feed-admin-btn--orange {
    background: rgba(255, 180, 50, 0.12);
    border-color: rgba(255, 180, 50, 0.35);
}

/* Console panel-header toggle button positions */
.console-btn-pos-l1 {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.console-btn-pos-l2 {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.console-btn-pos-r1 {
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%);
}

.console-btn-pos-r2 {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
}

/* Watch-replay button spacing (used in both index.html and survival.html) */
.replay-btn-menu {
    margin: 0 auto 15px auto;
    display: block;
}

/* Account modal hint spacing */
.modal-hint-spacer {
    margin-top: 10px;
}

/* From public/survival.html */

#phaseHud {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--theme-primary);
    border-radius: 12px;
    padding: 8px 20px;
    color: white;
    font-weight: bold;
    font-family: monospace;
    font-size: 16px;
    text-shadow: 0 0 5px var(--theme-primary);
    z-index: 100;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 0 15px rgba(var(--theme-primary-rgb), 0.3);
    transition: opacity 0.3s, border-color 0.5s, text-shadow 0.5s, box-shadow 0.5s;
    pointer-events: none;
}

#phaseHud span.time {
    color: #ffcc00;
    font-size: 20px;
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.8);
}

#centerAnnouncement {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.5s;
    width: 100%;
}

#announceTitle {
    font-size: 50px;
    margin: 0;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
    transition: color 0.5s, text-shadow 0.5s;
}

#announceSub {
    font-size: 24px;
    margin: 5px 0 0 0;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
}

#winnerAnnouncement {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10000;
    pointer-events: none;
    width: 100%;
}

#winnerTitleText {
    font-size: 65px;
    color: #ffcc00;
    text-shadow: 0 0 30px #ffcc00, 0 0 10px #ffffff;
    margin: 0;
    text-transform: uppercase;
    line-height: 1.2;
    animation: pubgStamp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    border: none !important;
    padding: 0 !important;
}

#winnerName {
    font-size: 90px;
    color: #ffffff;
    text-shadow: 0 0 30px #ffffff, 0 0 15px var(--theme-primary);
    margin-top: 15px;
    margin-bottom: 0;
    line-height: 1;
    font-weight: 900;
    opacity: 0;
    animation: slideUpFade 0.8s ease-out 0.4s forwards;
    transition: text-shadow 0.5s;
}

@keyframes pubgStamp {
    0% {
        transform: scale(3);
        opacity: 0;
    }

    50% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideUpFade {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes dangerBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

#exitMatchBtn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #ff3131;
    border: 1px solid #ff3131;
    padding: 0 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    pointer-events: auto;
    transition: all 0.2s;
    z-index: 150;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    font-family: inherit;
    text-shadow: 0 0 5px rgba(255, 49, 49, 0.5);
    box-shadow: 0 0 8px rgba(255, 49, 49, 0.2);
}

#exitMatchBtn:hover {
    background: rgba(255, 49, 49, 0.2);
    transform: scale(1.05);
}

body.idle-hidden #exitMatchBtn {
    opacity: 0 !important;
    pointer-events: none !important;
}


@media (max-width: 1024px),
(max-height: 500px) {




    /* Angepasst für Mobile */

    #exitMatchBtn {
        top: 10px;
        right: 10px;
        font-size: 12px;
        height: 28px;
        padding: 0 8px;
    }
}

@media (max-width: 800px) {
    #announceTitle {
        font-size: 32px;
    }

    #announceSub {
        font-size: 18px;
    }

    #phaseHud {
        font-size: 12px;
        padding: 4px 10px;
        top: 10px;
    }

    #phaseHud span.time {
        font-size: 14px;
    }

    #winnerTitleText {
        font-size: 35px !important;
    }

    #winnerName {
        font-size: 55px !important;
    }
}

.room-list-container {
    height: 135px !important;
    min-height: 135px;
    scroll-behavior: smooth;
}

.room-item {
    padding: 2px 6px !important;
    margin-bottom: 2px !important;
    min-height: 20px !important;
    line-height: 1.1 !important;
}

.room-item * {
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.1 !important;
}


/* Theme-basierter & transparenterer Hintergrund für das Modal */


/* ── Ping/FPS Graph ─────────────────────────────────────────── */

.perf-graph-eye {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 60;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(10,10,20,0.7);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.2s, background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(4px);
}
.perf-graph-eye.active {
    background: rgba(var(--theme-primary-rgb), 0.15);
    border-color: rgba(var(--theme-primary-rgb), 0.5);
    color: var(--theme-primary);
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.3);
}
.perf-graph-eye:hover {
    background: rgba(var(--theme-primary-rgb), 0.2);
    color: #fff;
}

.perf-graph-box {
    position: fixed;
    bottom: 60px;
    left: 20px;
    z-index: 59;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4);
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.2), 0 4px 20px rgba(0,0,0,0.8);
    transition: border-color 0.8s ease, box-shadow 0.8s ease;
}
.perf-graph-box.hidden { display: none; }

/* ── Emote Wheel ────────────────────────────────────────────── */

.emote-wheel-trigger-btn {
    position: fixed;
    bottom: 20px;
    left: calc(50% - 24px);
    transform: translateX(-50%);
    z-index: 60;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 49%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.5) 100%);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.6);
    border-top: 1px solid rgba(255,255,255,0.5);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 4px rgba(255,255,255,0.4), 0 4px 10px rgba(0,0,0,0.6);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    pointer-events: auto;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}
.emote-wheel-trigger-btn .wheel-btn-label,
.clip-capture-trigger-btn .wheel-btn-label,
.sticker-wheel-trigger-btn .wheel-btn-label {
    position: relative;
    z-index: 2;
}
.emote-wheel-trigger-btn .wheel-cooldown-sweep,
.sticker-wheel-trigger-btn .wheel-cooldown-sweep {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background: conic-gradient(from -90deg, transparent 0deg var(--cooldown-progress, 0deg), rgba(0,0,0,0.72) var(--cooldown-progress, 0deg) 360deg);
    transition: opacity 0.08s linear;
}
.emote-wheel-trigger-btn .wheel-cooldown-text,
.sticker-wheel-trigger-btn .wheel-cooldown-text {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 1px 4px rgba(0,0,0,1);
    opacity: 0;
}
.emote-wheel-trigger-btn.on-cooldown .wheel-cooldown-sweep,
.sticker-wheel-trigger-btn.on-cooldown .wheel-cooldown-sweep,
.emote-wheel-trigger-btn.on-cooldown .wheel-cooldown-text,
.sticker-wheel-trigger-btn.on-cooldown .wheel-cooldown-text {
    opacity: 1;
}
.emote-wheel-trigger-btn.on-cooldown .wheel-btn-label,
.sticker-wheel-trigger-btn.on-cooldown .wheel-btn-label {
    opacity: 0.35;
}
.emote-wheel-trigger-btn.ingame-visible {
    opacity: 1;
    pointer-events: auto;
}
.emote-wheel-trigger-btn:hover {
    background: linear-gradient(180deg, rgba(var(--theme-primary-rgb),0.5) 0%, rgba(var(--theme-primary-rgb),0.2) 49%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.6) 100%);
    border-color: #fff;
    transform: translateX(-50%) scale(1.1);
    box-shadow: inset 0 2px 8px rgba(255,255,255,0.7), 0 8px 15px rgba(var(--theme-primary-rgb),0.6);
}

body.idle-hidden .emote-wheel-trigger-btn {
    opacity: 0;
    pointer-events: none;
}

.clip-capture-trigger-btn {
    position: fixed;
    bottom: 20px;
    left: calc(50% - 72px);
    transform: translateX(-50%);
    z-index: 60;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 49%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.5) 100%);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.6);
    border-top: 1px solid rgba(255,255,255,0.5);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 4px rgba(255,255,255,0.4), 0 4px 10px rgba(0,0,0,0.6);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.clip-capture-trigger-btn.ingame-visible {
    opacity: 1;
    pointer-events: auto;
}

.clip-capture-trigger-btn:hover {
    background: linear-gradient(180deg, rgba(var(--theme-primary-rgb),0.5) 0%, rgba(var(--theme-primary-rgb),0.2) 49%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.6) 100%);
    border-color: #fff;
    transform: translateX(-50%) scale(1.1);
    box-shadow: inset 0 2px 8px rgba(255,255,255,0.7), 0 8px 15px rgba(var(--theme-primary-rgb),0.6);
}

.clip-capture-trigger-btn.is-busy {
    filter: saturate(0.75);
}

body.idle-hidden .clip-capture-trigger-btn {
    opacity: 0;
    pointer-events: none;
}

.emote-wheel {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}
.emote-wheel.visible {
    pointer-events: auto;
}
.emote-wheel.hidden {
    display: none;
}

.emote-wheel-bg {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.75) 70%, transparent 100%);
    transform: translate(-50%, -50%);
    border: 2px solid rgba(var(--theme-primary-rgb), 0.25);
    box-shadow: 0 0 40px rgba(0,0,0,0.8), inset 0 0 30px rgba(0,0,0,0.5);
}

.emote-wheel-center {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.9);
    border: 2px solid rgba(var(--theme-primary-rgb), 0.6);
    color: rgba(var(--theme-primary-rgb), 0.9);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.emote-wheel-item {
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(10, 10, 20, 0.85);
    border: 2px solid rgba(255,255,255,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s, background 0.12s;
    font-size: 22px;
    line-height: 1;
    gap: 6px;
    user-select: none;
    z-index: 3;
}
.emote-wheel-item .emote-label {
    font-size: 9px;
    font-family: 'Orbitron', sans-serif;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.3px;
}
.emote-wheel-item.active {
    background: rgba(var(--theme-primary-rgb), 0.25);
    border-color: rgba(var(--theme-primary-rgb), 0.9);
    box-shadow: 0 0 18px rgba(var(--theme-primary-rgb), 0.6);
    transform: translate(-50%, -50%) scale(1.18);
}

/* Emote bubble on canvas overlay */
.emote-bubble {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    text-align: center;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.9));
    transition: opacity 0.4s;
    transform: translateX(-50%);
    animation: emotePop 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.emote-bubble .bubble-emoji {
    font-size: 48px;
    line-height: 1;
}
.emote-bubble .bubble-label {
    font-size: 12px;
    font-family: 'Orbitron', sans-serif;
    color: rgba(255,255,255,0.9);
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(0,0,0,1);
    background: rgba(0,0,0,0.5);
    padding: 1px 6px;
    border-radius: 4px;
}
@keyframes emotePop {
    from { transform: translateX(-50%) scale(0.4); opacity: 0; }
    to   { transform: translateX(-50%) scale(1);   opacity: 1; }
}

/* ── Sticker Wheel ─────────────────────────────────────────────────────────── */
.sticker-wheel-trigger-btn {
    position: fixed;
    bottom: 20px;
    left: calc(50% + 24px);
    transform: translateX(-50%);
    z-index: 60;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 49%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.5) 100%);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.6);
    border-top: 1px solid rgba(255,255,255,0.5);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 4px rgba(255,255,255,0.4), 0 4px 10px rgba(0,0,0,0.6);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}
.sticker-wheel-trigger-btn.ingame-visible {
    opacity: 1;
    pointer-events: auto;
}
.sticker-wheel-trigger-btn:hover {
    background: linear-gradient(180deg, rgba(var(--theme-primary-rgb),0.5) 0%, rgba(var(--theme-primary-rgb),0.2) 49%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.6) 100%);
    border-color: #fff;
    transform: translateX(-50%) scale(1.1);
    box-shadow: inset 0 2px 8px rgba(255,255,255,0.7), 0 8px 15px rgba(var(--theme-primary-rgb),0.6);
}
body.idle-hidden .sticker-wheel-trigger-btn {
    opacity: 0;
    pointer-events: none;
}

.sticker-wheel {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}
.sticker-wheel.visible { pointer-events: auto; }
.sticker-wheel.hidden  { display: none; }

.sticker-wheel-bg {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.75) 70%, transparent 100%);
    transform: translate(-50%, -50%);
    border: 2px solid rgba(var(--theme-primary-rgb), 0.25);
    box-shadow: 0 0 40px rgba(0,0,0,0.8), inset 0 0 30px rgba(0,0,0,0.5);
}

.sticker-wheel-center {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.9);
    border: 2px solid rgba(var(--theme-primary-rgb), 0.6);
    color: rgba(var(--theme-primary-rgb), 0.9);
    font-size: 11px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.sticker-wheel-item {
    position: absolute;
    width: 58px;
    height: 58px;
    border-radius: 12px;
    background: rgba(10, 10, 20, 0.88);
    border: 2px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s, background 0.12s;
    overflow: hidden;
    user-select: none;
    z-index: 3;
}
.sticker-wheel-item.active {
    background: rgba(var(--theme-primary-rgb), 0.22);
    border-color: rgba(var(--theme-primary-rgb), 0.9);
    box-shadow: 0 0 18px rgba(var(--theme-primary-rgb), 0.6);
    transform: translate(-50%, -50%) scale(1.18);
}
.sticker-wheel-item.on-cooldown {
    opacity: 0.4;
    filter: grayscale(0.8);
    cursor: not-allowed;
}
.sticker-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    pointer-events: none;
}

/* From public/singleplayer.html */

body.singleplayer-mode .minimap-container {
    pointer-events: none !important;
    cursor: default !important;
}

#singleplayerHeader {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--theme-primary);
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 10px;
    border: 1px solid var(--theme-primary);
    z-index: 100;
    transition: color 0.5s, border-color 0.5s, text-shadow 0.5s;
}

#pauseBtn,
#exitBtn {
    position: absolute;
    top: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid #fff;
    padding: 0 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    pointer-events: auto;
    transition: all 0.2s;
    z-index: 100;
    height: 34px;
    width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-family: inherit;
}

#pauseBtn {
    right: 155px;
    border-color: #ffcc00;
    color: #ffcc00;
}

#pauseBtn:hover {
    background: rgba(255, 204, 0, 0.2);
}

#exitBtn {
    right: 15px;
    border-color: #ff3131;
    color: #ff3131;
}

#exitBtn:hover {
    background: rgba(255, 49, 49, 0.2);
}

.friendly-mode-toggle {
    position: absolute;
    top: 110px;
    left: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4);
    box-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    cursor: pointer;
    transition: background 0.2s, border-color 0.5s, box-shadow 0.5s;
    z-index: 100;
    font-family: monospace;
}

.friendly-mode-toggle:hover {
    background: rgba(var(--theme-primary-rgb), 0.2);
}

.friendly-mode-toggle input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--theme-primary);
    width: 16px;
    height: 16px;
    margin: 0;
    transition: accent-color 0.5s;
}

.friendly-mode-toggle span {
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#fpsDisplay {
    top: 145px !important;
    left: 20px !important;
    z-index: 100;
}

#offlineGameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 20, 0.95);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid var(--theme-primary);
    text-align: center;
    color: white;
    box-shadow: 0 0 30px rgba(var(--theme-primary-rgb), 0.3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    min-width: 250px;
    pointer-events: auto;
    transition: border-color 0.5s, box-shadow 0.5s;
}

#offlineGameOver.hidden {
    display: none !important;
}

#offlineGameOver h1 {
    margin: 0;
    color: var(--theme-primary);
    text-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.8);
    font-size: 32px;
    text-transform: uppercase;
    transition: color 0.5s, text-shadow 0.5s;
}

#offlineGameOver p {
    margin: 10px 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
}

#offlineGameOver strong {
    color: #ccff00;
    font-size: 24px;
    text-shadow: 0 0 8px rgba(204, 255, 0, 0.5);
}

.go-btn {
    background: rgba(0, 0, 0, 0.6);
    color: var(--theme-primary);
    border: 2px solid var(--theme-primary);
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.2);
    transition: all 0.2s;
    width: 100%;
    max-width: 220px;
    font-family: inherit;
}

.go-btn:hover {
    background: rgba(var(--theme-primary-rgb), 0.2);
    transform: scale(1.05);
}

.go-btn.quit {
    border-color: #ff3131;
    color: #ff3131;
    box-shadow: 0 0 10px rgba(255, 49, 49, 0.2);
}

.go-btn.quit:hover {
    background: rgba(255, 49, 49, 0.2);
}

@media (max-width: 1024px),
(max-height: 500px) {
    #singleplayerHeader {
        font-size: 14px;
        top: 10px;
        padding: 3px 8px;
    }

    #pauseBtn,
    #exitBtn {
        top: 10px;
        font-size: 12px;
        padding: 0 5px;
        height: 26px;
        width: 95px;
    }

    #pauseBtn {
        right: 115px;
    }

    .friendly-mode-toggle {
        top: 64px;
        left: 10px;
        font-size: 11px;
        padding: 2px 4px;
        border-radius: 6px;
        gap: 5px;
    }

    .friendly-mode-toggle input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }

    #fpsDisplay {
        top: 86px !important;
        left: 10px !important;
        font-size: 9px !important;
        padding: 1px 3px !important;
        border-radius: 4px !important;
    }
}

/* From public/servereditor.html */

@font-face {
    font-family: 'Fredoka';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/fredoka-v17-latin-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Fredoka';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/fredoka-v17-latin-700.woff2') format('woff2');
}

/* ==========================================
   ACCOUNT KEY MODALS
   ========================================== */

.setting-section-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 0 14px 0;
}

.account-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    backdrop-filter: blur(4px);
}

.account-modal-overlay.hidden {
    display: none;
}

.account-modal-box {
    position: relative;
    background: rgba(10, 10, 22, 0.97);
    border: 2px solid var(--theme-primary);
    border-radius: 16px;
    padding: 22px 28px 22px 28px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 0 40px rgba(var(--theme-primary-rgb), 0.25);
    color: #fff;
    text-align: center;
    box-sizing: border-box;
}

.account-modal-title {
    margin: 0 32px 16px 32px;
    font-size: 18px;
    color: var(--theme-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.account-key-warning {
    background: rgba(255, 80, 80, 0.12);
    border: 1px solid rgba(255, 80, 80, 0.4);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    color: #ff9999;
    line-height: 1.55;
    margin-bottom: 16px;
    text-align: left;
}

.account-key-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 2px;
    word-break: break-all;
    user-select: text;
    -webkit-user-select: text;
}

.account-key-masked {
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 3px;
    user-select: none;
    -webkit-user-select: none;
}

.account-key-eye-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.account-key-eye-btn:hover {
    opacity: 0.7;
}

.account-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.account-modal-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 12px 0;
}

.account-modal-storage-note {
    margin: 10px 0 16px 0;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.62);
    text-align: left;
}

.account-modal-box>.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    margin: 0;
}

.account-key-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 2px;
    padding: 10px 14px;
    text-align: center;
    margin-bottom: 8px;
    outline: none;
    text-transform: uppercase;
}

.account-key-input:focus {
    border-color: var(--theme-primary);
}

.account-import-error {
    font-size: 12px;
    color: #ff7777;
    margin-bottom: 8px;
}

.account-import-error.hidden {
    display: none;
}

/* ======================================================
   REPLAY OVERLAY
   ====================================================== */
#replayOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 8500;
    display: none;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

#replayBadge {
    margin-top: 14px;
    background: rgba(8, 8, 22, 0.88);
    border: 1px solid #ff4444;
    color: #ff4444;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 4px;
    padding: 4px 18px;
    border-radius: 4px;
    pointer-events: none;
    text-shadow: 0 0 8px #ff4444;
}

#replayBar {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(8, 8, 22, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px 14px;
    pointer-events: auto;
}

.rpBtn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 13px;
    padding: 4px 11px;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    transition: background 0.15s;
    white-space: nowrap;
}

.rpBtn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.rpBtn.rpExit {
    color: #ff8888;
    border-color: rgba(255, 100, 100, 0.35);
}

.rpBtn.rpExit:hover {
    background: rgba(255, 60, 60, 0.2);
}

#rpProgressWrap {
    width: 160px;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

#rpProgress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff4444, #ff8844);
    border-radius: 3px;
    transition: width 0.08s linear;
}

#rpSpeed {
    color: #ffaa00;
    font-family: monospace;
    font-size: 13px;
    min-width: 30px;
    text-align: center;
}

.replay-bottom-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 6px;
}

.replay-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.replay-row-top {
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    align-items: center;
    gap: 8px;
}

.replay-row-bottom {
    justify-content: space-between;
}

.replay-group {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.replay-group--left {
    flex: 0 0 auto;
    justify-content: flex-start;
}

.replay-group--center {
    justify-content: center;
    justify-self: center;
}

.replay-group--right {
    flex: 0 0 auto;
    justify-content: flex-end;
    justify-self: end;
}

.replay-mini-btn {
    min-width: 24px;
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    font-family: "Segoe UI Symbol", "Arial Unicode MS", system-ui, sans-serif;
    text-align: center;
}

input.replay-zoom-slider {
    width: 24px;
    max-width: 24px;
    margin: 0 2px;
    flex: 0 0 auto;
}

.replay-time-readout {
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    font-family: monospace;
    min-width: 94px;
    text-align: center;
    white-space: nowrap;
}

.replay-speed-readout {
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
    font-family: monospace;
}

.replay-play-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    flex: 0 0 auto;
}

.replay-btn-glyph {
    display: block;
    font-size: 12px;
    line-height: 1;
    transform: translateY(-0.5px);
}

.replay-btn-glyph--play {
    margin-left: 1px;
}

.replay-btn-glyph--pause {
    font-size: 10px;
    letter-spacing: -1px;
}

.replay-progress-row {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-width: 0;
}

.replay-death-marker-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.35);
}

.replay-death-marker-icon {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    color: #f4f4f4;
    font-size: 14px;
    line-height: 1;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.85);
    font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", sans-serif;
}

@media (max-width: 600px) {
    #replayBar {
        width: min(94vw, 360px);
        padding: 6px 10px;
        border-radius: 12px;
    }

    #rpProgressWrap {
        width: 100%;
        margin: 0 4px;
    }

    .rpBtn {
        font-size: 12px;
        padding: 4px 8px;
    }

    .replay-row {
        gap: 6px;
    }

    .replay-row-top {
        gap: 8px;
        grid-template-columns: max-content 1fr max-content;
    }

    .replay-mini-btn {
        min-width: 22px;
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    input.replay-zoom-slider {
        width: 19px;
        max-width: 19px;
        margin: 0 1px;
    }

    .replay-time-readout {
        min-width: 84px;
        font-size: 10px;
    }

    .replay-speed-readout {
        min-width: 26px;
        font-size: 10px;
    }

    .replay-play-btn {
        width: 22px;
        height: 22px;
    }

    .replay-btn-glyph {
        font-size: 10px;
    }

    .replay-btn-glyph--pause {
        font-size: 9px;
    }

    .replay-death-marker-icon {
        width: 15px;
        height: 15px;
    }

    .replay-death-marker-icon {
        font-size: 11px;
    }

    .replay-death-marker-line {
        width: 1px;
    }
}

/* ======================================================
   REPLAY PROMPT DIALOG
   ====================================================== */
#replayPrompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 8600;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 18vh;
    pointer-events: none;
}

#replayPromptBox {
    background: rgba(8, 8, 24, 0.94);
    border: 1px solid rgba(255, 68, 68, 0.6);
    border-radius: 12px;
    padding: 22px 32px 20px;
    text-align: center;
    pointer-events: auto;
    box-shadow: 0 0 40px rgba(255, 68, 68, 0.25), 0 4px 24px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: replayPromptIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes replayPromptIn {
    from {
        transform: scale(0.85) translateY(-10px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

#replayPromptTitle {
    color: #ff6666;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 6px;
    text-shadow: 0 0 12px rgba(255, 68, 68, 0.5);
}

#replayPromptSub {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin-bottom: 18px;
    font-family: monospace;
}

#replayPromptBtns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

#replayPromptYes {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.6);
    color: #ff8888;
    font-size: 14px;
    padding: 8px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 1px;
    transition: background 0.15s, box-shadow 0.15s;
}

#replayPromptYes:hover {
    background: rgba(255, 68, 68, 0.3);
    box-shadow: 0 0 14px rgba(255, 68, 68, 0.4);
}

#replayPromptNo {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-family: monospace;
    transition: background 0.15s;
}

#replayPromptNo:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.replay-clip-inactive-left,
.replay-clip-inactive-right {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 1;
}

.replay-clip-inactive-left {
    left: 0;
    border-radius: 4px 0 0 4px;
}

.replay-clip-inactive-right {
    right: 0;
    border-radius: 0 4px 4px 0;
}

.replay-clip-active-range {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(57, 255, 20, 0.12);
    border-top: 2px solid rgba(57, 255, 20, 0.55);
    border-bottom: 2px solid rgba(57, 255, 20, 0.55);
    pointer-events: none;
    z-index: 0;
}

.replay-clip-handle {
    position: absolute;
    top: -3px;
    width: 14px;
    height: calc(100% + 6px);
    background: linear-gradient(180deg, #ffe066 0%, #ffcc00 60%, #e6a800 100%);
    border-radius: 3px;
    cursor: ew-resize;
    z-index: 4;
    transform: translateX(-50%);
    transition: box-shadow 0.15s;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.replay-clip-handle:hover,
.replay-clip-handle.dragging {
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.8), 0 0 4px rgba(255, 204, 0, 0.5);
}

.replay-clip-handle-grip {
    display: flex;
    flex-direction: row;
    gap: 2px;
    align-items: center;
    justify-content: center;
}

.replay-clip-handle-grip::before,
.replay-clip-handle-grip::after {
    content: '';
    display: block;
    width: 1.5px;
    height: 8px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 1px;
}

.replay-row-clip-times {
    display: flex;
    align-items: center;
    padding: 0 2px;
    margin-top: 1px;
}

.replay-clip-time {
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
    font-family: monospace;
    letter-spacing: 0.3px;
}

.replay-clip-save-btn {
    width: auto;
    min-width: 44px;
    height: 24px;
    font-size: 11px;
    font-weight: bold;
    color: #39ff14;
    border-color: rgba(57, 255, 20, 0.45);
    background: rgba(57, 255, 20, 0.07);
    transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
    letter-spacing: 0.3px;
    padding: 0 8px;
}

.replay-clip-mini-btn {
    flex-shrink: 0;
}

.replay-clip-save-btn:hover:not(:disabled) {
    background: rgba(57, 255, 20, 0.17);
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.3);
}

.replay-clip-save-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.replay-clip-save-btn.exporting {
    color: #ffcc00;
    border-color: rgba(255, 204, 0, 0.45);
    background: rgba(255, 204, 0, 0.07);
    animation: clipExportPulse 0.9s ease-in-out infinite;
}

@keyframes clipExportPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@media (max-width: 600px) {
    .replay-clip-handle {
        width: 12px;
    }

    .replay-clip-save-btn {
        min-width: 40px;
        font-size: 10px;
        height: 24px;
        padding: 0 6px;
    }
}

/* ======================================================
   REPLAY PROMPT DIALOG
   ====================================================== */
#replayPrompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 8600;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 18vh;
    pointer-events: none;
}

#replayPromptBox {
    background: rgba(8, 8, 24, 0.94);
    border: 1px solid rgba(255, 68, 68, 0.6);
    border-radius: 12px;
    padding: 22px 32px 20px;
    text-align: center;
    pointer-events: auto;
    box-shadow: 0 0 40px rgba(255, 68, 68, 0.25), 0 4px 24px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: replayPromptIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes replayPromptIn {
    from {
        transform: scale(0.85) translateY(-10px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

#replayPromptTitle {
    color: #ff6666;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 6px;
    text-shadow: 0 0 12px rgba(255, 68, 68, 0.5);
}

#replayPromptSub {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin-bottom: 18px;
    font-family: monospace;
}

#replayPromptBtns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

#replayPromptYes {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.6);
    color: #ff8888;
    font-size: 14px;
    padding: 8px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 1px;
    transition: background 0.15s, box-shadow 0.15s;
}

#replayPromptYes:hover {
    background: rgba(255, 68, 68, 0.3);
    box-shadow: 0 0 14px rgba(255, 68, 68, 0.4);
}

#replayPromptNo {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-family: monospace;
    transition: background 0.15s;
}

#replayPromptNo:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}
