/* TỔNG THỂ */
.stc-ranking-wrapper {
    background: #fff;
    padding: 40px;
    font-family: 'Montserrat', sans-serif;
    color: #333;
    max-width: 1300px;
    margin: 0 auto;
}

.stc-flex-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    /* Khoảng cách giữa 2 cột, có thể chỉnh lại thành 0 nếu muốn khít 50/50 */
    flex-wrap: nowrap;
    /* Ép 2 cột luôn nằm ngang trên desktop */
}

/* CỘT TRÁI: PODIUM (ABSOLUTE LAYOUT) */
.stc-left-column {
    flex: 1;
    /* Chia tỉ lệ 1:1 */
    width: 50%;
    /* Cố định chiều rộng 50% */
    position: relative;
    height: 580px;
    /* Giữ nguyên các thuộc tính absolute cho rank 1, 2, 3 bên trong */
}

.stc-podium-item {
    position: absolute;
    text-align: center;
    transition: all 0.3s ease;
}

/* Vị trí cụ thể từng Rank */
.stc-podium-item.rank-1 {
    left: 50%;
    top: -40px;
    transform: translateX(-40%);
    z-index: 10;
}

.rank-2 {
    left: 0;
    top: 220px;
    z-index: 5;
}

.rank-3 {
    right: 0;
    top: 270px;
    z-index: 5;
}

/* Số lớn phía sau */
.stc-num-bg {
    position: absolute;
    font-size: 160px;
    font-weight: 900;
    line-height: 0.8;
    z-index: 1;
    pointer-events: none;
}

.rank-1 .stc-num-bg {
    top: -60px;
    right: -20px;
    background: #FFD700;
    /* Màu vàng đặc */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1;
    /* Đảm bảo không bị mờ */
}

/* Màu Bạc Silver cho Rank 2 */
.rank-2 .stc-num-bg {
    top: -80px;
    left: -20px;
    background: #C0C0C0;
    /* Màu bạc đặc */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1;
}

/* Màu Đồng Bronze cho Rank 3 */
.rank-3 .stc-num-bg {
    bottom: 60px;
    left: -70px;
    background: #CD7F32;
    /* Màu đồng đặc */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1;
}

.stc-podium-item>img {
    width: 200px;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1;
    position: absolute;
    z-index: 0;
}

.stc-podium-item.rank-1>img {
    top: -25px;
    right: -55px;
}

.stc-podium-item.rank-2>img {
    top: -60px;
    left: -70px;
}

.stc-podium-item.rank-3>img {
    bottom: 20px;
    left: -70px;
}

/* Avatar Box */
.stc-avatar-box {
    position: relative;
    z-index: 2;
    margin: 0 auto;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stc-avatar-box img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.rank-1 .stc-avatar-box {
    width: 260px;
    height: 260px;
    /* border: 10px solid #FFD700; */
}

.rank-2 .stc-avatar-box {
    width: 230px;
    height: 230px;
    /* border: 8px solid #C0C0C0; */
}

.rank-3 .stc-avatar-box {
    width: 180px;
    height: 180px;
    /* border: 6px solid #CD7F32; */
}

/* Vương miện */
.stc-crown-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    background-size: contain;
    background-repeat: no-repeat;
}

.rank-1 .stc-crown-icon {
    top: -44px;
    left: 56%;
    width: 100px;
    height: 70px;
    background-image: url('https://cdn-icons-png.flaticon.com/512/1319/1319983.png');
}

.rank-2 .stc-crown-icon {
    top: -34px;
    left: 55%;
    width: 75px;
    height: 55px;
    background-image: url('https://cdn-icons-png.flaticon.com/512/1319/1319983.png');
    filter: grayscale(1) brightness(1.1);
}

.rank-3 .stc-crown-icon {
    top: -28px;
    left: 57%;
    width: 65px;
    height: 45px;
    background-image: url('https://cdn-icons-png.flaticon.com/512/1319/1319983.png');
    filter: sepia(1) saturate(5) hue-rotate(-30deg);
}

.stc-meta {
    /* margin-top: 15px; */
    position: relative;
    z-index: 4;
}

.stc-name {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 16px;
    color: #000;
}

.stc-sbd {
    font-weight: bold;
    font-size: 16px;
    color: #000;
}

/* CỘT PHẢI: HEADER & GRID */
.stc-right-column {
    flex: 1;
    /* Chia tỉ lệ 1:1 */
    width: 50%;
    /* Cố định chiều rộng 50% */
    min-width: unset;
    /* Bỏ min-width cũ để tránh bị đẩy xuống hàng */
}

.stc-header {
    text-align: left;
    margin-bottom: 40px
}

.stc-sub-title {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    /* letter-spacing: 1px; */
    text-align: center;
}

