/* ============================================================================
   BreakersDojo — Page Classement (ranking)
   Design system partagé : tokens --bd-* (breakersdojo.css)
   Thème sombre (défaut) + thème clair (html[data-theme="light"])
   ========================================================================== */

/* ============================================================== HERO == */
.bd-rank-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 44px 40px 40px;
    margin-bottom: 26px;
    background:
        radial-gradient(90% 140% at 0% 0%, rgba(255, 46, 62, 0.18), transparent 55%),
        radial-gradient(90% 140% at 100% 100%, rgba(33, 89, 255, 0.16), transparent 55%),
        var(--bd-bg-2);
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-lg);
    overflow: hidden;
}

.bd-rank-hero-text {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.bd-rank-hero-title {
    margin: 0;
    font-size: clamp(2.5rem, 6vw, 3.8rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
}

.bd-rank-hero-sub {
    margin: 10px 0 0;
    font-size: clamp(1.02rem, 2.4vw, 1.35rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: linear-gradient(90deg, var(--bd-accent), var(--bd-flame-1));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.bd-rank-hero-desc {
    margin: 14px 0 0;
    color: var(--bd-text-muted);
    line-height: 1.6;
    font-size: 1.02rem;
}

.bd-rank-hero-mark {
    position: relative;
    z-index: 0;
    flex: 0 0 auto;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 66px;
    color: rgba(255, 255, 255, 0.06);
    -webkit-user-select: none;
    user-select: none;
}

html[data-theme="light"] .bd-rank-hero-mark {
    color: rgba(20, 20, 30, 0.06);
}

/* ========================================================== RESPONSIVE == */
@media (max-width: 640px) {
    .bd-rank-hero {
        padding: 34px 24px;
    }

    .bd-rank-hero-mark {
        display: none;
    }
}

/* ============================================================== PODIUM ==
   2e | 1er | 3e — le 1er est surélevé, chaque carte porte la couleur de
   sa médaille (or / argent / bronze).                                 */
.bd-podium {
    display: grid;
    grid-template-columns: 1fr 1.12fr 1fr;
    align-items: end;
    gap: 16px;
    margin: 8px 0 32px;
}

.bd-podium__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 26px 18px 22px;
    text-align: center;
    background: var(--bd-bg-3);
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-lg);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bd-podium__card:hover {
    transform: translateY(-4px);
    box-shadow: var(--bd-shadow);
}

.bd-podium__card--1 {
    padding: 44px 18px 30px;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(216, 162, 74, 0.30), transparent 60%),
        var(--bd-bg-3);
    border-color: rgba(216, 162, 74, 0.55);
    box-shadow: 0 18px 44px rgba(216, 162, 74, 0.16);
}

.bd-podium__card--2 {
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(196, 202, 214, 0.22), transparent 60%),
        var(--bd-bg-3);
    border-color: rgba(196, 202, 214, 0.45);
}

.bd-podium__card--3 {
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(201, 138, 94, 0.22), transparent 60%),
        var(--bd-bg-3);
    border-color: rgba(201, 138, 94, 0.45);
}

.bd-podium__crown {
    position: absolute;
    top: 12px;
    font-size: 24px;
    color: var(--bd-gold);
    text-shadow: 0 2px 16px rgba(216, 162, 74, 0.65);
}

.bd-podium__rank {
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    color: var(--bd-text-muted);
    opacity: 0.6;
}

.bd-podium__card--1 .bd-podium__rank {
    color: var(--bd-gold);
    opacity: 1;
}

.bd-podium__card--2 .bd-podium__rank {
    color: #c4cad6;
    opacity: 1;
}

.bd-podium__card--3 .bd-podium__rank {
    color: #c98a5e;
    opacity: 1;
}

.bd-podium__avatar {
    margin: 0;
}

.bd-podium__avatar img {
    width: 84px;
    height: 84px;
    object-fit: cover;
    background: var(--bd-bg);
    border: 3px solid var(--bd-border-strong);
}

.bd-podium__card--1 .bd-podium__avatar img {
    width: 104px;
    height: 104px;
    border-color: var(--bd-gold);
}

.bd-podium__card--2 .bd-podium__avatar img {
    border-color: #c4cad6;
}

.bd-podium__card--3 .bd-podium__avatar img {
    border-color: #c98a5e;
}

