/* Configuration globale pour mobile */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #111112; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Force l'application au format Smartphone uniquement */
#app-container {
    position: relative;
    width: 100%;
    max-width: 430px; 
    height: 100%;
    max-height: 932px; 
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 0 40px rgba(15, 15, 15, 0.9);
}

/* Écran de lumière */
#light-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1e90ff; 
    opacity: 1;
    transition: background-color 0.4s ease, opacity 0.3s ease;
    z-index: 1;
}

/* --- TOUTES LES ANIMATIONS --- */
.anim-candle {
    animation: flicker 3s infinite alternate ease-in-out;
}

.anim-pulse {
    animation: pulse 4s infinite ease-in-out;
}

.anim-rainbow {
    animation: rainbow 15s infinite linear;
}

.anim-aurora {
    animation: aurora 12s infinite ease-in-out;
}

.anim-ocean {
    animation: ocean 10s infinite ease-in-out;
}

.anim-twinkle {
    animation: twinkle 1.5s infinite ease-in-out;
}

.anim-sunset {
    animation: sunset 12s infinite ease-in-out;
}

/* Panneau de contrôle principal du bas */
#control-panel {
    position: absolute;
    bottom: 25px;
    left: 4%;
    width: 92%; 
    display: flex;
    justify-content: space-between;
    background: rgba(29, 90, 151, 0.621);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 10px 8px;
    border-radius: 30px;
    border: 1px solid rgba(35, 12, 210, 0.897);
    z-index: 10;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#control-panel.invisible {
    opacity: 0;
    transform: translateY(120px);
    pointer-events: none;
}

/* Boutons principaux */
.main-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border: none;
    border-radius: 50%;
    background: rgba(17, 91, 195, 0.662);
    color: #fff;
    cursor: pointer;
    font-size: 9px;
    font-weight: 600;
}

.main-btn:active {
    background: rgba(228, 5, 5, 0.868);
    transform: scale(0.92);
}

.main-btn img {
    width: 18px;
    height: 18px;
    margin-bottom: 4px;
    object-fit: contain;
}

/* GRAND BLOC DE MENU */
.dropdown {
    position: absolute;
    bottom: 105px; 
    left: 4%;
    width: 92%; 
    background: rgba(10, 10, 10, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.8);
    z-index: 11;
}

/* Config du défilement pour les animations si l'écran est petit */
#animation-dropdown {
    max-height: 52%;
    overflow-y: auto;
}
#animation-dropdown::-webkit-scrollbar {
    width: 4px;
}
#animation-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
}

.hidden {
    display: none !important;
}

.menu-title {
    color: rgba(43, 79, 180, 0.6);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(30, 7, 238, 0.76);
    padding-bottom: 6px;
}

/* CONFIGURATION DU SCROLL COULEURS (1 SEULE COLONNE) */
#color-dropdown {
    max-height: 50%; 
}

#color-text-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px; 
    overflow-y: scroll; 
    padding-right: 8px; 
}

#color-text-list::-webkit-scrollbar {
    width: 7px;
    display: block !important;
}
#color-text-list::-webkit-scrollbar-track {
    background: rgba(61, 60, 60, 0.18);
    border-radius: 4px;
}
#color-text-list::-webkit-scrollbar-thumb {
    background: rgba(209, 9, 9, 0.45);
    border-radius: 4px;
}

/* Éléments boutons de la liste de couleurs */
.color-list-item {
    display: block;
    width: 100%;
    padding: 11px 12px;
    background: rgba(56, 54, 54, 0.242);
    border: none;
    border-left: 5px solid transparent;
    color: #f009095d;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
}

.color-list-item:active {
    background: rgba(186, 10, 10, 0.895);
}

/* Boutons pour les menus Animations et Timer */
.sub-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 6px 0;
    background: rgba(45, 45, 45, 0.295);
    border: none;
    color: rgba(234, 47, 10, 0.605);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.sub-btn:active {
    background: rgba(244, 8, 8, 0.893);
}

/* STYLE DE LA ZONE DE DÉCOMPTE (TIMER ACTIF) */
.countdown-display {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffb300; 
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Ajustement du curseur d'intensité */
#intensity-dropdown {
    padding: 20px 15px;
}

#intensity-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #4808e9;
    border-radius: 4px;
    outline: none;
}

#intensity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fbf9f97b;
}

/* Message plein écran */
#overlay-hint {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(216, 53, 8, 0.85);
    color: #fff;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 12px;
    text-align: center;
    width: 80%;
    pointer-events: none;
    z-index: 5;
    animation: fadeOutMsg 3s forwards;
}

/* --- TOUTES LES KEYFRAMES DES FONCTIONS LUMINEUSES --- */
@keyframes flicker {
    0%, 100% { opacity: var(--user-intensity); filter: brightness(1); }
    14% { opacity: calc(var(--user-intensity) * 0.9); filter: brightness(0.93); }
    28% { opacity: calc(var(--user-intensity) * 0.98); filter: brightness(1); }
    45% { opacity: calc(var(--user-intensity) * 0.85); filter: brightness(0.88); }
    70% { opacity: calc(var(--user-intensity) * 0.99); filter: brightness(1); }
}

@keyframes pulse {
    0%, 100% { opacity: var(--user-intensity); }
    50% { opacity: calc(var(--user-intensity) * 0.25); }
}

@keyframes rainbow {
    0% { background-color: #ff0000; }
    17% { background-color: #ff00ff; }
    33% { background-color: #0000ff; }
    50% { background-color: #00ffff; }
    66% { background-color: #00ff00; }
    83% { background-color: #ffff00; }
    100% { background-color: #ff0000; }
}

@keyframes aurora {
    0% { background-color: #0575e6; }
    35% { background-color: #00f260; }
    70% { background-color: #7f00ff; }
    100% { background-color: #0575e6; }
}

@keyframes ocean {
    0%, 100% { background-color: #012443; opacity: var(--user-intensity); }
    50% { background-color: #005c53; opacity: calc(var(--user-intensity) * 0.65); }
}

@keyframes twinkle {
    0%, 100% { opacity: var(--user-intensity); filter: brightness(1); }
    30% { opacity: calc(var(--user-intensity) * 0.2); filter: brightness(0.5); }
    50% { opacity: var(--user-intensity); filter: brightness(1.2); }
    75% { opacity: calc(var(--user-intensity) * 0.35); filter: brightness(0.6); }
}

@keyframes sunset {
    0% { background-color: #f12711; }
    50% { background-color: #f5af19; }
    100% { background-color: #f12711; }
}

@keyframes fadeOutMsg {
    0%, 75% { opacity: 1; }
    100% { opacity: 0; }
}