/* ============================================
   Crownfall 3D - Styles
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #e8e8ff;
    cursor: default;
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas { display: block; }

/* ============================================
   Overlays (Men&uuml;s)
   ============================================ */
.overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: radial-gradient(ellipse at center, rgba(25, 15, 45, 0.92) 0%, rgba(3, 3, 10, 0.98) 100%);
    backdrop-filter: blur(10px);
}

/* Hauptmenü bekommt transparenten Overlay, damit die Canvas-Szene sichtbar bleibt */
#main-menu {
    background: radial-gradient(ellipse at center, rgba(10, 6, 25, 0.35) 0%, rgba(2, 1, 6, 0.65) 100%);
    backdrop-filter: none;
}

#main-menu .menu-inner {
    background: linear-gradient(135deg, rgba(30, 20, 65, 0.72) 0%, rgba(10, 8, 28, 0.88) 100%);
    backdrop-filter: blur(6px);
}

/* 3D-Renderer-Canvas im Hintergrund des Hauptmenüs */
.menu-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    pointer-events: none;
}

/* Audio-Kontrolle (oben rechts) */
.audio-control {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 200;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: rgba(15, 10, 35, 0.7);
    border: 1px solid rgba(180, 160, 255, 0.2);
    border-radius: 30px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s ease;
}

.audio-control.visible {
    display: flex;
}

.audio-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(80, 70, 120, 0.5);
    border: 1px solid rgba(160, 140, 220, 0.3);
    color: #e8d8ff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.audio-toggle:hover {
    background: rgba(120, 100, 180, 0.6);
    border-color: rgba(200, 180, 255, 0.5);
    transform: scale(1.05);
}

.audio-toggle.muted {
    background: rgba(80, 40, 40, 0.5);
    border-color: rgba(200, 100, 100, 0.4);
    color: #ff9898;
}

.audio-slider-wrap {
    display: flex;
    align-items: center;
    width: 110px;
}

.audio-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #c4501a 0%, #c4501a var(--val, 50%), rgba(255, 255, 255, 0.12) var(--val, 50%), rgba(255, 255, 255, 0.12) 100%);
    outline: none;
    cursor: pointer;
}

.audio-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffd080;
    box-shadow: 0 0 8px rgba(255, 180, 80, 0.6);
    cursor: pointer;
    border: none;
    transition: transform 0.15s;
}

.audio-volume::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

.audio-volume::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffd080;
    box-shadow: 0 0 8px rgba(255, 180, 80, 0.6);
    cursor: pointer;
    border: none;
}

.overlay.active {
    display: flex;
    animation: overlayIn 0.35s ease-out;
}

@keyframes overlayIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.menu-inner {
    position: relative;
    z-index: 2;
    min-width: 480px;
    max-width: 680px;
    padding: 50px 60px;
    background: linear-gradient(135deg, rgba(40, 30, 80, 0.65) 0%, rgba(15, 10, 40, 0.85) 100%);
    border: 1px solid rgba(180, 160, 255, 0.2);
    border-radius: 18px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 80px rgba(180, 140, 60, 0.15);
    text-align: center;
}

/* ============================================
   Hauptmen&uuml;
   ============================================ */
.logo-block { margin-bottom: 45px; }

.logo-crown {
    font-size: 60px;
    color: #ffd700;
    filter: drop-shadow(0 0 30px rgba(255, 210, 100, 0.8));
    margin-bottom: 10px;
    animation: crownFloat 3s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 30px rgba(255, 210, 100, 0.8)); }
    50% { transform: translateY(-8px); filter: drop-shadow(0 0 50px rgba(255, 180, 60, 1)); }
}

