/* ------------------------------------------------------------------
   Rechercher un athlète — design ancré dans le scoreboard CFJJB.
   Deux thèmes portés par la discipline : GI = kimono blanc (clair),
   NOGI = rashguard noir (sombre). Le toggle est la signature du site.
   ------------------------------------------------------------------ */

:root {
  /* GI — kimono blanc */
  --fond: #f4f4f2;
  --surface: #ffffff;
  --encre: #14181b;
  --encre-douce: #626a70;
  --filet: #e2e4e1;
  --filet-doux: #edeeec;
  --bleu: #1d5fa8;          /* barre athlète du scoreboard */
  --bleu-sombre: #164a84;
  --rouge: #d8232a;
  --noir-barre: #111417;    /* fond du chrono */
  --vert-chrono: #17a94b;
  --ombre: 0 1px 2px rgba(20,24,27,.08), 0 8px 24px rgba(20,24,27,.06);
  --ceinture-blanche: #e9e5dc;
  --ceinture-blanche-filet: #cfc9bc;
  --ceinture-bleue: #1d5fa8;
  --ceinture-violette: #6b3fa0;
  --ceinture-marron: #6e4a2d;
  --ceinture-noire: #111417;
  --ceinture-inconnue: #d5d8d5;
  --condensed: "Barlow Condensed", "Arial Narrow", sans-serif;
  --corps: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

/* NOGI — rashguard noir */
:root[data-discipline="nogi"] {
  --fond: #0e1013;
  --surface: #16191d;
  --encre: #eef0f2;
  --encre-douce: #98a1a8;
  --filet: #23272c;
  --filet-doux: #1e2226;
  --bleu: #2a72c4;
  --bleu-sombre: #1d5fa8;
  --noir-barre: #000000;
  --vert-chrono: #1fc75a;
  --ombre: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.45);
  --ceinture-blanche: #e9e5dc;
  --ceinture-blanche-filet: transparent;
  --ceinture-noire: #dfe3e6;   /* une ceinture noire doit rester visible sur noir */
  --ceinture-inconnue: #3a4046;
}

* { box-sizing: border-box; margin: 0; }

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--corps);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  body, .carte, .disc, #champ, .recherche-trait, .pied {
    transition: background-color .35s ease, color .35s ease,
                border-color .35s ease, box-shadow .35s ease;
  }
}

#page {
  min-height: calc(100vh - 64px);   /* 64px ≈ l'en-tête .haut, sorti de la colonne */
  display: flex;
  flex-direction: column;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- haut de page : marque + toggle discipline ----------
   hors de la colonne centrale : ancré aux bords de la fenêtre */

.haut {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px 0;
}

@media (max-width: 560px) {
  .haut { padding: 16px 16px 0; }
}

.marque {
  font-family: var(--condensed);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  letter-spacing: .08em;
  color: var(--encre);
  user-select: none;
}

.marque span { color: var(--bleu); }

.beta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--bleu);
  border: 1px solid var(--bleu);
  border-radius: 3px;
  padding: 2px 6px 3px;
  margin-left: 8px;
  vertical-align: 14px;
}

.haut-gauche {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

/* marque + powered by, sur la même ligne */
.haut-ligne {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* .powered.powered--haut : bat la règle .powered du pied, définie plus bas */
.powered.powered--haut { margin-left: 0; font-size: 13px; gap: 8px; }
.powered.powered--haut img { width: 28px; height: 28px; }
.powered.powered--haut b { font-size: 15px; }

/* réseaux d'Arthur (photos de profil) + contact, sous la marque */
.reseaux {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reseaux a:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }

.rs {
  position: relative;
  display: inline-flex;
  flex: none;
}

.rs-photo {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--filet);
  transition: border-color .15s ease;
}

.rs-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}

/* la photo TikTok est un export large : on recadre comme sur arthurcalvez.fr */
.rs--tiktok .rs-photo img { transform: scale(2.5) translateY(7%); }

.rs-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--filet);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--ombre);
}

.rs-badge svg { width: 9px; height: 9px; fill: var(--encre); }

.rs:hover .rs-photo { border-color: var(--bleu); }
.rs:hover .rs-badge svg { fill: var(--bleu); }

.reseaux .contact {
  font-family: var(--condensed);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bleu);
  border: 1px solid var(--bleu);
  border-radius: 3px;
  padding: 3px 10px 4px;
  margin-left: 2px;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}

.reseaux .contact:hover {
  background: var(--bleu);
  color: #fff;
}

.discipline {
  display: flex;
  justify-content: flex-end;
  gap: 0;
}

.disc {
  appearance: none;
  border: 1px solid var(--filet);
  background: transparent;
  color: var(--encre-douce);
  font-family: var(--condensed);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .14em;
  padding: 9px 26px 10px;
  cursor: pointer;
}

.disc:first-child { border-radius: 3px 0 0 3px; border-right: 0; }
.disc:last-child  { border-radius: 0 3px 3px 0; }

.disc:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }

/* l'onglet actif porte la couleur de sa discipline */
:root[data-discipline="gi"] .disc[data-d="gi"] {
  background: var(--encre); color: var(--fond); border-color: var(--encre);
}
:root[data-discipline="nogi"] .disc[data-d="nogi"] {
  background: var(--encre); color: var(--fond); border-color: var(--encre);
}

/* ---------- entête + recherche ---------- */

.entete {
  padding-top: 6vh;
  transition: padding-top .45s cubic-bezier(.4, 0, .2, 1);
}

.etat-accueil .entete { padding-top: 26vh; }

