/* Ranking Page Specific Styles */

.ranking-hero {
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Podium Section */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
    margin-bottom: 5rem;
    padding: 2rem;
    min-height: 350px;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    position: relative;
    transition: var(--transition);
    width: 250px;
    backdrop-filter: blur(20px);
}

.podium-item:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.podium-item.gold { 
    height: 320px; 
    border-color: rgba(255, 215, 0, 0.3);
    order: 2;
}
.podium-item.silver { 
    height: 280px; 
    border-color: rgba(192, 192, 192, 0.3);
    order: 1;
}
.podium-item.bronze { 
    height: 240px; 
    border-color: rgba(205, 127, 50, 0.3);
    order: 3;
}

.podium-rank {
    position: absolute;
    top: -20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    color: #000;
}

.gold .podium-rank { background: #ffd700; box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
.silver .podium-rank { background: #c0c0c0; box-shadow: 0 0 20px rgba(192, 192, 192, 0.5); }
.bronze .podium-rank { background: #cd7f32; box-shadow: 0 0 20px rgba(205, 127, 50, 0.5); }

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.podium-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.podium-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.podium-badge {
    font-size: 0.85rem;
    color: var(--accent-cyan);
    font-weight: 600;
}

.podium-score {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    opacity: 0.9;
}

/* Tabs */
.ranking-tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.ranking-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    overflow-x: auto;
    max-width: 100%;
}

.rank-tab-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.rank-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.rank-tab-btn.active {
    background: var(--accent-purple);
    color: #fff;
    box-shadow: 0 4px 15px rgba(157, 80, 255, 0.3);
}

/* Table */
.ranking-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 32px;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.ranking-table th {
    padding: 1.5rem 2rem;
    font-weight: 700;
    color: var(--text-dim);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-glass);
}

.ranking-table td {
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border-glass);
    vertical-align: middle;
}

.ranking-table tr:last-child td {
    border-bottom: none;
}

.ranking-table tr.me {
    background: rgba(0, 242, 255, 0.05);
}

.rank-cell {
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--text-dim);
    width: 100px;
}

.player-cell .player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.small-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2a2e36;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent-cyan);
    border: 1px solid var(--border-glass);
}

.rank-badge {
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.score-cell {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
}

.view-detail-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.view-detail-btn:hover {
    background: var(--accent-cyan);
    color: #000;
    border-color: transparent;
    transform: scale(1.1);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border-glass);
    border-radius: 32px;
    padding: 3rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

.player-modal-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.large-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    margin: 0 auto 1.5rem;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 242, 255, 0.2);
}

.modal-badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(157, 80, 255, 0.1);
    color: var(--accent-purple);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.modal-stat-main {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 2rem;
}

.modal-stat-main .label {
    display: block;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.modal-stat-main .value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-cyan);
}

.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.game-stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 1rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-game-name {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.stat-game-val {
    font-weight: 700;
    color: #fff;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 900px) {
    .podium-container {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }
    .podium-item {
        width: 100%;
        max-width: 350px;
        height: auto !important;
        order: unset !important;
    }
}

@media (max-width: 600px) {
    .ranking-table th:nth-child(3),
    .ranking-table td:nth-child(3) {
        display: none;
    }
    .container {
        padding: 0 1rem;
    }
}
