/*═══════════════════════════════════════════════════════════════
   NEON RIDER - CSS FRAMEWORK
   Teil 1: Base, Variables & Reset
═══════════════════════════════════════════════════════════════*/

/* ─────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Neon Colors */
    --neon-pink: #FF10F0;
    --neon-cyan: #00F0FF;
    --neon-purple: #B026FF;
    --neon-yellow: #FFF01F;
    --neon-green: #39FF14;
    --neon-orange: #FF6B35;
    --neon-red: #FF0055;
    
    /* Background */
    --dark-bg: #0a0a0a;
    --grid-color: #1a1a2e;
    --overlay-bg: rgba(10, 10, 10, 0.95);
    --card-bg: rgba(26, 26, 46, 0.5);
    --card-bg-hover: rgba(26, 26, 46, 0.8);
}

body {
    margin: 0;
    padding: 0;
    background: var(--dark-bg);
    font-family: 'Courier New', monospace;
    color: var(--neon-cyan);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* ─────────────────────────────────────
   GAME CONTAINER
   ───────────────────────────────────── */
.game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 800px;
    background: var(--dark-bg);
    border: 2px solid var(--neon-cyan);
    box-shadow: 
        0 0 20px var(--neon-cyan),
        inset 0 0 20px rgba(0, 240, 255, 0.1);
    animation: borderGlow 3s infinite;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
}

/* ─────────────────────────────────────
   UTILITY CLASSES
   ───────────────────────────────────── */
/* BUG FIX: Removed redundant visibility/opacity/pointer-events.
   display:none already removes the element from rendering entirely.
   Having !important on all four caused conflicts when JS set inline display styles. */
.hidden {
    display: none !important;
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.glitch {
    animation: glitch 0.3s ease-in-out;
}

.slow-motion {
    animation: slowMotion 1s ease-out;
}
/*═══════════════════════════════════════════════════════════════
   Teil 2: Typography & Text Effects
═══════════════════════════════════════════════════════════════*/

/* ─────────────────────────────────────
   NEON TEXT EFFECTS
   ───────────────────────────────────── */
.neon-title {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--neon-pink);
    text-shadow: 
        0 0 10px var(--neon-pink),
        0 0 20px var(--neon-pink),
        0 0 30px var(--neon-pink),
        0 0 40px var(--neon-pink);
    margin: 30px 0;
    letter-spacing: 6px;
    animation: flicker 3s infinite alternate;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--neon-cyan);
    margin-bottom: 25px;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.neon-text {
    color: var(--neon-yellow);
    text-shadow: 
        0 0 10px var(--neon-yellow),
        0 0 20px var(--neon-yellow);
}

/* ─────────────────────────────────────
   HIGH SCORE TEXT
   ───────────────────────────────────── */
.high-score {
    margin-top: 5px;
    font-size: 1.2rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
}

.new-high-score {
    color: var(--neon-green);
    font-size: 1.5rem;
    text-shadow: 
        0 0 10px var(--neon-green),
        0 0 20px var(--neon-green);
    animation: pulse 1s infinite;
    margin: 20px 0;
}
/*═══════════════════════════════════════════════════════════════
   Teil 3: Buttons
═══════════════════════════════════════════════════════════════*/

/* ─────────────────────────────────────
   BASE BUTTON STYLES
   ───────────────────────────────────── */
.neon-button {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 12px 28px;
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 10px var(--neon-cyan),
        inset 0 0 10px rgba(0, 240, 255, 0.1);
    margin: 20px 0;
}

.neon-button:hover,
.neon-button:focus-visible {
    background: var(--neon-cyan);
    color: var(--dark-bg);
    box-shadow: 
        0 0 20px var(--neon-cyan),
        0 0 30px var(--neon-cyan),
        inset 0 0 20px rgba(0, 240, 255, 0.5);
}

.neon-button:focus-visible {
    outline: none;
    transform: scale(1.04);
}

.neon-button:active {
    transform: scale(0.98);
}

.neon-button.small {
    padding: 10px 25px;
    font-size: 0.9rem;
    margin-top: 20px;
}

.neon-button.secondary {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    box-shadow: 0 0 15px var(--neon-purple);
}

.neon-button.secondary:hover {
    background: var(--neon-purple);
    color: var(--dark-bg);
    box-shadow: 
        0 0 25px var(--neon-purple),
        0 0 40px var(--neon-purple);
}

.neon-button.highlight {
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
    box-shadow: 
        0 0 20px var(--neon-yellow),
        inset 0 0 10px rgba(255, 240, 31, 0.1);
    animation: highlightPulse 1s infinite alternate;
}

.neon-button.highlight:hover {
    background: var(--neon-yellow);
    color: var(--dark-bg);
    box-shadow: 
        0 0 30px var(--neon-yellow),
        0 0 50px var(--neon-yellow);
}

/* ─────────────────────────────────────
   HIGHSCORE BUTTON
   ───────────────────────────────────── */
.highscore-btn-center {
    background: var(--card-bg-hover);
    border: 2px solid var(--neon-yellow);
    color: var(--neon-yellow);
    padding: 10px 18px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--neon-yellow);
    margin: 10px 0 20px 0;
    text-transform: uppercase;
    animation: pulseGlow 2s infinite;
}

.highscore-btn-center:hover {
    background: var(--neon-yellow);
    color: var(--dark-bg);
    box-shadow: 
        0 0 25px var(--neon-yellow),
        0 0 40px var(--neon-yellow);
    transform: scale(1.05);
}

/* ─────────────────────────────────────
   SOUND TOGGLE BUTTONS
   ───────────────────────────────────── */
.start-button-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.sound-toggle-button,
.sound-toggle {
    background: rgba(10, 10, 10, 0.9);
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--neon-cyan);
}

.sound-toggle-button {
    width: 60px;
    height: 60px;
}

.sound-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    z-index: 100;
}

.sound-toggle-button:hover,
.sound-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px var(--neon-cyan);
    border-color: var(--neon-pink);
}

.sound-toggle-button:active,
.sound-toggle:active {
    transform: scale(0.95);
}

.sound-toggle-button .sound-icon,
.sound-toggle .sound-icon {
    font-size: 28px;
    transition: all 0.2s ease;
}

.sound-toggle .sound-icon {
    font-size: 24px;
}

.sound-toggle-button.muted,
.sound-toggle.muted {
    border-color: #666;
    box-shadow: 0 0 10px #666;
}

