/* ── Leaderboard Page Styles ───────────────────────────────────────── */

/* Podium */
.podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    min-height: 220px;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease both;
}

.podium-loading {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    max-width: 220px;
}

.podium-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.podium-crown {
    position: absolute;
    top: -18px;
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.podium-name {
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    word-break: break-word;
}

.podium-pts {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.podium-block {
    width: 100%;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    color: rgba(0,0,0,0.25);
    transition: all 0.3s ease;
}

/* 1st = tallest */
.podium-slot:nth-child(1) .podium-block { height: 120px; background: linear-gradient(180deg,#f8d848,#e6a817); }
.podium-slot:nth-child(1) .podium-avatar { background: linear-gradient(135deg,#f8d848,#e6a817); }
/* 2nd */
.podium-slot:nth-child(2) .podium-block { height: 85px; background: linear-gradient(180deg,#c0c0c0,#909090); }
.podium-slot:nth-child(2) .podium-avatar { background: linear-gradient(135deg,#c0c0c0,#909090); }
/* 3rd */
.podium-slot:nth-child(3) .podium-block { height: 60px; background: linear-gradient(180deg,#cd7f32,#a0522d); }
.podium-slot:nth-child(3) .podium-avatar { background: linear-gradient(135deg,#cd7f32,#a0522d); }

/* Points legend */
.points-legend {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    width: 100%;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.legend-title {
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 0.75rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Table */
.lb-table-wrap {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.lb-table thead th {
    padding: 0.9rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--card-border);
    background: rgba(0,0,0,0.03);
}

.lb-table tbody tr {
    border-bottom: 1px solid var(--card-border);
    transition: background 0.2s ease;
}

.lb-table tbody tr:last-child { border-bottom: none; }
.lb-table tbody tr:hover { background: rgba(230,126,34,0.04); }

.lb-table tbody td {
    padding: 0.85rem 1rem;
    font-weight: 500;
}

.lb-rank {
    font-weight: 800;
    font-size: 1rem;
    width: 3rem;
    text-align: center;
}

.lb-rank-1 { color: #e6a817; }
.lb-rank-2 { color: #909090; }
.lb-rank-3 { color: #a0522d; }

.lb-username {
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lb-disc-icon {
    color: #5865F2;
    font-size: 0.85rem;
}

.lb-pts {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--accent-gold);
}

.lb-stat { color: var(--text-muted); }

@media (max-width: 640px) {
    .lb-table thead th:nth-child(n+5),
    .lb-table tbody td:nth-child(n+5) { display: none; }
    .podium-container { gap: 0.5rem; }
}

/* Admin Leaderboard Overlay */
.lb-admin-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.lb-admin-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lb-admin-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 860px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: translateY(30px);
    transition: transform 0.35s cubic-bezier(0.25,0.8,0.25,1);
    margin: auto;
}

.lb-admin-overlay.active .lb-admin-panel {
    transform: translateY(0);
}

.lb-admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}

.lb-admin-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
}

/* Player cards in admin */
.lb-player-card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.lb-player-card:hover {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.lb-card-section {
    margin-bottom: 20px;
}

.lb-card-section:last-child {
    margin-bottom: 0;
}

.lb-card-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 6px;
    letter-spacing: 0.5px;
}

.lb-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.lb-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lb-form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.lb-form-group input, .lb-form-group select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lb-form-group input:focus, .lb-form-group select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15);
}
