/* Couleurs reprises du site du club. */
:root {
  color-scheme: dark;
  --nuit: #0F1826;
  --carte: #172130;
  --marine: #1B3A5C;
  --trait: #2A3444;
  --blanc: #F7F7F2;
  --gris: #9AA4B1;
  --balle: #8EB754;
  --corail: #FF6B35;
  --titre: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --texte: "Barlow", "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--nuit);
  color: var(--blanc);
  font-family: var(--texte);
  font-size: 16px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--balle); outline-offset: 2px; }

/* ---------- Bandeau ---------- */
.bandeau { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px; }
.bandeau h1 {
  margin: 0;
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.bandeau h1 em { font-style: normal; color: var(--balle); }
.club {
  font-family: var(--titre);
  font-weight: 500;
  font-size: clamp(1rem, 2vw, 1.7rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gris);
}
.horloge {
  margin-left: auto;
  font-family: var(--titre);
  font-weight: 600;
  font-size: clamp(1.8rem, 4.4vw, 3.6rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.info {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--corail);
  border-radius: 6px;
  font-size: 1rem;
}

/* ---------- Affichage (tablette) ---------- */
.terrains { display: grid; grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 14px; flex: 1 1 auto; min-height: 0; }
@media (orientation: landscape) and (min-width: 700px) {
  .terrains { grid-template-columns: repeat(2, 1fr); }
}
.terrain {
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.terrain header {
  background: var(--marine);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  font-family: var(--titre);
  text-transform: uppercase;
}
.nom-terrain { font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2.8rem); letter-spacing: 0.08em; }
.heure { font-weight: 600; font-size: clamp(1.5rem, 3.4vw, 2.8rem); color: var(--balle); font-variant-numeric: tabular-nums; }
.duel { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-evenly; padding: 6px 20px; }
.joueur { padding-block: 14px; min-width: 0; }
.joueur + .joueur { border-top: 1px solid var(--trait); }
.ligne-nom { display: flex; align-items: center; gap: 14px; }
.joueur .nom {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--titre);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.6vw, 4rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.joueur .classement {
  flex: none;
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.2vw, 2.7rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--balle);
  color: var(--nuit);
}
.joueur .nom-club { margin-top: 4px; color: var(--gris); font-size: clamp(1.1rem, 2.3vw, 1.9rem); overflow-wrap: anywhere; }
.libre {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  font-family: var(--titre);
  font-size: clamp(1.5rem, 3.4vw, 2.8rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--trait);
}
@media (prefers-reduced-motion: no-preference) {
  .terrain.maj header { animation: flash 1.4s ease-out; }
  @keyframes flash { from { background: var(--balle); } to { background: var(--marine); } }
}

/* ---------- Saisie (téléphone) ---------- */
body.page-saisie { height: auto; min-height: 100%; }
.saisie { display: flex; flex-direction: column; gap: 14px; max-width: 640px; width: 100%; margin-inline: auto; }
.onglets { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 8px; }
.onglet {
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 6px;
  padding: 10px 4px;
  cursor: pointer;
  font-family: var(--titre);
  font-weight: 600;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.onglet small { font-family: var(--texte); font-weight: 400; font-size: 0.78rem; letter-spacing: 0; text-transform: none; color: var(--gris); }
.onglet[aria-selected="true"] { background: var(--marine); border-color: var(--balle); }
.onglet[aria-selected="true"] small { color: var(--blanc); }
form { display: flex; flex-direction: column; gap: 14px; }
fieldset {
  border: 1px solid var(--trait);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 7.5rem;
  gap: 10px;
  min-width: 0;
}
legend {
  font-family: var(--titre);
  font-weight: 600;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--balle);
  padding-inline: 6px;
}
.champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.champ.large { grid-column: 1 / -1; }
.champ label { font-size: 0.82rem; color: var(--gris); }
.champ input, .champ select {
  width: 100%;
  background: var(--nuit);
  border: 1px solid var(--trait);
  border-radius: 6px;
  padding: 11px 10px;
  font-size: 1.05rem;
}
.court { max-width: 11rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bouton {
  flex: 1 1 10rem;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 13px 16px;
  font-family: var(--titre);
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.bouton.principal { background: var(--balle); color: var(--nuit); }
.bouton.secondaire { background: transparent; border-color: var(--trait); color: var(--blanc); }
.bouton.danger { background: var(--corail); color: var(--nuit); }
.bouton:disabled { opacity: 0.5; cursor: default; }
.retour { min-height: 1.4em; margin: 0; color: var(--balle); font-weight: 500; }
.retour.erreur { color: var(--corail); }
.lien-discret { background: none; border: 0; padding: 0; color: var(--gris); text-decoration: underline; cursor: pointer; align-self: flex-start; font-size: 0.9rem; }
