/* Club TV — Rugby B.W. Est
   Conçu pour un écran 16:9 ; 1rem = 16px sur un écran 1920×1080, tout se met à l'échelle. */

:root {
  --navy: #211d70;
  --navy-fonce: #13104a;
  --navy-nuit: #0c0a33;
  --bordeaux: #5d0733;
  --orange: #f8971d;
  --encre: #15132f;
  --papier: #f6f5f9;
  --ligne: #dedbe9;
  --gris: #6b6880;
  --vert: #0f9d6b;
  --rouge: #d62839;
  --police: 'Outfit', system-ui, sans-serif;
}

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

html {
  font-size: min(calc(100vw / 120), calc(100vh / 67.5));
  background: #000;
}
body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--navy-nuit);
  font-family: var(--police);
  color: #fff;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

#ecran {
  position: relative;
  width: 120rem;
  height: 67.5rem;
  overflow: hidden;
  display: grid;
  grid-template-rows: 8.5rem 1fr 5rem;
  grid-template-columns: minmax(0, 1fr);
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.018) 0 3rem, transparent 3rem 6rem),
    radial-gradient(ellipse at 80% 0%, #2b2690 0%, transparent 55%),
    linear-gradient(160deg, var(--navy-fonce), var(--navy-nuit));
}

/* ── Bandeau supérieur ─────────────────────────────── */
.barre {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 0 3rem;
  background: var(--navy);
  border-bottom: .4rem solid var(--orange);
}
.logo { width: 6rem; height: 6rem; object-fit: contain; }
.barre-titres { display: flex; flex-direction: column; }
.barre-club {
  font-size: 1.3rem; font-weight: 700; letter-spacing: .3em;
  text-transform: uppercase; color: var(--orange);
}
.barre h1 {
  font-size: 3.6rem; font-weight: 800; line-height: 1;
  letter-spacing: -.01em;
}
.barre-sous {
  justify-self: start;
  font-size: 1.9rem; font-weight: 500; color: #c9c6e4;
  padding-left: 2rem; border-left: .2rem solid rgba(255,255,255,.2);
}
.barre-sous:empty { display: none; }
.horloge { display: flex; flex-direction: column; align-items: flex-end; }
#heure { font-size: 3.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
#date { font-size: 1.4rem; color: #c9c6e4; }

/* ── Scène & transitions ───────────────────────────── */
#scene { position: relative; overflow: hidden; }
.diapo {
  position: absolute; inset: 0;
  padding: 2.5rem 3rem;
  display: flex; flex-direction: column;
  animation: entree .8s cubic-bezier(.2,.8,.2,1) both;
}
.diapo.sortie { animation: sortie .6s ease-in both; }
@keyframes entree { from { opacity: 0; transform: translateX(4rem); } to { opacity: 1; transform: none; } }
@keyframes sortie { to { opacity: 0; transform: translateX(-4rem); } }

.vide {
  margin: auto; text-align: center;
  font-size: 2.6rem; font-weight: 600; color: #a9a5d6;
}

.cat {
  display: inline-block;
  background: var(--orange); color: var(--encre);
  font-weight: 800; font-size: 1.5rem; letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem 1rem; border-radius: .6rem;
  white-space: nowrap;
}
.nous { color: var(--bordeaux); }

/* ── Grilles génériques ────────────────────────────── */
.grille { display: grid; gap: 1.8rem; flex: 1; align-content: center; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }

