html, body {
    height: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden; /* Prevent scrolling */
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
    touch-action: none; /* Prevents browser handling of touch gestures */
}

.game-container {
    text-align: center;
    width: 100%;
    max-width: 800px;
}


#gameCanvas {
    background-color: #8fd44e; /* Lighter grass color */
    background-image: 
        linear-gradient(
            90deg, 
            rgba(143, 212, 78, 0.8) 0%, 
            rgba(153, 222, 88, 0.6) 35%, 
            rgba(143, 212, 78, 0.8) 100%
        ),
        linear-gradient(
            rgba(0, 0, 0, 0.05) 1px, 
            transparent 1px
        ),
        linear-gradient(
            90deg, 
            rgba(0, 0, 0, 0.05) 1px, 
            transparent 1px
        ),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.05) 20px,
            rgba(255, 255, 255, 0.05) 40px
        );
    background-size: 100% 100%, 20px 20px, 20px 20px, 80px 80px;
    animation: grass-sway 10s ease-in-out infinite alternate;
    border: 1px solid #333;
    cursor: crosshair;
    width: 100%;
    height: auto;
    touch-action: none; /* Prevents browser handling of touch gestures */
}

@keyframes grass-sway {
    0% {
        background-position: 0% 0%, 0px 0px, 0px 0px, 0px 0px;
    }
    100% {
        background-position: 0% 0%, 0px 0px, 0px 0px, 20px 20px;
    }
}

/* Full screen mode styles */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100svw;
    height: 100svh;
    z-index: 1000;
    background-color: #f0f0f0;
    padding: 0;
    margin: 0;
    max-width: none;
}

.fullscreen-mode #gameCanvas {
    width: 100svw;
    height: 100svh;
    border: none;
    /* Ensure the grass background scales appropriately in fullscreen mode */
    background-size: 100% 100%, 30px 30px, 30px 30px, 120px 120px;
    /* Slow down the animation slightly in fullscreen for a more subtle effect */
    animation-duration: 15s;
}


/* Title menu styles */
.title-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(143, 212, 78, 0.9); /* Match lighter grass color with transparency */
    background-image: 
        linear-gradient(
            rgba(143, 212, 78, 0.8) 0%, 
            rgba(153, 222, 88, 0.7) 100%
        );
    z-index: 2000;
}

.title-menu h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: #fff; /* White text for better contrast against green */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); /* Stronger shadow for better readability */
}

.play-button {
    padding: 1rem 2rem;
    font-size: 1.5rem;
    background-color: #388E3C;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.play-button:hover {
    background-color: #2E7D32;
    transform: scale(1.05);
}

.play-button:active {
    transform: scale(0.98);
}

/* Media query for mobile devices */
@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .title-menu h1 {
        font-size: 2rem;
    }

    .play-button {
        padding: 0.8rem 1.6rem;
        font-size: 1.2rem;
    }
}