.logo-title {
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 12px;
    background: linear-gradient(180deg, #ffeb80 0%, #ffa020 50%, #c4401a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 20px rgba(255, 160, 50, 0.4);
    margin-bottom: 0;
}

.logo-sub {
    font-size: 18px;
    color: #c8b4ff;
    letter-spacing: 4px;
    font-style: italic;
    margin-top: -4px;
}

.logo-tag {
    display: inline-block;
    margin-top: 18px;
    padding: 4px 14px;
    font-size: 11px;
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: rgba(255, 215, 0, 0.08);
}

.menu-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

.mode-card {
    padding: 24px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    color: white;
    text-align: center;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mode-card:hover::before { left: 100%; }
.mode-card:hover { transform: translateY(-4px); }

.mode-defender {
    background: linear-gradient(135deg, #2e5a8f 0%, #1a3558 100%);
    border: 2px solid #4a90e2;
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.3);
}

.mode-defender:hover {
    box-shadow: 0 12px 32px rgba(74, 144, 226, 0.5);
    border-color: #6bb0ff;
}

.mode-attacker {
    background: linear-gradient(135deg, #8b2e2e 0%, #5a1a1a 100%);
    border: 2px solid #c44040;
    box-shadow: 0 6px 20px rgba(196, 64, 64, 0.3);
}

.mode-attacker:hover {
    box-shadow: 0 12px 32px rgba(196, 64, 64, 0.5);
    border-color: #ff6060;
}

.mode-icon {
    font-size: 42px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.mode-title {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 2px;
}

.mode-desc {
    font-size: 12px;
    color: #ccd;
    line-height: 1.4;
}

.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 360px;
    margin: 0 auto;
}

/* ============================================
   Buttons
   ============================================ */
.primary-btn {
    position: relative;
    padding: 18px 30px;
    background: linear-gradient(135deg, #8b4a14 0%, #c4501a 50%, #c41e3a 100%);
    border: 1px solid rgba(255, 200, 100, 0.5);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s;
}

.primary-btn:hover::before { left: 100%; }

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(196, 80, 26, 0.5);
}

.btn-sub {
    font-size: 12px;
    font-weight: normal;
    color: #ffdcb0;
    opacity: 0.8;
}

.secondary-btn {
    padding: 12px 24px;
    background: rgba(80, 70, 120, 0.4);
    border: 1px solid rgba(160, 140, 220, 0.3);
    border-radius: 8px;
    color: #d0c8ff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(100, 90, 160, 0.6);
    border-color: rgba(200, 180, 255, 0.5);
    color: white;
}

.debug-btn {
    margin-top: 8px;
    background: rgba(100, 50, 30, 0.4);
    border-color: rgba(255, 150, 80, 0.35);
    color: #ffc898;
    font-size: 13px;
    letter-spacing: 1px;
    position: relative;
}

.debug-btn::before {
    content: 'DEBUG';
    position: absolute;
    top: -6px;
    left: 10px;
    padding: 1px 6px;
    background: #c44020;
    color: white;
    font-size: 9px;
    font-weight: bold;
    border-radius: 8px;
    letter-spacing: 2px;
}

.debug-btn:hover {
    background: rgba(180, 80, 40, 0.5);
    border-color: rgba(255, 180, 100, 0.7);
    color: #ffe0b0;
}

.menu-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.build-tag {
    font-size: 11px;
    color: #888;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Hintergrund-Partikel (CSS-animiert) */
.bg-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.bg-particles::before,
.bg-particles::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 215, 0, 0.3), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(200, 150, 255, 0.4), transparent),
        radial-gradient(2px 2px at 80% 20%, rgba(255, 180, 100, 0.3), transparent),
        radial-gradient(1px 1px at 40% 85%, rgba(255, 255, 255, 0.3), transparent);
    background-size: 300px 300px;
    animation: particleDrift 60s linear infinite;
}

.bg-particles::after {
    animation-duration: 90s;
    animation-direction: reverse;
    opacity: 0.5;
}

@keyframes particleDrift {
    from { transform: translate(0, 0); }
    to { transform: translate(-300px, -300px); }
}

/* ============================================
   Tutorial / Credits
   ============================================ */
.section-title {
    font-size: 32px;
    margin-bottom: 25px;
    background: linear-gradient(180deg, #ffd700, #ff8800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 30px;
    margin-bottom: 30px;
}

.ctrl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 13px;
}

.ctrl-row span { color: #bbc; }

kbd {
    display: inline-block;
    padding: 3px 8px;
    background: linear-gradient(180deg, #444 0%, #222 100%);
    border: 1px solid #666;
    border-bottom: 2px solid #222;
    border-radius: 4px;
    color: #ffd700;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    font-weight: bold;
    min-width: 28px;
    text-align: center;
}

.credits-text {
    font-size: 15px;
    line-height: 1.7;
    color: #ccc;
    margin-bottom: 20px;
    text-align: left;
}

/* ============================================
   Lade-Bildschirm
   ============================================ */
.loader-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    font-size: 16px;
    color: #ccc;
    letter-spacing: 2px;
}

/* ============================================
   Game Over / Stats
   ============================================ */
.stats-panel {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 20px 25px;
    margin: 20px 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 15px;
    color: #ccc;
}

.stat-row:last-child {
    border-bottom: none;
    color: #ffd700;
    font-size: 18px;
    font-weight: bold;
}

#gameover-title.victory {
    background: linear-gradient(180deg, #ffd700, #ff8800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#gameover-title.defeat {
    background: linear-gradient(180deg, #ff5050, #8b0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   HUD
   ============================================ */
.hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
}

.hud.hidden { display: none; }

.hud-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(10, 10, 25, 0.7) 0%, rgba(10, 10, 25, 0) 100%);
}

.hud-stats {
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(15, 12, 35, 0.75);
    border: 1px solid rgba(180, 160, 255, 0.25);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    backdrop-filter: blur(6px);
    min-width: 100px;
}

.hud-item .hud-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 4px currentColor);
}