.sound-toggle-button.muted:hover,
.sound-toggle.muted:hover {
    border-color: #999;
    box-shadow: 0 0 20px #999;
}

.sound-toggle-button.muted .sound-icon,
.sound-toggle.muted .sound-icon {
    opacity: 0.5;
}

.sound-toggle-button.toggling,
.sound-toggle.toggling {
    animation: soundPulse 0.3s ease;
}

/* ─────────────────────────────────────
   RAINBOW MODE BUTTON
   ───────────────────────────────────── */
.rainbow-mode-button,
.rainbow-button {
    background: linear-gradient(90deg, 
        #FF0000 0%, 
        #FF7F00 16%, 
        #FFFF00 33%, 
        #00FF00 50%, 
        #0000FF 66%, 
        #4B0082 83%, 
        #9400D3 100%);
    background-size: 200% 200%;
    border: 3px solid #FFD700;
    color: white;
    padding: 12px 25px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: rainbowShift 3s ease infinite;
    margin: 20px 10px;
}

.rainbow-mode-button:hover,
.rainbow-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 40px rgba(255, 215, 0, 1);
    border-color: #FFFFFF;
}

.rainbow-button .sound-icon {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
    animation: rainbowPulse 2s ease-in-out infinite;
}
/*═══════════════════════════════════════════════════════════════
   Teil 4: Screens & Modals
═══════════════════════════════════════════════════════════════*/

/* ─────────────────────────────────────
   SCREEN BASE
   ───────────────────────────────────── */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: var(--overlay-bg);
    z-index: 10;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 15px 10px;
}

/* BUG FIX: #gameOverScreen did not exist in HTML — the actual element is #crashOverlay.
   All four rules were silently dead. Renamed to #crashOverlay so animations fire correctly. */
#crashOverlay {
    animation: fadeInScreen 0.5s ease-out;
}

#crashOverlay .neon-title {
    animation: gameOverTitle 0.6s ease-out;
}

#crashOverlay .stats {
    animation: statsSlideIn 0.5s ease-out 0.3s both;
}

#crashOverlay .neon-button {
    animation: buttonBounce 0.6s ease-out 0.5s both;
}

/* ─────────────────────────────────────
   MODAL BASE
   ───────────────────────────────────── */
/* BUG FIX: z-index hierarchy was inconsistent:
   Old values: .modal=100, .pause-overlay=70, .crash-overlay-screen=60
   Problem: Achievement modal (100) appeared above pause screen (70) unintentionally.
   New clear hierarchy: pause=50, crash=60, modal=70 — modals sit on top of game screens. */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 70;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: rgba(26, 26, 46, 0.95);
    border: 3px solid var(--neon-cyan);
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 
        0 0 30px var(--neon-cyan),
        inset 0 0 30px rgba(0, 240, 255, 0.1);
    animation: slideInFast 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: 2px solid var(--neon-pink);
    color: var(--neon-pink);
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px var(--neon-pink);
}

.modal-close:hover {
    background: var(--neon-pink);
    color: var(--dark-bg);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 2rem;
    color: var(--neon-yellow);
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 20px var(--neon-yellow);
    letter-spacing: 3px;
}

/* ─────────────────────────────────────
   STATS DISPLAY
   ───────────────────────────────────── */
.stats {
    background: var(--card-bg);
    border: 1px solid var(--neon-pink);
    padding: 30px 50px;
    margin: 30px 0;
    border-radius: 5px;
    box-shadow: 
        0 0 20px var(--neon-pink),
        inset 0 0 20px rgba(255, 16, 240, 0.1);
}

.stats p {
    margin: 15px 0;
    font-size: 1.3rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* ─────────────────────────────────────
   CRASH OVERLAY
   ───────────────────────────────────── */
.crash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 50;
    pointer-events: none;
    animation: crashFlash 0.5s ease-out;
}

.crash-overlay-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 60;
    animation: crashOverlayFadeIn 0.3s ease-out;
}

.crash-overlay-content {
    background: rgba(26, 26, 46, 0.95);
    border: 3px solid var(--neon-pink);
    padding: 40px 50px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 
        0 0 40px var(--neon-pink),
        inset 0 0 30px rgba(255, 16, 240, 0.1);
    animation: crashContentBounce 0.5s ease-out;
    max-width: 500px;
    width: 90%;
}

.crash-title {
    font-size: 3rem;
    color: var(--neon-pink);
    text-shadow: 
        0 0 20px var(--neon-pink),
        0 0 40px var(--neon-pink);
    margin-bottom: 20px;
    letter-spacing: 8px;
    animation: crashTitlePulse 1s infinite alternate;
}

.crash-stats {
    margin: 30px 0;
}

.crash-stats p {
    font-size: 1.5rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan);
    margin: 10px 0;
}

.crash-new-highscore {
    color: var(--neon-yellow);
    font-size: 1.3rem;
    text-shadow: 
        0 0 15px var(--neon-yellow),
        0 0 30px var(--neon-yellow);
    animation: pulse 1s infinite;
    margin-top: 15px;
}

.crash-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.crash-buttons .neon-button {
    margin: 0;
    width: 100%;
    font-size: 1.2rem;
    padding: 15px 30px;
}

.crash-buttons .neon-button:nth-child(1) {
    animation: buttonSlideIn 0.4s ease-out 0.1s backwards;
}

.crash-buttons .neon-button:nth-child(2) {
    animation: buttonSlideIn 0.4s ease-out 0.2s backwards;
}

.crash-buttons .neon-button:nth-child(3) {
    animation: buttonSlideIn 0.4s ease-out 0.3s backwards;
}

.crash-hint {
    font-size: 0.8rem;
    color: var(--neon-purple);
    opacity: 0.7;
    margin-top: 20px;
    font-style: italic;
}

/* ─────────────────────────────────────
   PAUSE OVERLAY
   ───────────────────────────────────── */
.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* BUG FIX: Was rgba(10,10,10,0.05) — only 5% opacity, game was fully visible behind pause screen.
       Fixed to 0.85 to match crash overlay and actually dim the background. */
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    /* BUG FIX: Was z-index 70 (same as modal), causing modals to not always appear above pause.
       New clear hierarchy: pause=50 < crash=60 < modal=70 */
    z-index: 50;
    animation: pauseFadeIn 0.3s ease-out;
}

