/* ═══════ Showcase ═══════ */

.top3-showcase {
    width: 100%;
    position: relative;
    margin-bottom: 20px;
}

/* ═══════ Cards Container (Podium) ═══════ */

.top3-cards {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    padding: 20px 0 0;
    position: relative;
    z-index: 1;
}

/* ═══════ Card Base ═══════ */

.top3-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px 14px;
    background-color: var(--card);
    backdrop-filter: blur(12px);
    border-radius: var(--br-16);
    border: 2px solid var(--transparent-10-w);
    position: relative;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: var(--text-default);
    animation: top3FadeIn 0.6s ease-out both;
}

.top3-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--br-16) var(--br-16) 0 0;
    z-index: 2;
}

.top3-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--br-16);
    pointer-events: none;
    z-index: 0;
}

.top3-card:hover {
    transform: translateY(-8px);
}

/* ═══════ #1 Gold ═══════ */

.top3-card--1 {
    border-color: var(--top-one);
    flex: 1.2;
    padding: 28px 18px 16px;
    order: 2;
    transform: translateY(-20px);
    box-shadow: 0 0 30px color-mix(in srgb, var(--top-one) 20%, transparent);
    animation-delay: 0s;
}

.top3-card--1::before {
    background: linear-gradient(90deg, var(--top-one), color-mix(in srgb, var(--top-one) 60%, #fff));
    height: 4px;
}

.top3-card--1::after {
    background: radial-gradient(ellipse at top, color-mix(in srgb, var(--top-one) 8%, transparent), transparent 70%);
}

.top3-card--1:hover {
    transform: translateY(-28px);
    box-shadow: 0 0 40px color-mix(in srgb, var(--top-one) 35%, transparent);
}

/* ═══════ #2 Silver ═══════ */

.top3-card--2 {
    border-color: color-mix(in srgb, var(--top-two) 50%, transparent);
    order: 1;
    animation-delay: 0.15s;
}

.top3-card--2::before {
    background: var(--top-two);
}

.top3-card--2::after {
    background: radial-gradient(ellipse at top, color-mix(in srgb, var(--top-two) 6%, transparent), transparent 70%);
}

.top3-card--2:hover {
    border-color: var(--top-two);
    box-shadow: 0 0 25px color-mix(in srgb, var(--top-two) 25%, transparent);
}

/* ═══════ #3 Bronze ═══════ */

.top3-card--3 {
    border-color: color-mix(in srgb, var(--top-three) 50%, transparent);
    order: 3;
    animation-delay: 0.15s;
}

.top3-card--3::before {
    background: var(--top-three);
}

.top3-card--3::after {
    background: radial-gradient(ellipse at top, color-mix(in srgb, var(--top-three) 6%, transparent), transparent 70%);
}

.top3-card--3:hover {
    border-color: var(--top-three);
    box-shadow: 0 0 25px color-mix(in srgb, var(--top-three) 25%, transparent);
}

/* ═══════ #4 & #5 Runners ═══════ */

.top3-card--4,
.top3-card--5 {
    flex: 0.85;
    padding: 16px 12px 12px;
    opacity: 0.85;
    border-color: var(--transparent-10-w);
    animation-delay: 0.25s;
}

.top3-card--4 {
    order: 0;
}

.top3-card--5 {
    order: 4;
}

.top3-card--4::before,
.top3-card--5::before {
    background: var(--transparent-10-w);
}

.top3-card--4::after,
.top3-card--5::after {
    background: none;
}

.top3-card--4:hover,
.top3-card--5:hover {
    opacity: 1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.top3-card--4 .top3-card__medal,
.top3-card--5 .top3-card__medal {
    background: var(--transparent-10-w);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.top3-card--4 .top3-card__avatar,
.top3-card--5 .top3-card__avatar {
    width: 48px;
    height: 48px;
    border: 1px solid var(--transparent-10-w);
    box-shadow: none;
}

.top3-card--4 .top3-card__exp-value,
.top3-card--5 .top3-card__exp-value {
    font-size: 0.95rem;
    color: var(--text-default);
}

.top3-card--4 .top3-card__privilege,
.top3-card--5 .top3-card__privilege {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
}

/* ═══════ Medal Badge ═══════ */

.top3-card__medal {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.top3-card__medal svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

.top3-card--1 .top3-card__medal {
    width: 32px;
    height: 32px;
    background: var(--top-one);
    box-shadow: 0 2px 12px color-mix(in srgb, var(--top-one) 50%, transparent);
}

.top3-card--1 .top3-card__medal svg {
    width: 16px;
    height: 16px;
}

.top3-card--2 .top3-card__medal {
    background: var(--top-two);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--top-two) 40%, transparent);
}

.top3-card--3 .top3-card__medal {
    background: var(--top-three);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--top-three) 40%, transparent);
}

/* ═══════ Crown (1st place only) ═══════ */

.top3-card__crown {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    animation: crownFloat 3s ease-in-out infinite;
}

.top3-card__crown svg {
    width: 24px;
    height: 24px;
    fill: var(--top-one);
}

@keyframes crownFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

/* ═══════ Avatar ═══════ */

.top3-card__avatar-wrap {
    position: relative;
    margin-bottom: 8px;
}

.top3-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--br-50);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.top3-card--1 .top3-card__avatar {
    width: 72px;
    height: 72px;
    border: 3px solid var(--top-one);
    box-shadow: 0 0 20px color-mix(in srgb, var(--top-one) 30%, transparent);
}

