body {
    margin: 0;
    padding: 0;
    background: url('./images/background.png') no-repeat center center fixed;
    background-size: cover; /* Ensures the image covers the entire screen */
    font-family: Arial, sans-serif;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Full viewport height */
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Dark overlay */
    z-index: -1; /* Ensure it stays behind all content */
}

.panel {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 10px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}



#modifiers-panel {
    width: 150px;
    position: fixed !important;
    z-index: 2000 !important;
    transition: opacity 0.3s ease;
}

#next-panel {
    width: 150px;
}

#score-panel {
    width: 150px;
}

#grid-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modifier-card {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 10px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
    transition: transform 0.2s, background-color 0.2s, border-color 0.2s !important;
    margin-bottom: 8px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0, 255, 255, 0.1) !important;
}

.modifier-card:hover {
    transform: translateY(-2px);
    background-color: rgba(0, 0, 0, 0.8) !important;
    border-color: rgba(0, 255, 255, 0.8) !important;
}

.modifier-card:active {
    transform: translateY(0);
    background-color: rgba(0, 255, 255, 0.1) !important;
}

#selected-modifiers {
    position: absolute;
    top: 0; /* Align at the top of the screen */
    left: 50%;
    transform: translateX(-50%);
    width: 300px; /* Match the grid width */
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 10px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
    z-index: 1000;
}

#main-menu button {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffff;
    border-radius: 8px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 200px;
}

#main-menu button:hover {
    background-color: rgba(0, 255, 255, 0.2);
    transform: scale(1.05);
}

#main-menu a {
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    margin: 0 10px;
}

#main-menu a:hover {
    color: white;
    text-decoration: underline;
}

#volume-slider {
    -webkit-appearance: none;
    height: 5px;
    background: #00ffff;
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

#volume-slider:hover {
    opacity: 1;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

#toggle-music {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffff;
    color: #fff;
    padding: 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s;
}

#toggle-music:hover {
    background-color: rgba(0, 255, 255, 0.2);
}

#leaderboard {
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    min-width: 300px;
}

#leaderboard table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}

#leaderboard th, 
#leaderboard td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #00ffff;
}

#leaderboard th {
    color: #00ffff;
    font-weight: bold;
}

#leaderboard tr:hover {
    background: rgba(0, 255, 255, 0.1);
}

#close-leaderboard {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffff;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

#close-leaderboard:hover {
    background: rgba(0, 255, 255, 0.2);
}

#settings-menu {
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    min-width: 300px;
    text-align: center;
}

#settings-menu h2 {
    color: #00ffff;
    margin-bottom: 20px;
}

#settings-menu h3 {
    color: white;
    margin: 10px 0;
}

#settings-volume-slider {
    -webkit-appearance: none;
    height: 5px;
    background: #00ffff;
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

#settings-volume-slider:hover {
    opacity: 1;
}

#settings-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

#settings-toggle-music,
#close-settings {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffff;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}

#settings-toggle-music:hover,
#close-settings:hover {
    background: rgba(0, 255, 255, 0.2);
}

input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #00ffff;
    border-radius: 4px;
    background-color: transparent;
    cursor: pointer;
    position: relative;
}

input[type="checkbox"]:checked::before {
    content: '✓';
    position: absolute;
    color: #00ffff;
    font-size: 16px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

input[type="checkbox"]:hover {
    background-color: rgba(0, 255, 255, 0.1);
}

label:hover span {
    text-decoration: underline;
}

/* Mobile Controls Styles */
#mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 10px;
    pointer-events: auto;
}

.mobile-button {
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid #00ffff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    color: white;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.mobile-button:active {
    background: rgba(0, 255, 255, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
        touch-action: none;
    }

    #main-menu {
        padding: 10px;
    }

    #main-menu button {
        width: 180px;
        font-size: 14px;
    }

    .panel {
        transform: scale(0.9);
    }

    #settings-menu, 
    #leaderboard,
    #game-over-screen {
        width: 90%;
        max-width: 300px;
    }

    #modifiers-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        width: 90%;
        max-width: 300px;
        max-height: 80vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 15px !important;
        margin: 10px !important;
        width: auto !important;
        max-width: 90% !important;
        min-width: 280px !important;
    }

    .modifier-card {
        padding: 8px !important;
        margin: 5px !important;
        font-size: 12px !important;
    }

    #modifier-timer {
        position: sticky !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.9) !important;
        padding: 5px !important;
        border-top: 1px solid #00ffff !important;
    }
}

/* Prevent text selection on mobile */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}