/* KC : direction « KC ultime » (DA 6). Fond nuit, image en haut, peu de texte, blob = masque. */
:root {
  --nuit: #04081A; --fond2: #0A1440; --kc: #1B3FCB; --elec: #5E85FF; --encre: #F4F6FF; --muet: #8C97C4;
  --ligne: rgba(255,255,255,0.10); --carte: rgba(255,255,255,0.06); --ok: #8EE0B5; --okfond: #1F3A2E;
  --alerte: #F5C451; --danger: #FF6B84;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--nuit); color: var(--encre); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: 96px; }
@media (min-width: 900px) { .app { max-width: 720px; } }
.chargement { padding: 40vh 24px 0; text-align: center; color: var(--muet); }

/* image du haut */
.hero { position: relative; height: 56vh; min-height: 420px; max-height: 620px; overflow: hidden; background: var(--nuit); display: flex; flex-direction: column; }
.hero img.fond { position: absolute; inset: -12% -16%; width: 132%; height: 124%; object-fit: cover; transform: rotate(-6deg); opacity: 0.95; }
.hero .voile-haut { position: absolute; left: 0; right: 0; top: 0; height: 140px; background: linear-gradient(180deg, rgba(4,8,26,0.8), rgba(4,8,26,0)); }
.hero .voile-bas { position: absolute; left: 0; right: 0; bottom: 0; height: 55%; background: linear-gradient(180deg, rgba(4,8,26,0), var(--nuit) 100%); }
.hero .contenu { position: relative; margin-top: auto; padding: 0 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.entete { position: relative; display: flex; align-items: center; justify-content: space-between; padding: calc(16px + env(safe-area-inset-top)) 22px 0; }
.entete .marque { display: flex; align-items: center; gap: 12px; }
.entete img { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,0.45); }
.entete .titre { font-weight: 800; font-size: 16px; }
.entete .sous { font-size: 12px; color: rgba(244,246,255,0.75); }

.kicker { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--elec); display: flex; align-items: center; gap: 8px; }
.kicker.live { color: var(--danger); }
.kicker .point { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.affiche { font-size: clamp(40px, 12vw, 58px); font-weight: 800; letter-spacing: -2px; line-height: 0.95; text-shadow: 0 6px 30px rgba(0,0,0,0.5); }
.affiche.masque { color: var(--muet); }
.contexte { font-size: 14px; color: rgba(244,246,255,0.8); }
.actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 800; font-size: 15px; border: 1.5px solid transparent; }
.btn.plein { background: var(--encre); color: var(--fond2); box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.btn.bleu { background: var(--kc); color: var(--encre); }
.btn.contour { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.08); }
.btn.rond { width: 48px; padding: 0; }
.btn.danger { border-color: rgba(255,107,132,0.5); color: var(--danger); }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn.petit { min-height: 38px; padding: 0 14px; font-size: 13px; }

/* sections et lignes */
.section { padding: 10px 22px 0; display: flex; flex-direction: column; gap: 10px; }
.section h2 { margin: 6px 0 0; font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muet); }
.ligne { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 20px; background: var(--carte); border: 1px solid var(--ligne); min-height: 64px; }
.ligne .corps { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.ligne .nom { font-size: 16px; font-weight: 800; }
.ligne .nom.masque { color: var(--muet); }
.ligne .detail { font-size: 12px; color: var(--muet); }
.date { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 48px; height: 48px; border-radius: 16px; background: rgba(255,255,255,0.08); line-height: 1; }
.date .jour { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muet); }
.date .num { font-size: 18px; font-weight: 800; }
.pastille { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.pastille.vu { background: var(--okfond); color: var(--ok); }
.pastille.avoir { background: rgba(94,133,255,0.18); color: var(--elec); }
.pastille.live { background: rgba(255,107,132,0.18); color: var(--danger); }
.pastille.avenir { background: rgba(255,255,255,0.08); color: var(--muet); }
.pastille.masque { background: rgba(255,255,255,0.06); color: var(--muet); }
.blob { width: 34px; height: 34px; flex-shrink: 0; }
.note { font-size: 12.5px; color: var(--muet); text-align: center; padding: 6px 22px; }
.note b { color: var(--elec); font-size: 16px; text-shadow: 0 0 16px rgba(94,133,255,0.8); }
.bandeau { margin: 0 22px; padding: 12px 14px; border-radius: 16px; background: rgba(245,196,81,0.12); border: 1px solid rgba(245,196,81,0.35); font-size: 13px; line-height: 1.4; }
.bandeau.rouge { background: rgba(255,107,132,0.12); border-color: rgba(255,107,132,0.4); }
.vide { padding: 30px 22px; color: var(--muet); text-align: center; }

/* fiche */
.fiche-tete { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 22px 0; }
.fiche-tete .milieu { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muet); text-align: center; flex-grow: 1; padding: 0 8px; }
.duel { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 22px 22px 8px; }
.duel .equipe { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 96px; }
.badge { width: 80px; height: 80px; border-radius: 20px; background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; letter-spacing: -0.5px; }
.badge.kc { background: var(--fond2); border-color: var(--kc); }
.badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.duel .vs { font-weight: 800; font-size: 22px; color: var(--muet); padding-bottom: 28px; }
.duel .score { font-size: 54px; font-weight: 800; letter-spacing: -2px; line-height: 1; padding-bottom: 24px; display: flex; gap: 10px; align-items: baseline; }
.duel .score .perd { color: var(--muet); }
.cache3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cache3 div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 14px; background: var(--carte); border: 1px solid var(--ligne); text-align: center; }
.cache3 b { font-size: 24px; font-weight: 800; color: var(--elec); }
.cache3 span { font-size: 11px; color: var(--muet); }
.game { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--carte); border: 1px solid var(--ligne); }
.game .n { font-weight: 800; font-size: 18px; color: var(--elec); min-width: 34px; }
.liens { display: flex; flex-direction: column; gap: 8px; }

