/* Règles générales */
:root{
    --c-bg: #0f141a;
    --c-panel: #181f2b;
    --c-fg: #e6edf3;
    --c-muted: #9fb0bf;
    --c-blue-1: #29a3ff;      /* accent clair */
    --c-blue-2: #0077ff;      /* accent principal */
    --c-blue-3: #0057c2;      /* accent sombre */
}

.wr-red { color: #ca5353; }
.wr-orange { color: #e1aa44;; }
.wr-green { color: #429f42; }
.wr-blue { color: #3d8ae1; }

.player_infos_small{
    max-width: clamp(60px, 20vw, 200px);
}

.small, small {
  font-size: .78em;
}

#light_mode_switch {
    cursor:pointer;
}
.light_mode_enabled .can_be_hidden {
    display:none !important;
}

.bg-body {
    background-color: #212631!important;
}
#leaderboardsNav {
    padding-bottom: 13px;
}
#leaderboardsNav .nav-link {
    text-transform: uppercase;
    font-size: .8rem;
    letter-spacing: .7px;
    color: #cfd8dc;
    padding: .75rem .9rem;
    position: relative;
    font-weight: 600;
}
#leaderboardsNav .nav-link:hover, #leaderboardsNav .nav-link.active {
    color: #fff;
}
#leaderboardsNav .nav-link.active::after {
    content: "";
    position: absolute;
    left: 30%;
    width: 40%;
    bottom: 0;
    height: 3px;
    background: #026de7;
    border-radius: 2px 2px 0 0;
}

/* ---------- Pings ------------ */
#card_ping {
    background:var(--url);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    width: 100%;
    height: 100%;
    position: absolute;
}

/* ---------- Rank emblem ----------------------- */
.rank-crop{
    --size: 40px;   /* taille rendue */
    --zoom: 4;    /* 1.0 = pas de zoom ; 1.8–2.4 recommandé pour les emblems */
    position: relative;
    display: inline-block;
    width: var(--size);
    height: var(--size);
}
.rank-crop > img{
    position: absolute;
    inset: -50px;
    margin: auto;
    width: 180%;
    height: 100%;
    transform: scale(var(--zoom));
    transform-origin: 50% 50%;
    image-rendering: -webkit-optimize-contrast;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}
.role-icon {
  width: 22px; height: 22px;
  object-fit: contain;
  margin-right: .4rem;
  vertical-align: -2px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35));
}

