: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 {
    font-size: 11px;
    letter-spacing: 3px;
    font-family: monospace;
    font-weight: 700;
    text-transform: uppercase;
    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 1.1s linear infinite;
}

#preloaderArc2 {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: spin-reverse 0.85s linear infinite;
}

#preloaderDomain {
    font-size: 11px;
    letter-spacing: 2px;
    font-family: monospace;
    font-weight: 700;
    text-transform: uppercase;
    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,
#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 1.2s ease-in-out, background 0.2s;
    z-index: 110;
    line-height: normal;
}

.ui-toggle-btn {
    padding-bottom: 5px;
}

/* Korrektur für Augen-Icon Baseline */
#debugToggleBtn:hover,
#gfxSelectMainWrapper:hover,
.low-graphics-toggle:hover,
.ui-toggle-btn:hover {
    background: rgba(var(--theme-primary-rgb), 0.2);
}

#debugToggleBtn 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,
#gfxSelectMainWrapper span,
.low-graphics-toggle span,
.ui-toggle-btn span {
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#debugToggleBtn {
    top: 60px;
}

.low-graphics-toggle {
    top: 75px;
}

#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: 5px;
    z-index: 10;
    pointer-events: none;
}

#pingDisplay,
#statsDisplay,
#uptimeDisplay {
    font-size: 13px;
    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 10px;
    border-radius: 10px;
    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 1.2s ease-in-out;
    white-space: nowrap;
}

#uptimeDisplay {
    color: var(--theme-primary);
}

.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);
}

#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: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.legal-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
    margin: 0 5px;
}

.legal-footer a:hover {
    color: var(--theme-primary);
    text-shadow: 0 0 5px rgba(var(--theme-primary-rgb), 0.5);
}


/* ================================================================
 * 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;
}

.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;
}

/* 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 !important;
    height: 150px !important;
    aspect-ratio: 1 / 1 !important;
    max-width: none !important;
    max-height: none !important;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(var(--theme-primary-rgb), 0.3);
    border-radius: 50% !important;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
    z-index: 50 !important;
    pointer-events: auto;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#minimap {
    width: 100%;
    height: 100%;
}

.minimap-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 50;
    pointer-events: none;
}

.minimap-wrapper .minimap-container {
    position: relative !important;
    bottom: 0 !important;
    right: 0 !important;
}

.toggle-minimap-btn {
    position: absolute;
    top: 0;
    right: 0;
    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: 6px;
    margin-bottom: 4px;
    position: relative;
    min-height: 26px;
}

.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 {
    left: 0;
    font-size: 14px;
}

#specClose {
    right: 0;
    font-size: 18px !important;
    line-height: 1 !important;
    margin-right: 0px !important;
}

.spectator-ui .panel-title {
    color: var(--theme-primary);
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(var(--theme-primary-rgb), 0.5);
    margin: 0;
    text-align: center;
    width: 100%;
    padding: 0 28px;
    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 45px 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-size: 12px;
    font-weight: 900;
    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);
}

/* Kein Wobble im Badge */
.mode-badge .jelly-letter {
    animation: none !important;
    transform: none !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    -webkit-text-stroke: 0 !important;
    filter: none !important;
}

.mode-badge .badge-word:first-child .jelly-letter {
    color: var(--theme-primary);
    text-shadow: 0 0 6px rgba(var(--theme-primary-rgb), 0.5);
}

.mode-badge .badge-word:last-child .jelly-letter {
    color: var(--theme-secondary);
    text-shadow: 0 0 6px rgba(var(--theme-secondary-rgb), 0.5);
}

.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;
}

.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;
    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,
.minimap-container,
#debugOverlay,
#pingDisplay,
#statsDisplay,
#uptimeDisplay,
.score-board,
.legal-footer,
.version-label {
    transition: opacity 1.2s 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 .minimap-container,
body.idle-hidden .ping-display,
body.idle-hidden .uptime-display,
body.idle-hidden .stats-display,
body.idle-hidden .fps-display,
body.idle-hidden .score-board,
body.idle-hidden #debugToggleBtn,
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 {
    opacity: 0 !important;
    pointer-events: none !important;
}


/* ================================================================
 * 9. SURVIVAL & SPECIAL THEMES
 * ================================================================ */
/* SURVIVAL & SPECIAL THEMES Override - Jetzt konsistent mit Menü */
.mode-badge {
    font-family: 'DynaPuff', 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,
    #gfxSelectMainWrapper,
    .low-graphics-toggle,
    .ui-toggle-btn {
        left: 10px;
        font-size: 11px;
        padding: 2px 4px;
        border-radius: 6px;
        gap: 5px;
    }

    #debugToggleBtn input,
    .low-graphics-toggle input[type="checkbox"],
    .ui-toggle-btn input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }

    #debugToggleBtn {
        top: 35px;
    }

    .low-graphics-toggle,
    #gfxSelectMainWrapper {
        top: 57px;
    }

    #debugOverlay {
        top: 79px;
        left: 10px;
        gap: 3px;
    }

    #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: 6px;
    }

    .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;
    }

    .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;
    }
}

@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;
    }

    .minimap-container {
        width: 75px !important;
        height: 75px !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);
}

@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
 * ================================================================ */

/* From public/survival.html */

.minimap-container {
    width: 150px !important;
    height: 150px !important;
    aspect-ratio: 1/1 !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 50% !important;
}

@media (max-width: 800px) {
    .minimap-container {
        width: 100px !important;
        height: 100px !important;
    }
}

#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 */


/* From public/singleplayer.html */

.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');
}