/* onglets du haut (competition) */
.onglets { display: flex; gap: 6px; padding: 0 22px; overflow-x: auto; }
.onglets button { flex-shrink: 0; height: 38px; padding: 0 14px; border-radius: 10px; background: var(--carte); border: 1px solid var(--ligne); color: var(--muet); font-weight: 700; font-size: 13px; }
.onglets button.actif { background: var(--kc); color: var(--encre); border-color: transparent; }
.tableau { border-radius: 16px; background: var(--carte); border: 1px solid var(--ligne); overflow: hidden; }
.tableau .rang { display: grid; grid-template-columns: 28px minmax(0, 1fr) 48px 64px; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--ligne); font-size: 14px; }
.tableau .rang:last-child { border-bottom: none; }
.tableau .rang.kc { background: rgba(27,63,203,0.25); font-weight: 800; }
.tableau .rang .num { color: var(--muet); font-weight: 800; }
.tableau .rang .droite { text-align: right; }
.tableau .rang .serie { font-size: 11px; color: var(--muet); text-align: right; letter-spacing: 1px; }
.curseur { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 16px; background: var(--kc); position: relative; overflow: hidden; }
.curseur .corps { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.curseur .k { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #DCE7FF; }
.curseur .v { font-weight: 800; font-size: 18px; }
.curseur .d { font-size: 12px; color: #DCE7FF; }
.curseur .boutons { display: flex; gap: 6px; }
.curseur .boutons button { width: 44px; height: 44px; border-radius: 12px; background: var(--encre); color: var(--fond2); display: flex; align-items: center; justify-content: center; }
.effectif { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.joueur { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; background: var(--carte); border: 1px solid var(--ligne); text-align: center; }
.joueur .role { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: var(--elec); }
.joueur .pseudo { font-weight: 800; font-size: 14px; }
.joueur .pays { font-size: 10px; color: var(--muet); text-transform: uppercase; }
.form { display: flex; flex-direction: column; gap: 10px; }
input[type=password], input[type=text] { width: 100%; min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--ligne); background: var(--carte); color: var(--encre); font: inherit; }
.connexion { padding: 30vh 22px 0; display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
.connexion img { width: 96px; height: 96px; border-radius: 28px; }

/* barre du bas */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(4,8,26,0.92); backdrop-filter: blur(12px); border-top: 1px solid var(--ligne); padding: 0 8px calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: space-around; z-index: 5; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 60px; padding: 10px 4px 2px; color: var(--encre); opacity: 0.6; font-size: 10.5px; font-weight: 600; border-top: 3px solid transparent; }
.nav a.actif { opacity: 1; font-weight: 800; border-top-color: var(--elec); }
.nav a.actif svg { stroke: var(--elec); }
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--encre); color: var(--fond2); padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.dialogue { position: fixed; inset: 0; background: rgba(4,8,26,0.85); display: flex; align-items: center; justify-content: center; padding: 22px; z-index: 20; }
.dialogue .boite { background: var(--fond2); border: 1px solid var(--ligne); border-radius: 22px; padding: 22px; max-width: 380px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.dialogue h3 { margin: 0; font-size: 20px; }
.dialogue p { margin: 0; color: var(--muet); font-size: 14px; line-height: 1.4; }

/* ---- passe graphique 2 : badges d'equipe, flou anti-spoiler, lecteur ---- */
.hero.petit { height: auto; min-height: 0; padding-bottom: 8px; }
.hero.petit .voile-bas { height: 70%; }
.hero img.fond { inset: -10% -6%; width: 112%; height: 120%; transform: none; opacity: 0.9; }
.duo { display: inline-flex; align-items: center; }
.duo .mini + .mini { margin-left: -8px; }
.mini { width: 34px; height: 34px; border-radius: 11px; background: hsl(var(--h, 220) 45% 22%); border: 2px solid hsl(var(--h, 220) 60% 45%); color: var(--encre); font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; letter-spacing: -0.3px; }
.mini.kc { background: var(--fond2); border-color: var(--kc); }
.mini img { width: 100%; height: 100%; object-fit: cover; }
.duo.grand { margin-right: 12px; vertical-align: middle; }
.duo.grand .mini { width: 44px; height: 44px; border-radius: 14px; font-size: 12px; }
.affiche { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.ligne .nom .vs { color: var(--muet); font-weight: 600; }
.ligne.ligne-masque .nom { color: var(--muet); }
.compteur { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(94,133,255,0.2); color: var(--elec); font-size: 11px; align-items: center; justify-content: center; margin-left: 6px; letter-spacing: 0; }
.badge { background: hsl(var(--h, 220) 45% 20%); border-color: hsl(var(--h, 220) 60% 45%); font-size: 22px; }
details.bloc summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.bloc summary::-webkit-details-marker { display: none; }
details.bloc summary::after { content: "›"; color: var(--muet); font-size: 20px; transform: rotate(90deg); transition: transform .2s; }
details.bloc[open] summary::after { transform: rotate(-90deg); }
details.bloc > .ligne, details.bloc > .game { margin-top: 10px; }

/* flou anti-spoiler : du faux contenu derriere, jamais le vrai */
.flou { filter: blur(9px); user-select: none; pointer-events: none; transition: filter .35s ease; }
.badge.flou { filter: blur(6px); }
.deflou { animation: deflou .6s ease-out both; }
@keyframes deflou { from { filter: blur(12px); opacity: .4; } to { filter: blur(0); opacity: 1; } }
button.flou-zone { position: relative; background: none; border: none; color: inherit; font: inherit; }
.flou-zone .indice { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.25); font-size: 12px; font-weight: 700; color: var(--encre); backdrop-filter: blur(4px); }
.duel.flou-zone { width: 100%; }
.duel.flou-zone .indice { bottom: -8px; }
.score.flou-zone { padding: 10px 14px 26px; border-radius: 18px; }
.score.flou-zone:active { background: rgba(255,255,255,0.06); }
.score .tiret { font-size: 28px; }

/* lecteur */
.lecteur-page { background: #000; min-height: 100vh; display: flex; flex-direction: column; }
.scene { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.scene #yt, .scene iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene .couche { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.pause-ecran { position: absolute; inset: 0; z-index: 3; background: var(--nuit); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
.pause-ecran .affiche { font-size: clamp(28px, 7vw, 48px); justify-content: center; }
.pause-ecran .muet, .titre-l .muet { color: var(--muet); font-weight: 700; font-size: 0.6em; margin-left: 8px; }
.pause-ecran .actions { justify-content: center; }
.barre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; background: var(--nuit); border-top: 1px solid var(--ligne); }
.barre .titre-l { flex-basis: 100%; font-weight: 800; font-size: 15px; display: flex; align-items: center; }
.barre .btn.petit { min-height: 42px; padding: 0 12px; font-size: 13px; }
.barre .btn.rond { width: 44px; min-height: 44px; }
.barre .btn.plein.rond { width: 52px; min-height: 52px; }
.lecteur-page .note { color: var(--muet); }
@media (orientation: landscape) and (max-height: 500px) {
  .lecteur-page { height: 100vh; }
  .scene { aspect-ratio: auto; flex-grow: 1; }
  .barre { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; background: rgba(4,8,26,0.9); transform: translateY(100%); transition: transform .25s; }
  .lecteur-page.barre-visible .barre { transform: translateY(0); }
  .lecteur-page .note { display: none; }
}
:fullscreen .lecteur-page, .lecteur-page:fullscreen { height: 100vh; }
.lecteur-page:fullscreen .scene { aspect-ratio: auto; flex-grow: 1; }
.lecteur-page:fullscreen .barre { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; background: rgba(4,8,26,0.9); transform: translateY(100%); transition: transform .25s; }
.lecteur-page.barre-visible:fullscreen .barre { transform: translateY(0); }
.lecteur-page:fullscreen .note { display: none; }

.scene .bandeau-haut { position: absolute; left: 0; right: 0; top: 0; height: 64px; z-index: 3; background: var(--nuit); display: flex; align-items: center; gap: 10px; padding: 0 14px; font-weight: 800; font-size: 14px; border-bottom: 1px solid var(--ligne); }
.scene .bandeau-haut img { width: 32px; height: 32px; border-radius: 9px; }
.scene .bandeau-haut .sans { margin-left: auto; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muet); font-weight: 700; }
.scene .demarrage { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: var(--nuit); display: flex; align-items: center; justify-content: center; transition: opacity .5s; }
.scene .demarrage.parti { opacity: 0; pointer-events: none; }
.pause-ecran[hidden] { display: none; }
.pastille.replay { background: rgba(255,255,255,0.1); color: var(--encre); padding: 6px 8px; }
