/* =====================================================================================
   style.css : l'apparence des DEUX pages (classement et fiche joueur).
   Pour changer les couleurs du site, modifie juste le bloc ":root" juste en dessous.
   ===================================================================================== */
:root{
  --ink:#1e1e1e;      /* fond proche du thème sombre de VS Code */
  --navy:#373e42;     /* fond principal des blocs */
  --navy2:#424a4e;    /* blocs en relief */
  --line:#535d62;     /* bordures */
  --text:#f1f3f2;
  --muted:#adb6b9;
  --gold:#ff823c;     /* accent orange */
  --gold-dim:#bd5c2d;
  --win:#46c9bd;      /* victoire */
  --loss:#e2625c;     /* défaite */
  --bleu:#4ba8e8;
  --rouge:#ec6570;
  --titre:'Barlow Condensed',system-ui,sans-serif;
  --texte:'Barlow',system-ui,sans-serif;
}
*{box-sizing:border-box}
html{background:var(--ink)}
body{margin:0;color:var(--text);font:16px/1.45 var(--texte);background:var(--ink);min-height:100vh}
button{font:inherit;color:inherit;cursor:pointer}
a{color:inherit}
:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
small{font-weight:400;color:var(--muted)}
.cadre{max-width:1100px;margin:0 auto;padding:0 20px 56px}
.gagne{color:var(--win)} .perdu{color:var(--loss)}

/* ======================= EN-TÊTE ======================= */
header{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap;padding:32px 0 18px;border-bottom:1px solid var(--gold-dim)}
h1{margin:0;font:600 44px/1 var(--titre);letter-spacing:.01em}
.maj{color:var(--muted);font-size:14px;margin-top:6px}
.retour{display:inline-block;color:var(--gold);text-decoration:none;font:600 22px var(--titre);letter-spacing:.02em}
.retour:hover{text-decoration:underline}
.actions{margin-left:auto;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.bouton{background:transparent;border:1px solid var(--gold-dim);border-radius:8px;padding:8px 16px;color:var(--gold);font-weight:500}
a.bouton{text-decoration:none;display:inline-block}
.bouton:hover{border-color:var(--gold);background:rgba(255,130,60,.1)}
.bouton:disabled{opacity:.5;cursor:wait}
#message{color:var(--muted);font-size:14px}

nav{display:flex;gap:6px;margin:18px 0 20px}
nav button{background:none;border:0;border-bottom:2px solid transparent;padding:8px 14px;color:var(--muted);font:600 20px var(--titre);letter-spacing:.02em}
nav button:hover{color:var(--text)}
nav button[aria-selected=true]{color:var(--gold);border-color:var(--gold)}

.vide{padding:44px 20px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:12px}
.vide a{color:var(--gold)}
.note{color:var(--muted);font-size:14px;margin:0 0 14px}
.pied{margin-top:40px;color:var(--muted);font-size:13px;text-align:center}

/* ======================= ACCUEIL : SUIVI DES LP ======================= */
/* un grand graphique en haut, deux petits dessous (deux fois moins larges, même hauteur) */
.lp{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0 4px}
.lp-carte{grid-column:span 1;min-width:0;display:flex;flex-direction:column;gap:10px;background:var(--navy);border:1px solid var(--line);border-radius:12px;padding:14px 16px}
.lp-carte.grande{grid-column:1 / -1}
.lp-tete{display:flex;align-items:center;gap:10px;min-width:0;text-decoration:none}
.lp-tete .avatar{width:34px;height:34px;border-radius:8px}
.lp-tete .nom{font-size:20px}
.lp-tete:hover .nom{color:var(--gold)}
.lp-corps{display:flex;align-items:stretch;gap:16px;min-width:0}
.lp-graph{flex:1;min-width:0;height:200px}
.lp-graph svg{display:block;width:100%;height:200px}
.lp-graph text{font:11px var(--texte);fill:var(--muted)}
.lp-vide{height:100%;display:grid;place-items:center;padding:0 12px;color:var(--muted);font-size:13px;text-align:center;border:1px dashed var(--line);border-radius:8px}
.lp-cote{flex:none;width:150px;display:flex;flex-direction:column;justify-content:center;gap:16px;padding-left:16px;border-left:1px solid var(--line)}
.lp-carte:not(.grande) .lp-cote{width:122px;padding-left:12px;gap:12px}
.lp-cote small{display:block;font-size:12px;color:var(--muted)}
.lp-cote b{display:block;font:600 24px/1.05 var(--titre)}
.lp-carte:not(.grande) .lp-cote b{font-size:21px}
.lp-cote .barre{margin-top:6px}
.lp-evol{font-variant-numeric:tabular-nums}
.lp-vide-liste{grid-column:1 / -1}

/* ======================= CLASSEMENT ======================= */
.liste{display:grid;gap:8px}
.ligne{display:grid;grid-template-columns:minmax(190px,1.5fr) minmax(170px,1.2fr) 120px 110px 70px;align-items:center;gap:16px;
  background:var(--navy);border:1px solid var(--line);border-radius:12px;padding:12px 18px;color:inherit;text-decoration:none}
.ligne:hover{border-color:var(--gold-dim);background:var(--navy2)}
.joueur{display:flex;align-items:center;gap:12px;min-width:0}
.avatar{flex:none;width:48px;height:48px;border-radius:10px;background:var(--navy2) center/cover;border:1px solid var(--line)}
.identite{min-width:0;display:flex;flex-direction:column}
.nom{font:600 21px/1.1 var(--titre);letter-spacing:.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nom small{margin-left:4px;font-size:14px}
.niveau{color:var(--muted);font-size:13px}
.live{color:var(--win);font-size:13px;display:flex;align-items:center;gap:8px;white-space:nowrap}
.live .txt{min-width:0;overflow:hidden;text-overflow:ellipsis}
.live i{flex:none;width:8px;height:8px;border-radius:50%;background:var(--win);animation:pulse 1.8s ease-out infinite}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(70,201,189,.7)}100%{box-shadow:0 0 0 8px rgba(70,201,189,0)}}
.rang{display:block}
.rang b{font:600 24px/1 var(--titre);letter-spacing:.01em}
.rang small{margin-left:6px;font-size:14px}
.barre{display:block;height:4px;background:var(--line);border-radius:2px;margin-top:8px;overflow:hidden}
.barre i{display:block;height:100%;border-radius:2px}
.bilan b{display:block;font:600 24px/1 var(--titre)}
.bilan small{font-size:13px}
.forme{display:flex;gap:3px}
.forme i{width:8px;height:20px;border-radius:2px;background:var(--win)}
.forme i.d{background:var(--loss)}
.kda b{display:block;font:600 24px/1 var(--titre)}
.kda small{font-size:13px}