.stc-main-title {
    color: #036b52;
    font-size: 32px;
    font-weight: 800;
    margin: 5px 0 0;
    text-transform: uppercase;
    text-align: center;
}

.stc-others-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Giữ nguyên 3 cột như mẫu */
    gap: 20px;
}

.stc-grid-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.stc-grid-num {
    position: absolute;
    left: -10px;
    top: -15px;
    font-size: 95px;
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 1px #036b52;
    z-index: 1;
    font-family: sans-serif !important;
}

.stc-grid-thumb {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 2;
    border: 3px solid #eee;
    transition: 0.3s;
}

.stc-grid-thumb:hover {
    border-color: #036b52;
    transform: scale(1.05);
}

.stc-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stc-grid-info {
    text-align: center;
    margin-top: 10px;
    z-index: 2;
}

.stc-grid-name {
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    color: #000;
    overflow: hidden;
}

.stc-grid-sbd {
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

.stc-footer-action {
    text-align: center;
    margin-top: 25px;
}

.stc-btn-more {
    background: transparent;
    border: 2px solid #036b52;
    color: #036b52;
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: 0.3s;
    font-size: 16px;
    text-decoration: none;
}

.stc-btn-more:hover {
    background: #036b52;
    color: #fff;
    box-shadow: 0 5px 15px rgba(3, 107, 82, 0.3);
}


.stc-avatar-frame {
    position: relative;
    margin: 0 auto;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* Gán ảnh khung tương ứng (Bạn thay URL thật vào đây nhé) */
.frame-gold   { background-image: url('http://stalent.vn/wp-content/plugins/contest-ranking/assets/img/vuongmienvang.png'); width: 320px; height: 320px; }
.frame-silver { background-image: url('http://stalent.vn/wp-content/plugins/contest-ranking/assets/img/vuongmienbac.png'); width: 280px; height: 280px; }
.frame-bronze { background-image: url('http://stalent.vn/wp-content/plugins/contest-ranking/assets/img/vuongmiendong.png'); width: 240px; height: 240px; }

/* Ảnh avatar thí sinh nằm lọt lòng trong khung */
.stc-user-avatar {
    width: 75%;  /* Chỉnh tỷ lệ này để ảnh nằm vừa khít vòng tròn trong khung */
    height: 75%;
    border-radius: 50% !important;
    object-fit: cover;
    margin-top: 10%;
}

.stc-avatar-frame.frame-gold .stc-user-avatar {
    width: 75%;
    height: 75%;
}

.stc-avatar-frame.frame-silver .stc-user-avatar {
    width: 80%;
    height: 80%;
}

.stc-avatar-frame.frame-bronze .stc-user-avatar {
    width: 60%;
    height: 60%;
    margin-top: 7%;
}

/* Ảnh số hạng 1, 2, 3 */
.stc-num-img {
    position: absolute;
    z-index: 10;
    width: 80px;
}
.rank-1 .stc-num-img { top: 20px; right: 0; }
.rank-2 .stc-num-img { top: 40px; left: -10px; }
.rank-3 .stc-num-img { bottom: 60px; left: -10px; }

@media (max-width: 1024px) {

    .stc-left-column,
    .stc-right-column {
        width: 100%;
        flex: none;
    }

    .stc-left-column {
        height: 500px;
        /* Thu nhỏ chiều cao trên mobile */
    }
}

/* MOBILE RESPONSIVE */
@media (max-width: 1100px) {
    .stc-flex-layout {
        flex-direction: column;
        align-items: center;
    }

    .stc-left-column {
        width: 100%;
        max-width: 600px;
        height: 500px;
        margin-bottom: 40px;
    }

    .rank-1 .stc-avatar-box {
        width: 240px;
        height: 240px;
    }

    .rank-2 .stc-avatar-box {
        width: 180px;
        height: 180px;
    }

    .rank-3 .stc-avatar-box {
        width: 160px;
        height: 160px;
    }

    .rank-2 {
        top: 100px;
    }

    .rank-3 {
        top: 160px;
    }
}


/* 1. Thẻ chứa avatar: Phải để visible */
.stc-avatar-box {
    position: relative;
    z-index: 10;
    margin: 0 auto;
    border-radius: 50%;
    background: #fff;
    overflow: visible !important; /* Cho phép vương miện lòi ra ngoài */
}

/* 2. Thẻ vương miện: Phải có z-index cao nhất */
.stc-crown-icon {
    position: absolute;
    z-index: 999 !important; /* Đảm bảo nằm trên ảnh */
    pointer-events: none;
}

/* 3. Thẻ ảnh: Đây mới là chỗ cần cắt tròn */
.stc-avatar-box img {
    width: 100%;
    height: 100%;
    border-radius: 50% !important; /* Bo tròn ảnh ở đây */
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 5; /* Thấp hơn vương miện */
}