/* Hall of Fame / Leaderboard page styles */

.hall-of-fame-container {
    background: #1a1d2e;
    border-radius: 1.25rem;
    padding: 2rem 2.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-md);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.2rem;
}

/* ========== LEADERBOARD TABLE ========== */

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
}

.leaderboard-table thead {
    background: linear-gradient(135deg, #f7931a 0%, #e67e00 100%);
}

.leaderboard-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaderboard-table th:first-child {
    border-top-left-radius: 8px;
    text-align: center;
    width: 80px;
}

.leaderboard-table th:last-child {
    border-top-right-radius: 8px;
    text-align: center;
    /* width: 150px; */
}

.leaderboard-table th:nth-child(3) {
    text-align: center;
    /* width: 150px; */
}

.leaderboard-table tbody tr {
    background: #2a2a2a;
    transition: all 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    background: #333;
    transform: scale(1.01);
}

.leaderboard-table tbody tr:nth-child(even) {
    background: #252525;
}

.leaderboard-table tbody tr:nth-child(even):hover {
    background: #333;
}

.leaderboard-table td {
    padding: 15px;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
}

/* ========== TABLE CELLS ========== */

.rank-cell {
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.rank-1 { color: #FFD700; }
.rank-2 { color: #C0C0C0; }
.rank-3 { color: #CD7F32; }

.user-cell {
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.user-name {
    flex-shrink: 0;
}

/* User info and badges containers */
.user-cell .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-cell .badges {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Reset badge margins when inside badges container (uses gap instead) */
.user-cell .badges .you-badge,
.user-cell .badges .nostr-badge {
    margin-left: 0;
}

.elo-cell {
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: #f7931a;
}

.questions-cell {
    text-align: center;
    color: #999;
}

/* Challenge vs Practice count styling */
.challenge-count {
    color: #f7931a;
    font-weight: 600;
}

.practice-count {
    color: #63b3ed;
    font-weight: 500;
}

.count-separator {
    color: #666;
}

/* Questions legend */
.questions-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: #bbb;
}

.legend-title {
    font-weight: 600;
    color: #999;
}

.legend-separator {
    color: #555;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.challenge-dot {
    background-color: #f7931a;
}

.practice-dot {
    background-color: #63b3ed;
}

/* ========== CURRENT USER HIGHLIGHT ========== */

.current-user-row {
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.2) 0%, rgba(230, 126, 0, 0.15) 100%) !important;
    border: 2px solid #f7931a !important;
    box-shadow: 0 0 20px rgba(247, 147, 26, 0.4);
    position: relative;
}

.current-user-row:hover {
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.25) 0%, rgba(230, 126, 0, 0.2) 100%) !important;
    transform: scale(1.02) !important;
}

/* ========== SEPARATOR ========== */

.separator-row {
    background: transparent !important;
    pointer-events: none;
}

.separator-row:hover {
    background: transparent !important;
    transform: none !important;
}

.separator-line {
    text-align: center;
    color: #666;
    font-size: 1.5rem;
    padding: 10px 0;
    letter-spacing: 4px;
}

/* ========== BACK LINK ========== */

.back-link {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 24px;
    background: #333;
    color: #f7931a;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.back-link:hover {
    background: #f7931a;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
    .hall-of-fame-container {
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }

    .leaderboard-table {
        width: 100%;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 4px;
    }

    .leaderboard-table th {
        font-size: 0.8rem;
    }

    /* Column widths */
    .leaderboard-table th:first-child,
    .leaderboard-table td:first-child {
        width: 12%;  /* Rank */
    }

    .leaderboard-table th:nth-child(2),
    .leaderboard-table td:nth-child(2) {
        width: 40%;  /* User */
    }

    .leaderboard-table th:nth-child(3),
    .leaderboard-table td:nth-child(3) {
        width: 24%;  /* Bitcoin Score */
    }

    .leaderboard-table th:last-child,
    .leaderboard-table td:last-child {
        width: 24%;  /* Questions Answered */
    }

    /* Two-line layout for user cell on mobile */
    .user-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .user-cell .user-info {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .user-cell .badges {
        display: flex;
        align-items: center;
        gap: 4px;
        margin-left: 36px; /* Align under username (28px avatar + 8px gap) */
    }
}

@media (max-width: 400px) {
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 6px 3px;
    }

    .leaderboard-table th {
        font-size: 0.7rem;
    }

    .leaderboard-table td {
        font-size: 0.8rem;
    }

    .rank-cell {
        font-size: 0.95rem;
    }

    .elo-cell {
        font-size: 0.85rem;
    }
}
