/* Импортируем пиксельный шрифт */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #2c3e50, #34495e, #1a242f);
    color: #ecf0f1;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

h1 {
    color: #f1c40f;
    margin-bottom: 25px;
    font-size: 2.5em;
    text-shadow: 4px 4px 6px rgba(0, 0, 0, 0.7);
    letter-spacing: 3px;
}

#game-container {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(255, 255, 255, 0.1);
    padding: 25px;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#score {
    font-size: 1.6em;
    margin-bottom: 20px;
    color: #2ecc71;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

#game-board {
    width: 400px;
    height: 400px;
    background: 
        linear-gradient(to right, #2c3e50 1px, transparent 1px) 0 0 / 20px 20px,
        linear-gradient(to bottom, #2c3e50 1px, transparent 1px) 0 0 / 20px 20px;
    background-color: #333;
    border: 5px solid #27ae60;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.snake {
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
}

.snake.snake-head {
    background: linear-gradient(45deg, #f1c40f, #e67e22);
    border-radius: 8px 8px 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8), 0 0 15px rgba(241, 196, 15, 0.7);
}

.food {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 30% 30%, #9b59b6, #8e44ad);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7), 0 0 10px #9b59b6;
    border-radius: 50%;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

#game-over-message {
    margin-top: 30px;
    background-color: rgba(192, 57, 43, 0.9);
    padding: 20px;
    border-radius: 10px;
    font-size: 1.3em;
    border: 2px solid #e74c3c;
    box-shadow: 0 0 15px rgba(192, 57, 43, 0.8);
    animation: fadeIn 0.5s ease-out;
}

#game-over-message p {
    margin: 0 0 15px 0;
    color: #ecf0f1;
}

#restart-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    font-family: 'Press Start 2P', cursive;
}

#restart-btn:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

#restart-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

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

.hidden {
    display: none;
}