.titre {
  display: block;
  font-family: var(--condensed);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: .035em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 18px;
  cursor: text;
}

.recherche { position: relative; }

#champ {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--encre);
  background: transparent;
  padding: 6px 2px 12px;
  font-family: var(--corps);
  font-size: 19px;
  color: var(--encre);
  border-radius: 0;
  appearance: none;
}

#champ::placeholder { color: var(--encre-douce); opacity: .7; }
#champ:focus { outline: none; }
#champ:focus-visible ~ .recherche-trait,
#champ:focus ~ .recherche-trait { transform: scaleX(1); }

.recherche-trait {
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--bleu);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}

/* ---------- résultats ---------- */

#resultats { flex: 1; padding: 34px 0 10px; }

.vide {
  color: var(--encre-douce);
  font-size: 15px;
  padding: 8px 2px;
  max-width: 46ch;
}

.carte {
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--ombre);
  margin-bottom: 26px;
}

@media (prefers-reduced-motion: no-preference) {
  .carte { animation: surgir .35s ease both; }
  @keyframes surgir {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
}

.carte-nom {
  background: linear-gradient(180deg, var(--bleu), var(--bleu-sombre));
  color: #fff;
  padding: 12px 18px 10px;
}

.carte-nom h2 {
  font-family: var(--condensed);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: .045em;
  text-transform: uppercase;
  line-height: 1.05;
}

.carte-club {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .82;
  margin-top: 2px;
}

.carte-corps {
  display: flex;
  gap: 18px;
  padding: 16px 18px 18px;
}

.carte-corps + .carte-corps { border-top: 1px solid var(--filet-doux); }

.carte-video {
  flex: 0 0 168px;
  align-self: flex-start;
  display: block;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

.carte-video img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.carte-video .video-legende {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 8px 6px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.78));
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
}

.combats { flex: 1; min-width: 0; list-style: none; padding: 0; }

.combat + .combat { border-top: 1px solid var(--filet-doux); }

.combat a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 2px;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
}

.combat a:hover .combat-phase,
.combat a:focus-visible .combat-phase { color: var(--bleu); }

.combat a:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }

.combat-phase {
  font-family: var(--condensed);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .15s ease;
}

.combat-adversaire {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--encre-douce);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combat-adversaire b { color: var(--encre); font-weight: 600; }

.combat-chrono {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--vert-chrono);
  background: var(--noir-barre);
  padding: 2px 8px 3px;
  border-radius: 3px;
  white-space: nowrap;
}

.ceinture {
  display: inline-block;
  width: 26px; height: 8px;
  border-radius: 2px;
  align-self: center;
  flex: none;
}
.ceinture[data-c="blanche"]  { background: var(--ceinture-blanche); box-shadow: inset 0 0 0 1px var(--ceinture-blanche-filet); }
.ceinture[data-c="bleue"]    { background: var(--ceinture-bleue); }
.ceinture[data-c="violette"] { background: var(--ceinture-violette); }
.ceinture[data-c="marron"]   { background: var(--ceinture-marron); }
.ceinture[data-c="noire"]    { background: var(--ceinture-noire); }
.ceinture[data-c=""]         { background: var(--ceinture-inconnue); }

.combat-categorie {
  display: block;
  padding: 0 2px 10px;
  margin-top: -6px;
  font-size: 12px;
  color: var(--encre-douce);
  letter-spacing: .02em;
}

/* ---------- retour de bug (phase bêta) ---------- */

.retour {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 13px 16px;
  border: 1px solid var(--filet);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--ombre);
  color: var(--encre-douce);
  font-size: 13.5px;
}

.retour p { margin: 0; }

.retour-tag {
  flex: none;
  font-family: var(--condensed);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .14em;
  color: var(--bleu);
  border: 1px solid var(--bleu);
  border-radius: 3px;
  padding: 3px 9px 4px;
}

.retour a { color: var(--encre); font-weight: 600; }
.retour a:hover { color: var(--bleu); }

.etat-accueil .retour { display: none; }   /* accueil épuré : la bêta se signale dans l'entête */

/* ---------- pied ---------- */

.pied {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 28px;
  flex-wrap: wrap;
  padding: 26px 0 30px;
  border-top: 1px solid var(--filet);
  color: var(--encre-douce);
  font-size: 12.5px;
}

.etat-accueil .pied { border-top: 0; }

.pied p { flex: 1; min-width: 260px; margin: 0; }

/* powered by Arthur Calvez — bien visible, en bas à droite */
.powered {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-left: auto;
  flex: none;
  color: var(--encre-douce);
  font-size: 14.5px;
  text-decoration: none;
  white-space: nowrap;
}

.powered img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  border: 1px solid var(--filet);
}

.powered b { color: var(--encre); font-weight: 700; font-size: 17px; transition: color .15s ease; }
.powered:hover b { color: var(--bleu); }
.powered:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }

/* ---------- mobile ---------- */

@media (max-width: 560px) {
  .haut { align-items: flex-start; flex-wrap: wrap; gap: 14px; }
  .haut-ligne { gap: 12px 16px; }
  .reseaux { flex-wrap: wrap; gap: 12px; }
  .reseaux .contact { font-size: 13px; padding: 2px 8px 3px; }
  .etat-accueil .entete { padding-top: 16vh; }
  .titre { font-size: 32px; }
  .carte-corps { flex-direction: column; gap: 12px; }
  .carte-video { flex-basis: auto; width: 100%; }
  .combat-adversaire { white-space: normal; }
}