.hud-lives .hud-icon { color: #ff5050; }
.hud-gold .hud-icon { color: #ffd700; }
.hud-wave .hud-icon { color: #b080ff; }
.hud-score .hud-icon { color: #fff; }

.hud-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.hud-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff3030, #ff6060);
    transition: width 0.3s ease-out;
    border-radius: 3px;
}

.hud-val {
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}

.hud-actions {
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.hud-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #3e6030 0%, #2a4020 100%);
    border: 1px solid #5ea040;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.hud-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.hud-btn kbd { color: #fff; }

.allin-btn {
    background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
    border: 2px solid #ff6060;
    box-shadow: 0 0 20px rgba(255, 60, 60, 0.4), inset 0 1px 0 rgba(255, 200, 100, 0.3);
    position: relative;
    overflow: hidden;
    flex-direction: column;
    gap: 0;
    padding: 8px 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    animation: allinPulse 1.6s ease-in-out infinite;
}

.allin-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.35), transparent);
    animation: allinShine 2.5s linear infinite;
}

@keyframes allinPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 60, 60, 0.4), inset 0 1px 0 rgba(255, 200, 100, 0.3); }
    50% { box-shadow: 0 0 35px rgba(255, 100, 50, 0.8), inset 0 1px 0 rgba(255, 200, 100, 0.5); }
}

@keyframes allinShine {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.allin-btn small {
    font-size: 9px;
    color: #ffd700;
    font-weight: normal;
    letter-spacing: 1px;
}

.allin-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 4px rgba(255, 200, 100, 0.6));
}

.allin-btn:hover {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.15);
}

.allin-btn.used {
    opacity: 0.35;
    cursor: not-allowed;
    animation: none;
    filter: grayscale(0.7);
    pointer-events: none;
}

.allin-btn.used::before { display: none; }

/* All-In Screen-Effekt */
.allin-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255, 60, 20, 0.7) 0%, rgba(120, 0, 0, 0.4) 40%, transparent 70%);
    pointer-events: none;
    z-index: 200;
    opacity: 0;
    animation: allinFlash 2s ease-out;
}

@keyframes allinFlash {
    0% { opacity: 0; }
    15% { opacity: 1; }
    100% { opacity: 0; }
}

.allin-announce {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 96px;
    font-weight: 900;
    letter-spacing: 14px;
    background: linear-gradient(180deg, #ffe080 0%, #ff5020 60%, #8b0000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 80px rgba(255, 80, 20, 0.9);
    opacity: 0;
    pointer-events: none;
    z-index: 201;
    text-align: center;
    animation: allinAnnounce 2.4s ease-out;
}

@keyframes allinAnnounce {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); letter-spacing: 0; }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); letter-spacing: 20px; }
    70% { opacity: 1; transform: translate(-50%, -50%) scale(1); letter-spacing: 14px; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

/* Crosshair */
.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.crosshair-dot {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
}

.crosshair-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.hud.aiming .crosshair-ring { opacity: 1; }

/* Pointer-Lock-Hinweis (erscheint wenn Maus-Steuerung nicht aktiv) */
.pointer-lock-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 22px 36px;
    background: rgba(10, 10, 30, 0.88);
    border: 1px solid rgba(255, 215, 0, 0.55);
    border-radius: 14px;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    pointer-events: auto;
    z-index: 30;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(255, 215, 0, 0.2);
    animation: plh-pulse 1.8s ease-in-out infinite;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pointer-lock-hint:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55), 0 0 55px rgba(255, 215, 0, 0.55);
}
.pointer-lock-hint.hidden { display: none; }
.pointer-lock-hint .plh-icon {
    font-size: 40px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}
.pointer-lock-hint .plh-text {
    font-size: 20px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
    letter-spacing: 0.5px;
}
.pointer-lock-hint .plh-sub {
    font-size: 12px;
    color: rgba(230, 230, 255, 0.75);
    letter-spacing: 0.3px;
}
.pointer-lock-hint kbd {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
}
@keyframes plh-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.92; }
    50%      { transform: translate(-50%, -50%) scale(1.04); opacity: 1; }
}

/* Interact-Prompt */
.interact-prompt {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translate(-50%, 0);
    padding: 12px 24px;
    background: rgba(10, 10, 30, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 30px;
    backdrop-filter: blur(6px);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    animation: promptFloat 1.5s ease-in-out infinite;
}

.interact-prompt.hidden { display: none; }

@keyframes promptFloat {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -4px); }
}