.pause-content {
    background: rgba(26, 26, 46, 0.95);
    border: 3px solid var(--neon-cyan);
    padding: 40px 50px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 
        0 0 40px var(--neon-cyan),
        inset 0 0 30px rgba(0, 240, 255, 0.1);
    animation: pauseContentBounce 0.4s ease-out;
    max-width: 400px;
    width: 90%;
}

.pause-title {
    font-size: 2.5rem;
    color: var(--neon-cyan);
    text-shadow: 
        0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-cyan);
    margin-bottom: 30px;
    letter-spacing: 5px;
    animation: pauseTitlePulse 2s infinite alternate;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.pause-buttons .neon-button {
    margin: 0;
    width: 100%;
    font-size: 1.2rem;
    padding: 15px 30px;
}

.pause-hint {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 240, 255, 0.3);
}

.pause-hint p {
    font-size: 0.85rem;
    color: var(--neon-purple);
    opacity: 0.7;
    font-style: italic;
}
/*═══════════════════════════════════════════════════════════════
   Teil 5: Selection Buttons (Difficulty & Level)
═══════════════════════════════════════════════════════════════*/

/* ─────────────────────────────────────
   SELECTION CONTAINERS
   ───────────────────────────────────── */
.difficulty-selection,
.level-selection {
    margin: 8px 0;
    padding: 6px 10px;
    width: 100%;
    max-width: 700px;
    position: relative;
    z-index: 2;
}

.difficulty-label,
.level-label {
    font-size: 1rem;
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-align: center;
}