.bd-podium__pseudo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 0;
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--bd-text);
}

.bd-podium__pseudo img {
    width: auto;
    height: 18px;
}

.bd-podium__points {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.bd-podium__score {
    font-weight: 800;
    color: var(--bd-text);
}

.bd-podium__trophies {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-height: 26px;
    align-items: center;
}

/* Actions modérateur sous les cartes du podium (mêmes liens que le tableau). */
.bd-podium__actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.85rem;
}

/* ============================================================ TROPHÉS == */

.bd-trophy {
    height: 24px;
    width: auto;
}

/* Rangée de trophées : toujours sur une seule ligne (pas de retours à la
   ligne dans les cellules du tableau ni sur le podium). */
.bd-trophy-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Un métal = un trophée posé sur son socle numéroté (empilement vertical centré). */
.bd-trophy-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

/* Le trophée passe devant le haut du socle : il donne l'impression de reposer dessus. */
.bd-trophy-item .bd-trophy {
    position: relative;
    z-index: 1;
}

/* Socle : petite dalle teintée du métal, plus large que haute, biseau clair en
   haut / arête sombre en bas (relief), chiffre sombre lisible dans les deux thèmes. */
.bd-trophy-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    margin-top: -3px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: 0.01em;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -2px 0 rgba(0, 0, 0, 0.18),
        0 1px 2px rgba(0, 0, 0, 0.3);
}

.bd-trophy-count--gold {
    color: #4a3208;
    background: linear-gradient(180deg, #f6cf6b, #d8a24a);
}

.bd-trophy-count--silver {
    color: #2c313b;
    background: linear-gradient(180deg, #eef1f6, #bcc3d0);
}

.bd-trophy-count--bronze {
    color: #40220e;
    background: linear-gradient(180deg, #e7ab7c, #c98a5e);
}

/* ============================================================= DÉLTA ==
   Progression / régression de position vs le classement précédent.   */
.bd-delta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border: 1px solid var(--bd-border);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.bd-delta i {
    font-size: 0.9em;
}

.bd-delta--up {
    color: #3ddc84;
    background: rgba(61, 220, 132, 0.12);
    border-color: rgba(61, 220, 132, 0.38);
}

.bd-delta--down {
    color: #ff5d6c;
    background: rgba(255, 93, 108, 0.12);
    border-color: rgba(255, 93, 108, 0.38);
}

.bd-delta--same {
    color: var(--bd-text-muted);
    background: rgba(255, 255, 255, 0.05);
}

.bd-delta--new {
    color: var(--bd-flame-2);
    background: rgba(255, 194, 28, 0.12);
    border-color: rgba(255, 194, 28, 0.38);
}

.bd-delta--none {
    color: var(--bd-text-muted);
    border-color: transparent;
    background: transparent;
    padding-left: 0;
}

/* ============================================================ ACTIONS == */
.bd-rank-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

/* ============================================================= LISTES == */
.bd-rank-list {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--bd-border);
}

.bd-rank-list-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--bd-text);
}

.bd-rank-list-title i {
    color: var(--bd-accent);
}

.bd-rank-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bd-rank-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--bd-border);
    border-radius: 999px;
    background: var(--bd-bg-3);
    color: var(--bd-text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.bd-rank-links a:hover {
    transform: translateY(-2px);
    border-color: var(--bd-accent);
    background: var(--bd-bg-2);
    color: var(--bd-accent);
}

.bd-rank-links a i {
    font-size: 0.85em;
    color: var(--bd-text-muted);
}

.bd-rank-links a:hover i {
    color: var(--bd-accent);
}

/* ============================================================ TABLE == */
.bd-ranking-table .bd-rankcell {
    font-weight: 800;
}

/* Conteneur de défilement horizontal des tableaux plus larges que l'écran.
   Redéfini ici (aussi dans tailwind.css) pour que la page soit autonome. */
.bd-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; }

/* Mobile : le tableau est plus large que l'écran (trophées sur une ligne,
   colonne Actions). Il défile horizontalement dans son conteneur
   .bd-table-scroll ; on resserre padding et avatars pour limiter la
   largeur nécessaire. */