/* ── Résultats ─────────────────────────────────────── */
.resultat {
  background: #fff; color: var(--encre);
  border-radius: 1.4rem; overflow: hidden;
  border-left: 1rem solid var(--ligne);
  box-shadow: 0 1.2rem 3rem rgba(0,0,0,.35);
}
.resultat.victoire { border-left-color: var(--vert); }
.resultat.defaite { border-left-color: var(--rouge); }
.resultat.nul { border-left-color: var(--orange); }
.res-tete {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 1.1rem 1.6rem; background: var(--papier);
  font-size: 1.5rem; color: var(--gris); font-weight: 500;
}
.issue {
  margin-left: auto; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; font-size: 1.4rem;
}
.victoire .issue { color: var(--vert); }
.defaite .issue { color: var(--rouge); }
.nul .issue { color: #b86b00; }
.res-corps {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 1.5rem; padding: 1.8rem 1.6rem;
}
.eq { font-size: 2.3rem; font-weight: 700; line-height: 1.1; }
.eq.droite { text-align: right; }
.sc {
  font-size: 5rem; font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--navy);
  white-space: nowrap;
}
.sc i, .lv-score i { font-style: normal; color: var(--ligne); margin: 0 .6rem; font-weight: 400; }
.sans-score {
  margin-top: 1.6rem; font-size: 1.6rem; color: #a9a5d6;
}
.sans-score b { color: #fff; font-weight: 600; }

/* ── Agenda / programme ────────────────────────────── */
.jours { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; flex: 1; min-height: 0; }
.jours.un-jour { grid-template-columns: 1fr; }
.jour { display: flex; flex-direction: column; min-height: 0; }
.jour h2 {
  font-size: 2.3rem; font-weight: 800;
  color: var(--orange); margin-bottom: 1.2rem;
}
.liste { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.ag {
  display: grid;
  grid-template-columns: 7rem auto 1fr auto;
  align-items: center; gap: 1.4rem;
  background: #fff; color: var(--encre);
  border-radius: 1.1rem; padding: 1.1rem 1.4rem;
  border-left: .7rem solid var(--bordeaux);
}
.ag.ext { border-left-color: #b9a2ae; }
.ag.ag-tournoi { border-left-color: var(--orange); }
.ag.ag-evenement { border-left-color: #5b5f78; }
.ag.ag-entrainement { border-left-color: var(--navy); }
.ag-heure { font-size: 2.3rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--navy); }
.ag-titre { font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.ag-titre .vs { font-weight: 500; color: var(--gris); font-size: 1.5rem; margin: 0 .4rem; }
.ag-lieu { font-size: 1.35rem; color: var(--gris); margin-top: .2rem; }
.ag-tag {
  font-size: 1.2rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: .35rem .8rem; border-radius: .5rem;
  background: var(--papier); color: var(--gris); white-space: nowrap;
}
.ag-tag.dom { background: var(--bordeaux); color: #fff; }
.ag-tag.fini { background: #e7f6ef; color: var(--vert); }
.ag-tag.direct { background: var(--rouge); color: #fff; animation: clignote 1.4s infinite; }
.ag-score { font-size: 2.4rem; font-weight: 900; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ag-fin { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.ag.passe { opacity: .72; }
.dense .ag { padding: .7rem 1.2rem; }
.dense .ag-titre { font-size: 1.6rem; }
.dense .ag-heure { font-size: 1.9rem; }
.dense .ag-lieu { display: none; }
.rien { font-size: 1.8rem; color: #a9a5d6; padding: 1rem 0; }

/* ── Live ──────────────────────────────────────────── */
.live-grille { display: grid; gap: 1.8rem; flex: 1; align-content: center; }
.live-grille.n1 { grid-template-columns: 1fr; padding: 0 12rem; }
.live-grille.n2 { grid-template-columns: 1fr 1fr; }
.live-grille.n3, .live-grille.n4 { grid-template-columns: 1fr 1fr; }
.live-grille.n5, .live-grille.n6 { grid-template-columns: repeat(3, 1fr); }
.live-carte {
  background: #fff; color: var(--encre);
  border-radius: 1.4rem; overflow: hidden;
  box-shadow: 0 1.2rem 3rem rgba(0,0,0,.35);
  outline: .4rem solid transparent;
}
.live-carte.st-playing { outline-color: var(--rouge); }
.live-carte.st-ended { opacity: .85; }
.live-carte header {
  display: flex; align-items: center; gap: 1.2rem;
  background: var(--navy); color: #fff; padding: 1rem 1.5rem;
}
.lv-heure { font-size: 1.5rem; color: #c9c6e4; text-transform: capitalize; }
.pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: .6rem;
  font-size: 1.3rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: .35rem 1rem; border-radius: 99rem; background: rgba(255,255,255,.14);
}
.pill::before { content: ''; width: .8rem; height: .8rem; border-radius: 50%; background: #9ca3af; }
.st-playing .pill { background: var(--rouge); }
.st-playing .pill::before { background: #fff; animation: clignote 1.2s infinite; }
.st-halftime .pill { background: var(--orange); color: var(--encre); }
.st-halftime .pill::before { background: var(--encre); }
.st-ended .pill { background: var(--vert); }
.st-ended .pill::before { background: #fff; }
.lv-corps {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 1.2rem; padding: 2rem 1.6rem;
}
.lv-eq { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.lv-eq.droite { align-items: flex-end; text-align: right; }
.lv-nom { font-size: 2.3rem; font-weight: 800; line-height: 1.1; text-transform: uppercase; overflow-wrap: break-word; }
.lv-stats { display: flex; gap: .6rem; flex-wrap: wrap; font-size: 1.35rem; color: var(--gris); align-items: center; }
.carton { display: inline-block; width: 1.1rem; height: 1.5rem; border-radius: .2rem; vertical-align: -.2rem; margin-right: .2rem; }
.carton.j { background: #f5c400; }
.carton.r { background: var(--rouge); }
.lv-centre { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.lv-score { font-size: 6rem; font-weight: 900; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.n1 .lv-score { font-size: 11rem; }
.n1 .lv-nom { font-size: 3.6rem; }
.n5 .lv-score, .n6 .lv-score { font-size: 4.6rem; }
.n5 .lv-nom, .n6 .lv-nom { font-size: 1.8rem; }
.lv-chrono { font-size: 1.8rem; font-weight: 700; color: var(--gris); font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.lv-mt { font-size: 1.3rem; color: var(--gris); }
@keyframes clignote { 50% { opacity: .35; } }

/* ── Affiches / événements ─────────────────────────── */
.affiche { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 4rem; align-items: center; min-height: 0; }
.affiche.sans-image { grid-template-columns: 1fr; text-align: center; justify-items: center; }
.affiche img {
  max-height: 52rem; max-width: 60rem; object-fit: contain;
  border-radius: 1.2rem; box-shadow: 0 2rem 5rem rgba(0,0,0,.5);
}
.aff-date {
  display: inline-flex; align-items: center; gap: 1.2rem;
  background: var(--orange); color: var(--encre);
  font-size: 2.2rem; font-weight: 800;
  padding: .6rem 1.6rem; border-radius: .8rem; margin-bottom: 2rem;
}
.aff-titre { font-size: 6rem; font-weight: 900; line-height: 1.02; letter-spacing: -.02em; margin-bottom: 1.8rem; }
.sans-image .aff-titre { font-size: 8rem; max-width: 90rem; }
.aff-lieu { font-size: 2.2rem; color: #c9c6e4; margin-bottom: 2rem; }
.aff-texte { font-size: 2.1rem; line-height: 1.45; color: #e6e4f5; max-width: 60rem; white-space: pre-line; }
.sans-image .aff-texte { max-width: 80rem; }

/* ── Classements ───────────────────────────────────── */
.classement { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cl-tete { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.6rem; }
.cl-tete h2 { font-size: 2.6rem; font-weight: 800; }
.cl-tete small { margin-left: auto; font-size: 1.4rem; color: #a9a5d6; }
table.tableau {
  width: 100%; border-collapse: separate; border-spacing: 0 .5rem;
  font-size: 1.9rem; font-variant-numeric: tabular-nums;
}
.tableau th {
  text-align: center; font-size: 1.3rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: #a9a5d6; padding: 0 1rem .4rem;
}
.tableau th.equipe, .tableau td.equipe { text-align: left; }
.tableau td { background: #fff; color: var(--encre); padding: .75rem 1rem; text-align: center; font-weight: 600; }
.tableau td:first-child { border-radius: .8rem 0 0 .8rem; width: 5rem; font-weight: 800; color: var(--navy); }
.tableau td:last-child { border-radius: 0 .8rem .8rem 0; font-weight: 900; color: var(--navy); }
.tableau tr.nous-ligne td { background: var(--orange); color: var(--encre); }
.tableau tr.nous-ligne td.equipe { font-weight: 900; }
.tableau.compact { font-size: 1.55rem; }
.tableau.compact td { padding: .45rem .9rem; }

/* ── Vacatures ─────────────────────────────────────── */
.vacature {
  background: #fff; color: var(--encre);
  border-radius: 1.4rem; padding: 2.4rem 2.6rem;
  border-top: .8rem solid var(--orange);
  display: flex; flex-direction: column; gap: 1rem;
  box-shadow: 0 1.2rem 3rem rgba(0,0,0,.35);
}
.vacature h3 { font-size: 2.8rem; font-weight: 800; line-height: 1.1; color: var(--navy); }
.vacature p { font-size: 1.8rem; line-height: 1.45; color: #3b3857; white-space: pre-line; }
.vacature .contact { margin-top: auto; font-size: 1.6rem; font-weight: 700; color: var(--bordeaux); }
.accroche { font-size: 2rem; color: #c9c6e4; margin-bottom: 1.8rem; }

/* ── Sponsors ──────────────────────────────────────── */
.sponsors { flex: 1; display: grid; gap: 1.8rem; align-content: center; }
.sponsors.principal { grid-template-columns: repeat(2, 1fr); }
.sponsors.normal { grid-template-columns: repeat(4, 1fr); }
.sponsor {
  background: #fff; border-radius: 1.4rem;
  display: grid; place-items: center; padding: 2rem;
  height: 17rem; box-shadow: 0 1.2rem 3rem rgba(0,0,0,.35);
}
.principal .sponsor { height: 24rem; }
.sponsor img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sponsor span { color: var(--navy); font-size: 2.4rem; font-weight: 800; text-align: center; }
.merci { text-align: center; font-size: 2rem; color: #c9c6e4; margin-top: 1.4rem; }

/* ── Accueil (écran de repli) ──────────────────────── */
.accueil { margin: auto; text-align: center; }
.accueil img { width: 22rem; margin-bottom: 2rem; }
.accueil h2 { font-size: 6rem; font-weight: 900; }
.accueil p { font-size: 2.2rem; color: #c9c6e4; margin-top: 1rem; }

/* ── Pied : progression + bandeau défilant ─────────── */
.pied { background: var(--navy-nuit); border-top: .15rem solid rgba(255,255,255,.08); display: flex; flex-direction: column; }
.progression { height: .4rem; background: rgba(255,255,255,.08); }
.progression i { display: block; height: 100%; width: 0; background: var(--orange); }
.pied-ligne { flex: 1; display: flex; align-items: center; gap: 2rem; padding: 0 3rem; min-width: 0; }
.points { display: flex; gap: .6rem; flex-shrink: 0; }
.points i { width: 1rem; height: 1rem; border-radius: 50%; background: rgba(255,255,255,.2); }
.points i.on { background: var(--orange); }
.ticker { flex: 1; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-piste { display: inline-block; font-size: 1.8rem; font-weight: 500; color: #e6e4f5; padding-left: 100%; animation: defile linear infinite; }
.ticker-piste span { margin-right: 5rem; }
.ticker-piste span::before { content: '●'; color: var(--orange); margin-right: 1.2rem; font-size: 1.2rem; vertical-align: .25rem; }
@keyframes defile { to { transform: translateX(-100%); } }
.hors-ligne { font-size: 1.4rem; color: #ffb3b9; flex-shrink: 0; }

/* ── Animation d'essai ─────────────────────────────── */
.essai {
  position: absolute; inset: 0; z-index: 10;
  display: grid; place-items: center;
  visibility: hidden; overflow: hidden;
}
.essai.actif { visibility: visible; }
.essai-bandes { position: absolute; inset: 0; }
.essai-bandes i {
  position: absolute; left: -20%; width: 140%; height: 46%;
  transform: skewY(-8deg) translateX(-110%);
}
.essai-bandes i:nth-child(1) { top: -14%; background: var(--navy); }
.essai-bandes i:nth-child(2) { top: 32%; background: var(--bordeaux); }
.essai-bandes i:nth-child(3) { top: 64%; background: var(--orange); }
.essai.actif .essai-bandes i { animation: bande 7s cubic-bezier(.7,0,.2,1) both; }
.essai.actif .essai-bandes i:nth-child(2) { animation-delay: .08s; }
.essai.actif .essai-bandes i:nth-child(3) { animation-delay: .16s; }
@keyframes bande {
  0% { transform: skewY(-8deg) translateX(-110%); }
  10%, 88% { transform: skewY(-8deg) translateX(0); }
  100% { transform: skewY(-8deg) translateX(110%); }
}
.essai-contenu { position: relative; text-align: center; opacity: 0; }
.essai.actif .essai-contenu { animation: contenu 7s ease both; }
@keyframes contenu {
  0%, 8% { opacity: 0; transform: scale(.4); }
  16% { opacity: 1; transform: scale(1.08); }
  22%, 84% { opacity: 1; transform: scale(1); }
  92%, 100% { opacity: 0; transform: scale(1.3); }
}
.essai-mot {
  font-size: 22rem; font-weight: 900; font-style: italic;
  line-height: .9; text-transform: uppercase; letter-spacing: -.03em;
  color: #fff; text-shadow: .6rem .6rem 0 var(--encre);
}
.essai-cat { display: inline-block; font-size: 3rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; background: #fff; color: var(--navy); padding: .4rem 2rem; border-radius: .8rem; }
.essai-equipe { font-size: 5rem; font-weight: 800; text-transform: uppercase; margin-top: 1.5rem; text-shadow: .3rem .3rem 0 var(--encre); }
.essai-score { display: inline-block; margin-top: 1.5rem; font-size: 5.5rem; font-weight: 900; background: var(--encre); padding: .4rem 3rem; border-radius: 1rem; font-variant-numeric: tabular-nums; }
.essai-ballon { position: absolute; width: 16rem; left: -20rem; top: 60%; opacity: 0; }
.essai.actif .essai-ballon { animation: ballon 2.4s cubic-bezier(.3,.1,.3,1) .5s both; }
@keyframes ballon {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  50% { transform: translate(70rem, -40rem) rotate(400deg); }
  100% { opacity: 1; transform: translate(145rem, 0) rotate(800deg); }
}
/* Essai adverse : même annonce, plus sobre */
.essai.adverse .essai-bandes i:nth-child(1), .essai.adverse .essai-bandes i:nth-child(2), .essai.adverse .essai-bandes i:nth-child(3) { background: #2a2766; }
.essai.adverse .essai-mot { font-size: 14rem; }
.essai.adverse .essai-ballon, .essai.adverse .confettis { display: none; }

.confettis { position: absolute; inset: 0; pointer-events: none; }
.confettis i {
  position: absolute; top: -3rem; width: 1.2rem; height: 2rem; border-radius: .2rem;
  animation: tombe linear forwards;
}
@keyframes tombe { to { transform: translateY(75rem) rotate(720deg); } }

@media (prefers-reduced-motion: reduce) {
  .diapo, .diapo.sortie { animation-duration: .01s; }
  .ticker-piste { animation-duration: 0s !important; padding-left: 0; }
}
