/* Réinitialisation et comportements natifs mobiles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: #0c0b0b;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    overscroll-behavior-y: none;
    user-select: none;
    transition: background-color 0.3s;
}

#app-container {
    width: 100%;
    height: 100%;
    max-width: 450px; 
    position: relative;
    background-color: #000;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.light-zone {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: background-color 0.5s ease;
    z-index: 1;
}

/* Panneau UI */
.ui-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(25, 25, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: rgb(8, 8, 8);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    padding: 24px 20px 34px 20px;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s, color 0.3s;
    max-height: 85vh;
    overflow-y: auto;
}

.ui-panel.hidden {
    transform: translateY(105%);
}

/* En-tête avec image */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.panel-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
}

.control-group {
    margin-bottom: 24px;
}

/* Labels avec images */
.control-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #ddd;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Éléments de formulaire */
select, input[type="range"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 0 16px;
    height: 48px;
    font-size: 16px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

select option {
    background: #1a1a1a;
    color: white;
}

input[type="range"] {
    padding: 0;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    margin-top: 20px;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Boutons */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    height: 48px;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0 24px;
    border-radius: 14px;
    font-weight: 600;
    transition: background 0.1s;
    width: 100%;
}

.btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.timer-controls {
    display: flex;
    gap: 12px;
}

.timer-display {
    margin-top: 12px;
    font-size: 1rem;
    font-weight: bold;
    color: #FFBF00;
    text-align: center;
}

.btn-show-ui {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(12px);
    width: 60px;
    height: 60px;
    border-radius: 30px;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hidden { display: none !important; }

/* --- THÈME CLAIR (Mode activé par JS) --- */
body.light-mode {
    background-color: #f5f5f5;
}

body.light-mode .ui-panel {
    background: rgba(255, 255, 255, 0.95);
    color: #111;
}

body.light-mode .control-group label {
    color: #333;
}

body.light-mode select, 
body.light-mode input[type="range"] {
    background: rgba(0, 0, 0, 0.05);
    color: #0f0f0f;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode select option {
    background: #090909;
    color: #0f0f0f;
}

body.light-mode button,
body.light-mode .btn-primary,
body.light-mode .btn-icon {
    background: rgba(131, 129, 129, 0.55);
    color: #111;
    border: 1px solid rgba(249, 6, 6, 0.788);
}

body.light-mode .btn-show-ui {
    background: rgba(13, 13, 13, 0.9);
    color: #111;
}