* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#gameContainer {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 600px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10;
    border-radius: 20px;
}

/* ... (весь предыдущий код) ... */

#startScreen.hidden {
    display: none;
}

/* ... (весь предыдущий код) ... */

#level {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 2.5em;
    font-weight: bold;
    color: #555;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

#levelUpMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    z-index: 15;
    animation: levelUpPulse 2s ease-out forwards;
    pointer-events: none; /* Чтобы не мешать игре */
}

@keyframes levelUpPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

#gameOverScreen.hidden {
    display: none;
}

/* ... (остальной код) ... */

/* ... (остальной код) ... */

#startScreen h1 {
    color: #fff;
    font-size: 3em;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
    to { text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.6); }
}

#playerName {
    padding: 15px 25px;
    font-size: 1.2em;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    width: 300px;
    text-align: center;
    transition: all 0.3s ease;
}

#playerName:focus {
    outline: none;
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.5);
}

#startBtn, #restartBtn {
    padding: 15px 40px;
    font-size: 1.2em;
    border: none;
    border-radius: 50px;
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#startBtn:hover, #restartBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.4);
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

#score {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 2.5em;
    font-weight: bold;
    color: #555;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

#gameOverScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10;
    border-radius: 20px;
    transition: opacity 0.5s ease;
}

#gameOverScreen.hidden {
    display: none;
}

#gameOverScreen h2 {
    color: #fff;
    font-size: 2.5em;
    margin-bottom: 20px;
}

#gameOverScreen p {
    color: #fff;
    font-size: 1.5em;
    margin-bottom: 30px;
}

#finalScore {
    color: #f5576c;
    font-weight: bold;
}

@media (max-width: 600px) {
    #startScreen h1 {
        font-size: 2em;
    }
    
    #playerName {
        width: 250px;
        font-size: 1em;
    }
    
    #score {
        font-size: 2em;
        bottom: 10px;
        right: 10px;
    }
}