.difficulty-label {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.level-label {
    color: var(--neon-purple);
    text-shadow: 0 0 10px var(--neon-purple);
}

/* ─────────────────────────────────────
   CAROUSEL LAYOUT
   ───────────────────────────────────── */
.difficulty-buttons,
.level-buttons {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    gap: 10px;
    padding: 6px 6px 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    position: relative;
    /* Scrollbar hidden — navigation is via the ‹ › arrows */
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* old Edge/IE */
}

.difficulty-buttons::-webkit-scrollbar,
.level-buttons::-webkit-scrollbar {
    display: none;                  /* Chrome / Safari / new Edge */
    width: 0;
    height: 0;
}

/* Fade Gradients */
.difficulty-selection::before,
.difficulty-selection::after,
.level-selection::before,
.level-selection::after {
    content: "";
    position: absolute;
    top: 40px;
    bottom: 10px;
    width: 24px;
    pointer-events: none;
    z-index: 5;
}

.difficulty-selection::before,
.level-selection::before {
    left: 0;
    background: linear-gradient(90deg, var(--overlay-bg), transparent);
}

.difficulty-selection::after,
.level-selection::after {
    right: 0;
    background: linear-gradient(270deg, var(--overlay-bg), transparent);
}

/* Carousel with Arrows */
.carousel {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.carousel-arrow {
    height: 44px;
    width: 40px;
    border: 2px solid var(--neon-cyan);
    background: rgba(10, 10, 10, 0.8);
    color: var(--neon-cyan);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.carousel-arrow:hover {
    transform: scale(1.05);
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 18px rgba(255, 16, 240, 0.35);
}

/* ─────────────────────────────────────
   BUTTON BASE STYLES
   ───────────────────────────────────── */
.difficulty-btn,
.level-btn {
    flex: 0 0 auto;
    scroll-snap-align: center;
    background: var(--card-bg);
    border: 2px solid var(--grid-color);
    color: white;
    padding: 8px 10px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 110px;
    max-width: 110px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 3;
    pointer-events: auto;
}

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

.difficulty-btn:hover::before,
.level-btn:hover::before {
    left: 100%;
}

.difficulty-btn .diff-icon,
.level-btn .level-icon {
    font-size: 1.6rem;
    transition: transform 0.3s ease;
}

.difficulty-btn .diff-name,
.level-btn .level-name {
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1.2;
}

.difficulty-btn .diff-desc {
    font-size: 0.6rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.level-btn .level-desc {
    display: none;
}

.level-btn .level-unlock,
.difficulty-btn .diff-unlock {
    font-size: 0.55rem;
    color: var(--neon-yellow);
    margin-top: 3px;
    text-align: center;
    font-weight: bold;
}

/* ─────────────────────────────────────
   ACTIVE & HOVER STATES
   ───────────────────────────────────── */
.difficulty-btn.active,
.level-btn.active {
    transform: scale(1.05);
}

.level-btn:not(.locked):hover .level-icon,
.difficulty-btn:not(.locked):hover .diff-icon {
    transform: scale(1.2);
}

.level-btn.active .level-icon,
.difficulty-btn.active .diff-icon {
    transform: scale(1.25);
}

/* ─────────────────────────────────────
   LOCKED STATE
   ───────────────────────────────────── */
.difficulty-btn.locked,
.level-btn.locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.difficulty-btn.locked::after,
.level-btn.locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    opacity: 0.8;
    pointer-events: none;
}

.difficulty-btn.locked:hover,
.level-btn.locked:hover {
    opacity: 0.5;
    transform: none;
    background: var(--card-bg);
}

/* ─────────────────────────────────────
   DIFFICULTY COLORS
   ───────────────────────────────────── */
.difficulty-btn.easy {
    border-color: var(--neon-green);
}

.difficulty-btn.easy:hover,
.difficulty-btn.easy.active {
    background: var(--neon-green);
    color: var(--dark-bg);
    box-shadow: 0 0 20px var(--neon-green);
}

.difficulty-btn.normal {
    border-color: var(--neon-yellow);
}

.difficulty-btn.normal:hover,
.difficulty-btn.normal.active {
    background: var(--neon-yellow);
    color: var(--dark-bg);
    box-shadow: 0 0 20px var(--neon-yellow);
}

.difficulty-btn.hard {
    border-color: var(--neon-orange);
}

.difficulty-btn.hard:hover,
.difficulty-btn.hard.active {
    background: var(--neon-orange);
    color: var(--dark-bg);
    box-shadow: 0 0 20px var(--neon-orange);
}

.difficulty-btn.insane {
    border-color: var(--neon-red);
}

.difficulty-btn.insane:hover,
.difficulty-btn.insane.active {
    background: var(--neon-red);
    color: var(--dark-bg);
    box-shadow: 0 0 20px var(--neon-red);
    animation: shake 0.9s infinite;
}

.difficulty-btn.nightmare {
    border-color: #8B00FF;
    background: rgba(139, 0, 255, 0.1);
}

.difficulty-btn.nightmare:hover,
.difficulty-btn.nightmare.active {
    background: linear-gradient(45deg, #8B00FF, #FF0055);
    color: white;
    box-shadow: 
        0 0 30px #8B00FF,
        0 0 50px #FF0055;
    animation: nightmareGlow 0.5s infinite alternate;
}

/* ─────────────────────────────────────
   LEVEL COLORS
   ───────────────────────────────────── */
.level-btn[data-level="NEON_CITY"]:not(.locked):hover,
.level-btn[data-level="NEON_CITY"].active {
    border-color: #FF10F0;
    box-shadow: 0 0 20px #FF10F0;
    background: rgba(255, 16, 240, 0.2);
}

.level-btn[data-level="CYBER_SPACE"]:not(.locked):hover,
.level-btn[data-level="CYBER_SPACE"].active {
    border-color: #00FF00;
    box-shadow: 0 0 20px #00FF00;
    background: rgba(0, 255, 0, 0.2);
}

.level-btn[data-level="SUNSET_HIGHWAY"]:not(.locked):hover,
.level-btn[data-level="SUNSET_HIGHWAY"].active {
    border-color: var(--neon-orange);
    box-shadow: 0 0 20px var(--neon-orange);
    background: rgba(255, 107, 53, 0.2);
}

.level-btn[data-level="DEEP_SPACE"]:not(.locked):hover,
.level-btn[data-level="DEEP_SPACE"].active {
    border-color: #8B00FF;
    box-shadow: 0 0 20px #8B00FF;
    background: rgba(139, 0, 255, 0.2);
}

.level-btn[data-level="HELL_RIDE"]:not(.locked):hover,
.level-btn[data-level="HELL_RIDE"].active {
    border-color: #FF0000;
    box-shadow: 0 0 20px #FF0000;
    background: rgba(255, 0, 0, 0.2);
    animation: fireGlow 1s infinite alternate;
}

.level-btn[data-level="VEGAS"]:not(.locked):hover,
.level-btn[data-level="VEGAS"].active {
    border-color: #F4C430;
    box-shadow: 0 0 20px #F4C430, 0 0 32px #FF10F0;
    background: rgba(244, 196, 48, 0.18);
}
/*═══════════════════════════════════════════════════════════════
   Teil 6: HUD & Stats
═══════════════════════════════════════════════════════════════*/

/* ─────────────────────────────────────
   HUD CONTAINER
   ───────────────────────────────────── */
.hud {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 5;
    pointer-events: auto;
}

.hud-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* ─────────────────────────────────────
   HUD ITEMS
   ───────────────────────────────────── */
.hud-item {
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid var(--neon-cyan);
    padding: 8px 15px;
    border-radius: 5px;
    box-shadow: 
        0 0 10px var(--neon-cyan),
        inset 0 0 10px rgba(0, 240, 255, 0.1);
    min-width: 120px;
    flex: 1;
}

.hud-shield {
    min-width: 150px;
}

.hud-powerups {
    min-width: 120px;
}

.hud-difficulty {
    border-color: var(--neon-purple);
    box-shadow: 
        0 0 10px var(--neon-purple),
        inset 0 0 10px rgba(176, 38, 255, 0.1);
}

.hud-level {
    border-color: var(--neon-pink);
    box-shadow: 
        0 0 10px var(--neon-pink),
        inset 0 0 10px rgba(255, 16, 240, 0.1);
}

.hud-item .label {
    display: block;
    font-size: 0.7rem;
    color: var(--neon-cyan);
    margin-bottom: 4px;
    text-shadow: 0 0 5px var(--neon-cyan);
    letter-spacing: 1px;
}

.hud-item .value {
    display: block;
    font-size: 1.3rem;
    color: var(--neon-yellow);
    font-weight: bold;
    text-shadow: 0 0 10px var(--neon-yellow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─────────────────────────────────────
   POWER-UP INDICATORS
   ───────────────────────────────────── */
.powerup-icons {
    font-size: 1.2rem;
    letter-spacing: 5px;
    text-align: center;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.powerup-icons:empty::before {
    content: '-';
    color: rgba(255, 255, 255, 0.3);
}

.powerup-icons span {
    display: inline-block;
    animation: powerupPulse 1s ease-in-out infinite;
}

.powerup-icons span:nth-child(1) { animation-delay: 0s; }
.powerup-icons span:nth-child(2) { animation-delay: 0.2s; }
.powerup-icons span:nth-child(3) { animation-delay: 0.4s; }
.powerup-icons span:nth-child(4) { animation-delay: 0.6s; }
.powerup-icons span:nth-child(5) { animation-delay: 0.8s; }

/* ─────────────────────────────────────
   PROGRESS BARS
   ───────────────────────────────────── */
.bar {
    width: 100%;
    height: 18px;
    background: rgba(26, 26, 46, 0.5);
    border: 1px solid var(--neon-green);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
    box-shadow: 
        0 0 10px var(--neon-green),
        0 0 20px var(--neon-green);
    transition: width 0.3s ease;
}

/* ─────────────────────────────────────
   HUD TAP TO PAUSE
   ───────────────────────────────────── */
.hud.tap-to-pause {
    cursor: pointer;
}

.hud.tap-to-pause::after {
    content: '⏸️ TAP TO PAUSE';
    position: absolute;
    top: -25px;
    right: 15px;
    font-size: 0.7rem;
    color: var(--neon-cyan);
    opacity: 0.5;
    animation: tapHint 2s ease-in-out infinite;
    pointer-events: none;
}
/*═══════════════════════════════════════════════════════════════
   Teil 7: Highscore & Achievements
═══════════════════════════════════════════════════════════════*/

/* ─────────────────────────────────────
   DIFFICULTY TABS
   ───────────────────────────────────── */
/* BUG FIX: HTML uses class "achievement-tabs" but CSS had "achievement-categories".
   Styles (flex, gap, margin) were never applied to the achievement tab container. Fixed. */
.difficulty-tabs,
.achievement-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn,
.achievement-tab {
    background: rgba(10, 10, 10, 0.5);
    border: 2px solid var(--grid-color);
    color: white;
    padding: 8px 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

/* BUG FIX: .stats-tab was used in HTML but had no CSS styling — it looked identical to
   other tabs with no visual distinction. Added cyan accent to make it stand out. */
.stats-tab {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.stats-tab:hover,
.stats-tab.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
    transform: scale(1.05);
}

.tab-btn:hover,
.achievement-tab:hover {
    transform: scale(1.05);
    border-color: var(--neon-purple);
}

.tab-btn.active {
    border-color: var(--neon-cyan);
    background: var(--neon-cyan);
    color: var(--dark-bg);
    box-shadow: 0 0 15px var(--neon-cyan);
}

.achievement-tab.active {
    border-color: var(--neon-purple);
    background: var(--neon-purple);
    color: var(--dark-bg);
    box-shadow: 0 0 15px var(--neon-purple);
}

/* ─────────────────────────────────────
   HIGHSCORE TABLE
   ───────────────────────────────────── */
.highscore-table {
    background: rgba(10, 10, 10, 0.5);
    border: 2px solid var(--neon-purple);
    padding: 20px;
    border-radius: 5px;
    min-height: 300px;
}

.score-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin: 5px 0;
    background: var(--card-bg);
    border: 1px solid var(--grid-color);
    transition: all 0.3s ease;
}

.score-entry:hover {
    background: rgba(176, 38, 255, 0.2);
    border-color: var(--neon-purple);
    transform: translateX(5px);
}

.score-entry.top3 {
    border-color: var(--neon-yellow);
    background: rgba(255, 240, 31, 0.1);
}

.score-entry.rank1 {
    border-color: var(--neon-yellow);
    background: rgba(255, 240, 31, 0.2);
    box-shadow: 0 0 10px var(--neon-yellow);
}

.score-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--neon-cyan);
    min-width: 40px;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.score-entry.rank1 .score-rank {
    color: var(--neon-yellow);
    text-shadow: 0 0 15px var(--neon-yellow);
    font-size: 2rem;
}

.score-name {
    font-size: 1.3rem;
    color: var(--neon-pink);
    font-weight: bold;
    letter-spacing: 5px;
    text-shadow: 0 0 10px var(--neon-pink);
}

.score-value {
    font-size: 1.3rem;
    color: var(--neon-green);
    font-weight: bold;
    text-shadow: 0 0 10px var(--neon-green);
}

.no-scores {
    text-align: center;
    color: var(--neon-purple);
    font-size: 1.2rem;
    padding: 50px 20px;
    opacity: 0.7;
}

/* ─────────────────────────────────────
   NAME ENTRY (ARCADE STYLE)
   ───────────────────────────────────── */
.modal-content.name-entry {
    max-width: 500px;
}

.name-entry-score {
    text-align: center;
    font-size: 1.5rem;
    color: var(--neon-yellow);
    margin: 20px 0;
    text-shadow: 0 0 15px var(--neon-yellow);
}

.name-entry-label {
    text-align: center;
    font-size: 1rem;
    color: var(--neon-cyan);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.name-input-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.letter-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.letter-btn {
    background: var(--card-bg-hover);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    width: 50px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.letter-btn:hover {
    background: var(--neon-cyan);
    color: var(--dark-bg);
    transform: scale(1.1);
}

.letter-btn:active {
    transform: scale(0.95);
}

.letter-display {
    width: 80px;
    height: 80px;
    background: rgba(10, 10, 10, 0.8);
    border: 3px solid var(--neon-pink);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    color: var(--neon-pink);
    text-shadow: 0 0 20px var(--neon-pink);
    box-shadow: 
        0 0 20px var(--neon-pink),
        inset 0 0 20px rgba(255, 16, 240, 0.2);
    letter-spacing: 0;
}

/* ─────────────────────────────────────
   ACHIEVEMENT MODAL
   ───────────────────────────────────── */
/* ─────────────────────────────────────
   UNIFIED LARGE-MODAL SIZE
   Highscore, Achievements, Shop & About all share the exact same
   footprint (Achievements is the reference). Height is content-driven
   and capped at 85vh, so short content no longer stretches the modal.
   ───────────────────────────────────── */
.achievement-modal-content,
#highscoreModal .modal-content,
#shopModal .modal-content,
#aboutModal .modal-content {
    max-width: 700px;
    max-height: 85vh;
}

/* Breathing room inside the About & Shop modals */
#aboutModal .stats-section { margin-bottom: 18px; padding-bottom: 6px; }
#aboutModal .stats-section h3 { margin-bottom: 8px; }
#aboutModal .stats-section div { margin: 4px 0; }
#shopModal .modal-title { margin-bottom: 4px; }

.achievement-summary {
    background: rgba(10, 10, 10, 0.5);
    border: 2px solid var(--neon-purple);
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}

.achievement-summary p {
    font-size: 1.3rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    margin-bottom: 10px;
}

.achievement-progress-bar {
    width: 100%;
    height: 20px;
    background: var(--card-bg-hover);
    border: 2px solid var(--neon-cyan);
    border-radius: 10px;
    overflow: hidden;
}

.achievement-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    box-shadow: 0 0 15px var(--neon-cyan);
    transition: width 0.5s ease;
}

/* ─────────────────────────────────────
   ACHIEVEMENT GRID
   ───────────────────────────────────── */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.achievement-card {
    background: var(--card-bg-hover);
    border: 2px solid var(--grid-color);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.achievement-card:hover::before {
    left: 100%;
}

.achievement-card.unlocked {
    border-color: var(--neon-yellow);
    background: rgba(255, 240, 31, 0.1);
    box-shadow: 0 0 15px rgba(255, 240, 31, 0.3);
}

.achievement-card.unlocked:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--neon-yellow);
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.achievement-card.locked .achievement-icon {
    opacity: 0.4;
}

.achievement-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    opacity: 0.6;
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
    transition: transform 0.3s ease;
}

.achievement-card.unlocked .achievement-icon {
    animation: achievementIconPulse 2s ease-in-out infinite;
}

.achievement-name {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.achievement-card.unlocked .achievement-name {
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
}

.achievement-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    margin-bottom: 8px;
}

.achievement-progress {
    font-size: 0.7rem;
    color: var(--neon-purple);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(176, 38, 255, 0.3);
}

.achievement-card.unlocked .achievement-progress {
    color: var(--neon-green);
}
/*═══════════════════════════════════════════════════════════════
   Teil 8: Notifications & Special Effects
═══════════════════════════════════════════════════════════════*/

/* ─────────────────────────────────────
   LEGEND CELEBRATION
   ───────────────────────────────────── */
.legend-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    animation: legendAppear 1s ease-out;
}

.legend-content {
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.95) 0%,
        rgba(255, 140, 0, 0.95) 50%,
        rgba(255, 69, 0, 0.95) 100%);
    border: 5px solid #FFD700;
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 
        0 0 50px rgba(255, 215, 0, 0.8),
        0 0 100px rgba(255, 215, 0, 0.5),
        inset 0 0 50px rgba(255, 255, 255, 0.3);
    animation: legendPulse 2s ease-in-out infinite;
}

.legend-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: legendIconSpin 3s ease-in-out infinite;
}

.legend-title {
    font-size: 48px;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 
        0 0 20px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.8);
    letter-spacing: 8px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.legend-subtitle {
    font-size: 24px;
    color: #FFF;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.legend-reward {
    font-size: 20px;
    color: #FFD700;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
    margin-top: 20px;
    font-family: 'Courier New', monospace;
    animation: rewardBlink 1s ease-in-out infinite;
}

.legend-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, 
        rgba(255, 215, 0, 0.8) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 100%);
    z-index: 9998;
    pointer-events: none;
    animation: flashEffect 1s ease-out;
}

