body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    padding: 1.5rem 0;
    background: #000;  /* Changed to black */
    font-family: 'Silkscreen', cursive;
    font-weight: 400;
    box-sizing: border-box;
    overflow: hidden;  /* Prevent scrolling */
    color: #fff;  /* Changed text color to white */
}

#gameCanvas {
    border: 2px solid #ff0000;
    background: transparent !important;  /* Force transparency */
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1),
                0 0 40px rgba(255, 0, 0, 0.6),
                0 0 80px rgba(255, 0, 0, 0.3);
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

#score {
    font-size: 1rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
    text-align: center;
    position: relative;
    z-index: 4;
}

#controls {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    font-weight: 400;
    text-align: center;
    position: relative;
    z-index: 4;
}

.sound-controls {
    margin-top: 0.3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    position: relative;
    z-index: 4;
}

.sound-controls div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sound-controls button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 5px;
    background: transparent;  /* Changed to transparent */
    cursor: pointer;
    padding: 0;  /* Remove padding */
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-controls button:hover {
    background: transparent;
}

.sound-controls button.muted {
    background: transparent;
}

.volume-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;  /* Add smooth transition */
}

.sound-controls button:hover .volume-icon {
    transform: scale(1.2);  /* Grow on hover */
}

.sound-controls button:active .volume-icon {
    transform: scale(0.9);  /* Shrink when clicked */
}

footer {
    margin-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.8rem;  /* Slightly smaller footer text */
    font-weight: 400;
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #fff;  /* White text for footer */
}

footer a {
    color: #ff0000;  /* Red color */
    text-decoration: none;
}

footer a:hover {
    color: #cc0000;  /* Darker red on hover */
}

.x-icon {
    display: inline-flex;
    align-items: center;
}

.x-icon img {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.x-icon:hover img {
    transform: scale(1.2);
}

.x-icon:active img {
    transform: scale(0.9);
}

.game-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.3rem 0;
    letter-spacing: 2px;
    text-align: center;
    z-index: 3;
}

/* Mobile touch controls - hidden by default */
.mobile-controls {
    display: none;
    position: relative;
    z-index: 2;
}

.touch-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 1rem;
}

.middle-row {
    display: flex;
    gap: 50px;
}

.touch-button {
    width: 100px;
    height: 100px;
    border: 2px solid #ff0000;
    border-radius: 50%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6),
                0 0 40px rgba(255, 0, 0, 0.4),
                0 0 60px rgba(255, 0, 0, 0.2);
    position: relative;
    z-index: 2;
    transition: all 0.1s ease;  /* Changed from just transform to all */
    touch-action: manipulation;  /* Optimize for touch */
}

.touch-button:active,
.touch-button:focus {
    background: #1a0000;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.8),
                0 0 50px rgba(255, 0, 0, 0.4);
    transform: scale(0.9);
    outline: none;  /* Remove focus outline */
}

/* Add specific touch device handling */
@media (hover: none) and (pointer: coarse) {
    .touch-button.pressed {
        transform: scale(0.9);
        background: #1a0000;
    }
}

.arrow-icon {
    width: 40px;  /* Adjust size as needed */
    height: 40px;  /* Adjust size as needed */
}

/* Hide mobile elements by default */
.mobile-controls, .mobile-header-content {
    display: none;
}

/* Single mobile media query with all mobile styles */
@media (max-width: 768px), (pointer: coarse) {
    body {
        margin: 0;
        padding: 0;
        height: 100vh;
        width: 100vw;
        position: fixed;
        overflow: hidden;
    }

    .game-title {
        position: fixed;
        top: 1.5rem;
        left: 0;
        width: 100%;
        background: #000;
        padding: 0.5rem 0;
        font-size: 2rem;
        text-align: center;
        z-index: 3;
    }

    .mobile-header-content {
        display: flex;
        position: fixed;
        top: 5rem;
        width: 100%;
        justify-content: center;
        align-items: center;
        gap: 12px;
        font-size: 1.2rem;
        z-index: 3;
        background: #000;
    }

    .mobile-header-content a {
        color: #ff0000;
        text-decoration: none;
        transition: color 0.2s ease;
    }

    .mobile-header-content a:hover {
        color: #cc0000;
    }

    /* Center container for game elements */
    .mobile-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow: hidden;
    }

    #score {
        position: fixed;
        top: 7rem;
        width: 100%;
        text-align: center;
        font-size: 1.5rem;
        z-index: 3;
        background: #000;
        left: 0;  /* Ensure full width centering */
    }

    #gameCanvas {
        position: fixed;
        top: 9rem;
        width: 85vw;
        height: 85vw;
        left: 0;
        right: 0;
        margin-left: auto;
        margin-right: auto;
    }

    /* Mobile Controls */
    .mobile-controls {
        display: block;
        position: fixed;
        bottom: 2rem;
        left: 0;
        width: 100%;
        z-index: 2;
    }

    .touch-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .middle-row {
        display: flex;
        gap: 130px;
    }

    .touch-button {
        width: 110px;
        height: 110px;
        border: 2px solid #ff0000;
        border-radius: 50%;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        padding: 0;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.6),
                    0 0 40px rgba(255, 0, 0, 0.4),
                    0 0 60px rgba(255, 0, 0, 0.2);
        position: relative;
        z-index: 2;
        transition: all 0.1s ease;
        touch-action: manipulation;
    }

    .touch-button:active,
    .touch-button:focus,
    .touch-button.pressed {
        background: #1a0000;
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.8),
                    0 0 50px rgba(255, 0, 0, 0.4);
        transform: scale(0.9);
        outline: none;
    }

    .arrow-icon {
        width: 65px;
        height: 65px;
    }

    /* Sound controls */
    .sound-controls {
        position: fixed;
        bottom: 2.5rem;
        right: 2rem;
        z-index: 4;
        scale: 1.5;
    }

    .sound-controls button {
        width: 35px;
        height: 35px;
    }

    .volume-icon {
        width: 25px;
        height: 25px;
    }

    /* Hide desktop elements */
    #controls, footer {
        display: none;
    }
}
