/* Affichage TV : lisible de loin sur un téléviseur ou un projecteur. Les tailles suivent la largeur de l'écran.
   Couleurs du CFP Marie-Rollet : fond bleu marine, bleu vif, jaune. */
:root {
  --bg: #002744;
  --panel: #0a3557;
  --line: #24527a;
  --text: #ffffff;
  --text-2: #b4c8dc;
  --square: #dcebf6;
  --brand: #0e82c9;
  --amber: #ffe563;
  /* Recalculées quand les couleurs du site sont personnalisées (Gestion → Réglages du site). */
  --on-brand: #ffffff;
  --on-amber: #002744;
  --hl: var(--amber);
  --result-bg: #1b4468;
  --head: "Manrope", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: clamp(13px, min(0.9vw + 8px, 1.8vh), 26px); }
body.display { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 1rem/1.4 var(--sans); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }

.d-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap;
  padding: 1.25rem 2rem 1.1rem; position: relative; }
.d-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px;
  background: repeating-conic-gradient(var(--brand) 0 25%, var(--amber) 0 50%) 0 0 / 24px 24px; }
.d-brand { display: flex; align-items: center; gap: 1.25rem; min-width: 0; }
.d-logo { height: 4.5rem; width: auto; max-width: 12rem; object-fit: contain; flex: none; }
.d-title .d-site { margin: 0 0 .2rem; font: 700 .95rem/1.2 var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--hl); }
.d-title h1 { margin: 0; font: 800 2.4rem/1.1 var(--head); letter-spacing: -.02em; }
.d-title p { margin: .25rem 0 0; color: var(--text-2); font-size: 1.1rem; }
.d-round { display: grid; gap: .3rem; justify-items: end; min-width: 16rem; }
#d-round-label { font: 800 2rem/1 var(--head); color: var(--hl); }
#d-progress { width: 100%; height: .6rem; accent-color: var(--amber); }
#d-progress-label { color: var(--text-2); font-size: .95rem; }

.d-main { flex: 1; padding: 1.25rem 2rem; }
.d-loading { color: var(--text-2); font-size: 1.3rem; }
.d-layout { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.d-layout.single { grid-template-columns: minmax(0, 40rem); }
.d-layout h2 { margin: 0 0 .75rem; font: 800 1.4rem var(--head); }

.d-avatar { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; margin-right: .4em;
  background: rgba(128, 160, 190, .28); font-size: .85em; line-height: 1; vertical-align: middle;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", var(--sans); }
.d-rank { margin-left: .4em; opacity: .75; font-weight: 400; }

.d-pairings { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.d-pairing { display: grid; grid-template-columns: 3.4rem 1fr 1fr 9rem; border-radius: 8px; overflow: hidden; border: 2px solid var(--text); }
.d-table { display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font: 800 1.7rem var(--head); }
.d-side { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 .75rem; padding: .5rem 1rem; }
.d-side.white { background: #fff; color: #002744; }
.d-side.black { background: #00101d; color: #fff; }
.d-color { grid-column: 1 / -1; font-size: .75rem; opacity: .7; }
.d-name { font-weight: 700; font-size: 1.45rem; line-height: 1.15; overflow-wrap: anywhere; }
.d-rating { font-size: 1.3rem; font-variant-numeric: tabular-nums; opacity: .85; }
.d-result { display: grid; place-items: center; background: var(--result-bg); color: var(--text-2); font-size: 1rem; text-align: center; padding: 0 .5rem; }
.d-pairing.is-done .d-result { background: var(--amber); color: var(--on-amber); font: 800 1.5rem var(--head); }
.d-pairing.is-bye { grid-template-columns: 3.4rem 1fr 1fr; border-style: dashed; border-color: var(--line); }
.d-side.bye { background: var(--panel); color: var(--text-2); }

.d-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.25rem; }
.d-table-stand { width: 100%; border-collapse: collapse; font-size: 1.15rem; }
.d-table-stand th { text-align: left; color: var(--text-2); font-weight: 600; font-size: .9rem; padding: 0 .5rem .4rem; }
.d-table-stand td { padding: .35rem .5rem; border-top: 1px solid var(--line); }
.d-table-stand .num, .d-table-stand th.num { text-align: right; font-variant-numeric: tabular-nums; }
.d-table-stand .strong { font-weight: 700; }
.d-table-stand tr.podium td { font-weight: 700; }
.d-table-stand tr.p1 td:nth-child(2) { color: var(--hl); }
.d-table-stand tr.faded { opacity: .5; }

.d-roster { list-style: none; margin: 0; padding: 0; columns: 2 14rem; font-size: 1.2rem; }
.d-roster li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.d-roster .num { font-variant-numeric: tabular-nums; color: var(--text-2); }
.d-intro .d-big { font: 800 2.4rem/1.1 var(--head); margin: 0 0 .5rem; }
.d-intro p { font-size: 1.3rem; margin: 0 0 .5rem; }
.d-intro .d-cta { margin-top: 1.25rem; color: var(--hl); font-weight: 700; }
.d-empty { color: var(--text-2); }

.d-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .6rem 2rem; color: var(--text-2); font-size: .9rem; border-top: 1px solid var(--line); }
#d-status.bad { color: #ff9a8a; font-weight: 700; }
.d-back { color: var(--text-2); }
.d-links { display: flex; gap: 1.5rem; }
.d-rot { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; }
#d-rot-bar { width: 8rem; height: .4rem; accent-color: var(--hl); }

@media (max-width: 900px) {
  .d-layout { grid-template-columns: 1fr; }
  .d-pairing { grid-template-columns: 2.6rem 1fr 1fr; }
  .d-result { grid-column: 1 / -1; padding: .3rem; }
  .d-pairing.is-bye { grid-template-columns: 2.6rem 1fr; }
  .d-head, .d-main, .d-foot { padding-inline: 1rem; }
  .d-name { font-size: 1.1rem; }
}

/* Écran palmarès : Forme du moment et saison côte à côte. */
.d-layout.d-pal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.d-pal .d-panel { border-top: .5rem solid var(--amber); padding: 1.25rem 1.5rem; }
.d-pal h2 { font-size: 1.9rem; margin-bottom: .2rem; }
.d-pal-sub { margin: 0 0 1rem; color: var(--text-2); font-size: 1.05rem; }
.d-awards { list-style: none; margin: 0; padding: 0; }
.d-awards li { display: grid; grid-template-columns: 9.5rem 1fr; gap: .1rem 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.d-award-label { grid-row: span 2; font: 800 1rem/1.3 var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--hl); padding-top: .35rem; }
.d-award-names { font-weight: 700; font-size: 1.5rem; line-height: 1.25; display: flex; flex-wrap: wrap; gap: .1rem 1.25rem; overflow-wrap: anywhere; }
.d-award-more { font-weight: 400; color: var(--text-2); font-size: 1.1rem; align-self: center; }
.d-award-value { color: var(--text-2); font-size: 1.1rem; }
@media (max-width: 900px) {
  .d-layout.d-pal { grid-template-columns: 1fr; }
  .d-awards li { grid-template-columns: 1fr; }
  .d-award-label { grid-row: auto; }
}