@media (max-width: 640px) {
    .bd-ranking-table th,
    .bd-ranking-table td {
        padding: 7px 8px;
    }

    .bd-ranking-table .bd-avatar {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .bd-ranking-table td a {
        white-space: nowrap;
    }
}

/* ============================================================== ONGLETS == */
.bd-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--bd-border);
}

.bd-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    margin-bottom: -1px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--bd-text-muted);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.bd-tab:hover {
    color: var(--bd-text);
}

.bd-tab.is-active {
    color: var(--bd-accent);
    border-bottom-color: var(--bd-accent);
}

/* ============================================================ ARBRE (BRACKET) == */
.bd-bracket-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.bd-bracket-head .bd-rank-list-title {
    margin: 0;
}

.bd-bracket-head a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--bd-border);
    border-radius: 999px;
    background: var(--bd-bg-3);
    color: var(--bd-text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.bd-bracket-head a:hover {
    transform: translateY(-2px);
    border-color: var(--bd-accent);
    background: var(--bd-bg-2);
    color: var(--bd-accent);
}

.bd-bracket-frame {
    display: block;
    width: 100%;
    height: 640px;
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-lg);
    background: transparent;
}

/* ========================================================== RESPONSIVE == */
@media (max-width: 760px) {
    .bd-podium {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .bd-podium__card--1 {
        order: -1;
        padding: 34px 18px 26px;
    }

    .bd-podium__card--1 .bd-podium__avatar img {
        width: 92px;
        height: 92px;
    }

    .bd-podium__card:hover {
        transform: none;
    }

    .bd-bracket-frame {
        height: 480px;
    }
}

/* ==================================================== RESULTATS TOURNOI == */
.bd-results-note {
    color: var(--bd-text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.bd-result-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-lg, 10px);
    margin-bottom: 10px;
}

.bd-result-row > div {
    flex: 1 1 240px;
    min-width: 0;
}

.bd-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid var(--bd-border);
    color: var(--bd-text-muted);
}

.bd-badge--done {
    border-color: var(--bd-accent);
    color: var(--bd-accent);
}

/* ============================================================== PRONOSTICS == */
.bd-rank-messages {
    margin-bottom: 18px;
}

.bd-pred {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.bd-pred-wallet {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 16px 20px;
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-lg, 14px);
    background: linear-gradient(135deg, rgba(255, 196, 0, 0.1), transparent);
}

.bd-pred-wallet__label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--bd-text-muted);
}

.bd-pred-wallet__value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--bd-font);
    font-size: 1.5rem;
    font-weight: 900;
    color: #fbbf24;
}

.bd-pred-wallet__hint {
    flex-basis: 100%;
    font-size: 0.82rem;
    color: var(--bd-text-muted);
}

@media (min-width: 640px) {
    .bd-pred-wallet__hint {
        flex-basis: auto;
        margin-left: auto;
        text-align: right;
    }
}

.bd-pred-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.bd-pred-head .bd-rank-list-title {
    margin: 0;
}

.bd-pred-subtitle {
    font-family: var(--bd-font);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bd-text);
    margin: 0 0 12px;
}

.bd-pred-form,
.bd-pred-board {
    padding-top: 6px;
    border-top: 1px solid var(--bd-border);
}

.bd-pred-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.bd-pred-slot span {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--bd-text-muted);
    margin-bottom: 6px;
}

.bd-pred-slot select {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--bd-border);
    background: var(--bd-bg-3);
    color: var(--bd-text);
    font-size: 0.92rem;
    font-family: inherit;
}

.bd-pred-slot select:focus {
    outline: none;
    border-color: var(--bd-accent);
    box-shadow: 0 0 0 3px var(--bd-accent-soft);
}

.bd-pred-form__actions {
    display: flex;
    align-items: end;
}

.bd-pred-cote {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--bd-text-muted);
}

.bd-pred-cote strong {
    color: #fbbf24;
}

.bd-pred-record {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.bd-pred-record li {
    font-weight: 600;
    color: var(--bd-text);
}

.bd-pred-record span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--bd-text-muted);
}

.bd-pred-row--mine td {
    background: rgba(251, 191, 36, 0.12);
}

.bd-pred-positions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.bd-pred-position__title {
    font-family: var(--bd-font);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bd-text-muted);
    margin: 0 0 8px;
}

.bd-pred-position__title i {
    color: #fbbf24;
    margin-right: 6px;
}
