/* Écran TV – charte Mizu Studio (Lato, bleu #29B8EC, bleu clair #9DDBFA, anthracite #414042) */
:root {
  --mizu: #29b8ec;
  --mizu-light: #9ddbfa;
  --ink: #414042;
  --grey: #868487;
  --bg: #1f1e20;
  --bg-2: #2b2a2c;
  --white: #ffffff;
  --alert: #ff5a5f;
  --belt-white: #f1f1f1;
  --belt-blue: #1f5fbf;
  --belt-purple: #6a3fa0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); }
body { font-family: Lato, Arial, sans-serif; color: var(--white); cursor: none; }

/* scène fixe 1920×1080, mise à l'échelle par JS */
#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0;
  background: radial-gradient(ellipse at 30% 20%, #343335 0%, var(--bg) 70%);
  overflow: hidden;
}
.wave-bg {
  position: absolute; right: -220px; bottom: -40px; width: 1400px; opacity: 0.06; pointer-events: none;
}

/* ---------- en-tête ---------- */
header {
  position: absolute; left: 0; right: 0; top: 0; height: 150px;
  display: flex; align-items: center; padding: 0 80px; gap: 40px;
}
header .logo { height: 104px; }
header .title {
  flex: 1; font-weight: 300; text-transform: uppercase; letter-spacing: 0.28em;
  font-size: 34px; color: var(--mizu-light); white-space: nowrap;
}
header .badge { text-align: right; }
header .badge .type {
  display: inline-block; background: var(--mizu); color: var(--white); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.15em; font-size: 30px; padding: 10px 26px;
}
header .badge .sub {
  margin-top: 8px; font-size: 20px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--grey);
}

/* ---------- combat ---------- */
#screen-match { position: absolute; inset: 0; }
.bands { position: absolute; left: 80px; top: 170px; width: 1150px; height: 760px; display: flex; flex-direction: column; gap: 24px; }
.band {
  flex: 1; position: relative; display: flex; flex-direction: column; justify-content: center;
  padding: 0 60px 0 92px; overflow: hidden;
}
.band.a { background: var(--mizu); color: var(--white); }
.band.b { background: var(--white); color: var(--ink); }
.band .belt { position: absolute; left: 0; top: 0; bottom: 0; width: 32px; }
.band .belt::after { /* barrette noire de la ceinture */
  content: ''; position: absolute; left: 0; right: 0; bottom: 18%; height: 22%; background: #111;
}
.belt.white { background: var(--belt-white); box-shadow: inset -2px 0 0 rgba(0,0,0,.12); }
.belt.blue { background: var(--belt-blue); }
.belt.purple { background: var(--belt-purple); }
.band .name {
  font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1;
  font-size: 128px; white-space: nowrap;
}
.band .academy {
  margin-top: 18px; font-weight: 300; text-transform: uppercase; letter-spacing: 0.22em; font-size: 36px; opacity: .85;
  white-space: nowrap;
}
.band .corner {
  position: absolute; right: 40px; top: 28px; font-weight: 700; letter-spacing: 0.25em; font-size: 22px; opacity: .55;
}

