/* Ecrans plein cadre : appairage, verrou ; panneaux qui montent du bas : lieux, reglages. */
.ecran { position: fixed; inset: 0; }

/* Fond des ecrans d'accueil : deux lueurs, une par personne, qui se rejoignent */
.ecran-fond {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(60% 42% at 12% 4%, color-mix(in srgb, var(--koray) 26%, transparent), transparent 70%),
    radial-gradient(62% 44% at 92% 18%, color-mix(in srgb, var(--esma) 24%, transparent), transparent 70%),
    var(--fond);
}

.accueil, .verrou {
  min-height: 100%;
  max-width: 460px; margin: 0 auto;
  padding: calc(40px + var(--s-haut)) calc(20px + var(--s-droite)) calc(28px + var(--s-bas)) calc(20px + var(--s-gauche));
  display: flex; flex-direction: column; align-items: center;
}

/* Les deux cercles qui se chevauchent : la marque de l'appli */
.duo { display: flex; margin: 8px 0 22px; }
.duo span {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%;
  font: 700 30px var(--police-ronde); color: #fff;
  box-shadow: 0 0 0 4px var(--fond), var(--ombre-1);
}
.duo-a { background: var(--koray); }
.duo-b { background: var(--esma); margin-left: -18px; }
.duo-petit span { width: 60px; height: 60px; font-size: 24px; }
.duo-petit .duo-b { margin-left: -14px; }

