/* ============================================================
   BASE.CSS — Reset global + import des variables
   ============================================================ */

* {
  box-sizing: border-box;
  font-family: var(--font-body);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-main);
  color: var(--text-main);
  overflow: hidden;
}

h1, h2, h3 {
  margin: 0 0 12px;
  font-weight: 600;
}

button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

/* ============================================================
   ÉCRAN DE CHARGEMENT (overlay au démarrage)
   ============================================================ */

#app-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--bg-main, #0d1117);
  transition: opacity 0.35s ease;
}

#app-loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.als-logo {
  width: min(220px, 55vw);
  height: auto;
}

.als-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent, #007FFF);
  animation: als-spin 0.9s linear infinite;
}

.als-text {
  color: #8a92a6;
  font-size: 14px;
  letter-spacing: 0.04em;
  animation: als-pulse 2s infinite ease-in-out;
}

@keyframes als-spin { to { transform: rotate(360deg); } }
@keyframes als-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Bouton "Ajouter à l'écran d'accueil" (voir js/pwa.js) */
.als-install-btn {
  margin-top: 6px;
  padding: 11px 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: 600 14px/1.2 var(--font-body, sans-serif);
  cursor: pointer;
}
.als-install-btn:active {
  background: rgba(0, 127, 255, 0.25);
  border-color: var(--accent, #007FFF);
}

/* ============================================================
   BULLE DE VALEUR DES SLIDERS (pendant le drag tactile)
   ============================================================ */
.slider-value-bubble {
  position: fixed;
  transform: translate(-50%, -100%);
  background: var(--bg-card, #222A3F);
  border: 1px solid var(--accent, #007FFF);
  color: #fff;
  font: 600 15px/1 var(--font-body, sans-serif);
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  /* Au-dessus de TOUT : popups de test (10041 !important), console dashboard
     (999999), overlays... la bulle doit rester visible partout. */
  z-index: 2000000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.1s ease;
}

.slider-value-bubble.visible { opacity: 1; }

/* Petite flèche sous la bulle */
.slider-value-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  background: var(--bg-card, #222A3F);
  border-right: 1px solid var(--accent, #007FFF);
  border-bottom: 1px solid var(--accent, #007FFF);
  transform: translateX(-50%) rotate(45deg);
}