/* Import Arima and Gabriela fonts (can also be linked in HTML head) */
/* @import url('https://fonts.googleapis.com/css2?family=Arima:wght@400;700&family=Gabriela&display=swap'); */
/* Moved to HTML for potentially faster font loading */

/* Apply a simpler text-shadow for dark mode */
* {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
}

body {
    font-family: 'Gabriela', serif;
    margin: 0;
    padding: 10px; /* Reduced padding */
    text-align: center;
    background-color: #191970; /* Midnight Blue background */
    color: #E0E0E0; /* Light text color for body */
}

h1 {
    color: #ffffff;
    margin-top: 15px;
    margin-bottom: 20px; /* Reduced margin */
    font-size: 2.2em; /* Reduced font size for mobile */
    font-family: 'Arima', sans-serif;
    line-height: 1.1; /* Ensure single line for "Soaking Music" */
}

.button-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 buttons per row */
    gap: 10px; /* Reduced gap */
    max-width: 450px; /* Adjusted max-width for 3 buttons on mobile */
    margin: 0 auto;
}

/* Base styles for soak buttons (includes numbered and STOP button) */
.soak-button {
    padding: 12px 5px; /* Adjusted padding for smaller buttons */
    font-size: 1.6em; /* Adjusted font size */
    font-family: 'Arima', sans-serif; /* Consistent font for all buttons */
    border: 2px solid #4A4A4A; /* Darker border for dark mode */
    border-radius: 8px; /* Slightly reduced radius */
    color: #fff;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s, border 0.3s;
    box-shadow: 0 3px rgba(0,0,0,0.4); /* Adjusted box shadow for dark mode */
    position: relative;
    background-color: #ff6f61; /* Default button color (will be overridden for numbered) */
    display: flex; /* For centering text if needed */
    align-items: center;
    justify-content: center;
    min-height: 60px; /* Ensure buttons have some minimum height */
}

/* Assign different background colors to each numbered button using nth-child */
/* These will apply to buttons directly inside .button-container */
.button-container .soak-button:nth-child(1) { background-color: #ff6f61; }
.button-container .soak-button:nth-child(2) { background-color: #6b5b95; }
.button-container .soak-button:nth-child(3) { background-color: #88b04b; }
.button-container .soak-button:nth-child(4) { background-color: #f7cac9; color: #333; } /* Lighter bg, darker text */
.button-container .soak-button:nth-child(5) { background-color: #92a8d1; }
.button-container .soak-button:nth-child(6) { background-color: #955251; }
.button-container .soak-button:nth-child(7) { background-color: #b565a7; }
.button-container .soak-button:nth-child(8) { background-color: #009b77; }
.button-container .soak-button:nth-child(9) { background-color: #dd4124; }
.button-container .soak-button:nth-child(10) { background-color: #45b8ac; }
.button-container .soak-button:nth-child(11) { background-color: #EFC050; color: #333; } /* Lighter bg, darker text */
.button-container .soak-button:nth-child(12) { background-color: #5B5EA6; }
.button-container .soak-button:nth-child(13) { background-color: #9B2335; }
.button-container .soak-button:nth-child(14) { background-color: #D81159; }
.button-container .soak-button:nth-child(15) { background-color: #8F2D56; }
.button-container .soak-button:nth-child(16) { background-color: #2E86AB; } /* Deep Sky Blue */
.button-container .soak-button:nth-child(17) { background-color: #7209B7; } /* Vivid Violet */
.button-container .soak-button:nth-child(18) { background-color: #F72585; } /* Neon Pink */
.button-container .soak-button:nth-child(19) { background-color: #4CC9F0; color: #333; } /* Light Blue */
.button-container .soak-button:nth-child(20) { background-color: #FF9F1C; color: #333; } /* Orange Peel */
.button-container .soak-button:nth-child(21) { background-color: #2EC4B6; } /* Light Sea Green */
.button-container .soak-button:nth-child(22) { background-color: #E71D36; } /* Rose Red */
.button-container .soak-button:nth-child(23) { background-color: #011627; } /* Midnight Navy */
.button-container .soak-button:nth-child(24) { background-color: #6A4C93; } /* Royal Purple */
.button-container .soak-button:nth-child(25) { background-color: #8AC926; color: #333; } /* June Bud Green */
/* Add more .soak-button:nth-child(N) rules if $totalTracks in PHP increases */





/* High-Intensity Red Pulsating Active Button */
.active-button {
    /* outline stays outside the button and is more visible than border */
    outline: 8px solid #FF0000 !important; 
    outline-offset: 2px;
    border: none !important;
    z-index: 99; /* Ensures it stays on top of other buttons */
    animation: megaPulse 1.0s infinite ease-in-out;
}

@keyframes megaPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0px rgba(255, 0, 0, 0.9);
    }
    50% {
        /* Grows 15% bigger */
        transform: scale(1.15); 
        /* Massive red glow shockwave */
        box-shadow: 0 0 30px 20px rgba(255, 0, 0, 0); 
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0px rgba(255, 0, 0, 0);
    }
}






.soak-button:active {
    transform: translateY(1px) scale(0.98); /* Adjusted active transform */
    box-shadow: 0 1px rgba(0,0,0,0.4); /* Adjusted active box shadow */
}

/* Container for the STOP button for centering */
.stop-button-container {
    display: flex;
    justify-content: center;
    margin-top: 20px; /* Spacing from the grid */
    margin-bottom: 10px;
}

/* STOP button specific styling */
/* It inherits .soak-button for most styles */
#stopMusicBtn {
    background-color: #2c3e50; /* Dark color, distinct but themed */
    padding: 12px 25px; /* Give it a bit more horizontal padding */
    font-size: 1.5em; /* Slightly smaller if "STOP" is wider */
    width: auto; /* Allow it to size based on content */
    min-width: 100px; /* Ensure it's not too small */
}

audio {
    display: none; /* Hide the default audio player controls */
}