/* =========================================================
   LEADERBOARD TOURNAMENT REMI (FULL)
   - Layout fluid & responsive (%, aspect-ratio, clamp)
   - Asset gambar dipanggil dari public/remi/images/
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Poppins", sans-serif;
}

.leaderboard-page {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: clamp(16px, 4vw, 24px) clamp(12px, 4vw, 20px)
        clamp(20px, 5vw, 32px);
    color: #ffffff;
    background-image: url("../remi/images/bg-leaderboard.jpg");
    background-size: cover;
    background-position: center;
    background-color: #150a2e;
}

/* ========================= HEADER ========================= */

.leaderboard-header {
    position: relative;
    width: 100%;
    aspect-ratio: 1000 / 380;
    margin-bottom: clamp(-58px, -12vw, -7px);
}

.header-chip {
    position: absolute;
    top: 0;
    width: 17%;
    aspect-ratio: 1 / 1;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 2;
}

.header-chip--left {
    left: -2%;
    background-image: url("../remi/images/chip-spade-purple.png");
}

.header-chip--right {
    right: -5%;
    background-image: url("../remi/images/chip-heart-red.png");
}

.header-logo {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 70%;
    margin: 0 auto;
    background-image: url("../remi/images/header-logo.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: top center;
}

/* ========================= PODIUM ========================= */

.podium-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    grid-auto-flow: column;
    gap: clamp(0px, 1vw, 0px);
    /* margin-bottom: clamp(20px, 6vw, 28px); */
}

/* Menghilangkan pemicu pembungkus agar badge & name langsung diatur grid utama */
.podium-player {
    display: contents;
}

.podium-badge {
    width: 78%;
    aspect-ratio: 108 / 132;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    justify-self: center;
    align-self: end; /* BADGE TETAP RATA BAWAH */
}

.podium-player--rank-1 .podium-badge {
    width: 96%;
    aspect-ratio: 150 / 180;
    background-image: url("../remi/images/badge-champion.png");
    z-index: 2;
}

.podium-player--rank-2 .podium-badge {
    background-image: url("../remi/images/badge-2nd-place.png");
}

.podium-player--rank-3 .podium-badge {
    background-image: url("../remi/images/badge-3rd-place.png");
}

.podium-player--rank-4 .podium-badge {
    background-image: url("../remi/images/badge-4th-place.png");
}

.player-name {
    justify-self: center;
    align-self: start;
    font-size: clamp(15px, 3vw, 14px);
    font-weight: 700;
    text-align: center;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===================== TOP PLAYERS LIST ===================== */

.top-players-section {
    position: relative;
    border-radius: 18px;
    padding: clamp(12px, 3.5vw, 16px) clamp(10px, 3vw, 14px)
        clamp(16px, 4vw, 20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(10, 4, 30, 0.55);
}

.top-players-list {
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 1.5vw, 4px);
}
/* ===================== TOP PLAYERS LIST ===================== */

.top-player-row {
    display: flex;
    border-radius: 12px;
    border: 1px solid rgb(84 0 255 / 38%);
    background: rgb(12 16 199 / 14%);
    overflow: hidden;
    padding: 2px;
}

/* Sisi Kiri: Pembungkus Medali */
.rank-medal-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-right: 10px;
}

.rank-medal-icon {
    width: clamp(36px, 16vw, 45px);
    aspect-ratio: 1 / 1;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    font-size: clamp(25px, 5vw, 23px);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 3px 5px 4px rgb(0, 0, 0);
}

.top-player-row--rank-1 .rank-medal-icon {
    background-image: url("../remi/images/medal-gold.png");
}
.top-player-row--rank-2 .rank-medal-icon {
    background-image: url("../remi/images/medal-silver.png");
}
.top-player-row--rank-3 .rank-medal-icon {
    background-image: url("../remi/images/medal-bronze.png");
}
.top-player-row--rank-4 .rank-medal-icon {
    background-image: url("../remi/images/medal-green.png");
}

/* Sisi Kanan: Pembungkus Konten Utama */
.top-player-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* Baris Atas Kanan: Nama, Skor & Chip */
.top-player-info {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 12px);
    padding: clamp(2px, -0.2vw, 4px) clamp(2px, 0.5vw, 14px);
}

.top-player-name {
    flex: 1;
    min-width: 0;
    font-size: clamp(17px, 3vw, 15px);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-player-score {
    font-size: clamp(15px, 3vw, 14px);
    font-weight: 700;
    white-space: nowrap;
}

.rank-chip-icon {
    width: clamp(20px, 5.5vw, 28px);
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
}

.top-player-row--rank-1 .rank-chip-icon {
    background-image: url("../remi/images/chip-crown.png");
}
.top-player-row--rank-2 .rank-chip-icon {
    background-image: url("../remi/images/chip-club.png");
}
.top-player-row--rank-3 .rank-chip-icon {
    background-image: url("../remi/images/chip-heart-small.png");
}
.top-player-row--rank-4 .rank-chip-icon {
    background-image: url("../remi/images/chip-diamond.png");
}

/* Baris Bawah Kanan: Statistik Detail */
.top-player-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 2.5vw, 16px);
    padding: 0px 13px clamp(6px, 1.8vw, 8px) 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-col {
    display: grid;
    grid-template-columns: max-content max-content; /* Kedua kolom hanya selebar konten aslinya */
    column-gap: clamp(6px, 1.5vw, 10px);
    row-gap: clamp(2px, 0.8vw, 4px);
    align-items: center;
    justify-content: start; /* Merapatkan seluruh elemen grid ke sisi kiri */
}

.stat-item {
    display: contents;
}

.stat-label {
    color: #d1d1d1;
    font-size: clamp(14px, 2.5vw, 13px);
    line-height: 1.2;
}

.stat-value {
    color: #ffffff;
    font-size: clamp(14px, 2.5vw, 13px);
    line-height: 1.2;
    text-align: left;
}

/* ========================= FOOTER ========================= */

.footer-cards-chips {
    width: 100%;
    aspect-ratio: 1080 / 200;
    margin-top: clamp(-87px, 5vw, -87px);
    background-image: url("../remi/images/footer-cards-chips.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

/* ===================== PODIUM FOOTER / MATCH INFO ===================== */

.podium-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    margin: clamp(3px, 3vw, 3px) 0 clamp(4px, 2.5vw, 5px);
}

.match-info {
    text-align: center;
    font-size: clamp(15px, 2.8vw, 14px);
    font-weight: 600;
    color: #ffd700;
    margin-bottom: clamp(-5px, 0vw, 12px);
}
