/* Charte CrossFit Angers — noir dominant, blanc respiration, jaune en accent.
   Contrainte forte : le jeu doit tenir sur UN écran de téléphone, sans scroll. */
:root {
  --noir: #0e0e0e;
  --noir2: #181818;
  --noir3: #242424;
  --jaune: #f4e13b;
  --or: #e2c424;
  --jaune-soft: #f8ec74;
  --blanc: #ffffff;
  --gris: #9c9c9c;
  --ligne: #2c2c2c;
  --disp: 'Oswald', Arial, sans-serif;
  --body: 'Inter', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--noir);
  color: var(--blanc);
  font-family: var(--body);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  height: 100dvh;
  overflow: hidden;
}

/* --- en-tête de marque (compact) ----------------------------------------- */

.brand {
  width: 100%;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding-bottom: 8px;
}
.brand svg { width: 20px; height: 20px; flex: none; }
.brand span {
  font-family: var(--disp);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--gris);
}

/* --- typographie de marque ----------------------------------------------- */

h1, h2, .persona, .btn, .kpi b, th {
  font-family: var(--disp);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

h1 { font-size: 1.35rem; margin: 0 0 2px; line-height: 1.05; }
h1 .accent { color: var(--jaune); }
.sub { color: var(--gris); font-size: 0.78rem; margin: 0 0 10px; line-height: 1.35; }

/* main occupe tout l'espace restant ; seules les zones marquées défilent. */
main {
  width: 100%;
  max-width: 460px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- cartes -------------------------------------------------------------- */

.card {
  background: var(--noir2);
  border: 1px solid var(--ligne);
  border-radius: 12px;
  padding: 12px 14px;
  flex: none;
}

/* Carte mise en avant : aplat jaune, texte noir. Un seul élément clé par vue. */
.card.vedette {
  background: var(--jaune);
  border-color: var(--jaune);
  color: var(--noir);
}
.card.vedette .label { color: rgba(14, 14, 14, 0.62); }
.card.vedette .persona, .card.vedette .code { color: var(--noir); }

.label {
  font-family: var(--body);
  color: var(--gris);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 3px;
}
.persona {
  font-size: clamp(1.4rem, 7vw, 2rem);
  line-height: 1.02;
  color: var(--jaune);
  overflow-wrap: anywhere;
}
.persona.moi { color: var(--blanc); font-size: clamp(1.2rem, 5.5vw, 1.6rem); }

.code {
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(1.8rem, 9vw, 2.4rem);
  letter-spacing: 0.28em;
  color: var(--jaune);
  text-align: center;
  padding-left: 0.28em;
  line-height: 1.15;
}

/* --- contrôles ----------------------------------------------------------- */

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 13px;
  font-size: 1rem;
  background: var(--jaune);
  color: var(--noir);
  cursor: pointer;
  flex: none;
}
.btn:active { background: var(--or); }
.btn:disabled { opacity: 0.45; }
.btn.ghost { background: transparent; color: var(--jaune); border: 1px solid var(--ligne); }

input[type="text"], input[type="search"] {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--ligne);
  background: var(--noir);
  color: var(--blanc);
  font-family: var(--body);
  font-size: 1rem;
  flex: none;
}
input.code-input {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
input:focus { outline: 2px solid var(--jaune); outline-offset: 1px; }

/* La liste des prénoms est la SEULE zone qui défile (108 noms). */
.names {
  display: grid;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}
.names button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--ligne);
  background: var(--noir2);
  color: var(--blanc);
  font-family: var(--body);
  font-size: 0.98rem;
  cursor: pointer;
}
.names button:active { border-color: var(--jaune); }

.err { color: #ff6b6b; font-size: 0.82rem; margin: 6px 0 0; min-height: 1.1em; }
.ok { color: var(--jaune); }

/* Le X signature, en séparateur entre « je suis » et « je cherche ». */
.xsep { display: flex; justify-content: center; flex: none; }
.xsep svg { width: 22px; height: 22px; }

img.shot { width: 100%; border-radius: 10px; display: block; max-height: 32dvh; object-fit: contain; background: #000; }

/* Choix du filtre : une seule ligne, on fait défiler horizontalement. */
.filtres {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  flex: none;
  -webkit-overflow-scrolling: touch;
}
.filtre {
  flex: none;
  padding: 8px 13px;
  border-radius: 99px;
  border: 1px solid var(--ligne);
  background: var(--noir2);
  color: var(--gris);
  font-family: var(--body);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.filtre.actif { background: var(--jaune); border-color: var(--jaune); color: var(--noir); font-weight: 600; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery img { width: 100%; border-radius: 10px; display: block; border: 1px solid var(--ligne); }

/* Mention de confidentialité — discrète, jamais coupée. */
.confidentialite {
  flex: none;
  color: var(--gris);
  font-size: 0.66rem;
  line-height: 1.45;
  padding-top: 8px;
  border-top: 1px solid var(--ligne);
}
.confidentialite b { color: var(--blanc); font-weight: 600; }

a { color: var(--jaune); }
.hidden { display: none; }

/* Les pages galerie / régie sont des listes : elles, elles peuvent défiler. */
body.page-longue { height: auto; min-height: 100dvh; overflow: visible; padding: 20px 16px 40px; }
body.page-longue main { display: block; max-width: 900px; }
