:root {
    --font-light: 'eaglelight', sans-serif;
    --font-bold: 'eaglebold', sans-serif;
    --color-text: white;
    --color-bg-day: rgba(255, 255, 255, 0.1);
    --color-bg-night: rgba(0, 0, 0, 0.5);
    --color-stop-day: red;
    --color-stop-night: #080099;
    --shadow-color: black;
    --transition-speed: 0.3s;
    --blur-amount: 8px;
}

@font-face {
    font-family: 'eaglelight';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/EagleLight.otf'); /* Adjusted path assuming fonts are in assets/fonts or similar */
}

@font-face {
    font-family: 'eaglebold';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/EagleBold.otf');
}

* {
    box-sizing: border-box;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: var(--font-light);
    color: var(--color-text);
    /* background-color: black; Removed to prevent covering background images */
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header */
#header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    font-family: var(--font-bold);
    text-shadow: 2px 2px 4px black;
}

#header h1 {
    margin: 0;
    margin-right: 15px;
    font-size: clamp(1.2rem, 4vw, 2rem);
}

#logo {
    width: 100px;
    height: auto;
}

/* Main Layout */
main {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 80px 20px 20px 20px; /* Space for header */
}

/* Backgrounds */
#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Keep behind content */
    background-color: black; /* Fallback color */
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: opacity 2s ease-in-out;
}

#image1 {
    background-image: url('../images/day.jpg');
    opacity: 1;
}

#image2 {
    background-image: url('../images/night.jpg');
    opacity: 0;
}

/* Start Button Overlay */
#boutonStart {
    position: absolute;
    z-index: 50;
    width: 80%;
    max-width: 600px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--blur-amount));
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(2rem, 5vw, 4rem);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.2s, opacity 0.5s;
    text-align: center;
}

#boutonStart:active {
    transform: scale(0.95);
}

/* Sound Grid Container */
.conteneurBoutonsSons {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto; /* Toggle - Grid - Stop */
    gap: 20px;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

/* Toggle Button (Day/Night) */
#boutonNuitJourHaut {
    width: 100%;
    padding: 20px;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--blur-amount));
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Sound Buttons Grid */
.grid-sons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    height: 100%;
}

.boutonSon {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: white;
    font-family: var(--font-light);
    font-size: clamp(1rem, 2vw, 1.5rem);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, background-color 0.3s, border-color 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    padding: 10px;
    transform: scale(0); /* Initial state for animation */
}

.boutonSon.clicked {
    animation: buttonClickAnimation 0.2s ease-in-out;
}

@keyframes buttonClickAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Stop Button */
#boutonStop {
    width: 100%;
    padding: 20px;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    background-color: var(--color-stop-day);
    color: black;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.5s, color 0.5s, transform 0.2s;
    font-family: var(--font-light);
}

#boutonStop:active {
    transform: scale(0.98);
}

/* Night Mode Styles (Applied via class on body or container) */
body.mode-night #boutonStop {
    background-color: var(--color-stop-night);
    color: white;
}

body.mode-night .boutonSon {
    backdrop-filter: hue-rotate(45deg) blur(var(--blur-amount));
    border-color: rgba(0,0,0,0.5);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .grid-sons {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
        grid-template-rows: repeat(5, 1fr); /* More rows */
    }
    
    #header {
        padding: 5px;
    }
    
    #logo {
        width: 60px;
    }
}
