body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
    touch-action: manipulation;
    overflow: hidden; /* Prevent scrolling when swiping */
}

.header {
    text-align: center;
    margin-bottom: 10px;
}

#info-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.info-icon {
    font-size: 20px;
}

#game-container {
    position: relative;
    touch-action: none; /* Prevent browser handling of touch events */
}
#game-board {
    border: 2px solid #333;
    background-color: #fff;
}
#score {
    margin-top: 20px;
    font-size: 24px;
}
#start-button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 18px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
#start-button:hover {
    background-color: #45a049;
}

#hide-in-game {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
}
#swipe-info {
    margin-top: 10px;
    text-align: center;
    color: #666;
    display: none;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    transition: opacity 0.3s ease;
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    max-width: 80%;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

/* Joystick styles */
#joystick-container {
    margin: 20px auto;
    position: relative;
    width: 80px;
    height: 80px;
    display: none; /* Hidden by default, shown in media query */
}

#joystick-base {
    width: 80px;
    height: 80px;
    background-color: rgba(100, 100, 100, 0.5);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

#joystick-thumb {
    width: 40px;
    height: 40px;
    background-color: rgba(50, 50, 50, 0.8);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    touch-action: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Media query for mobile devices */
@media (max-width: 768px) or (pointer: coarse) {
    #swipe-info {
        display: block;
    }
    canvas {
        max-width: 100%;
        height: auto;
    }
    #joystick-container {
        display: block; /* Show joystick on mobile */
    }
}