/* Mobile d'abord. Grands caractères, grands boutons : le public a souvent passé 70 ans. */
:root {
  --fond: #fbf7f0;
  --encre: #1d2329;
  --doux: #4f5861;
  --vert: #1f6f43;
  --vert-fonce: #17583a;
  --rouge: #b3261e;
  --rouge-fonce: #8f1d17;
  --gris: #8a9199;
  --trait: #e4ddd1;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 1.2rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--vert-fonce); text-underline-offset: 3px; }
button { font: inherit; }
:focus-visible { outline: 4px solid #e8a33d; outline-offset: 3px; }

/* ─── Page publique ─── */
.page { max-width: 38rem; margin: 0 auto; padding: 1.5rem 16px 2rem; }
h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); line-height: 1.15; margin: .3rem 0 1rem; }
h2 { font-size: 1.35rem; margin: 0 0 .5rem; }
h3 { font-size: 1.15rem; margin: 1rem 0 .3rem; }

.etat { display: flex; align-items: center; gap: .7rem; font-size: 1.45rem; font-weight: 700; margin: 0 0 1.4rem; }
.point { flex: 0 0 auto; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--trait); }
.point.vert { background: #23a35a; box-shadow: 0 0 0 5px rgba(35, 163, 90, .2); }
.point.gris { background: var(--gris); }

.appel { display: grid; gap: .6rem; margin-bottom: 2rem; }
.appel label { font-weight: 600; }
.appel input {
  font: inherit; font-size: 1.25rem; padding: .8rem 1rem; width: 100%;
  border: 2px solid #c9c0b2; border-radius: 12px; background: #fff; color: var(--encre);
}
.appel input:focus { border-color: var(--vert); outline: none; }
.message { min-height: 1.6em; margin: 0; font-weight: 600; color: var(--rouge-fonce); }

.gros-bouton {
  display: block; width: 100%; min-height: 4.2rem; padding: .9rem 1.2rem;
  font-size: 1.5rem; font-weight: 700; color: #fff; border: 0; border-radius: 16px; cursor: pointer;
}
.gros-bouton.vert { background: var(--vert); }
.gros-bouton.vert:hover:not(:disabled) { background: var(--vert-fonce); }
.gros-bouton.rouge { background: var(--rouge); }
.gros-bouton:disabled { background: var(--gris); cursor: not-allowed; }
.gros-bouton.bleu { background: #1f4e79; }
.gros-bouton.gris-clair { background: #e9e3d8; color: var(--encre); }
.gros-bouton[hidden] { display: none; }

/* File d'attente */
.file { margin-bottom: 2rem; padding: 1.2rem; border: 3px solid #1f4e79; border-radius: 16px; background: #fff; }
.file[hidden], .appel[hidden] { display: none; }
.file p { margin: 0 0 .8rem; }
.file-rang { font-size: 1.5rem; font-weight: 800; }

/* Flèche « ← Retour » : grande, en haut à gauche, sur la tablette et pendant l'appel */
.retour {
  align-self: flex-start; min-height: 3.2rem; padding: .5rem 1.2rem;
  font-size: 1.3rem; font-weight: 700; border: 2px solid #c9c0b2; border-radius: 14px;
  background: #fff; color: var(--encre); cursor: pointer;
}
.retour-appel { position: absolute; top: .4rem; left: .5rem; z-index: 3; min-height: 2.8rem; font-size: 1.1rem; }
.appel-en-cours .chrono { padding-left: 8.5rem; padding-right: 8.5rem; }
@media (max-width: 480px) {
  .appel-en-cours .chrono { padding: .6rem 16px .6rem 8rem; text-align: right; }
}

/* Dans l'appel : le chronomètre, toujours visible */
.chrono {
  margin: 0; padding: .6rem 16px; background: #10161b; color: #fff;
  font-size: 1.2rem; font-weight: 700; text-align: center;
}
.chrono-tablette {
  margin: 0; text-align: center; font-size: clamp(1.4rem, 4.5vw, 2.2rem); font-weight: 800; color: var(--encre);
}
.chrono-tablette[hidden] { display: none; }

/* Dans l'appel : « quelqu'un attend », par-dessus la vidéo */
.rappel {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .9rem 16px; background: #ffe9a8; color: #3b2a00; font-size: 1.15rem; font-weight: 700;
}
.rappel[hidden] { display: none; }
.rappel p { margin: 0; flex: 1 1 14rem; }
.rappel button {
  font-weight: 700; padding: .6rem 1.2rem; border: 0; border-radius: 12px;
  background: #3b2a00; color: #fff; cursor: pointer; min-height: 3rem;
}

.infos { border-top: 2px solid var(--trait); padding-top: 1.2rem; margin-top: 1.4rem; }
.infos p, .infos ol, .infos ul { margin: 0 0 .7rem; }
.infos li { margin-bottom: .35rem; }
.fort { font-weight: 700; }

.pied { max-width: 38rem; margin: 0 auto; padding: 1rem 16px 2.5rem; color: var(--doux); font-size: 1.05rem; }

/* Appel en cours : la vidéo prend tout l'écran. */
.appel-en-cours { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; background: #10161b; }
.appel-en-cours[hidden] { display: none; }
.appel-en-cours .video { flex: 1 1 auto; min-height: 0; }
.raccrocher { border-radius: 0; min-height: 4.5rem; }
body.en-appel { overflow: hidden; }
.essai { color: #fff; padding: 2rem 16px; font-size: 1.3rem; text-align: center; }

/* ─── La tablette ─── */
body.hubert { min-height: 100vh; min-height: 100dvh; }
.tablette {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  gap: 1rem; padding: 16px;
}
.tablette .video { flex: 1 1 60%; min-height: 0; border-radius: 16px; overflow: hidden; background: #10161b; }
.tablette .video[hidden] { display: none; }
.deux-boutons { flex: 1 1 auto; display: grid; gap: 1rem; grid-template-columns: 1fr; }
body.hubert.en-appel .deux-boutons { flex: 0 0 auto; }
.enorme {
  min-height: 7rem; padding: 1rem; border: 0; border-radius: 24px; cursor: pointer;
  font-size: clamp(1.8rem, 6vw, 3.2rem); font-weight: 800; color: #fff; line-height: 1.15;
  transition: opacity .2s;
}
.enorme.vert { background: var(--vert); }
.enorme.rouge { background: var(--rouge); }
/* Le bouton de l'état en cours reste vif ; l'autre pâlit. */
.deux-boutons:has(.actif) .enorme:not(.actif):not(.faire-entrer) { opacity: .45; }
.enorme.actif { box-shadow: 0 0 0 6px rgba(0, 0, 0, .15) inset; }
body.hubert.en-appel .enorme { min-height: 5rem; font-size: clamp(1.4rem, 4vw, 2.2rem); }
.consigne { margin: 0; text-align: center; font-size: clamp(1.3rem, 3.5vw, 1.8rem); font-weight: 600; color: var(--doux); }
.arrivee {
  margin: 0; padding: 1.2rem; border-radius: 18px; text-align: center;
  background: #ffe9a8; color: #3b2a00; font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 800;
  animation: battre 1s ease-in-out 3;
}
.arrivee[hidden] { display: none; }
.attente {
  margin: 0; padding: 1rem; border-radius: 18px; text-align: center;
  background: #dbe8f5; color: #10304d; font-size: clamp(1.4rem, 4.5vw, 2.2rem); font-weight: 800;
}
.attente[hidden] { display: none; }
@keyframes battre { 50% { transform: scale(1.04); } }

@media (min-width: 700px) and (orientation: landscape) {
  .deux-boutons { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .arrivee { animation: none; }
  .enorme { transition: none; }
}