/* Wellen-Ank&uuml;ndigung */
.wave-announce {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    font-size: 64px;
    font-weight: 900;
    letter-spacing: 6px;
    background: linear-gradient(180deg, #ffe080 0%, #ff4040 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(255, 100, 50, 0.8);
    opacity: 0;
    text-align: center;
}

.wave-announce.show {
    animation: announce 2.8s ease-out;
}

@keyframes announce {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}

/* Benachrichtigungen */
.notifications {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
}

.notification {
    padding: 10px 16px;
    background: rgba(15, 12, 35, 0.85);
    border-left: 3px solid #ffd700;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    backdrop-filter: blur(6px);
    animation: notifIn 0.3s ease-out;
}

.notification.error { border-left-color: #ff5050; }
.notification.success { border-left-color: #5ec850; }

@keyframes notifIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Commander-Panel */
.commander-panel {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(40, 15, 15, 0.92) 0%, rgba(12, 5, 5, 0.96) 100%);
    border: 1px solid rgba(255, 80, 60, 0.4);
    border-radius: 14px;
    padding: 12px 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 30px rgba(200, 60, 40, 0.15);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    z-index: 14;
    min-width: 560px;
}

.commander-panel.hidden { display: none; }

.commander-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cmd-title {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 3px;
    color: #ff8866;
    text-shadow: 0 0 8px rgba(255, 100, 80, 0.5);
}

.cmd-sub {
    font-size: 10px;
    color: #aaa;
    letter-spacing: 1px;
}

.commander-monsters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.commander-queue {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed rgba(255, 130, 80, 0.35);
    border-radius: 8px;
}

.queue-label {
    font-size: 11px;
    color: #ff8866;
    letter-spacing: 2px;
    white-space: nowrap;
    font-weight: bold;
}

.queue-slots {
    flex: 1;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    min-height: 32px;
    align-items: center;
}

.queue-item {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
    animation: queueAdd 0.2s ease-out;
    transition: transform 0.15s;
}

.queue-item::after {
    content: attr(data-idx);
    position: absolute;
    top: -6px;
    left: -4px;
    background: #ffaa44;
    color: #1a0808;
    font-size: 9px;
    font-weight: bold;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.queue-item:hover {
    transform: scale(1.1);
}

.queue-item.firing {
    animation: queueFire 0.4s ease-out;
}

@keyframes queueAdd {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes queueFire {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 255, 255, 0.8); }
    50% { transform: scale(1.3); box-shadow: 0 0 20px rgba(255, 200, 100, 0.9); }
    100% { transform: scale(0); opacity: 0; }
}

.queue-empty-hint {
    font-size: 11px;
    color: #aa6666;
    font-style: italic;
    letter-spacing: 1px;
}

.queue-clear {
    padding: 4px 8px;
    background: rgba(120, 30, 30, 0.5);
    border: 1px solid rgba(200, 60, 60, 0.4);
    border-radius: 6px;
    color: #ff8866;
    cursor: pointer;
    font-size: 14px;
}

.queue-clear:hover {
    background: rgba(180, 40, 40, 0.8);
}

.cmd-card.locked {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.cmd-card {
    padding: 8px 10px;
    background: linear-gradient(180deg, rgba(60, 25, 25, 0.7) 0%, rgba(25, 10, 10, 0.9) 100%);
    border: 1px solid rgba(200, 100, 80, 0.3);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.cmd-card:hover {
    border-color: #ff8866;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255, 100, 80, 0.3);
}

.cmd-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cmd-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.cmd-card-name {
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.cmd-card-cost {
    font-size: 11px;
    color: #ffcc66;
}

/* Mini-Kompass */
.mini-compass {
    position: absolute;
    top: 90px;
    right: 30px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at center, rgba(20, 15, 50, 0.8) 60%, rgba(0, 0, 0, 0.5) 100%);
    border: 2px solid rgba(180, 160, 255, 0.3);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(100, 80, 180, 0.2);
    pointer-events: auto;
}

.compass-dial {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6px;
}

.compass-n {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 0 0 4px rgba(255, 100, 100, 0.6);
}

.compass-castle,
.compass-portal {
    position: absolute;
    top: 50%; left: 50%;
    font-size: 15px;
    transform: translate(-50%, -50%);
    text-shadow: 0 0 6px currentColor;
}

.compass-castle { color: #ffd700; }
.compass-portal { color: #c040ff; }

/* ============================================
   Bau-Men&uuml;
   ============================================ */
.build-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 24px 30px;
    background: linear-gradient(135deg, rgba(30, 20, 60, 0.95) 0%, rgba(10, 8, 30, 0.98) 100%);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    min-width: 500px;
    z-index: 50;
    display: none;
    pointer-events: auto;
}

.build-menu.visible { display: block; animation: buildIn 0.2s ease-out; }

@keyframes buildIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.build-menu h3 {
    color: #ffd700;
    margin-bottom: 18px;
    text-align: center;
    letter-spacing: 2px;
}

.build-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.build-card {
    padding: 12px;
    background: linear-gradient(180deg, rgba(60, 50, 100, 0.6) 0%, rgba(25, 20, 55, 0.9) 100%);
    border: 2px solid rgba(120, 120, 200, 0.4);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.build-card:hover {
    border-color: #ffd700;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 200, 100, 0.3);
}

.build-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.build-card.disabled:hover {
    transform: none;
    border-color: rgba(120, 120, 200, 0.4);
    box-shadow: none;
}

.build-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.build-name {
    font-size: 13px;
    font-weight: bold;
    color: white;
}

.build-cost {
    font-size: 12px;
    color: #ffd700;
}

.build-desc {
    font-size: 11px;
    color: #aab;
    line-height: 1.3;
    margin-top: 4px;
}

.menu-hint {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: #888;
}

/* ============================================
   Draft-Phase
   ============================================ */
.draft-overlay { align-items: stretch; padding: 30px; }

.draft-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: auto;
    background: linear-gradient(135deg, rgba(30, 22, 60, 0.92) 0%, rgba(12, 8, 30, 0.96) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 30px 40px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 60px rgba(180, 140, 60, 0.12);
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 60px);
}

.draft-header {
    text-align: center;
}

.phase-badge {
    display: inline-block;
    padding: 4px 14px;
    background: linear-gradient(90deg, rgba(255, 180, 60, 0.2), rgba(196, 80, 26, 0.2));
    border: 1px solid rgba(255, 180, 60, 0.4);
    border-radius: 16px;
    font-size: 11px;
    letter-spacing: 4px;
    color: #ffd700;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.draft-title {
    font-size: 36px;
    background: linear-gradient(180deg, #ffe080 0%, #ff8800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.draft-sub {
    font-size: 14px;
    color: #bbc;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.5;
}

.draft-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    flex: 1;
    min-height: 0;
}

.draft-body-3col {
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 16px;
}

.draft-spells .col-header h3 {
    background: linear-gradient(180deg, #c080ff 0%, #7030c0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.soon-tag {
    background: linear-gradient(90deg, rgba(200, 130, 255, 0.2), rgba(120, 50, 180, 0.2));
    border: 1px solid rgba(180, 120, 240, 0.4);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 10px;
    color: #d0a8ff !important;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.spells-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    align-content: flex-start;
}

.spell-card {
    padding: 10px 8px;
    background: linear-gradient(180deg, rgba(60, 40, 95, 0.4) 0%, rgba(25, 15, 55, 0.7) 100%);
    border: 1px solid rgba(140, 100, 200, 0.25);
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    transition: all 0.2s;
}

.spell-card:hover {
    border-color: rgba(180, 120, 240, 0.5);
}

.spell-card.locked {
    opacity: 0.55;
    filter: grayscale(0.4);
}

.spell-card.locked::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(120, 70, 180, 0.05) 8px,
        rgba(120, 70, 180, 0.05) 16px
    );
    pointer-events: none;
}

.spell-icon {
    font-size: 22px;
    filter: drop-shadow(0 0 6px rgba(180, 120, 240, 0.5));
}

.spell-name {
    font-size: 11px;
    font-weight: bold;
    color: #e0c8ff;
}

.spell-desc {
    font-size: 10px;
    color: #998bb0;
    line-height: 1.3;
}

.spell-lock {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 11px;
    color: #998bb0;
}

.spells-note {
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    font-size: 11px;
    color: #998bb0;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.draft-col {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(180, 160, 255, 0.15);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    min-height: 0;
}

.col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.col-header h3 {
    font-size: 18px;
    color: #ffd700;
    letter-spacing: 2px;
}

.draft-counter, .wave-count {
    font-size: 13px;
    color: #aab;
}

.draft-counter strong, .wave-count strong {
    color: #ffd700;
    font-size: 15px;
}

/* Turm-Grid */
.draft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
    gap: 10px;
    flex: 1;
    align-content: flex-start;
    overflow-y: auto;
    padding-right: 4px;
}

.draft-tower {
    padding: 12px 10px;
    background: linear-gradient(180deg, rgba(60, 50, 95, 0.6) 0%, rgba(25, 20, 55, 0.9) 100%);
    border: 2px solid rgba(120, 120, 200, 0.35);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.draft-tower:hover {
    transform: translateY(-3px);
    border-color: #8080ff;
    box-shadow: 0 6px 16px rgba(120, 120, 255, 0.3);
}

.draft-tower.selected {
    border-color: #ffd700;
    background: linear-gradient(180deg, rgba(120, 90, 30, 0.7) 0%, rgba(60, 40, 10, 0.9) 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.draft-tower.selected::after {
    content: '\2713';
    position: absolute;
    top: 4px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: #ffd700;
    color: #2a1a10;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
}

.draft-tower-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.draft-tower-name {
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.draft-tower-cost {
    font-size: 11px;
    color: #ffd700;
}

/* Gewählte Slots */
.draft-slots {
    display: flex;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.draft-slot {
    flex: 1;
    aspect-ratio: 1;
    max-height: 56px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed rgba(120, 120, 200, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 20px;
    transition: all 0.2s;
}

.draft-slot.filled {
    border-style: solid;
    border-color: #ffd700;
    background: rgba(60, 45, 10, 0.5);
    color: white;
    box-shadow: 0 0 12px rgba(255, 200, 60, 0.4);
}

/* Feindliche Wellen-Vorschau */
.wave-preview {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.wave-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid rgba(255, 100, 100, 0.5);
    border-radius: 6px;
    transition: all 0.15s;
}

.wave-row:hover {
    background: rgba(40, 20, 30, 0.5);
    border-left-color: #ff6060;
}

.wave-row.boss {
    border-left-color: #ffd700;
    background: linear-gradient(90deg, rgba(80, 50, 10, 0.4), rgba(0, 0, 0, 0.3));
}

.wave-num {
    min-width: 54px;
    font-size: 12px;
    font-weight: bold;
    color: #aab;
}

.wave-enemies {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.wave-enemy {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: rgba(40, 20, 20, 0.7);
    border: 1px solid rgba(200, 80, 80, 0.3);
    border-radius: 12px;
    font-size: 11px;
    color: white;
}

.wave-enemy.goblin { border-color: rgba(107, 166, 63, 0.5); }
.wave-enemy.orc { border-color: rgba(160, 64, 64, 0.5); }
.wave-enemy.troll { border-color: rgba(90, 74, 58, 0.6); }
.wave-enemy.dragon {
    border-color: rgba(255, 215, 0, 0.6);
    background: rgba(80, 20, 20, 0.6);
    color: #ffd700;
}

.wave-enemy-count {
    font-weight: bold;
}

.wave-enemy-icon { font-size: 14px; }

/* Bedrohungsbalken */
.threat-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.threat-label {
    font-size: 11px;
    color: #aab;
    letter-spacing: 2px;
    text-transform: uppercase;
    min-width: 120px;
}

.threat-track {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
}

.threat-fill {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #5ec850 0%, #ffcc00 50%, #ff3030 100%);
    border-radius: 4px;
    transition: width 0.3s;
}

/* Footer */
.draft-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.draft-start {
    min-width: 220px;
}

.draft-start:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   Prep-Banner (zwischen Wellen)
   ============================================ */
.prep-banner {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
    background: linear-gradient(135deg, rgba(20, 40, 70, 0.92) 0%, rgba(10, 15, 40, 0.96) 100%);
    border: 1px solid rgba(100, 180, 255, 0.4);
    border-radius: 14px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(100, 160, 255, 0.15);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    z-index: 15;
    animation: prepSlideIn 0.4s ease-out;
}

.prep-banner.hidden { display: none; }

@keyframes prepSlideIn {
    from { transform: translate(-50%, -30px); opacity: 0; }
    to { transform: translateX(-50%); opacity: 1; }
}

.prep-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prep-phase {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 3px;
    color: #88bbff;
}

.prep-hint {
    font-size: 11px;
    color: #aab;
}

.prep-timer {
    position: relative;
    width: 60px;
    height: 60px;
}

.prep-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.prep-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.prep-ring-fill {
    fill: none;
    stroke: #44aaff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 138;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.2s linear, stroke 0.3s;
    filter: drop-shadow(0 0 4px #44aaff);
}

.prep-ring-fill.warning { stroke: #ffcc00; filter: drop-shadow(0 0 4px #ffcc00); }
.prep-ring-fill.danger { stroke: #ff4040; filter: drop-shadow(0 0 6px #ff4040); }

.prep-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 900;
    color: white;
    font-variant-numeric: tabular-nums;
}

.prep-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.prep-label {
    font-size: 11px;
    color: #88bbff;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.prep-enemies {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.prep-enemy {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(60, 20, 20, 0.6);
    border: 1px solid rgba(200, 80, 80, 0.4);
    border-radius: 10px;
    color: white;
}

.prep-enemy.dragon {
    border-color: rgba(255, 215, 0, 0.6);
    color: #ffd700;
}

/* ============================================
   Intro-Overlay (Text über der 3D-Szene)
   ============================================ */
.intro-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.4) 100%);
}

.intro-overlay.fadeout {
    animation: introFade 0.8s ease-out forwards;
}

@keyframes introFade {
    to { opacity: 0; transform: scale(1.05); }
}

/* Intro-Skip-Button (unten rechts während Intro) */
.intro-skip-btn {
    position: absolute;
    bottom: 28px;
    right: 28px;
    z-index: 250;
    padding: 10px 18px;
    background: rgba(15, 10, 30, 0.65);
    border: 1px solid rgba(255, 200, 100, 0.35);
    border-radius: 22px;
    color: #ffd9a0;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: skipBtnIn 0.8s ease-out 1.5s backwards;
    transition: all 0.2s ease;
}

.intro-skip-btn:hover {
    background: rgba(40, 25, 15, 0.8);
    border-color: rgba(255, 220, 140, 0.7);
    color: #ffe8bc;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(200, 120, 40, 0.4);
}

.intro-skip-btn kbd {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 220, 140, 0.3);
    border-radius: 5px;
    font-size: 11px;
    letter-spacing: 1px;
    color: #ffd080;
    font-family: 'Segoe UI', monospace;
}

.intro-skip-btn.fadeout {
    animation: skipBtnOut 0.4s ease-in forwards;
}

@keyframes skipBtnIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes skipBtnOut {
    to { opacity: 0; transform: translateY(10px); }
}

.intro-title-main {
    font-size: 140px;
    font-weight: 900;
    letter-spacing: 16px;
    background: linear-gradient(180deg, #ffe080 0%, #ff5020 50%, #8b0000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 120px rgba(255, 80, 20, 0.9);
    animation: introTitlePulse 4s ease-in-out infinite;
    margin-bottom: 10px;
    text-align: center;
}

.intro-title-sub {
    font-size: 22px;
    font-style: italic;
    color: #ffd08a;
    letter-spacing: 6px;
    text-shadow: 0 0 20px rgba(255, 180, 80, 0.7);
    animation: introSubFade 2s ease-in-out;
    text-align: center;
}

@keyframes introTitlePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 40px rgba(255, 80, 20, 0.6)); }
    50% { transform: scale(1.02); filter: drop-shadow(0 0 80px rgba(255, 140, 40, 0.9)); }
}

@keyframes introSubFade {
    0% { opacity: 0; transform: translateY(20px); }
    50% { opacity: 1; transform: translateY(0); }
    100% { opacity: 1; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

/* ====== Online-Lobby ====== */
.lobby-overlay .lobby-stage {
    max-width: 720px;
    padding: 32px 40px;
    text-align: center;
}
.lobby-title {
    font-size: 28px;
    margin: 0 0 8px;
    letter-spacing: 0.04em;
}
.lobby-sub {
    opacity: 0.75;
    margin: 0 0 24px;
    font-size: 14px;
}
.lobby-actions {
    display: flex;
    gap: 20px;
    align-items: stretch;
    justify-content: center;
    margin: 16px 0 24px;
    flex-wrap: wrap;
}
.lobby-card {
    flex: 1 1 240px;
    max-width: 280px;
    background: rgba(20, 30, 50, 0.55);
    border: 1px solid rgba(120, 180, 255, 0.25);
    border-radius: 12px;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}
.lobby-card h3 {
    margin: 0;
    font-size: 16px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.9;
}
.lobby-side,
.lobby-code-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.lobby-side select,
.lobby-code-label input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(120, 180, 255, 0.4);
    color: #eef;
    font-size: 15px;
    border-radius: 6px;
    box-sizing: border-box;
}
.lobby-code-label input {
    font-family: 'Courier New', monospace;
    font-size: 22px;
    letter-spacing: 0.2em;
    text-align: center;
    text-transform: uppercase;
}
.lobby-divider {
    align-self: center;
    opacity: 0.4;
    font-size: 13px;
    padding: 0 8px;
}
.lobby-code-display {
    margin: 18px auto 8px;
    padding: 14px 24px;
    display: inline-block;
    background: rgba(255, 200, 80, 0.08);
    border: 1px solid rgba(255, 200, 80, 0.35);
    border-radius: 12px;
}
.lobby-code-label-big {
    display: block;
    font-size: 11px;
    letter-spacing: 0.25em;
    opacity: 0.6;
    margin-bottom: 4px;
    text-transform: uppercase;
}
.lobby-code-value {
    font-family: 'Courier New', monospace;
    font-size: 48px;
    letter-spacing: 0.3em;
    font-weight: bold;
    color: #ffd866;
}
.lobby-share {
    display: flex;
    gap: 8px;
    max-width: 520px;
    margin: 0 auto 16px;
}
.lobby-share input {
    flex: 1;
    padding: 8px 10px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(120,180,255,0.3);
    color: #eef;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
}
.lobby-meta {
    font-size: 13px;
    opacity: 0.85;
    margin: 12px 0;
}
.lobby-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 18px 0 12px;
}
.lobby-vs-side {
    background: rgba(20, 30, 50, 0.55);
    border: 1px solid rgba(120, 180, 255, 0.3);
    border-radius: 10px;
    padding: 14px 22px;
    min-width: 140px;
}
.lobby-vs-side strong {
    display: block;
    font-size: 20px;
    margin-top: 4px;
}
.lobby-vs-label {
    font-size: 11px;
    opacity: 0.6;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.lobby-vs-x {
    font-size: 24px;
    opacity: 0.5;
    letter-spacing: 0.1em;
}
.loader-spinner.small {
    width: 28px;
    height: 28px;
    margin: 14px auto;
}
.mode-card.mode-online {
    background: linear-gradient(135deg, #2a6d6a 0%, #1a3f4f 100%);
    border: 2px solid #4fd0c0;
    box-shadow: 0 6px 20px rgba(79, 208, 192, 0.3);
}
.mode-card.mode-online:hover {
    box-shadow: 0 12px 32px rgba(79, 208, 192, 0.55);
    border-color: #7df0dc;
}
.mode-card.mode-online .mode-icon {
    filter: drop-shadow(0 0 16px rgba(120, 240, 220, 0.6));
}

.mode-card.mode-singleplayer {
    background: linear-gradient(135deg, #4a3a8f 0%, #2a1f58 100%);
    border: 2px solid #8e7dff;
    box-shadow: 0 6px 20px rgba(142, 125, 255, 0.3);
}
.mode-card.mode-singleplayer:hover {
    box-shadow: 0 12px 32px rgba(142, 125, 255, 0.55);
    border-color: #b5a8ff;
}
.mode-card.mode-singleplayer .mode-icon {
    filter: drop-shadow(0 0 16px rgba(180, 160, 255, 0.6));
}

/* Zwei-Spalten-Layout im Hauptmenü */
.menu-modes-2col {
    grid-template-columns: 1fr 1fr;
}

/* Rollen-Popup (Singleplayer) */
.role-overlay .menu-inner {
    max-width: 720px;
}
.role-title {
    font-size: 26px;
    margin: 0 0 6px;
    letter-spacing: 0.04em;
    text-align: center;
}
.role-sub {
    opacity: 0.75;
    margin: 0 0 24px;
    font-size: 14px;
    text-align: center;
}

/* Lobby: Raumliste */
.lobby-list-wrap {
    background: rgba(10, 20, 35, 0.55);
    border: 1px solid rgba(120, 180, 255, 0.25);
    border-radius: 12px;
    padding: 18px;
    margin: 16px auto 20px;
    max-width: 560px;
    text-align: left;
}
.lobby-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.lobby-list-header h3 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}
.lobby-refresh-btn {
    background: rgba(120, 180, 255, 0.15);
    border: 1px solid rgba(120, 180, 255, 0.4);
    color: #cde;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.3s;
}
.lobby-refresh-btn:hover { transform: rotate(90deg); background: rgba(120, 180, 255, 0.3); }
.lobby-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}
.lobby-empty {
    text-align: center;
    padding: 28px 10px;
    opacity: 0.55;
    font-size: 14px;
}
.lobby-room-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 50, 80, 0.5);
    border: 1px solid rgba(120, 180, 255, 0.25);
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    color: #eef;
    font-family: inherit;
    text-align: left;
    transition: all 0.15s;
}
.lobby-room-entry:hover {
    background: rgba(60, 100, 160, 0.6);
    border-color: rgba(140, 200, 255, 0.6);
    transform: translateX(4px);
}
.lobby-room-main { display: flex; flex-direction: column; gap: 2px; }
.lobby-room-code {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.2em;
    color: #ffd866;
}
.lobby-room-side { font-size: 11px; opacity: 0.65; letter-spacing: 0.08em; }
.lobby-room-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11px; }
.lobby-room-age { opacity: 0.5; }
.lobby-room-join { color: #4fd0c0; font-weight: 500; }

.lobby-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
    margin: 0 auto;
}

/* MP-Bereitschaft: Indikator im Draft und in der Lobby */
.draft-peer-status {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
}
.draft-peer-status.waiting,
.lobby-status.waiting {
    background: rgba(255, 200, 80, 0.15);
    border: 1px solid rgba(255, 200, 80, 0.45);
    color: #ffd866;
}
.draft-peer-status.ready,
.lobby-status.ready {
    background: rgba(80, 220, 120, 0.15);
    border: 1px solid rgba(80, 220, 120, 0.5);
    color: #8ef0a8;
}
.lobby-status {
    display: inline-block;
    margin: 12px 0;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}
