/* Application « Les lucioles » : ambiance de nuit */

.app-lucioles {
  --fond: #070b16;
  --carton: #111a2e;
  --encre: #eef2ff;
  --encre-douce: #aab4cf;
  --trait: #2a3552;
  --accent: #c8e85a;
  --accent-fonce: #8ba52a;
  background: var(--fond);
  color: var(--encre);
}
.app-lucioles .btn-principal { color: #10170a; }
.app-lucioles .btn-secondaire { background: transparent; color: var(--encre); border-color: var(--encre-douce); }
.app-lucioles .btn-barre { color: var(--encre); border-color: var(--trait); }
.app-lucioles .barre { background: rgba(10, 15, 30, 0.92); border-top-color: var(--trait); }
.app-lucioles .modale { background: #f8f9fc; color: #1d2433; }
.app-lucioles .modale .btn-principal { color: #10170a; }
.app-lucioles .pave-touche { background: #fff; color: #1d2433; }
.app-lucioles .pave-ok { background: #1d2433; color: #fff; }

.lucioles-app { height: 100vh; height: 100dvh; }

/* Projection */
.projection { position: relative; width: 100%; height: 100%; overflow: hidden; background: #050914; }
.projection-canvas { position: absolute; inset: 0; display: block; }
.proj-texte {
  position: absolute;
  left: 4vw;
  top: 50%;
  transform: translateY(-50%);
  width: 34vw;
  color: #eef2ff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.proj-texte:empty { display: none; }
.proj-texte h2 { font-size: clamp(1.6rem, 3.6vw, 4.4rem); margin: 0 0 1.2rem; line-height: 1.05; letter-spacing: -0.01em; color: #e9ff9a; }
.proj-texte p { font-size: clamp(1rem, 1.7vw, 2rem); line-height: 1.45; margin: 0; color: #d6def2; }
.projection[data-page="accueil"] .proj-texte,
.projection[data-page="fin"] .proj-texte { width: 60vw; left: 20vw; text-align: center; }
.projection[data-page="accueil"] .proj-texte h2 { font-size: clamp(2.4rem, 7vw, 8rem); }

.proj-bandeau {
  position: absolute;
  left: 50%;
  bottom: 2.5vh;
  transform: translateX(-50%);
  max-width: 92%;
}
.code-salle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem 0.9rem;
  background: rgba(12, 18, 34, 0.88);
  border: 1px solid #34406a;
  border-radius: 16px;
  padding: 0.7rem 1.2rem;
  color: #dfe6fb;
  font-size: clamp(0.85rem, 1.2vw, 1.3rem);
  text-align: center;
}
.code-salle strong { font-size: clamp(1.6rem, 3vw, 3rem); letter-spacing: 0.15em; color: #e9ff9a; }
.code-aide { flex-basis: 100%; color: #aab4cf; }
.code-salle.discret { opacity: 0.55; padding: 0.3rem 0.8rem; }
.code-salle.discret strong { font-size: 1.1rem; }

/* Portrait (téléphone) : texte en haut, essaim dessous */
@media (max-aspect-ratio: 1/1) {
  .proj-texte { left: 5vw; width: 90vw; top: 4vh; transform: none; }
  .proj-texte h2 { font-size: clamp(1.4rem, 6vw, 2.4rem); margin-bottom: 0.6rem; }
  .proj-texte p { font-size: clamp(0.95rem, 3.6vw, 1.2rem); }
  .projection[data-page="accueil"] .proj-texte, .projection[data-page="fin"] .proj-texte { left: 5vw; width: 90vw; }
}

/* Vue combinée : projection en haut (16:9), poste de contrôle dessous */
.cadre-combine { grid-template-rows: auto minmax(0, 1fr) auto; }
.projection-combinee { height: auto; aspect-ratio: 16 / 9; max-height: 62vh; width: 100%; }
.projection-combinee .proj-texte h2 { font-size: clamp(1rem, 2.4vw, 2.4rem); margin-bottom: 0.4rem; }
.projection-combinee .proj-texte p { font-size: clamp(0.7rem, 1.25vw, 1.25rem); }
@media (max-aspect-ratio: 1/1) {
  .projection-combinee { aspect-ratio: 4 / 5; max-height: 52vh; }
  .projection-combinee .proj-texte { top: 2vh; }
  .projection-combinee .proj-texte p { font-size: 0.85rem; }
}

/* Poste de contrôle */
.controle { padding: 1rem 1.2rem 1.4rem; }
.ctl-page { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.1rem; align-items: stretch; text-align: center; }
.ctl-page h2 { margin: 0.4rem 0 0; font-size: clamp(1.4rem, 3vw, 2.2rem); color: #e9ff9a; }
.ctl-page p { margin: 0; font-size: clamp(1.05rem, 2vw, 1.4rem); line-height: 1.4; color: var(--encre-douce); }
.ctl-grand-titre { font-size: clamp(2rem, 6vw, 3.4rem) !important; }
.ctl-consigne { color: var(--encre) !important; font-weight: 600; }
.ctl-regarde { font-size: clamp(1.3rem, 3vw, 2rem) !important; color: var(--encre) !important; padding: 2rem 0 1rem; }
.btn-geant { min-height: 92px; font-size: clamp(1.3rem, 3vw, 2rem); padding: 1rem 2.4rem; align-self: center; }
.ctl-page .btn-grand { align-self: center; }

.barre-temps { height: 12px; border-radius: 6px; background: #1d2742; overflow: hidden; }
.barre-temps-remplie { display: block; height: 100%; width: 0; background: var(--accent); animation: remplir 20s linear forwards; }
@keyframes remplir { to { width: 100%; } }

.bloc-curseur { display: grid; gap: 0.45rem; text-align: left; background: #0f182b; border: 1px solid var(--trait); border-radius: 16px; padding: 0.8rem 1rem; }
.curseur-libelle { font-weight: 700; font-size: clamp(1rem, 1.8vw, 1.25rem); }
.curseur-valeur { color: #e9ff9a; }
.curseur { width: 100%; height: 48px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.curseur::-webkit-slider-thumb { width: 36px; height: 36px; }
.curseur::-moz-range-thumb { width: 32px; height: 32px; }
.curseur-graduations { display: flex; justify-content: space-between; color: var(--encre-douce); font-size: 0.9rem; }

.bascule { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.bascule-choix {
  font: inherit; font-weight: 700; min-height: 52px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--trait); background: transparent; color: var(--encre);
}
.bascule-choix.actif { background: var(--accent); border-color: var(--accent); color: #10170a; }

.jauge-sync { display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 0.4rem; text-align: left; font-weight: 700; }
.jauge-sync strong { color: #e9ff9a; }
.jauge-fond { grid-column: 1 / -1; height: 14px; border-radius: 7px; background: #1d2742; overflow: hidden; }
.jauge-niveau { height: 100%; width: var(--niveau, 0%); background: linear-gradient(90deg, #6f8a2a, #e9ff9a); transition: width 0.6s ease; }

.rangee-boutons { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }
#liaison { font-size: 0.95rem; color: #f0a35c; }
#liaison.ok { color: #9be27a; }

/* Choix de la vue */
.choix-vue { max-width: 980px; margin: 0 auto; padding: 2rem 1.2rem 3rem; text-align: center; }
.choix-vue h1 { font-size: clamp(2.2rem, 6vw, 4rem); color: #e9ff9a; margin: 0.5rem 0; }
.choix-intro { color: var(--encre-douce); font-size: 1.2rem; line-height: 1.45; }
.choix-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.6rem; }
.choix-carte {
  display: grid; gap: 0.5rem; text-align: left; padding: 1.4rem; border-radius: 18px;
  background: #101a30; border: 1px solid #2c3a62; color: var(--encre); text-decoration: none; min-height: 140px;
}
.choix-carte strong { font-size: 1.4rem; color: #e9ff9a; }
.choix-carte span { color: var(--encre-douce); line-height: 1.4; }
.choix-carte:active { transform: scale(0.98); }
.choix-pied { margin-top: 2rem; }
.choix-pied a { color: var(--encre-douce); }
.saisie-code .pave-ecran { color: #1d2433; background: #fff; }