/* ======================= RECORDS ======================= */
.cartes{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:12px}
.carte{display:flex;gap:14px;align-items:center;background:var(--navy);border:1px solid var(--line);border-radius:12px;padding:16px;color:inherit;text-decoration:none}
.carte:hover{border-color:var(--gold-dim);background:var(--navy2)}
.carte .valeur{font:600 40px/1 var(--titre);color:var(--gold)}
.carte .titre{color:var(--muted);font-size:14px;margin-bottom:2px}
.carte .qui{font-size:15px}
.carte .qui small{display:block}
.carte .suite{margin-left:auto;color:var(--gold-dim);font:600 28px/1 var(--titre)}
.carte:hover .suite{color:var(--gold)}
.pastille{flex:none;width:52px;height:52px;border-radius:10px;background:var(--navy2) center/cover;border:1px solid var(--line)}

/* ======================= PAGE JOUEUR ======================= */
.tete{display:flex;align-items:center;gap:18px;margin:26px 0 24px}
.tete .avatar{width:72px;height:72px;border-radius:14px}
.tete h1{font-size:42px}
.tete h1 small{font-size:20px;margin-left:6px}
.sections{display:grid;grid-template-columns:minmax(0,1fr);gap:30px}
h2{margin:0 0 12px;font:600 22px var(--titre);letter-spacing:.02em;color:var(--text)}
.grand-rang{display:flex;align-items:center;gap:20px;background:var(--navy);border:1px solid var(--line);border-radius:12px;padding:16px 20px;flex-wrap:wrap}
.grand-rang .nom-rang{font:600 36px/1 var(--titre)}
.grand-rang .detail-lp{flex:1;min-width:140px;max-width:260px}
.tuiles{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.tuile{background:var(--navy);border:1px solid var(--line);border-radius:10px;padding:12px 14px}
.tuile b{display:block;font:600 28px/1.1 var(--titre)}
.tuile small{font-size:13px}
.graph{background:var(--navy);border:1px solid var(--line);border-radius:12px;padding:10px 6px 4px}
.graph svg{display:block;width:100%;height:auto}
.graph text{font:12px var(--texte);fill:var(--muted)}
table{width:100%;border-collapse:collapse}
th,td{padding:8px 10px;text-align:left;border-bottom:1px solid var(--line)}
th{color:var(--muted);font-weight:500;font-size:13px}
.champ-cellule{display:flex;align-items:center;gap:10px}
.mini{flex:none;width:30px;height:30px;border-radius:7px;background:var(--navy2) center/cover;border:1px solid var(--line)}
.tableau-champions{background:var(--navy);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.tableau-champions tr:last-child td{border-bottom:0}

/* ----- une partie = un menu déroulant (balise <details>) ----- */
.parties{display:grid;gap:8px}
.filtres-parties{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;margin:0 0 12px}
.filtres-parties label{display:grid;gap:4px;color:var(--muted);font-size:12px}
.filtres-parties select{min-width:150px;padding:7px 28px 7px 10px;border:1px solid var(--line);border-radius:5px;background:var(--navy);color:var(--text);font:inherit}
.compteur-parties{margin-left:auto;padding:7px 0;color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums}
.partie-bloc{background:var(--navy);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.partie-bloc[open]{border-color:var(--gold-dim)}
.partie-bloc.surbrillance{animation:flash 2.8s ease-out 1}
@keyframes flash{0%,40%{box-shadow:0 0 0 3px var(--gold)}100%{box-shadow:0 0 0 3px rgba(255,130,60,0)}}
summary.partie{display:grid;grid-template-columns:5px 42px minmax(110px,1fr) minmax(100px,.9fr) 56px 80px 120px 124px 52px 22px;gap:14px;align-items:center;
  padding:8px 14px 8px 0;cursor:pointer;list-style:none}
summary.partie::-webkit-details-marker{display:none}
summary.partie:hover{background:rgba(255,255,255,.03)}
.partie .bord{align-self:stretch;background:var(--win)}
.partie-bloc.defaite .partie .bord{background:var(--loss)}
.partie .mini{width:40px;height:40px;border-radius:9px}
.partie b{font-weight:600}
.partie small{display:block}
.partie .c-degats small{white-space:nowrap}
summary.partie>*{min-width:0}
.partie .c-sr{display:inline-flex;align-items:center;gap:6px}
.partie .c-sr .ss{display:inline-grid;grid-template-rows:1fr 1fr;gap:2px}
.partie .c-sr .ss img,.partie .c-sr .ss span{width:18px;height:18px;border-radius:3px}
.partie .c-sr .ru{grid-template-rows:none;grid-auto-flow:column;margin-left:0}
.partie .c-sr .ru img,.partie .c-sr .ru span{width:18px;height:18px;border-radius:50%;background:rgba(0,0,0,.35)}
.fleche{justify-self:center;width:9px;height:9px;margin-top:-4px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);transition:transform .15s}
.partie-bloc[open] .fleche{transform:rotate(-135deg);margin-top:4px;border-color:var(--gold)}

/* ----- l'intérieur du menu : les deux équipes ----- */
.detail{padding:4px 16px 18px;border-top:1px solid var(--line);background:var(--ink)}
.equipes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.equipe{min-width:0;margin-top:14px}
.equipe-titre{display:flex;align-items:baseline;gap:12px;font:600 20px var(--titre);letter-spacing:.02em;margin-bottom:4px}
.equipe-titre small{font-size:13px;font-family:var(--texte);letter-spacing:0}
.defile{min-width:0;overflow:hidden}
.tableau-partie{width:100%;min-width:0;table-layout:fixed;font-size:12px}
.tableau-partie th,.tableau-partie td{padding:5px 3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}
.tableau-partie th:nth-child(1),.tableau-partie td:nth-child(1){width:8%}
.tableau-partie th:nth-child(2),.tableau-partie td:nth-child(2){width:19%}
.tableau-partie th:nth-child(3),.tableau-partie td:nth-child(3){width:12%}
.tableau-partie th:nth-child(4),.tableau-partie td:nth-child(4){width:13%}
.tableau-partie th:nth-child(5),.tableau-partie td:nth-child(5){width:8%}
.tableau-partie th:nth-child(6),.tableau-partie td:nth-child(6){width:7%}
.tableau-partie th:nth-child(7),.tableau-partie td:nth-child(7){width:5%}
.tableau-partie th:nth-child(8),.tableau-partie td:nth-child(8){width:28%}
.tableau-partie td:nth-child(2) .n,.tableau-partie td:nth-child(2) .r{overflow:hidden;text-overflow:ellipsis}
.tableau-partie td:nth-child(2) .n small{display:inline}
.tableau-partie td:nth-child(2) .r small{display:inline;font-size:10px}
.tableau-partie tr:last-child td{border-bottom:0}
.tableau-partie tr.ami td{background:rgba(255,130,60,.08)}
.tableau-partie tr.moi td{background:rgba(255,130,60,.17)}
.tableau-partie tr.ami .n{color:var(--gold)}
.tableau-partie tr.moi td:first-child{box-shadow:inset 3px 0 0 var(--gold)}
.cc{position:relative;display:inline-block}
.cc .mini{display:block;width:32px;height:32px}
.cc .niv{position:absolute;right:-5px;bottom:-5px;background:var(--ink);border:1px solid var(--line);border-radius:6px;font-size:11px;line-height:1;padding:2px 4px;color:var(--muted)}
.n{display:block;font-weight:600}
.n small{margin-left:2px;font-size:12px}
a.n{text-decoration:none}
a.n:hover{text-decoration:underline}
.r{display:block;font-size:12.5px}
.r small{margin-left:2px;font-size:12px}
.r.inconnu{color:var(--muted)}
.c-champ{width:56px}
.tableau-partie .c-champ{width:8%}
.tableau-partie small{display:block;font-size:12px}
.barre-d{display:block;height:4px;width:100%;max-width:64px;background:var(--line);border-radius:2px;margin-top:4px;overflow:hidden}
.barre-d i{display:block;height:100%;background:var(--gold-dim);border-radius:2px}
.objets{display:flex;gap:1px;overflow:hidden}
.objets img,.objets span{width:16px;height:16px;flex:0 0 16px;border-radius:3px;background:var(--navy2);display:block}
.legende{margin:14px 0 0;color:var(--muted);font-size:13px}
.or-partie{margin-top:18px;padding:14px;background:var(--navy);border:1px solid var(--line);border-radius:10px}
.or-partie h3{margin:0 0 8px;font:600 18px var(--titre)}
.graphique-or{display:block;width:100%;height:auto;overflow:visible}
.graphique-or text{font:12px var(--texte);fill:var(--muted)}
.graphique-or .grille{stroke:var(--line);stroke-width:1}
.graphique-or .zero{stroke:var(--muted);stroke-width:1.5}
.graphique-or .avance-bleue,.graphique-or .avance-rouge{stroke-width:3;stroke-linecap:round}
.graphique-or .avance-bleue{stroke:var(--bleu)}
.graphique-or .avance-rouge{stroke:var(--rouge)}
.legende-or{margin:4px 0 0;color:var(--muted);font-size:13px}
.bleu{color:var(--bleu)}.rouge{color:var(--rouge)}
.evenements{margin-top:12px;border:1px solid var(--line);border-radius:8px;background:var(--navy)}
.evenements summary{padding:10px 12px;cursor:pointer;font-weight:600}
.evenements summary small{margin-left:8px}
.evenements ol{max-height:360px;overflow:auto;margin:0;padding:0 12px 10px;list-style:none}
.evenements li{display:flex;gap:12px;align-items:baseline;padding:5px 0;border-top:1px solid var(--line);font-size:13px}
.evenements time{flex:none;width:46px;color:var(--gold);font-variant-numeric:tabular-nums}

/* ======================= TÉLÉPHONE ======================= */
@media (max-width:760px){
  .lp{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:520px){
  .lp-corps{flex-direction:column;gap:10px}
  .lp-cote,.lp-carte:not(.grande) .lp-cote{width:auto;flex-direction:row;flex-wrap:wrap;gap:6px 22px;padding:10px 0 0;border-left:0;border-top:1px solid var(--line)}
}
@media (max-width:820px){
  h1{font-size:36px}
  .tete h1{font-size:32px}
  .ligne{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"joueur kda" "rang bilan" "forme forme";row-gap:10px;padding:12px 14px;gap:10px 12px}
  .joueur{grid-area:joueur}.rang{grid-area:rang}.bilan{grid-area:bilan;text-align:right}.forme{grid-area:forme}.kda{grid-area:kda;text-align:right}
  summary.partie{grid-template-columns:5px 42px 1fr auto 22px;grid-template-areas:"bord icone mode kda fleche" "bord icone cs duree fleche" "bord icone sr objets fleche";row-gap:4px}
  .partie .c-sr{grid-area:sr}.partie .c-objets{grid-area:objets;justify-self:end}
  .partie .bord{grid-area:bord}.partie .mini{grid-area:icone}.partie .c-mode{grid-area:mode}.partie .c-kda{grid-area:kda;text-align:right}
  .partie .c-cs{grid-area:cs}.partie .c-duree{grid-area:duree;text-align:right}.partie .fleche{grid-area:fleche}
  .partie .c-degats{display:none}
  .detail{padding-left:10px;padding-right:10px}
  .equipes{grid-template-columns:1fr}
  .filtres-parties{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .filtres-parties select{width:100%;min-width:0}
  .compteur-parties{margin-left:0}
  .tableau-partie .c-or,.tableau-partie .c-vis,.tableau-partie .c-obj{display:none}
  .barre-d{width:70px}
}
@media (max-width:1100px) and (min-width:901px){
  .objets img,.objets span{width:15px;height:15px;flex-basis:15px}
}
@media (max-width:1000px){
  .equipes{grid-template-columns:1fr}
}
@media (max-width:600px){
  .tuiles{grid-template-columns:repeat(2,1fr)}
  .tuile b{font-size:24px;white-space:nowrap}
  .col-moy{display:none}
  .grand-rang{gap:12px}
  .grand-rang .nom-rang{font-size:30px}
  .tete{gap:14px}
  .tete .avatar{width:56px;height:56px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* onglets de l'accueil : défilent au lieu de déborder sur mobile */
nav[role=tablist]{overflow-x:auto;scrollbar-width:none}nav[role=tablist]::-webkit-scrollbar{display:none}
nav button{white-space:nowrap;flex:none}
@media(max-width:520px){nav button{padding:8px 10px;font-size:18px}}

/* sélecteur de joueur avec recherche */
.sj{position:relative;display:flex;align-items:center;gap:10px;margin:16px 0 14px;max-width:420px;padding:4px 12px 4px 4px;border:1px solid var(--line);border-radius:99px;background:var(--navy)}
.sj:focus-within{border-color:var(--gold)}
.sj .avatar{flex:none;width:32px;height:32px;border-radius:50%;background-size:cover}
.sj-in{flex:1;min-width:0;border:0;background:none;color:var(--text);font:inherit;font-size:15px;outline:none}
.sj-in::placeholder{color:var(--muted)}
.sj-liste{position:absolute;z-index:20;left:0;right:0;top:calc(100% + 6px);max-height:320px;overflow-y:auto;padding:6px;border:1px solid var(--gold-dim);border-radius:12px;background:var(--navy2);box-shadow:0 12px 30px rgba(0,0,0,.45)}
.sj-liste[hidden],.sj-liste a[hidden],.sj-vide[hidden]{display:none}
.sj-liste a{display:flex;align-items:center;gap:10px;padding:6px 10px;border-radius:8px;color:var(--text);text-decoration:none}
.sj-liste a:hover,.sj-liste a:focus{background:var(--navy);outline:none}
.sj-liste a.actif{color:var(--gold)}
.sj-liste a small{color:var(--muted)}
.sj-liste .avatar{width:26px;height:26px}
.sj-vide{margin:0;padding:10px;color:var(--muted);font-size:14px}
