/* Base commune au site public et aux outils de l'équipe. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--fond); }

body {
  margin: 0;
  font-family: var(--police-texte);
  font-size: var(--taille-m);
  line-height: 1.5;
  color: var(--encre);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 250ms ease, color 250ms ease;
}

h1, h2, h3, h4 {
  font-family: var(--police-titre);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
  color: var(--titre);
}
h3, h4 { font-weight: 800; }

/* Sections « salle de jeu » : toujours sombres, texte clair dans les deux modes. */
.sur-nuit, .heros, .scene-roue, .robot, .bloc-alertes, .pied, .banniere, .equipe-nav {
  --titre: #ffffff;
  --lien: #9cc3ff;
}

p { margin: 0 0 1em; }
a { color: var(--lien); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; border-radius: 6px; }

[hidden], .cache { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.conteneur { width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 0 var(--marge); }
.chiffres { font-variant-numeric: tabular-nums; }

/* Icônes */
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.75em 1.3em; border-radius: var(--rayon-plein); border: 2px solid transparent;
  font-family: var(--police-titre); font-weight: 800; letter-spacing: 0.005em;
  text-decoration: none !important; white-space: nowrap;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}
.bouton:active { transform: translateY(1px) scale(0.98); }
.bouton-principal { background: var(--bleu); color: #fff; box-shadow: var(--ombre-bleue); }
.bouton-principal:hover { background: var(--bleu-fonce); transform: translateY(-1px); }
.bouton-jackpot {
  background: linear-gradient(180deg, #fcd34d, var(--or) 45%, var(--or-fonce)); color: var(--sur-or);
  box-shadow: var(--ombre-or), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.bouton-jackpot:hover { background: linear-gradient(180deg, #fde68a, #fcd34d 45%, var(--or)); transform: translateY(-1px); }
.bouton-contour { background: var(--surface); color: var(--encre); border-color: var(--ligne-forte); }
.bouton-contour:hover { border-color: var(--bleu); color: var(--lien); }
.bouton-fantome { background: transparent; color: inherit; border-color: transparent; }
.bouton-fantome:hover { background: rgba(37, 99, 235, 0.10); }
.bouton-danger { background: var(--corail-fonce); color: #fff; }
.bouton-danger:hover { background: #be123c; }
.bouton-petit { padding: 0.45em 0.9em; font-size: var(--taille-s); }
.bouton[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Pastilles */
.chip {
  display: inline-flex; align-items: center; gap: 0.35em;
  padding: 0.25em 0.7em; border-radius: var(--rayon-plein);
  background: var(--bleu-pale); color: var(--bleu-texte);
  font-size: var(--taille-xs); font-weight: 700; white-space: nowrap;
}
.chip-menthe { background: var(--menthe-pale); color: var(--menthe-texte); }
.chip-corail { background: var(--corail-pale); color: var(--corail-texte); }
.chip-orange { background: var(--orange-pale); color: var(--orange-texte); }
.chip-gris { background: var(--gris-pale); color: var(--gris-texte); }
.chip-jackpot { background: var(--or); color: var(--sur-or); }

/* Champs de formulaire */
.champ { display: grid; gap: 0.35em; }
.champ > span, .etiquette { font-size: var(--taille-s); font-weight: 700; color: var(--encre-douce); }
.saisie, select.saisie, textarea.saisie {
  width: 100%; padding: 0.7em 0.9em; border-radius: var(--rayon-s);
  border: 1.5px solid var(--ligne-forte); background: var(--surface); color: var(--encre);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.saisie::placeholder { color: var(--encre-pale); }
.saisie:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18); }
.saisie[readonly] { background: var(--surface-2); color: var(--encre-douce); }
textarea.saisie { resize: vertical; min-height: 6em; }
.case { display: flex; gap: 0.6em; align-items: flex-start; font-size: var(--taille-s); cursor: pointer; }
.case input { margin-top: 0.2em; width: 1.1em; height: 1.1em; accent-color: var(--bleu); flex: none; }

/* Avis et messages */
.avis {
  padding: 0.85em 1.1em; border-radius: var(--rayon-m); background: var(--bleu-pale);
  color: var(--bleu-texte); font-size: var(--taille-s); display: flex; gap: 0.6em; align-items: flex-start;
}
.avis-erreur { background: var(--corail-pale); color: var(--corail-texte); }
.avis-succes { background: var(--menthe-pale); color: var(--menthe-texte); }
.avis-attention { background: var(--orange-pale); color: var(--orange-texte); }

.toast-zone { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast {
  background: var(--nuit-2); color: #fff; padding: 0.8em 1.1em; border-radius: var(--rayon-m);
  border: 1px solid var(--nuit-ligne); box-shadow: var(--ombre-l); font-weight: 600; animation: toast-entree 260ms ease-out;
}
.toast-erreur { background: #9f1239; border-color: #be123c; }
@keyframes toast-entree { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 760px) { .toast-zone { bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* Squelettes de chargement */
.squelette { background: linear-gradient(90deg, var(--squelette-1) 0%, var(--squelette-2) 50%, var(--squelette-1) 100%); background-size: 200% 100%; animation: chatoiement 1.3s infinite; border-radius: var(--rayon-m); }
@keyframes chatoiement { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