/* ─────────────────────────────────────
   SUPER JUMP UNLOCK
   ───────────────────────────────────── */
.superjump-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    animation: superJumpAppear 0.8s ease-out;
}

.superjump-content {
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.95) 0%,
        rgba(255, 165, 0, 0.95) 100%);
    border: 4px solid #FFD700;
    padding: 35px 50px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 0.8),
        inset 0 0 30px rgba(255, 255, 255, 0.3);
    animation: superJumpPulse 2s ease-in-out infinite;
}

.superjump-icon {
    font-size: 70px;
    margin-bottom: 15px;
    animation: superJumpBounce 1s ease-in-out infinite;
}

.superjump-title {
    font-size: 36px;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 
        0 0 15px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(255, 215, 0, 0.8);
    letter-spacing: 4px;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.superjump-subtitle {
    font-size: 20px;
    color: #FFF;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.superjump-desc {
    font-size: 16px;
    color: #FFD700;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
}

.superjump-badge {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    margin: 10px auto 20px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    animation: badgePulse 2s ease-in-out infinite;
}

/* ─────────────────────────────────────
   RAINBOW MODE EFFECTS
   ───────────────────────────────────── */
body.rainbow-mode {
    background: linear-gradient(
        135deg,
        rgba(255, 0, 0, 0.1),
        rgba(255, 127, 0, 0.1),
        rgba(255, 255, 0, 0.1),
        rgba(0, 255, 0, 0.1),
        rgba(0, 0, 255, 0.1),
        rgba(75, 0, 130, 0.1),
        rgba(148, 0, 211, 0.1)
    );
    background-size: 400% 400%;
    animation: rainbowBackground 15s ease infinite;
}

body.rainbow-mode .hud {
    border: 2px solid transparent;
    border-image: linear-gradient(
        90deg,
        #FF0000,
        #FF7F00,
        #FFFF00,
        #00FF00,
        #0000FF,
        #4B0082,
        #9400D3
    ) 1;
    animation: rainbowBorderShift 3s linear infinite;
}

body.rainbow-mode .neon-title {
    animation: rainbowTextGlow 3s ease-in-out infinite;
}

/* BUG FIX: border-image is incompatible with border-radius — it silently removes rounded corners.
   Fixed: Use box-shadow glow + animated border-color via CSS animation instead.
   This preserves border-radius while still showing rainbow color on the button border. */
body.rainbow-mode .neon-button {
    border: 2px solid transparent;
    background-clip: padding-box;
    outline: 2px solid transparent;
    box-shadow:
        0 0 8px 2px rgba(255, 0, 0, 0.5),
        0 0 16px 4px rgba(0, 255, 0, 0.3),
        0 0 24px 6px rgba(0, 0, 255, 0.2);
    animation: rainbowButtonGlow 3s ease-in-out infinite, rainbowButtonBorder 3s linear infinite;
}

@keyframes rainbowButtonBorder {
    0%   { border-color: #FF0000; box-shadow: 0 0 12px 3px rgba(255,0,0,0.6); }
    17%  { border-color: #FF7F00; box-shadow: 0 0 12px 3px rgba(255,127,0,0.6); }
    33%  { border-color: #FFFF00; box-shadow: 0 0 12px 3px rgba(255,255,0,0.6); }
    50%  { border-color: #00FF00; box-shadow: 0 0 12px 3px rgba(0,255,0,0.6); }
    67%  { border-color: #0000FF; box-shadow: 0 0 12px 3px rgba(0,0,255,0.6); }
    83%  { border-color: #4B0082; box-shadow: 0 0 12px 3px rgba(75,0,130,0.6); }
    100% { border-color: #FF0000; box-shadow: 0 0 12px 3px rgba(255,0,0,0.6); }
}
/*═══════════════════════════════════════════════════════════════
   Teil 9: Animations
═══════════════════════════════════════════════════════════════*/

/* ─────────────────────────────────────
   TEXT & GLOW ANIMATIONS
   ───────────────────────────────────── */
@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 
            0 0 10px var(--neon-pink),
            0 0 20px var(--neon-pink),
            0 0 30px var(--neon-pink),
            0 0 40px var(--neon-pink);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px var(--neon-yellow);
    }
    50% {
        box-shadow: 
            0 0 25px var(--neon-yellow),
            0 0 35px var(--neon-yellow);
    }
}

@keyframes borderGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px var(--neon-cyan),
            inset 0 0 20px rgba(0, 240, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 0 40px var(--neon-cyan),
            0 0 60px var(--neon-cyan),
            inset 0 0 30px rgba(0, 240, 255, 0.2);
    }
}

@keyframes highlightPulse {
    from {
        box-shadow: 
            0 0 20px var(--neon-yellow),
            inset 0 0 10px rgba(255, 240, 31, 0.1);
    }
    to {
        box-shadow: 
            0 0 40px var(--neon-yellow),
            0 0 60px var(--neon-yellow),
            inset 0 0 20px rgba(255, 240, 31, 0.2);
    }
}

/* ─────────────────────────────────────
   MOVEMENT ANIMATIONS
   ───────────────────────────────────── */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes glitch {
    0% {
        filter: hue-rotate(0deg);
        transform: translate(0);
    }
    20% {
        filter: hue-rotate(90deg);
        transform: translate(-5px, 5px);
    }
    40% {
        filter: hue-rotate(180deg);
        transform: translate(5px, -5px);
    }
    60% {
        filter: hue-rotate(270deg);
        transform: translate(-5px, -5px);
    }
    80% {
        filter: hue-rotate(360deg);
        transform: translate(5px, 5px);
    }
    100% {
        filter: hue-rotate(0deg);
        transform: translate(0);
    }
}

@keyframes slowMotion {
    0% {
        filter: blur(0px) brightness(1);
    }
    50% {
        filter: blur(5px) brightness(1.5);
    }
    100% {
        filter: blur(0px) brightness(1);
    }
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
}

/* ─────────────────────────────────────
   MODAL & SCREEN ANIMATIONS
   ───────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFast {
    from {
        transform: translateY(-100px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes buttonSlideIn {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

/* ─────────────────────────────────────
   GAME OVER ANIMATIONS
   ───────────────────────────────────── */
@keyframes gameOverTitle {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes crashFlash {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

@keyframes crashOverlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

@keyframes crashContentBounce {
    0% {
        transform: scale(0.5) rotate(-5deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.1) rotate(2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes crashTitlePulse {
    from {
        text-shadow: 
            0 0 20px var(--neon-pink),
            0 0 40px var(--neon-pink);
    }
    to {
        text-shadow: 
            0 0 30px var(--neon-pink),
            0 0 60px var(--neon-pink),
            0 0 80px var(--neon-pink);
    }
}

/* ─────────────────────────────────────
   PAUSE ANIMATIONS
   ───────────────────────────────────── */
@keyframes pauseFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

@keyframes pauseContentBounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    60% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pauseTitlePulse {
    from {
        text-shadow: 
            0 0 20px var(--neon-cyan),
            0 0 40px var(--neon-cyan);
    }
    to {
        text-shadow: 
            0 0 30px var(--neon-cyan),
            0 0 60px var(--neon-cyan),
            0 0 80px var(--neon-cyan);
    }
}

@keyframes tapHint {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ─────────────────────────────────────
   DIFFICULTY & LEVEL ANIMATIONS
   ───────────────────────────────────── */
@keyframes nightmareGlow {
    0% {
        box-shadow: 
            0 0 20px #8B00FF,
            0 0 40px #FF0055;
    }
    100% {
        box-shadow: 
            0 0 40px #8B00FF,
            0 0 60px #FF0055,
            0 0 80px #8B00FF;
    }
}

@keyframes fireGlow {
    0% {
        box-shadow: 0 0 20px #FF0000;
    }
    100% {
        box-shadow: 0 0 40px #FF0000, 0 0 60px #FF4500;
    }
}

/* ─────────────────────────────────────
   ACHIEVEMENT ANIMATIONS
   ───────────────────────────────────── */
@keyframes achievementIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes powerupPulse {
    0%, 100% { 
        transform: scale(1);
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.2);
        filter: brightness(1.5);
    }
}

/* ─────────────────────────────────────
   LEGEND & SPECIAL UNLOCK ANIMATIONS
   ───────────────────────────────────── */
@keyframes legendAppear {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes legendFadeOut {
    to {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

@keyframes legendPulse {
    0%, 100% {
        box-shadow: 
            0 0 50px rgba(255, 215, 0, 0.8),
            0 0 100px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 
            0 0 80px rgba(255, 215, 0, 1),
            0 0 150px rgba(255, 215, 0, 0.8);
    }
}

@keyframes legendIconSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(10deg) scale(1.1); }
    50% { transform: rotate(0deg) scale(1.2); }
    75% { transform: rotate(-10deg) scale(1.1); }
}

@keyframes rewardBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes flashEffect {
    0% { opacity: 0; }
    10% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes superJumpAppear {
    0% {
        transform: translate(-50%, -150%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes superJumpFadeOut {
    to {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

@keyframes superJumpPulse {
    0%, 100% {
        box-shadow: 
            0 0 40px rgba(255, 215, 0, 0.8),
            inset 0 0 30px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 60px rgba(255, 215, 0, 1),
            0 0 80px rgba(255, 165, 0, 0.8),
            inset 0 0 40px rgba(255, 255, 255, 0.4);
    }
}

@keyframes superJumpBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ─────────────────────────────────────
   RAINBOW MODE ANIMATIONS
   ───────────────────────────────────── */
@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rainbowPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes rainbowBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rainbowBorderShift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes rainbowTextGlow {
    0% { text-shadow: 0 0 20px #FF0000, 0 0 40px #FF0000; }
    14% { text-shadow: 0 0 20px #FF7F00, 0 0 40px #FF7F00; }
    28% { text-shadow: 0 0 20px #FFFF00, 0 0 40px #FFFF00; }
    42% { text-shadow: 0 0 20px #00FF00, 0 0 40px #00FF00; }
    57% { text-shadow: 0 0 20px #0000FF, 0 0 40px #0000FF; }
    71% { text-shadow: 0 0 20px #4B0082, 0 0 40px #4B0082; }
    85% { text-shadow: 0 0 20px #9400D3, 0 0 40px #9400D3; }
    100% { text-shadow: 0 0 20px #FF0000, 0 0 40px #FF0000; }
}

@keyframes rainbowButtonGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.6); }
    14% { box-shadow: 0 0 20px rgba(255, 127, 0, 0.6); }
    28% { box-shadow: 0 0 20px rgba(255, 255, 0, 0.6); }
    42% { box-shadow: 0 0 20px rgba(0, 255, 0, 0.6); }
    57% { box-shadow: 0 0 20px rgba(0, 0, 255, 0.6); }
    71% { box-shadow: 0 0 20px rgba(75, 0, 130, 0.6); }
    85% { box-shadow: 0 0 20px rgba(148, 0, 211, 0.6); }
}

/* ─────────────────────────────────────
   SOUND TOGGLE ANIMATION
   ───────────────────────────────────── */
@keyframes soundPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
/*═══════════════════════════════════════════════════════════════
   Teil 10: Responsive Design
═══════════════════════════════════════════════════════════════*/

/* ─────────────────────────────────────
   TABLET (768px - 1024px)
   ───────────────────────────────────── */
@media (max-width: 1024px) and (min-width: 769px) {
    .start-button-container {
        gap: 20px;
    }
    
    .sound-toggle-button {
        width: 55px;
        height: 55px;
    }
}

/* ─────────────────────────────────────
   MOBILE (max-width: 768px)
   ───────────────────────────────────── */
@media (max-width: 768px) {
    /* Game Container */
    .game-container {
        height: 100vh;
        max-width: 100%;
        border: none;
    }

    /* Screens */
    .screen {
        padding: 10px 5px;
    }

    /* Typography */
    .neon-title {
        font-size: 2rem;
        letter-spacing: 3px;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    /* Buttons */
    .neon-button {
        font-size: 1.1rem;
        padding: 12px 30px;
        margin: 15px 0;
    }

    .highscore-btn-center {
        font-size: 0.75rem;
        padding: 8px 15px;
    }

    .high-score {
        margin-top: 15px;
        font-size: 1rem;
    }

    /* Selection Areas */
    .difficulty-selection,
    .level-selection {
        padding: 10px 5px;
        margin: 15px 0;
    }

    .difficulty-label,
    .level-label {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .difficulty-buttons,
    .level-buttons {
        gap: 8px;
    }

    .difficulty-btn,
    .level-btn {
        min-width: 110px;
        max-width: 120px;
        padding: 10px 8px;
    }

    .difficulty-btn .diff-icon,
    .level-btn .level-icon {
        font-size: 1.8rem;
    }

    .difficulty-btn .diff-name,
    .level-btn .level-name {
        font-size: 0.75rem;
    }

    .difficulty-btn .diff-desc,
    .level-btn .level-desc {
        font-size: 0.6rem;
    }

    /* Carousel */
    /* BUG FIX: Arrows must be hidden first, then grid-template-columns updated.
       Old order caused a layout jump because hidden arrows still occupied grid column space
       briefly before browser collapsed them. Fixed: arrows hidden first, then grid reset. */
    .carousel-arrow {
        display: none;
    }
    
    .carousel {
        grid-template-columns: 1fr;
    }

    /* HUD */
    .hud {
        top: 10px;
        left: 10px;
        right: 10px;
        gap: 8px;
    }

    .hud-row {
        gap: 8px;
    }

    .hud-item {
        min-width: 0;
        padding: 6px 10px;
    }

    .hud-item .label {
        font-size: 0.6rem;
        margin-bottom: 2px;
    }

    .hud-item .value {
        font-size: 1rem;
    }

    .hud-powerups {
        min-width: 80px;
    }
    
    .powerup-icons {
        font-size: 1rem;
        gap: 3px;
        letter-spacing: 3px;
    }

    /* Stats */
    .stats {
        padding: 20px 30px;
        margin: 20px 0;
    }

    .stats p {
        font-size: 1.1rem;
        margin: 10px 0;
    }

    /* Modals */
    .modal-content {
        padding: 20px;
        max-width: 95%;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    /* Tabs */
    .difficulty-tabs,
    /* BUG FIX: Also renamed .achievement-categories → .achievement-tabs in mobile query */
    .achievement-tabs {
        gap: 3px;
    }

    .tab-btn,
    .achievement-tab {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    /* Highscore */
    .score-entry {
        padding: 8px 10px;
    }

    .score-rank {
        font-size: 1.2rem;
        min-width: 30px;
    }

    .score-name,
    .score-value {
        font-size: 1rem;
    }

    /* Name Entry */
    .letter-display {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .letter-btn {
        width: 40px;
        height: 35px;
        font-size: 1.2rem;
    }

    .name-input-container {
        gap: 10px;
    }

    /* Achievements */
    .achievement-modal-content {
        padding: 20px 15px;
    }
    
    .achievement-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
        max-height: 350px;
    }
    
    .achievement-card {
        padding: 12px;
    }
    
    .achievement-icon {
        font-size: 2.5rem;
    }
    
    .achievement-name {
        font-size: 0.85rem;
    }
    
    .achievement-desc {
        font-size: 0.7rem;
    }

    /* Crash Overlay */
    .crash-overlay-content {
        padding: 30px 25px;
    }

    .crash-title {
        font-size: 2rem;
        letter-spacing: 4px;
    }

    .crash-stats p {
        font-size: 1.2rem;
    }

    .crash-buttons .neon-button {
        font-size: 1rem;
        padding: 12px 25px;
    }

    .crash-hint {
        font-size: 0.7rem;
    }

    /* Pause Overlay */
    .pause-content {
        padding: 30px 25px;
    }

    .pause-title {
        font-size: 2rem;
        letter-spacing: 3px;
    }

    .pause-buttons .neon-button {
        font-size: 1rem;
        padding: 12px 25px;
    }

    .pause-hint p {
        font-size: 0.75rem;
    }

    /* Sound Toggle */
    .start-button-container {
        /* BUG FIX: 'flex' is not a valid flex-direction value — was silently ignored by browser.
           Fixed to 'row' which keeps buttons side-by-side as intended. */
        flex-direction: row;
        gap: 15px;
    }
    
    .sound-toggle-button {
        width: 50px;
        height: 50px;
    }
    
    .sound-toggle-button .sound-icon {
        font-size: 24px;
    }
    
    .sound-toggle {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }
    
    .sound-toggle .sound-icon {
        font-size: 20px;
    }
}

/* ─────────────────────────────────────
   SMALL MOBILE (max-width: 480px)
   ───────────────────────────────────── */
@media (max-width: 480px) {
    .hud-row {
        flex-wrap: wrap;
    }

    .hud-item {
        min-width: calc(50% - 4px);
    }

    .achievement-grid {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────
   LANDSCAPE MODE ON MOBILE
   ───────────────────────────────────── */
@media (max-width: 768px) and (orientation: landscape) {
    .neon-title {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }

    .difficulty-selection,
    .level-selection {
        margin: 8px 0;
        padding: 8px 5px;
    }

    .neon-button {
        font-size: 0.9rem;
        padding: 8px 20px;
        margin: 8px 0;
    }
}
.danger-btn {
    background: #ff2b2b;
    color: white;
    border: none;
    padding: 10px 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(255, 43, 43, 0.6);
}

.danger-btn:hover {
    background: #ff4d4d;
}

.stats-warning {
    font-size: 0.8rem;
    color: #ffaaaa;
    margin-top: 8px;
}
.hud-boss {
  border-color: #FFD700;
  box-shadow: 0 0 12px rgba(255,215,0,0.6);
}