.top3-card--2 .top3-card__avatar {
    border: 2px solid var(--top-two);
    box-shadow: 0 0 12px color-mix(in srgb, var(--top-two) 20%, transparent);
}

.top3-card--3 .top3-card__avatar {
    border: 2px solid var(--top-three);
    box-shadow: 0 0 12px color-mix(in srgb, var(--top-three) 20%, transparent);
}

.top3-card:hover .top3-card__avatar {
    transform: scale(1.08);
}

.top3-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--br-50);
}

/* ═══════ Name ═══════ */

.top3-card__name {
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.top3-card--1 .top3-card__name {
    font-size: 0.95rem;
}

.top3-card--1:hover .top3-card__name { color: var(--top-one); }
.top3-card--2:hover .top3-card__name { color: var(--top-two); }
.top3-card--3:hover .top3-card__name { color: var(--top-three); }

/* ═══════ Rank Image ═══════ */

.top3-card__rank-img {
    height: 24px;
    width: auto;
    margin-bottom: 6px;
}

.top3-card--1 .top3-card__rank-img {
    height: 30px;
}

/* ═══════ EXP ═══════ */

.top3-card__exp {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4px;
}

.top3-card__exp-value {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.top3-card--1 .top3-card__exp-value {
    font-size: 1.25rem;
}

.top3-card--1 .top3-card__exp-value { color: var(--top-one); }
.top3-card--2 .top3-card__exp-value { color: var(--top-two); }
.top3-card--3 .top3-card__exp-value { color: var(--top-three); }

.top3-card__exp-label {
    font-size: 0.58rem;
    color: var(--text-custom);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ═══════ Meta Line ═══════ */

.top3-card__meta {
    font-size: 0.68rem;
    color: var(--text-custom);
    margin-bottom: 6px;
    white-space: nowrap;
}

.top3-card__meta-sep {
    margin: 0 4px;
    opacity: 0.4;
}

/* ═══════ Privilege Badge ═══════ */

.top3-card__privilege {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.top3-card--1 .top3-card__privilege {
    background: color-mix(in srgb, var(--top-one) 15%, transparent);
    color: var(--top-one);
}

.top3-card--2 .top3-card__privilege {
    background: color-mix(in srgb, var(--top-two) 15%, transparent);
    color: var(--top-two);
}

.top3-card--3 .top3-card__privilege {
    background: color-mix(in srgb, var(--top-three) 15%, transparent);
    color: var(--top-three);
}

/* ═══════ Profile Link ═══════ */

.top3-card__profile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 6px 0;
    border-radius: 8px;
    background-color: var(--transparent-5-w);
    color: var(--text-custom);
    font-size: 0.72rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    z-index: 1;
    margin-top: auto;
}

.top3-card__profile:hover {
    background-color: var(--transparent-10-w);
    color: var(--text-default);
}

.top3-card__profile svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* ═══════ Skeleton ═══════ */

.top3-card--skeleton {
    min-height: 220px;
    overflow: hidden;
    border: 1px solid var(--transparent-5-w);
}

.top3-card--1-skeleton {
    min-height: 260px;
    flex: 1.2;
    order: 2;
    transform: translateY(-20px);
}

.top3-card--skeleton::before,
.top3-card--skeleton::after {
    display: none;
}

/* ═══════ Empty ═══════ */

.top3-block__empty {
    width: 100%;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-custom);
    opacity: 0.5;
    font-size: 0.9rem;
}

/* ═══════ Animations ═══════ */

@keyframes top3FadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.top3-card--1 {
    animation-name: top3FadeInGold;
}

@keyframes top3FadeInGold {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
}

/* ═══════ Responsive ═══════ */

@media (max-width: 991.98px) {
    .top3-cards {
        gap: 8px;
    }

    .top3-card {
        padding: 16px 10px 10px;
    }
}

@media (max-width: 767.98px) {
    .top3-showcase {
        display: none;
    }
}
