/* Écrans sociaux de La Chasse au vert (lot F) : panneau de partage, carte
   d'arrivée par lien, réponses à ton défi, bloc social de fin, villes,
   classement, réglages, à propos.

   Les composants de la promo Mantan traduits en CSS (comme le social.css de
   Pile Poil) : Bulle, Mot, Badge, Pastille, Carte. Ombre dure pour ce qui
   surgit, ombre floue pour les seules cartes à lire ; autocollants opaques,
   jamais de backdrop-filter, jamais de thème sombre. Toutes les classes
   commencent par so- (ou arrivee- pour la carte que le serveur écrit avant
   tout JavaScript) pour ne rien toucher de style.css.

   Les entrées au ressort sont jouées en JS (Web Animations) : la propriété
   transform leur appartient, l'inclinaison fixe d'un autocollant passe donc
   par la propriété rotate. Tailles de texte en rem : l'interface tient à
   130 %. */

/* --------------------------------------------------------------------------
   Écran
   -------------------------------------------------------------------------- */

/* z-index 3 : au-dessus des écrans du lot E, sous le bouton son (5) et la
   pause (4) de la façade ; .ui ne prend pas les pointeurs, nos écrans si */
.so-ecran {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fffbeb;
  font-family: 'Nunito', 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.3;
  color: #1f2937;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  isolation: isolate;
}

/* Soleil de la promo : 20 rayons de 9° tous les 18°, à 55 %, fondu radial,
   rotation lente ; fixé derrière le contenu qui défile */