.timer-box {
  position: absolute; left: 1254px; top: 170px; width: 586px; height: 760px;
  background: rgba(0, 0, 0, 0.35); border-top: 6px solid var(--mizu);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.timer-box .label {
  padding: 0 40px; text-align: center; line-height: 1.5;
  font-size: 26px; text-transform: uppercase; letter-spacing: 0.3em; color: var(--mizu-light); font-weight: 400;
  min-height: 40px;
}
.timer {
  font-weight: 300; font-size: 230px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  margin: 24px 0;
}
.timer.low { color: var(--alert); }
.timer.paused { opacity: .45; }
.state-pill {
  font-size: 30px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.25em; padding: 10px 28px;
  border: 3px solid currentColor; color: var(--white);
}
.state-pill.blink { animation: blink 1.1s steps(2, start) infinite; }
.state-pill.hidden { visibility: hidden; }
@keyframes blink { to { visibility: hidden; } }
.progress { position: absolute; left: 0; bottom: 0; height: 10px; background: var(--mizu); transition: width .25s linear; }
.timer-box.low .progress { background: var(--alert); }

footer {
  position: absolute; left: 80px; right: 80px; bottom: 40px; height: 90px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 26px; text-transform: uppercase; letter-spacing: 0.25em; color: var(--grey); font-weight: 400;
}
footer .match-title { color: var(--white); font-weight: 700; }

/* ---------- overlay résultat ---------- */
.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(20, 20, 22, 0.96); text-align: center; opacity: 0; pointer-events: none; transition: opacity .4s;
}
.overlay.show { opacity: 1; }
.overlay .kicker {
  font-size: 46px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.35em; color: var(--mizu);
}
.overlay .big {
  margin-top: 26px; font-size: 170px; font-weight: 900; text-transform: uppercase; line-height: 1; white-space: nowrap;
}
.overlay .academy { margin-top: 18px; font-size: 38px; font-weight: 300; letter-spacing: .25em; text-transform: uppercase; color: var(--mizu-light); }
.overlay .detail {
  margin-top: 50px; font-size: 52px; font-weight: 300; text-transform: uppercase; letter-spacing: 0.12em;
}
.overlay .detail b { font-weight: 700; color: var(--mizu); font-variant-numeric: tabular-nums; }
.overlay.show .big { animation: pop .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- attente ---------- */
#screen-standby, #screen-fastest { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
#screen-standby .logo-big { height: 380px; }
#screen-standby .t1 { margin-top: 60px; font-size: 58px; font-weight: 300; text-transform: uppercase; letter-spacing: .32em; color: var(--white); }
#screen-standby .next { margin-top: 90px; }
#screen-standby .next .k { font-size: 30px; letter-spacing: .3em; text-transform: uppercase; color: var(--mizu); font-weight: 700; }
#screen-standby .next .v { margin-top: 18px; font-size: 76px; font-weight: 900; text-transform: uppercase; }
#screen-standby .next .v span { color: var(--mizu-light); font-weight: 300; margin: 0 30px; }

/* ---------- soumission la plus rapide ---------- */
#screen-fastest .k { font-size: 44px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--mizu); }
#screen-fastest .champ { margin-top: 30px; }
#screen-fastest .champ .time { font-size: 220px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1; }
#screen-fastest .champ .who { margin-top: 10px; font-size: 110px; font-weight: 900; text-transform: uppercase; }
#screen-fastest .champ .how { margin-top: 16px; font-size: 38px; font-weight: 300; text-transform: uppercase; letter-spacing: .15em; color: var(--mizu-light); }
#screen-fastest ol { margin-top: 60px; list-style: none; display: flex; gap: 30px; }
#screen-fastest li { background: rgba(255,255,255,.06); border-top: 4px solid var(--mizu); padding: 20px 34px; min-width: 300px; }
#screen-fastest li .n { font-size: 22px; letter-spacing: .25em; color: var(--grey); }
#screen-fastest li .nm { margin-top: 6px; font-size: 34px; font-weight: 700; text-transform: uppercase; }
#screen-fastest li .tm { margin-top: 4px; font-size: 30px; color: var(--mizu-light); font-variant-numeric: tabular-nums; }
#screen-fastest .empty { margin-top: 40px; font-size: 40px; color: var(--grey); font-weight: 300; }

.hidden-screen { display: none !important; }

/* ---------- état connexion / son ---------- */
.hint {
  position: absolute; right: 30px; bottom: 20px; font-size: 20px; letter-spacing: .1em; color: var(--grey);
  background: rgba(0,0,0,.4); padding: 8px 16px; display: none;
}
.hint.show { display: block; }
.offline {
  position: absolute; left: 50%; top: 20px; transform: translateX(-50%); background: var(--alert); color: #fff;
  font-weight: 700; font-size: 26px; padding: 10px 26px; letter-spacing: .1em; display: none; z-index: 10;
}
.offline.show { display: block; }

/* ---------- Quintet ---------- */
.band .team {
  font-size: 26px; font-weight: 700; text-transform: uppercase; letter-spacing: .28em; opacity: .75; margin-bottom: 10px;
  white-space: nowrap;
}
.band .pills { display: flex; gap: 12px; margin-top: 22px; }
.band .pills span {
  font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 6px 16px;
  border: 2px solid currentColor; white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis;
}
.band .pills span.out { opacity: .3; text-decoration: line-through; }
.band.a .pills span.cur { background: #fff; color: var(--mizu); border-color: #fff; }
.band.b .pills span.cur { background: var(--ink); color: #fff; border-color: var(--ink); }
.band .name.unknown { opacity: .55; }
.band .points {
  position: absolute; right: 0; top: 0; bottom: 0; width: 230px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: rgba(0, 0, 0, .18);
}
.band.b .points { background: rgba(0, 0, 0, .07); }
.band .points .p { font-size: 150px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.band .points .ap { margin-top: 10px; font-size: 26px; font-weight: 700; letter-spacing: .1em; }
.band .points .ap i { font-style: normal; opacity: .6; font-weight: 400; margin-right: 4px; }
.band .chosen { font-size: 30px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; margin-top: 16px; }

/* repos du gagnant : mauve, comme les lumières */
.timer.rest { color: #c39bff; }
.timer-box.resting { border-top-color: #9b5cff; background: rgba(110, 50, 200, .18); }
.timer-box.resting .progress { background: #9b5cff; }
.timer-box.resting .label { color: #c39bff; font-size: 32px; font-weight: 700; }
.state-pill.rest { color: #c39bff; border-color: #9b5cff; max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Quintet : équipe en photos ---------- */
.band .status { margin-top: 14px; font-size: 30px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; opacity: .8; min-height: 0; }
.band .status:empty { display: none; }
.band.quintet .team { font-size: 34px; opacity: .9; margin-bottom: 6px; }
.band .roster { display: flex; gap: 14px; margin-top: 20px; }
.mcard { display: flex; align-items: center; gap: 12px; width: 320px; padding: 6px 12px 6px 6px; border: 2px solid transparent; background: rgba(0,0,0,.08); }
.band.b .mcard { background: rgba(0,0,0,.05); }
.mcard img { width: 84px; height: 84px; object-fit: cover; flex: 0 0 auto; background: #3a393c; }
.mcard .mi { min-width: 0; }
.mcard .mn { font-size: 24px; font-weight: 900; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard .mw { margin-top: 4px; font-size: 18px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.band.a .mcard.cur { border-color: #fff; background: rgba(255,255,255,.18); }
.band.b .mcard.cur { border-color: var(--ink); }
.mcard.out img { filter: grayscale(1); opacity: .35; }
.mcard.out .mn { text-decoration: line-through; opacity: .45; }
.mcard.out .mw { color: var(--alert); opacity: 1; }
.band.a .mcard.out .mw { color: #fff; background: var(--alert); display: inline-block; padding: 1px 8px; }
.band.compact .mcard { width: 240px; }
.band.compact .mcard img { width: 66px; height: 66px; }

/* ---------- tableau ---------- */
#screen-bracket { position: absolute; left: 80px; right: 80px; top: 170px; bottom: 50px; }
#screen-bracket .k { font-size: 30px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--mizu); margin-bottom: 30px; }
#screen-bracket .bk-wrap { position: relative; height: 800px; }
#bk-tv { transform-origin: 0 0; }

.test-badge {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: #f5a524; color: #1f1e20;
  font-weight: 900; font-size: 22px; letter-spacing: .25em; text-transform: uppercase; padding: 6px 20px; display: none; z-index: 9;
}
.test-badge.show { display: block; }
.timer.dim { opacity: .35; }

/* overlay de révélation */
.overlay .vsline { display: flex; align-items: center; gap: 50px; margin-top: 30px; }
.overlay .vsline .n { font-size: 110px; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
.overlay .vsline .n.a { color: var(--mizu); }
.overlay .vsline .vs { font-size: 54px; font-weight: 300; color: var(--grey); text-transform: uppercase; }
.overlay .teams { margin-top: 20px; font-size: 32px; font-weight: 300; letter-spacing: .25em; text-transform: uppercase; color: var(--mizu-light); }
.overlay.show .vsline .n.a { animation: slideL .7s cubic-bezier(.2, 1.2, .4, 1); }
.overlay.show .vsline .n.b { animation: slideR .7s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes slideL { from { transform: translateX(-400px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideR { from { transform: translateX(400px); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay .elim { margin-top: 26px; font-size: 36px; font-weight: 300; text-transform: uppercase; letter-spacing: .15em; color: var(--grey); }
.overlay .elim s { color: var(--white); }

/* ---------- palmarès ---------- */
#screen-results { position: absolute; left: 80px; right: 80px; top: 180px; bottom: 60px; display: flex; gap: 60px; }
#screen-results .col { flex: 1; min-width: 0; }
#screen-results .col.right { flex: 0 0 640px; }
#screen-results .k { font-size: 30px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--mizu); margin-bottom: 26px; }
#screen-results .w { display: flex; align-items: center; gap: 26px; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
#screen-results .w .ty { flex: 0 0 170px; font-size: 20px; letter-spacing: .2em; text-transform: uppercase; color: var(--grey); }
#screen-results .w .nm { font-size: 46px; font-weight: 900; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#screen-results .w .dt { font-size: 22px; color: var(--mizu-light); text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#screen-results .fs { background: rgba(255,255,255,.05); border-top: 6px solid var(--mizu); padding: 30px 36px; }
#screen-results .fs .tm { font-size: 120px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
#screen-results .fs .nm { font-size: 54px; font-weight: 900; text-transform: uppercase; margin-top: 10px; }
#screen-results .fs .dt { font-size: 24px; color: var(--mizu-light); text-transform: uppercase; letter-spacing: .12em; margin-top: 8px; }
#screen-results .fs-more { margin-top: 20px; font-size: 26px; color: var(--grey); }
#screen-results .fs-more div { padding: 8px 0; }
#screen-results .fs-more b { color: var(--white); }
#screen-results .empty { font-size: 34px; color: var(--grey); font-weight: 300; }
#screen-results .stat { margin-top: 22px; background: rgba(255,255,255,.05); border-left: 6px solid var(--mizu); padding: 16px 24px; }
#screen-results .stat .sk { font-size: 20px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; color: var(--mizu); }
#screen-results .stat .sn { margin-top: 6px; font-size: 40px; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
#screen-results .stat .sc { margin-top: 2px; font-size: 22px; color: var(--mizu-light); text-transform: uppercase; letter-spacing: .12em; }
#screen-results .fs .tm { font-size: 96px; }
/* en ligne : la largeur mesurée est celle du texte, pas de la colonne (sinon le nom rétrécit toujours) */
#screen-results .fs .nm, #screen-results .stat .sn { display: inline-block; max-width: none; }
.belt.brown { background: #6b4423; }
.belt.black { background: #111; }
.band .belt.black::after { background: #c62828; } /* barrette rouge de la ceinture noire */
