/* Custom styles for the game */
body {
    touch-action: none;
    user-select: none;
}

#gameCanvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Snake segments */
.snake-segment {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #22c55e;
    border-radius: 3px;
}
/* Food */
.food {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ef4444;
    border-radius: 50%;
}

/* Play Again Button */
#restartBtn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#restartBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

#restartBtn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#restartBtn::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.3) 100%);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

#restartBtn:hover::after {
    transform: translateX(0);
}

/* Controls for mobile */
.controls {
    display: none;
}

@media (max-width: 768px) {
    .controls {
        display: grid;
        grid-template-areas:
            ". up ."
            "left . right"
            ". down .";
        gap: 10px;
        margin-top: 20px;
    }
    
    .control-btn {
        width: 60px;
        height: 60px;
        background-color: rgba(34, 197, 94, 0.3);
        border: 2px solid #22c55e;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 24px;
    }
    
    #up { grid-area: up; }
    #left { grid-area: left; }
    #right { grid-area: right; }
    #down { grid-area: down; }
}