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

body {
    font-family: 'Arial', sans-serif;
    background-color: #87CEEB;
    background-image: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    padding: 10px;
}

.game-container {
    background-color: #2E8B57;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: 550px;
    width: 100%;
    text-align: center;
    border: 3px solid #228B22;
}

h1 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Courier New', monospace;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.score {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.controls {
    display: flex;
    gap: 8px;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#start-btn {
    background-color: #FFD700;
    color: #333;
}

#start-btn:hover {
    background-color: #FFA500;
}

#pause-btn {
    background-color: #FF6347;
    color: white;
}

#pause-btn:hover {
    background-color: #FF4500;
}

#reset-btn {
    background-color: #4682B4;
    color: white;
}

#reset-btn:hover {
    background-color: #1E90FF;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(25, 18px);
    grid-template-rows: repeat(18, 18px);
    gap: 1px;
    background-color: #228B22;
    margin: 15px auto;
    border: 3px solid #006400;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    width: fit-content;
}

.cell {
    width: 18px;
    height: 18px;
    background-color: #98FB98;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.snake {
    background-color: #32CD32;
    border-radius: 4px;
    box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3);
}

.snake-head {
    background-color: #228B22;
    border-radius: 6px;
    position: relative;
}

.snake-head::before,
.snake-head::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #000;
    border-radius: 50%;
    top: 3px;
}

.snake-head::before {
    left: 3px;
}

.snake-head::after {
    right: 3px;
}

.food {
    background-color: #FF6347;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    }
    100% {
        transform: scale(1.1);
        box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    }
}

.instructions {
    margin-top: 15px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    text-align: left;
    backdrop-filter: blur(5px);
}

.instructions h3 {
    color: #fff;
    margin-bottom: 6px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-size: 14px;
}

.instructions p {
    color: #f0f0f0;
    margin-bottom: 4px;
    font-size: 12px;
}

@media (max-width: 700px) {
    .game-board {
        grid-template-columns: repeat(20, 18px);
        grid-template-rows: repeat(15, 18px);
    }
    
    .cell {
        width: 18px;
        height: 18px;
    }
    
    .game-container {
        padding: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
}