.so-ecran::before {
  content: '';
  position: fixed;
  left: 50%;
  top: 38%;
  z-index: -1;
  width: 320vmax;
  height: 320vmax;
  translate: -50% -50%;
  background: repeating-conic-gradient(#fde68a 0deg 9deg, transparent 9deg 18deg);
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(circle, #000 calc(0.283 * min(100vw, 100vh)), transparent calc(1.169 * min(100vw, 100vh)));
  mask-image: radial-gradient(circle, #000 calc(0.283 * min(100vw, 100vh)), transparent calc(1.169 * min(100vw, 100vh)));
  animation: so-tourne 34.29s linear infinite;
  pointer-events: none;
}

@keyframes so-tourne {
  to { rotate: 360deg; }
}

.so-ecran[hidden],
.so-ecran [hidden],
.so-bloc [hidden] {
  display: none !important;
}

.so-ecran *,
.so-panneau *,
.so-bloc,
.so-bloc *,
.arrivee,
.arrivee * {
  box-sizing: border-box;
}

/* colonne de lecture : le contenu ne s'étale pas sur un écran large */
.so-colonne {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.so-centre {
  text-align: center;
}

.so-nombre {
  font-family: 'Baloo 2', 'Nunito', sans-serif;
  font-variant-numeric: tabular-nums;
}

.so-hors-ecran {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* en-tête : retour à gauche, titre au centre, la droite libre pour le bouton son de la façade */
.so-entete {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 58px 6px;
  flex: none;
}

.so-retour {
  position: absolute;
  left: 0;
  top: 6px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #15803d;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.so-retour:active {
  translate: 0 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.so-picto {
  width: 24px;
  height: 24px;
  flex: none;
}

/* --------------------------------------------------------------------------
   Autocollants de la promo
   -------------------------------------------------------------------------- */

.so-bulle {
  display: inline-block;
  margin: 0;
  max-width: 100%;
  padding: 0.196em 0.478em 0.109em;
  border-radius: 0.435em;
  background: #15803d;
  color: #fff;
  font: 800 1.75rem/1.05 'Baloo 2', 'Nunito', sans-serif;
  text-align: center;
  box-shadow: 0 0.152em 0 rgba(0, 0, 0, 0.18);
  rotate: -3deg;
  overflow-wrap: anywhere;
}

.so-bulle-rouge { background: #ef4444; }
.so-bulle-rose { background: #e11d48; }

.so-mot {
  margin: 0;
  font: 800 2.25rem/1.05 'Baloo 2', 'Nunito', sans-serif;
  letter-spacing: -0.01em;
  color: #15803d;
  text-align: center;
  text-shadow: 0 0.05em 0 #15803d22;
  rotate: -2deg;
}

.so-mot-rouge {
  color: #dc2626;
  text-shadow: 0 0.05em 0 #dc262622;
}

.so-mot-encre {
  color: #1f2937;
  text-shadow: 0 0.05em 0 #1f293722;
}

.so-badge {
  display: inline-block;
  padding: 0.18em 0.6em 0.07em;
  border-radius: 0.54em;
  background: #facc15;
  color: #1f2937;
  font: 800 0.875rem/1.2 'Baloo 2', 'Nunito', sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  box-shadow: 0 0.14em 0 rgba(0, 0, 0, 0.15);
  rotate: 4deg;
  animation: so-oscille 1.26s ease-in-out infinite;
}

@keyframes so-oscille {
  0%, 100% { rotate: 2deg; }
  50% { rotate: 6deg; }
}

.so-pastille {
  display: inline-block;
  padding: 0.267em 0.667em 0.1em;
  border-radius: 0.567em;
  background: #fff;
  color: #15803d;
  font: 800 1rem/1.25 'Baloo 2', 'Nunito', sans-serif;
  box-shadow: 0 0.167em 0 rgba(0, 0, 0, 0.15);
  rotate: -2deg;
  white-space: nowrap;
}

/* Carte (« Sous » de la promo) : la seule à ombre floue, faite pour être lue */
.so-carte {
  border-radius: 0.68em;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 0.27em 0.68em rgba(0, 0, 0, 0.18);
  padding: 14px 16px;
}

.so-etiquette {
  margin: 0 0 6px;
  font: 800 0.8125rem/1.25 'Nunito', sans-serif;
  color: #15803d;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.so-texte {
  margin: 0;
  font: 800 1rem/1.35 'Nunito', sans-serif;
}

.so-texte-doux {
  margin: 0;
  font: 700 0.9375rem/1.4 'Nunito', sans-serif;
  color: #374151;
}

.so-mascotte {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Boutons et champs
   -------------------------------------------------------------------------- */

.so-bouton {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0.45em 1em 0.3em;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #15803d;
  font: 800 1.25rem/1.1 'Baloo 2', 'Nunito', sans-serif;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.so-bouton:active {
  translate: 0 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

/* principal : « Défie tes amis », pleine largeur, vert foncé de la pompe
   (blanc sur vert seulement en gros caractères gras) */
.so-bouton-principal {
  width: 100%;
  min-height: 64px;
  background: #15803d;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 6px 0 #166534;
}

.so-bouton-principal:active {
  translate: 0 5px;
  box-shadow: 0 1px 0 #166534;
}

.so-bouton-rose {
  background: #e11d48;
  color: #fff;
  box-shadow: 0 6px 0 #9f1239;
}

.so-bouton-rose:active {
  box-shadow: 0 1px 0 #9f1239;
}

.so-bouton-large {
  width: 100%;
}

.so-bouton[disabled],
.so-bouton[aria-disabled='true'] {
  cursor: default;
  opacity: 0.6;
  translate: none;
}

/* anneau de chargement (envoi de la partie, lancement du défi) */
.so-anneau {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  border-radius: 50%;
  border: 0.16em solid currentColor;
  border-right-color: transparent;
  animation: so-tourne 0.9s linear infinite;
}

.so-lien {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  background: none;
  color: #15803d;
  font: 800 1rem/1.2 'Nunito', sans-serif;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.so-ecran :focus-visible,
.so-panneau :focus-visible,
.so-bloc :focus-visible,
.arrivee :focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 3px;
}

.so-panneau .so-feuille:focus,
.so-panneau .so-feuille:focus-visible {
  outline: none;
}

.so-boutons {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.so-boutons-ligne {
  display: flex;
  gap: 10px;
  width: 100%;
}

.so-boutons-ligne > * {
  flex: 1 1 0;
  min-width: 0;
}

.so-champ {
  width: 100%;
  height: 54px;
  padding: 6px 16px 2px;
  border: 3px solid #15803d;
  border-radius: 16px;
  background: #fff;
  color: #1f2937;
  font: 800 1.375rem/1 'Baloo 2', 'Nunito', sans-serif;
  outline: none;
}

.so-champ::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.so-champ:focus {
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35);
}

.so-onglets {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

.so-onglet {
  flex: 1;
  min-height: 44px;
  padding: 6px 10px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #15803d;
  font: 800 1.0625rem/1.1 'Baloo 2', 'Nunito', sans-serif;
  cursor: pointer;
}

.so-onglet[aria-selected='true'],
.so-onglet[aria-pressed='true'] {
  background: #15803d;
  color: #fff;
}

.so-carte .so-bouton:not(.so-bouton-principal):not(.so-bouton-rose) {
  background: #fffbeb;
  color: #15803d;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

/* --------------------------------------------------------------------------
   Bloc social de fin (dans le ticket du lot E) et carte des réponses
   -------------------------------------------------------------------------- */

.so-bloc {
  pointer-events: auto;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  font-family: 'Nunito', 'Baloo 2', sans-serif;
  font-weight: 800;
  color: #1f2937;
}

.so-duel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 18px;
}

.so-duel-tickets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.so-duel-ticket {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px 8px;
  border-radius: 14px;
  background: #f0fdf4;
  border: 3px solid #16a34a;
}

.so-duel-ticket-ami {
  background: #fff1f2;
  border-color: #fb7185;
}

.so-duel-ticket-gagnant {
  box-shadow: 0 4px 0 #15803d;
}

.so-duel-ticket-ami.so-duel-ticket-gagnant {
  box-shadow: 0 4px 0 #e11d48;
}

.so-duel-nom {
  font: 800 1rem/1.2 'Nunito', sans-serif;
  color: #374151;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.so-duel-km {
  font: 800 min(2rem, 8.5vw)/1 'Baloo 2', 'Nunito', sans-serif;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}

.so-duel-ticket-ami .so-duel-km {
  color: #be123c;
}

/* « Renvoie ta revanche à Léa » tient sur une ligne à 390 px */
.so-duel .so-bouton-principal {
  font-size: 1.3125rem;
  padding-left: 0.6em;
  padding-right: 0.6em;
}

.so-duel-prenom {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.so-duel-prenom .so-etiquette {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9375rem;
}

.so-mascotte-bloc {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
}

.so-mascotte-bloc .so-mascotte {
  width: 72px;
  height: 72px;
}

.so-mascotte-bloc .so-mot {
  font-size: 1.625rem;
  text-align: left;
  rotate: -1.5deg;
}

.so-ligne-classement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.so-ligne-classement .so-texte-doux {
  flex: 1 1 200px;
}

.so-envoi {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #374151;
}

.so-envoi-rate {
  color: #b91c1c;
}

/* « Défie tes amis » appelle sur 2 temps (2 × 500 ms à 120 BPM) */
.so-appel {
  animation: so-appel 0.5s ease-in-out 2;
}

@keyframes so-appel {
  0%, 100% { scale: 1; }
  40% { scale: 1.07; }
}

/* carte des réponses (écran titre, au-dessus du défi) */
.so-reponses {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
}

.so-reponse {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.so-reponse + .so-reponse {
  padding-top: 10px;
  border-top: 2px dashed #f1e7cc;
}

.so-reponse .so-texte {
  font-size: 1rem;
}

.so-reponse-bat .so-texte strong {
  color: #be123c;
}

.so-reponse .so-bouton {
  min-height: 48px;
  font-size: 1.125rem;
  padding: 0.4em 0.8em 0.25em;
  background: #e11d48;
  color: #fff;
  box-shadow: 0 4px 0 #9f1239;
}

/* --------------------------------------------------------------------------
   Arrivée par lien (§3.5) : carte écrite par le serveur, reprise par arrivee.js
   -------------------------------------------------------------------------- */

.arrivee {
  position: relative;
  z-index: 3;
  pointer-events: auto;
  width: min(100% - 32px, 440px);
  margin: max(24px, env(safe-area-inset-top)) auto 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 20px;
  border-radius: 24px;
  background: #fffbeb;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  font-family: 'Nunito', 'Baloo 2', sans-serif;
  font-weight: 800;
  color: #1f2937;
  text-align: center;
}

.arrivee-mascotte {
  width: 120px;
  height: 120px;
  margin: -4px auto -8px;
}

.arrivee-mascotte svg,
.arrivee-mascotte img {
  display: block;
  width: 100%;
  height: 100%;
}

.arrivee-bulle {
  display: inline-block;
  margin: 0;
  max-width: 100%;
  padding: 0.196em 0.478em 0.109em;
  border-radius: 0.435em;
  background: #e11d48;
  color: #fff;
  font: 800 1.75rem/1.1 'Baloo 2', 'Nunito', sans-serif;
  box-shadow: 0 0.152em 0 rgba(0, 0, 0, 0.18);
  rotate: -3deg;
  overflow-wrap: anywhere;
}

.arrivee-ville .arrivee-bulle {
  background: #15803d;
}

.arrivee-score {
  margin: 0;
  font: 800 2.25rem/1.05 'Baloo 2', 'Nunito', sans-serif;
  color: #1f2937;
  font-variant-numeric: tabular-nums;
}

.arrivee-score small {
  display: block;
  font: 800 1.125rem/1.2 'Nunito', sans-serif;
  color: #374151;
}

.arrivee-regle {
  margin: 0;
  font: 700 1rem/1.4 'Nunito', sans-serif;
  color: #374151;
  max-width: 34ch;
}

.arrivee-note {
  margin: 0;
  font: 700 0.9375rem/1.35 'Nunito', sans-serif;
  color: #92400e;
}

.arrivee-relever {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 0.4em 1em 0.25em;
  border: 0;
  border-radius: 18px;
  background: #15803d;
  color: #fff;
  font: 800 1.5rem/1.1 'Baloo 2', 'Nunito', sans-serif;
  box-shadow: 0 6px 0 #166534;
  cursor: pointer;
  touch-action: manipulation;
}

.arrivee-relever:active {
  translate: 0 5px;
  box-shadow: 0 1px 0 #166534;
}

.arrivee-anneau {
  display: none;
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: 0.16em solid currentColor;
  border-right-color: transparent;
  animation: so-tourne 0.9s linear infinite;
}

.arrivee-charge .arrivee-anneau {
  display: inline-block;
}

.arrivee-charge .arrivee-relever {
  cursor: progress;
}

.arrivee-gratuit {
  margin: -2px 0 0;
  font: 800 0.9375rem/1.3 'Nunito', sans-serif;
  color: #15803d;
}

.arrivee-quoi {
  max-width: 34ch;
  font: 700 0.9375rem/1.4 'Nunito', sans-serif;
  color: #374151;
}

/* --------------------------------------------------------------------------
   Villes
   -------------------------------------------------------------------------- */

.so-recherche {
  position: relative;
}

.so-recherche .so-picto {
  position: absolute;
  left: 14px;
  top: 50%;
  translate: 0 -50%;
  color: #15803d;
}

.so-recherche .so-champ {
  padding-left: 48px;
  font-size: 1.25rem;
}

.so-liste {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.so-ville {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px 6px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #1f2937;
  text-align: left;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.so-ville:active {
  translate: 0 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

.so-ville-nom {
  font: 800 1.25rem/1.15 'Baloo 2', 'Nunito', sans-serif;
  color: #15803d;
}

.so-ville-info {
  grid-column: 1;
  font: 700 0.875rem/1.3 'Nunito', sans-serif;
  color: #4b5563;
}

.so-ville .so-pastille {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-size: 0.875rem;
}

.so-ville-defi {
  background: #15803d;
  box-shadow: 0 4px 0 #166534;
}

.so-ville-defi .so-ville-nom,
.so-ville-defi .so-ville-info {
  color: #fff;
}

.so-pays {
  margin: 8px 0 0;
  font: 800 1.125rem/1.2 'Baloo 2', 'Nunito', sans-serif;
  color: #374151;
}

/* --------------------------------------------------------------------------
   Classement
   -------------------------------------------------------------------------- */

.so-barres {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 6px;
  height: 140px;
  padding: 0 2px;
}

.so-barre {
  position: relative;
  min-height: 6px;
  border-radius: 8px 8px 3px 3px;
  background: var(--so-barre, #16a34a);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}

.so-barre-moi {
  outline: 3px solid #1f2937;
  outline-offset: 2px;
}

.so-barre-moi::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -16px;
  translate: -50% 0;
  border: 7px solid transparent;
  border-top-color: #1f2937;
}

.so-bornes {
  display: flex;
  justify-content: space-between;
  font: 700 0.8125rem/1.2 'Nunito', sans-serif;
  color: #4b5563;
  font-variant-numeric: tabular-nums;
}

.so-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
}

.so-place {
  margin: 0 0 4px;
  font: 800 2rem/1.05 'Baloo 2', 'Nunito', sans-serif;
  color: #15803d;
  text-align: center;
}

.so-amis {
  margin: 0;
  padding: 0;
  list-style: none;
}

.so-ami {
  display: grid;
  grid-template-columns: 2.2em 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 2px;
  border-bottom: 2px dashed #f1e7cc;
}

.so-ami:last-child {
  border-bottom: 0;
}

.so-ami-rang {
  font: 800 1.125rem/1 'Baloo 2', 'Nunito', sans-serif;
  color: #6b7280;
}

.so-ami-nom {
  font: 800 1.125rem/1.2 'Nunito', sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.so-ami-km {
  white-space: nowrap;
  font: 800 1.375rem/1 'Baloo 2', 'Nunito', sans-serif;
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}

.so-ami-moi .so-ami-nom,
.so-ami-moi .so-ami-km {
  color: #15803d;
}

.so-ami-mascotte {
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Réglages et à propos
   -------------------------------------------------------------------------- */

.so-reglage {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.so-reglage .so-etiquette {
  margin: 0;
}

.so-sources {
  margin: 0;
  padding-left: 1.1em;
  font: 700 0.9375rem/1.45 'Nunito', sans-serif;
  color: #374151;
}

.so-pied {
  margin: 4px 0 8px;
  font: 800 0.875rem/1.3 'Nunito', sans-serif;
  color: #15803d;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Panneau de partage
   -------------------------------------------------------------------------- */

.so-panneau {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: 'Nunito', 'Baloo 2', sans-serif;
  font-weight: 800;
  color: #1f2937;
}

.so-voile {
  position: absolute;
  inset: 0;
  background: rgba(31, 41, 55, 0.32);
}

.so-feuille {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #fffbeb;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  outline: none;
}

.so-feuille-titre {
  align-self: center;
  margin: 2px 44px 0;
  font-size: 1.625rem;
}

.so-feuille-fermer {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.so-prenom {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.so-prenom .so-etiquette {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9375rem;
}

.so-cibles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.so-cible {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 10px 2px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #15803d;
  font: 800 1.1875rem/1.1 'Baloo 2', 'Nunito', sans-serif;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.13);
  cursor: pointer;
  touch-action: manipulation;
}

.so-cible:active {
  translate: 0 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.13);
}

.so-cible-picto {
  width: 22px;
  height: 22px;
  margin-top: -3px;
}

.so-cible-principale {
  grid-column: 1 / -1;
  min-height: 60px;
  background: #15803d;
  color: #fff;
  font-size: 1.375rem;
  box-shadow: 0 5px 0 #166534;
}

.so-cible-principale:active {
  box-shadow: 0 1px 0 #166534;
}

/* dernière cible seule sur sa ligne : elle prend toute la largeur */
.so-cibles > :last-child:nth-child(even) {
  grid-column: 1 / -1;
}

.so-apercu-cadre {
  padding: 12px 14px 10px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
}

.so-apercu {
  user-select: text;
  -webkit-user-select: text;
}

.so-apercu-ligne {
  margin: 0;
  font: 800 0.9375rem/1.45 'Nunito', sans-serif;
  color: #1f2937;
  overflow-wrap: anywhere;
}

.so-apercu-url {
  color: #15803d;
}

.so-apercu-feuille {
  display: inline-block;
  width: 1.3em;
  height: 0.75em;
  margin-right: 0.08em;
  vertical-align: -0.02em;
}

.so-point {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.18em;
  border-radius: 50%;
  background: var(--so-point, #16a34a);
  vertical-align: -0.08em;
}

@media (min-width: 600px) and (min-height: 520px) {
  .so-panneau {
    align-items: center;
  }

  .so-feuille {
    border-radius: 24px;
    max-height: calc(100dvh - 48px);
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  }
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.so-toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px));
  z-index: 1100;
  translate: -50% 0;
  max-width: calc(100vw - 32px);
  padding: 0.3em 0.7em 0.15em;
  border-radius: 0.435em;
  background: #15803d;
  color: #fff;
  font: 800 1.25rem/1.15 'Baloo 2', 'Nunito', sans-serif;
  text-align: center;
  box-shadow: 0 0.152em 0 rgba(0, 0, 0, 0.18);
  rotate: -3deg;
  pointer-events: none;
}

.so-toast[hidden] {
  display: none;
}

.so-toast[data-fond='rouge'] { background: #ef4444; }
.so-toast[data-fond='encre'] { background: #1f2937; }

/* --------------------------------------------------------------------------
   Paysage bas (844×390) : l'en-tête et les marges se resserrent
   -------------------------------------------------------------------------- */

@media (max-height: 480px) {
  .so-ecran {
    gap: 10px;
    padding-top: max(6px, env(safe-area-inset-top));
  }

  .so-mascotte {
    width: 72px;
    height: 72px;
  }

  .arrivee {
    margin-top: 10px;
    gap: 8px;
  }

  .arrivee-mascotte {
    width: 72px;
    height: 72px;
  }
}

/* --------------------------------------------------------------------------
   Moins de mouvement
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .so-badge,
  .so-appel,
  .so-ecran::before {
    animation: none;
  }
}

/* prénom illisible (émoji, chiffre seul) : l'aide le dit sous le champ */
.so-prenom-aide {
  margin: 6px 0 0;
  color: #b91c1c;
  text-transform: none;
  letter-spacing: 0;
}