/* ---------- Match history ------------ */
/* cellule joueur = support du trait */
.table-score td.player-cell{ position:relative; overflow:visible !important; }
.table-score td.player-cell::before{
    content:""; display:none; position:absolute; left:-10px; top:6px; bottom:6px;
    width:15px; border-radius:4px;
}
.row-self    td.player-cell::before{ display:block; background:#f59e0b; } /* vert */
.row-premade td.player-cell::before{ display:block; background:#6b1fc2; } /* orange */

.badge-kda{
    width:100px;
    display:inline-block; padding:2px 8px; border-radius:999px;
    background:#0f1523; border:1px solid rgba(255,255,255,.08);
    font-weight:600; font-size:.9rem; color:#cfd8ea;
}
.badge-kda.good{  border-color:rgba(25,135,84,.45);  color:#9be7c4; }  /* ≥4.0 */
.badge-kda.ok{    border-color:rgba(255,193,7,.45);  color:#ffd479; }  /* 2.0–3.9 */
.badge-kda.bad{   border-color:rgba(220,53,69,.45);  color:#f3a5a8; }  /* <2.0 */
.kp-chip{
    position:relative; display:inline-block; width:92px; height:18px;
    background:#0f1523; border:1px solid rgba(255,255,255,.08);
    border-radius:999px; overflow:hidden; text-align:center; font-size:.82rem;
}
.kp-chip::before{
    content:""; position:absolute; inset:0; width:calc(var(--kp,0) * 1%);
    background:linear-gradient(90deg,#1e90ff,#00d4ff); opacity:.35;
}
.kp-chip > span{ position:relative; z-index:1; color:#cfd8ea; }

.item-grid{
    --isize: 26px;
    display:inline-grid;
    grid-template-columns: repeat(7, var(--isize));
    gap: 4px;
    vertical-align:middle;
}
.item-slot{
    width:var(--isize); height:var(--isize);
    border-radius:4px;
    background:#0e1626;            /* “trou” quand vide */
    border:1px solid rgba(255,255,255,.08);
    overflow:hidden;               /* empêche tout débordement */
    display:block;
}
.item-slot img{
    width:100%; height:100%;
    display:block; border-radius:inherit;
    object-fit:cover;
}

.match-topline{
    display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.stat-pills{
    display:flex; 
    flex-wrap:wrap; 
    gap:5px;
    height:10px;
}
.pill{
    background:#0f1523;
    border:1px solid rgba(255,255,255,.08);
    color:#cfd8ea;
    border-radius:999px;
    padding:4px 10px;
    font-weight:600;
    line-height:1;
    display:inline-flex; align-items:center;
}
.pill i{ font-size:.9em; opacity:.85; }
.pill.good{
    background:rgba(25,135,84,.15);
    border-color:rgba(25,135,84,.35);
    color:#8be0b7;
}
.pill.bad{
    background:rgba(220,53,69,.12);
    border-color:rgba(220,53,69,.35);
    color:#f3a5a8;
}
.pill.pill-soft{
    background:#0e1626;
    color:#a9b7d7;
}
@media (max-width: 576px){
  .match-topline{ gap:6px; }
  .stat-pills{ gap:6px; }
  .pill{ padding:3px 8px; font-size:.88rem; }
  .champ-badge{ --s:34px; }
}

.meter-sm{
    --val: 0; --max: 1;
    width: 100%; height: 8px;
    background: #121a2a;
    border:1px solid rgba(255,255,255,.08);
    border-radius: 999px; overflow: hidden;
}
.meter-sm > span{
    display:block; height:100%;
    width: calc(100% * (var(--val) / max(var(--max), 1)));
    background: linear-gradient(90deg, #0dcaf0, #0d6efd);
}
.meter-sm--tank > span{
    background: linear-gradient(90deg, #ff8a80, #dc3545);
}
.champ-badge{
    --s: 40px;
    position: relative;
    display: inline-block;
    width: var(--s);
    height: var(--s);
}
.champ-badge > img{
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.champ-badge .lvl{
    position: absolute;
    right: -6px;
    bottom: -6px;
    min-width: calc(var(--s) / 2.4);
    height:    calc(var(--s) / 2.4);
    padding: 0 4px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #212631, #141a20);
    color: #fff;
    font-weight: 700;
    font-size: calc(var(--s) / 3.1);
    line-height: 1;
    border: 2px solid #0f1523;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,.45);
    z-index: 3;
    pointer-events: none;
}
.match-detail .match-scroll{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
.match-detail .match-scroll table{
    min-width: 1024px;
}
.table-score th, .table-score td { white-space: nowrap; }
.table-score td:first-child { white-space: normal; overflow: visible !important; }
.table-score td:first-child { overflow: visible !important; }

.match-stack { display: flex; flex-direction: column; gap: 12px; }
.match-tag{
    background: #151c2b;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,.06);
}
.match-tag.match-win { box-shadow: inset 3px 0 0 0 rgba(40,167,69,.7); }
.match-tag.match-loss{ box-shadow: inset 3px 0 0 0 rgba(220,53,69,.7); }

.match-head{ background: transparent; border: 0; padding: 0; text-align: left; }
.match-head:focus{ outline: none; }

.mates-row { display:flex; gap:6px; flex-wrap: wrap; }
.mate-pill{
    display:inline-flex; align-items:center; gap:6px;
    background:#0f1523; border:1px solid rgba(255,255,255,.06);
    border-radius: 999px; padding:2px 8px;
    font-size: .8rem; color:#cfd8ea;
}
.mate-pill img{ width:16px;height:16px;border-radius:50%; }

.items-row{ display:flex; gap:6px; flex-wrap: wrap; }
.items-row img{ width:24px;height:24px;border-radius:6px; }
.items-row .slot{ width:24px;height:24px;border-radius:6px;background:#1a2237; }

.match-detail{ background:#0f1523; border:1px solid rgba(255,255,255,.06); border-radius:10px; }

.table-score{ width:100%; border-collapse:separate; border-spacing:0 6px; }
.table-score th{ font-weight:600; color:#cfd8ea; }
.table-score td, .table-score th{ padding:6px 8px; font-size:.9rem; }
.row-blue { background: rgba(0,123,255,.06); }
.row-red  { background: rgba(220,53,69,.06); }

@media (max-width: 576px){
  .items-row img, .items-row .slot { width:22px; height:22px; }
}

/* ---------- Espace progression LP ------------- */

:root{
  --qt-bg: rgba(10,16,30,.7);
  --qt-border: rgba(80,150,255,.25);
  --qt-thumb-from: #0f2540;  /* bleu */
  --qt-thumb-to:   #08468c;  /* cyan */
  --qt-text: #cfe3ff;
  --qt-text-dim: #3c4e70;
}
.queue-toggle{
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 150px;
    padding: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgb(19, 25, 32), rgba(12,18,32,.8));
    border: 1px solid rgb(19, 25, 31);
    box-shadow: 0 6px 22px rgb(19, 25, 32), inset 0 1px 0 rgb(33, 38, 49);
    backdrop-filter: blur(6px);
}
.queue-toggle .qt-thumb{
    position: absolute;
    z-index: 0;
    top: 5px;
    left: 5px;
    width: calc(47% - 0px);
    height: calc(100% - 8px);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--qt-thumb-from), var(--qt-thumb-to));
    box-shadow: 0 8px 20px rgb(19, 25, 31), inset 0 1px 0 rgba(255,255,255,.2);
    transition: transform .22s cubic-bezier(.2,.8,.2,1);
    will-change: transform;
}
.queue-toggle[data-q="flex"] .qt-thumb{
    transform: translateX(100%);
}
.queue-toggle .qt-option{
    position: relative;
    z-index: 1;
    appearance: none;
    background: transparent;
    border: 0;
    padding: .45rem 0;
    border-radius: 999px;
    color: var(--qt-text-dim);
    font-weight: 600;
    letter-spacing: .2px;
}
.queue-toggle .qt-option[aria-selected="true"]{
    color: #fff;
    text-shadow: 0 0 16px rgba(160,220,255,.5);
}
.queue-toggle .qt-option:focus-visible{
    outline: 0;
    box-shadow: 0 0 0 2px rgba(60,130,255,.5);
    border-radius: 999px;
}
@media (prefers-reduced-motion: reduce){
    .queue-toggle .qt-thumb{ transition: none; }
}

/* ---------- Tank bar ------------ */
.meter-wrap {
    max-width: 100%;
    flex: 0 0 auto;
    margin-left: 16px;
}
.meter{
    position: relative;
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
}
.meter-fill{
    position:absolute; inset:0 auto 0 0;
    width: calc(100% * var(--scale, 1));            /* var(--scale) = 0..1 */
    background: linear-gradient(90deg, #1e6fff, #00b2ff);
    transition: width .25s ease;
}
.meter-seg{ position:absolute; top:0; bottom:0; z-index:1; transition: width .25s ease; }
.meter-mit{
    left:0;
    width: calc(100% * var(--scale, 1) * (var(--mit, 50) / 100));
    background: linear-gradient(90deg, #26a0ff, #6ad0ff);
}
.meter-tak{
    left: calc(100% * var(--scale, 1) * (var(--mit, 50) / 100));
    width: calc(100% * var(--scale, 1) * (1 - (var(--mit, 50) / 100)));
    background: linear-gradient(90deg, #ff5f6d, #ffc371);
}
.meter-foot{
    display:flex; 
    justify-content:space-between;
    gap:.5rem;
    margin-top:.105rem;
    color: var(--bs-secondary-color, #9aa3b2);
    font-style: italic;
    font-size: .75rem;
    letter-spacing: 0.5px;
}

/* ---------- Champ list ---------- */
.champ-strip{
    background: linear-gradient(180deg, var(--c-panel), #11161c);
    border: 1px solid rgba(0,0,0,.35);
    border-radius: 16px;
}
.champ-track{
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}
.champ-track::-webkit-scrollbar{ height: 8px; }
.champ-track::-webkit-scrollbar-thumb{
    background: rgba(0,119,255,.35);
    border-radius: 8px;
}
.champ-track-inner{ 
    width: max-content;
    gap: 0.7rem;
    margin-top: 5px;
}
.champ-item{
    min-width: 80px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(0,119,255,.14);
    border-radius: 14px;
    padding: .6rem .65rem;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.champ-item:hover{
    transform: translateY(-2px);
    border-color: rgba(0,119,255,.28);
    box-shadow: 0 8px 22px rgba(0,0,0,.25);
}

.champ-icon{
    width: 90px; height: 90px;  /* 80 -> 64 pour caser plus serré */
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(0,119,255,.18);
}

.champ-meta .champ-name,
.champ-name{ color: var(--c-fg); line-height:1.15; max-width: 100px; }
.champ-sub{ color: var(--c-muted); }

.pill{
    width: 90px;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .76rem;
    white-space: nowrap;
}
.pill-blue{
    color:#e8f3ff;
    background: linear-gradient(180deg, rgba(0,119,255,.25), rgba(0,119,255,.12));
    border: 1px solid rgba(120,175,255,.26);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 0 2px rgba(0,119,255,.08);
}
.pill-glass{
    color: var(--c-fg);
    background: linear-gradient(180deg, rgba(12,25,35,.35), rgba(12,25,35,.15));
    border: 1px solid rgba(120,175,255,.16);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pill-rank{display:inline-flex;align-items:center;gap:.5rem;padding:.25rem .6rem}
.pill-rank .rank-mini{width:18px;height:18px;object-fit:contain;filter:drop-shadow(0 0 2px rgba(0,0,0,.5))}

/* ---------- Rank badge ---------- */
.rank-badge {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;   /* ajuste taille du chiffre */
    color: var(--c-muted, #9fb0bf);
}

.rank-badge i {
    font-size: 1.1rem;   /* taille uniforme de l’icône */
    line-height: 1;
}

.trophy-gold {
    background: linear-gradient(180deg,#ffd700,#d4af37);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.trophy-silver {
    background: linear-gradient(180deg,#c0c0c0,#8d9093);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.trophy-bronze {
    background: linear-gradient(180deg,#cd7f32,#8a4f24);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---------- Card panel ---------- */
.leaderboard-card {
    background: linear-gradient(180deg, var(--c-panel), #13191f);
    border: 1px solid rgba(0,0,0,.35);
    border-radius: 10px;
    padding-bottom: 10px;
    height: 100%;
}

.lb-title {
    position: relative;
    display: inline-block;
    letter-spacing: .18em;
    text-transform: uppercase;
    font-weight: 700;
    font-size: .9rem;
    color: var(--c-fg);
    opacity: .95;
}

.lb-title::after{
    content:"";
    position:absolute;
    left:0; right:0; bottom:-10px;
    height:3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--c-blue-2), transparent);
    box-shadow: 0 0 18px rgba(0,119,255,.45);
}

@media (max-width: 576px){
    .lb-title::after{ opacity:.8; }
}

/* ---------- Badge moderne ---------- */
.lv-badge{
    --bg: 12, 25, 35;         /* base glass bg (rgb) */
    --glow: 0, 119, 255;      /* glow bleu */
    display:inline-flex; align-items:center; gap:.35rem;
    padding:.22rem .5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .78rem;
    color: var(--c-fg);
    background: linear-gradient(
        180deg,
        rgba(var(--bg), .35),
        rgba(var(--bg), .15)
    );
    border: 1px solid rgba(120, 175, 255, .18);
    backdrop-filter: blur(6px);
    white-space: nowrap;
    -webkit-backdrop-filter: blur(6px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 0 0 2px rgba(0,119,255,.08),
        0 6px 16px rgba(var(--glow), .16);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.lv-badge:hover{
    transform: translateY(-1px);
    border-color: rgba(120,175,255,.28);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 0 0 2px rgba(0,119,255,.16),
        0 10px 24px rgba(var(--glow), .22);
}
.lv-dot{
    width:.55rem; height:.55rem; border-radius:50%;
    background: radial-gradient(circle at 30% 30%, var(--c-blue-1), var(--c-blue-3));
    box-shadow: 0 0 8px rgba(0,119,255,.55);
}

/* ---------- Navbar ---------- */
.nav-wrap {
    background: #121c28;;
    border-bottom: 1px solid #2b313a;
}
.navbar-brand {
    margin-left: 15px;
    font-weight: 700;
    letter-spacing: .2px;
}
.main-nav .nav-link {
    text-transform: uppercase;
    font-size: .85rem;
    letter-spacing: .6px;
    color: #cfd8dc;
    padding: .75rem .9rem;
    position: relative;
}
.main-nav .nav-link:hover, .main-nav .nav-link.active {
    color: #fff;
}
.main-nav .nav-link.active::after {
    content: "";
    position: absolute;
    left: .6rem;
    right: .6rem;
    bottom: 0;
    height: 3px;
    background: #026de7;
    border-radius: 2px 2px 0 0;
}

/* ------------ Media Queries -------------- */
@media (min-width: 1px) {
    .hidden_if_less_than_320 {
        display: none;
    }

    .meter-wrap {
        width: 90px;
    }
}

@media (min-width: 320px) {
    .meter-wrap {
        width: 90px;
    }
}

@media (min-width: 400px) {
    .hidden_if_less_than_320 {
        display: block;
    }

    .meter-wrap {
        width: 130px;
    }
}

@media (min-width: 480px) {
    .meter-wrap {
        width: 160px;
    }
}

@media (min-width: 576px) {
    .meter-wrap {
        width: 200px;
    }
}

@media (min-width: 768px) {
    .meter-wrap {
        width: 350px;
    }
}

@media (min-width: 992px) {
    .meter-wrap {
        width: 200px;
    }
}

@media (min-width: 1200px) {
    .meter-wrap {
        width: 250px;
    }
}

@media (min-width: 1400px) {
    .meter-wrap {
        width: 350px;
    }
}