:root {
  color-scheme: dark;
  --fond: #111318;
  --surface: #1b1e26;
  --texte: #f2efe9;
  --texte-secondaire: rgba(242, 239, 233, 0.7);
  --texte-muet: rgba(242, 239, 233, 0.5);
  --accent: #c63974;
  --erreur: #e0554f;
  --bordure: rgba(255, 255, 255, 0.18);
  --champ-fond: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--fond);
  color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#app {
  min-height: 100dvh;
}

.ecran {
  max-width: 440px;
  margin: 0 auto;
  padding: max(2.5rem, env(safe-area-inset-top)) 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  justify-content: center;
}

.eyebrow {
  font-size: 0.8rem;
  color: var(--texte-muet);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
}

.titre {
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0 0 0.7rem;
  line-height: 1.3;
}

.corps {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--texte-secondaire);
  margin: 0 0 1.4rem;
  white-space: pre-line;
}

.ecran-capsule {
  align-items: center;
  text-align: center;
}

.photo-scellee {
  width: 100%;
  border-radius: 10px;
  margin: 0 0 1.4rem;
  display: block;
}

.lecteur-audio {
  width: 100%;
  margin: 1rem 0 1.6rem;
}

.compte-a-rebours {
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI Rounded", -apple-system, sans-serif;
  font-weight: 700;
  font-size: 120px;
  line-height: 1;
  margin: 0;
}

.titre-groupe {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texte-muet);
  margin: 1.4rem 0 0.5rem;
}

.titre-groupe:first-child {
  margin-top: 0;
}

.note {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--texte-muet);
  margin: 0 0 1.4rem;
  font-style: italic;
}

.champs {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.4rem;
}

.champ {
  font: inherit;
  font-size: 0.95rem;
  color: var(--texte);
  background: var(--champ-fond);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  width: 100%;
  appearance: none;
}

.champ::placeholder {
  color: var(--texte-muet);
}

.champ:focus {
  outline: none;
  border-color: var(--accent);
}

.champ-erreur {
  border-color: var(--erreur);
}

.boutons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ligne-selection {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--bordure);
  font-size: 0.9rem;
  line-height: 1.4;
}

.ligne-selection:first-of-type {
  margin-top: 0.2rem;
}

.case-selection {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.bouton {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: 10px;
  padding: 0.85rem;
  cursor: pointer;
  width: 100%;
}

.bouton-principal {
  background: var(--accent);
  color: #fff;
}

.bouton-secondaire {
  background: transparent;
  color: var(--texte);
  border: 1px solid var(--bordure);
}

/* Grille du calendrier */

.grille-page {
  max-width: 440px;
  margin: 0 auto;
  padding: max(2rem, env(safe-area-inset-top)) 1.25rem 4rem;
}

.entete-grille {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.3rem;
}

.legende-grille {
  font-size: 0.8rem;
  color: var(--texte-muet);
  margin: 0 0 1.4rem;
}

.grille {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bouton-invitation {
  aspect-ratio: 1;
  border-radius: 10px;
  border: none;
  background: var(--couleur-categorie);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 6px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.bouton-invitation.etat-verrouille {
  opacity: 0.4;
}

.bouton-invitation.etat-en-cours {
  border: 2px solid #fff;
}

.bouton-invitation.etat-termine {
  opacity: 0.8;
}

.zone-numero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.numero {
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI Rounded", -apple-system, sans-serif;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.numero-un-chiffre {
  font-size: 85px;
}

.numero-deux-chiffres {
  font-size: 70px;
}

.bandeau-bas {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.bandeau-gauche,
.bandeau-droite {
  font-size: 11px;
  color: #fff;
  line-height: 1.1;
}

.bandeau-droite {
  text-align: right;
}

.icone-coin {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 13px;
  height: 13px;
  color: #fff;
}

.icone-coin svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--texte);
  border: 1px solid var(--bordure);
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  max-width: 90vw;
  text-align: center;
  z-index: 200;
}

/* Mode développeur */

.dev-declencheur {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--bordure);
  background: var(--surface);
  color: var(--texte-muet);
  font-size: 0.8rem;
  z-index: 100;
  cursor: pointer;
}

.dev-fond {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  z-index: 300;
}

.dev-panneau {
  background: var(--surface);
  width: 100%;
  border-radius: 16px 16px 0 0;
  padding: 1.5rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dev-titre {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.4rem;
}

.dev-etiquette {
  font-size: 0.8rem;
  color: var(--texte-muet);
}

.dev-champ {
  font: inherit;
  color: var(--texte);
  background: var(--champ-fond);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  padding: 0.6rem;
  color-scheme: dark;
}

.dev-ligne-case {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin: 0.4rem 0;
}

.dev-bouton-texte {
  font: inherit;
  background: transparent;
  color: var(--texte-secondaire);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  padding: 0.6rem;
  cursor: pointer;
}

.dev-bouton-danger {
  font: inherit;
  background: transparent;
  color: var(--erreur);
  border: 1px solid var(--erreur);
  border-radius: 10px;
  padding: 0.6rem;
  cursor: pointer;
  margin-top: 0.4rem;
}

.entree-liste {
  margin-bottom: 1.4rem;
}

/* Boutons posés directement dans un écran (aperçu photo : Recommencer / Sceller) */
.ecran > .bouton + .bouton {
  margin-top: 0.6rem;
}
