/* =========================================================================
   GAMIFIED HALL OF FAME (Cyber-Mage / Modern Dark Fantasy)
   ========================================================================= */

:root {
    --magic-purple: var(--accent-primary);
    --magic-blue: var(--accent-secondary);
    --magic-gold: var(--warning);
    --neon-glow: 0 0 10px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5), 0 0 20px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.3);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: var(--border-color);
    --font-code: 'JetBrains Mono', monospace;
    --font-heading: 'Inter', sans-serif;
}

[data-theme="dark"] {
    --glass-bg: rgba(10, 10, 15, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

#page-leaderboard .page-header h1 {
    font-family: var(--font-heading);
    letter-spacing: -1px;
    background: linear-gradient(90deg, var(--magic-purple), var(--magic-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.3);
}

.hof-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

@media (max-width: 900px) {
    .hof-layout {
        grid-template-columns: 1fr;
    }
}

.hof-sidebar,
.hof-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border) !important;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02), 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-xl);
    transition: transform 0.3s, box-shadow 0.3s;
}

/* User Profile */
.hof-user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
}

.avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--text-muted), var(--bg-primary));
    margin-bottom: var(--space-md);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.avatar-container.avatar-frame-bronze {
    background: linear-gradient(135deg, var(--bronze), var(--bronze-dark));
}

.avatar-container.avatar-frame-silver {
    background: linear-gradient(135deg, var(--silver), var(--silver-dark));
    box-shadow: 0 0 15px rgba(229, 228, 226, 0.5);
}

.avatar-container.avatar-frame-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.avatar-container.avatar-frame-diamond {
    background: linear-gradient(135deg, var(--platinum), var(--platinum-dark));
    box-shadow: 0 0 25px rgba(0, 191, 255, 0.6);
}

.user-avatar-big {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.avatar-level-badge {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
}

.hof-user-name {
    font-size: var(--text-2xl);
    font-weight: 700;
    font-family: var(--font-heading);
}

.hof-user-title {
    color: var(--magic-purple);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-lg);
    font-weight: 600;
}

.hof-points-showcase {
    margin-bottom: var(--space-lg);
}

.hof-points-value.neon-text {
    font-size: var(--text-4xl);
    font-weight: 900;
    text-shadow: 0 0 10px var(--magic-blue), 0 0 20px var(--magic-purple);
    font-family: var(--font-code);
    line-height: 1;
}

.hof-points-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: var(--space-xs);
}

.hof-level-progress {
    width: 100%;
}

.hof-level-progress .progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.glow-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.glow-bar .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--magic-blue), var(--magic-purple));
    border-radius: 4px;
    box-shadow: 0 0 10px var(--magic-purple);
}

/* Badges */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--space-md);
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: var(--space-md) var(--space-xs);
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.badge-item.unlocked:hover {
    transform: translateY(-5px);
    background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.1);
    border-color: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.3);
    /* box-shadow: 0 5px 15px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.2); */
}

.badge-item.silhouette {
    opacity: 0.4;
    filter: grayscale(100%) brightness(0.5);
}

.badge-icon-wrap {
    font-size: 2rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.badge-name {
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.2;
}

/* Category Stats */
.cyber-stat {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.category-stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: var(--text-xl);
}

.category-stat-body {
    flex: 1;
}

.category-stat-header {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.glow-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.glow-progress .progress-bar-fill {
    border-radius: 3px;
}

/* Cyberpunk Leaderboard Table */
.cyberpunk-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.cyberpunk-table th {
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.cyberpunk-table td {
    padding: var(--space-md);
    background: var(--bg-glass);
}

.cyberpunk-table tr td:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.cyberpunk-table tr td:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.cyberpunk-table tr {
    transition: transform 0.2s;
}

/* .cyberpunk-table tr:hover {
  transform: scale(1.01);
} */

/* Neon Highlight for Current User */
.current-user-neon td {
    background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.15);
    border-top: 1px solid hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4);
    border-bottom: 1px solid hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4);
}

.current-user-neon td:first-child {
    border-left: 1px solid hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4);
    box-shadow: inset 10px 0 20px -10px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4);
}

.current-user-neon td:last-child {
    border-right: 1px solid hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4);
}

.td-name-flex {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-weight: 600;
}

.td-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    border: 1px solid var(--border-color);
}

.glow-text {
    font-family: var(--font-code);
    font-weight: 700;
    text-align: right;
    color: var(--magic-gold);
    text-shadow: 0 0 10px color-mix(in srgb, var(--magic-gold) 40%, transparent);
}

/* Medals & Dynamics */
.medal-gold {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.8));
}

.medal-silver {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 5px rgba(192, 192, 192, 0.8));
}

.medal-bronze {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 5px rgba(205, 127, 50, 0.8));
}

.dyn-up {
    color: var(--success);
    font-size: 0.75rem;
    margin-left: 4px;
}

.dyn-down {
    color: var(--danger);
    font-size: 0.75rem;
    margin-left: 4px;
}

.dyn-steady {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 4px;
    opacity: 0.5;
}

/* Timeline History */
.history-timeline {
    position: relative;
    padding-left: 20px;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 31px;
    top: 10px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--magic-purple), transparent);
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    /* margin-bottom: var(--space-lg); */
    position: relative;
}

.timeline-icon {
    width: 24px;
    height: 24px;
    background: var(--bg-card);
    border: 2px solid var(--magic-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 1;
    box-shadow: 0 0 10px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4);
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
    background: var(--bg-glass);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.timeline-title {
    font-size: var(--text-sm);
    font-weight: 600;
}

.timeline-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.timeline-pts {
    font-family: var(--font-code);
    font-weight: 700;
    color: var(--magic-blue);
    background: color-mix(in srgb, var(--magic-blue) 10%, transparent);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    border: 1px solid color-mix(in srgb, var(--magic-blue) 20%, transparent);
}