.titre-appli { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.sous-titre { margin: 8px 0 30px; color: var(--encre-2); font-size: 17px; text-align: center; }

.carte-etape {
  width: 100%; display: flex; flex-direction: column; gap: 14px;
  padding: 22px 18px 18px; border-radius: var(--r-grand);
  background: var(--surface); box-shadow: var(--ombre-2);
  animation: monte-etape 380ms var(--sortie);
}
@keyframes monte-etape { from { transform: translateY(10px); opacity: 0; } }
.carte-etape h2 { font-size: 22px; font-weight: 700; }
.aide { color: var(--encre-2); font-size: 15.5px; }
.champ-coller { display: flex; gap: 8px; }
.champ-coller input { flex: 1; min-width: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 16px; }
.champ-coller .bouton { flex: none; min-height: 52px; padding: 0 16px; }

.qui-avatar {
  align-self: center; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%;
  font: 700 38px var(--police-ronde); color: #fff; box-shadow: 0 0 0 5px var(--surface), 0 0 0 8px var(--anneau, var(--accent));
  margin: 6px 0 4px;
}
#etape-qui h2 { text-align: center; font-size: 26px; }
#etape-qui .aide { text-align: center; }

/* Verrou */
.verrou { justify-content: center; text-align: center; gap: 6px; }
.verrou-titre { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.verrou-aide { color: var(--encre-2); font-size: 16px; margin-bottom: 26px; }
.bouton-rond-grand {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 168px; height: 168px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface); color: var(--accent); font-weight: 600; font-size: 16px;
  box-shadow: var(--ombre-2), 0 0 0 10px color-mix(in srgb, var(--surface) 45%, transparent);
  transition: transform 200ms var(--sortie);
}
.bouton-rond-grand:active { transform: scale(0.95); }
.bouton-rond-grand span { color: var(--encre); }

.points { display: flex; gap: 16px; justify-content: center; margin: 4px 0 18px; }
.points span {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--encre-3);
  transition: background-color 120ms, border-color 120ms, transform 160ms var(--sortie);
}
.points span.plein { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.points.secoue { animation: secoue 380ms; }
@keyframes secoue { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.pave { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 26px; justify-content: center; margin-top: 14px; }
.pave button {
  width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--encre);
  font: 500 30px var(--police-ronde); font-variant-numeric: tabular-nums; box-shadow: var(--ombre-1);
  display: grid; place-items: center; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.pave button:active { background: var(--surface-3); }
.pave button[data-effacer] { background: transparent; box-shadow: none; color: var(--encre-2); }
#verrou-code .erreur { margin: 0 auto 4px; max-width: 320px; }
.verrou-titre-code { margin-bottom: 4px; }

/* Panneaux du bas */
.voile { position: fixed; inset: 0; z-index: 1000; background: rgb(20 12 22 / 0.32); animation: apparait 220ms; }
@keyframes apparait { from { opacity: 0; } }
.panneau {
  position: fixed; z-index: 1001; left: 0; right: 0; bottom: 0;
  max-height: calc(100% - 56px - var(--s-haut)); display: flex; flex-direction: column;
  margin: 0 auto; max-width: 560px;
  background: var(--surface); border-radius: var(--r-grand) var(--r-grand) 0 0; box-shadow: var(--ombre-feuille);
  animation: glisse 340ms var(--sortie);
}
@keyframes glisse { from { transform: translateY(100%); } }
.panneau-court { max-height: 72%; }
.panneau:focus { outline: none; }
.panneau-tete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 16px 10px 20px;
}
.panneau-tete h2 { font-size: 24px; font-weight: 700; }
.panneau-corps {
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 4px 16px calc(24px + var(--s-bas)); display: flex; flex-direction: column; gap: 14px;
}
.panneau-corps > * { flex-shrink: 0; }
.groupe { border-radius: var(--r-moyen); background: var(--surface-2); overflow: hidden; }
.groupe-titre { margin: 10px 4px -4px; font-size: 14px; font-weight: 600; color: var(--encre-2); }
.ligne {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 14px;
  border: 0; background: transparent; text-align: left; color: var(--encre); font-size: 16px; cursor: pointer;
}
.ligne + .ligne { border-top: 1px solid var(--trait); }
.ligne .ic { color: var(--encre-2); }
.ligne-texte { flex: 1; min-width: 0; }
.ligne-texte small { display: block; color: var(--encre-2); font-size: 14px; }
.ligne-danger { color: var(--danger); font-weight: 600; }
.ligne-danger .ic { color: var(--danger); }
.ligne-danger.confirmer { background: var(--danger); color: #fff; }
.ligne-danger.confirmer .ic { color: #fff; }
.pastille-emoji {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%;
  background: var(--surface); font-size: 22px; line-height: 1;
}
.vide { padding: 22px 18px; text-align: center; color: var(--encre-2); border-radius: var(--r-moyen); background: var(--surface-2); }
.vide strong { display: block; color: var(--encre); font-family: var(--police-ronde); font-size: 18px; margin-bottom: 4px; }

/* Formulaire de lieu */
.emojis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.emojis button {
  height: 48px; border: 2px solid transparent; border-radius: var(--r-petit); background: var(--surface-2);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.emojis button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-doux); }
.rayon-valeur { float: right; font-weight: 600; color: var(--encre); font-variant-numeric: tabular-nums; }
.note { font-size: 14px; color: var(--encre-2); }
.rangee { display: flex; gap: 10px; }
.rangee .bouton { flex: 1; }

/* Reglages */
.moi { display: flex; align-items: center; gap: 16px; padding: 4px 4px 6px; }
.moi-photo {
  position: relative; width: 84px; height: 84px; flex: none; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--anneau, var(--accent)); color: #fff; font: 700 32px var(--police-ronde);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--anneau, var(--accent)); overflow: hidden;
}
.moi-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.moi-photo .badge-photo {
  position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); color: var(--encre); box-shadow: var(--ombre-1);
}
.moi-photo .badge-photo .ic { width: 17px; height: 17px; }
.moi-nom { font: 700 24px var(--police-ronde); }
.moi-nom small { display: block; font: 400 15px var(--police); color: var(--encre-2); }
.couleurs { display: grid; grid-template-columns: repeat(6, 44px); justify-content: space-between; gap: 8px; padding: 14px; }
.couleurs button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c);
  box-shadow: 0 0 0 0 var(--surface-2), 0 0 0 0 var(--c); transition: box-shadow 160ms var(--sortie);
}
.couleurs button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface-2), 0 0 0 6px var(--c); }
.interrupteur { position: relative; width: 52px; height: 32px; flex: none; border-radius: 999px; background: var(--surface-3); transition: background-color 180ms; }
.interrupteur::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 220ms var(--sortie);
}
[aria-checked="true"] > .interrupteur { background: var(--succes); }
[aria-checked="true"] > .interrupteur::after { transform: translateX(20px); }
.aide-liste { margin: 0; padding: 14px 16px 14px 36px; color: var(--encre-2); font-size: 15px; display: grid; gap: 8px; }
.aide-liste li::marker { color: var(--accent); font-weight: 700; }
.apropos { padding: 14px 16px; font-size: 15px; color: var(--encre-2); display: grid; gap: 4px; }
.apropos strong { color: var(--encre); font-weight: 600; }
.empreinte { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; letter-spacing: 0.02em; color: var(--encre); }

/* Recadrage de la photo */
.recadre { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.recadre-cadre {
  position: relative; width: 256px; height: 256px; border-radius: 50%; overflow: hidden; touch-action: none;
  background: var(--surface-3); box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--anneau, var(--accent)); cursor: grab;
}
.recadre-cadre img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; pointer-events: none; max-width: none; }
.recadre .note { text-align: center; }

/* Page appairer.html */
.etapes-suivantes { margin-top: 14px; }
.etapes-suivantes h2 + .systeme, .systeme + .systeme { margin-top: -4px; }
.touche {
  display: inline-block; padding: 0 7px; border-radius: 7px; background: var(--surface-2);
  color: var(--encre); font-weight: 600; white-space: nowrap;
}
.petite { font-size: 14px; }
.note-ok { color: var(--succes); font-weight: 600; text-align: center; }
