/* Token Race Styles */

/* Ensure stream controls stay inline on desktop only */
@media (min-width: 769px) {
    .token-stream-section .stream-controls {
        display: inline-flex !important;
        align-items: center;
        gap: 0.5rem;
        white-space: nowrap;
    }
}

.token-stream-section .control-separator {
    margin: 0 0.25rem;
}

/* Fix pagination buttons to display horizontally on desktop only */
@media (min-width: 769px) {
    #pagination-controls {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    #pagination-controls .pagination-btn {
        display: inline-block;
    }
}

/* Ensure token header is properly aligned horizontally - override any conflicting styles */
#race-leaderboard .token-stream-header {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 1rem !important;
}

#race-leaderboard .token-avatar {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0 !important;
}

#race-leaderboard .token-main-info {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 1.5rem !important;
}

/* Position Rank Badge Styles */
.position-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    flex-shrink: 0;
}

.position-rank .rank-number {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: #00ff00;
}

.position-rank.gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 184, 0, 0.1));
    border-color: #ffd700;
}

.position-rank.gold .rank-number {
    color: #ffd700;
}

.position-rank.silver {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(169, 169, 169, 0.1));
    border-color: #c0c0c0;
}

.position-rank.silver .rank-number {
    color: #c0c0c0;
}

.position-rank.bronze {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(184, 115, 51, 0.1));
    border-color: #cd7f32;
}

.position-rank.bronze .rank-number {
    color: #cd7f32;
}

/* Token Main Metric Display */
.token-metric-main {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #00ff00;
    margin-left: 0.5rem;
}

/* Racing Chart Section */
.racing-chart-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.race-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 1rem;
}

.race-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    padding: 0.5rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #22c55e;
}

.race-light {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
}

.race-light.red.active {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

.race-light.yellow.active {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}

.race-light.green.active {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
    animation: pulse 1s infinite;
}

.race-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Race Type Switcher */
.race-type-switcher {
    display: flex;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.race-type-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.race-type-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.race-type-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.race-type-btn.active i {
    color: var(--primary);
}

.race-restart-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.race-restart-btn:hover {
    background: var(--surface);
    border-color: var(--primary);
}

.auto-update-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Racing Track */
.racing-track-container {
    position: relative;
    background: linear-gradient(180deg, var(--background) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    min-height: 600px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.start-line, .finish-line {
    position: absolute;
    top: 20px;
    bottom: 20px;
    width: 4px;
    background: repeating-linear-gradient(
        to bottom,
        #fff 0,
        #fff 10px,
        #000 10px,
        #000 20px
    );
    z-index: 2;
}

.start-line {
    left: 60px;
}

.finish-line {
    right: 60px;
}

.line-marker {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-primary);
    background: var(--surface);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.checkered-flag {
    position: absolute;
    top: -25px;
    right: -10px;
    width: 30px;
    height: 20px;
    background: repeating-conic-gradient(
        #000 0deg 90deg,
        #fff 90deg 180deg
    );
    background-size: 10px 10px;
}

.checkpoints {
    position: absolute;
    top: 0;
    left: 60px;
    right: 60px;
    height: 100%;
    pointer-events: none;
}

.checkpoint {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
    opacity: 0.3;
}

.checkpoint span {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.625rem;
    color: var(--text-muted);
}

/* Race Tracks */
.race-tracks {
    position: relative;
    padding: 20px 0;
    min-height: 480px;
    height: 480px;
}

.race-track {
    position: absolute;
    width: 100%;
    height: 40px;
    margin: 4px 0;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.track-lane {
    position: absolute;
    top: 50%;
    left: 60px;
    right: 60px;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--border) 0%, 
        var(--border) 45%, 
        transparent 45%, 
        transparent 55%, 
        var(--border) 55%, 
        var(--border) 100%
    );
    background-size: 20px 2px;
    transform: translateY(-50%);
    opacity: 0.3;
}

/* Race Cars */
.race-car {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
}

.race-car:hover {
    transform: translateY(-50%) scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.car-position {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--background);
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: bold;
    color: var(--text-primary);
}

.car-position.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
}

.car-position.silver {
    background: linear-gradient(135deg, #e5e7eb, #9ca3af);
    color: #000;
}

.car-position.bronze {
    background: linear-gradient(135deg, #f87171, #dc2626);
    color: #fff;
}

.car-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.car-info {
    display: flex;
    flex-direction: column;
}

.car-symbol {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.car-volume {
    font-size: 0.875rem;
    font-weight: bold;
    color: var(--primary);
    margin-left: auto;
}

/* Race Effects */
.race-car.accelerating {
    animation: accelerate 0.5s ease;
}

.race-car.overtaking {
    animation: overtake 1s ease;
}

.race-car.boosting .speed-trail {
    display: block;
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary));
    animation: trail 0.3s linear infinite;
}

.race-car.nitro .nitro-effect {
    display: block;
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #3b82f6, transparent);
    animation: nitro-flame 0.2s linear infinite;
}

.speed-trail, .nitro-effect {
    display: none;
}

/* Animations */
@keyframes accelerate {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

@keyframes overtake {
    0% { transform: translateY(-50%) translateX(0); }
    25% { transform: translateY(-50%) translateX(-10px); }
    75% { transform: translateY(-50%) translateX(10px); }
    100% { transform: translateY(-50%) translateX(0); }
}

@keyframes trail {
    0% { opacity: 1; transform: translateY(-50%) scaleX(1); }
    100% { opacity: 0; transform: translateY(-50%) scaleX(2); }
}

@keyframes nitro-flame {
    0%, 100% { transform: translateY(-50%) scale(1); opacity: 1; }
    50% { transform: translateY(-50%) scale(1.5); opacity: 0.5; }
}

/* Race Stats */
.race-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.stat-icon {
    flex-shrink: 0;
}

.stat-icon.gold {
    color: #f59e0b;
}

.stat-icon.orange {
    color: #fb923c;
}

.stat-icon.blue {
    color: #3b82f6;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Pulse Glow Animations */
@keyframes pulseGlowGreen {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
        border-color: var(--border);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(34, 197, 94, 0.6);
        border-color: #22c55e;
    }
}

@keyframes pulseGlowRed {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        border-color: var(--border);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(239, 68, 68, 0.6);
        border-color: #ef4444;
    }
}

@keyframes pulseGlowBlue {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
        border-color: var(--border);
    }
    50% {
        box-shadow: 0 0 15px 3px rgba(59, 130, 246, 0.5);
        border-color: #3b82f6;
    }
}

@keyframes pulseGlowOrange {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
        border-color: var(--border);
    }
    50% {
        box-shadow: 0 0 15px 3px rgba(245, 158, 11, 0.5);
        border-color: #f59e0b;
    }
}

@keyframes shimmerPurple {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
        filter: drop-shadow(0 0 3px rgba(139, 92, 246, 0.3));
    }
}

@keyframes shimmerGray {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
        filter: drop-shadow(0 0 3px rgba(100, 116, 139, 0.3));
    }
}

/* Race Car Pulse Classes */
.race-car.pulse-green {
    animation: pulseGlowGreen 1s ease-in-out 3;
}

.race-car.pulse-red {
    animation: pulseGlowRed 1s ease-in-out 3;
}

.race-car.pulse-blue {
    animation: pulseGlowBlue 0.67s ease-in-out 3;
}

.race-car.pulse-orange {
    animation: pulseGlowOrange 0.67s ease-in-out 3;
}

.race-car.shimmer-purple .car-icon {
    animation: shimmerPurple 0.5s ease-in-out 2;
}

.race-car.shimmer-gray .car-icon {
    animation: shimmerGray 0.5s ease-in-out 2;
}

/* Token Race specific mobile page number styling */
@media (max-width: 768px) {
    #mobile-page-number-race {
        display: block !important;
        color: #00ff00 !important;
        font-family: 'IBM Plex Mono', monospace !important;
        font-size: 10px !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        text-align: center !important;
        margin: 0 auto !important;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Racing track container adjustments */
    .racing-track-container {
        padding: 1rem;
        min-height: auto;
        margin: 1rem 0;
    }
    
    /* Hide desktop race track visualization on mobile */
    .start-line, .finish-line, .checkpoints {
        display: none;
    }
    
    /* Convert race tracks to vertical cards */
    .race-tracks {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        height: auto;
        min-height: auto;
        padding: 0;
    }
    
    /* Mini race track card for mobile */
    .race-track {
        position: relative !important;
        transform: none !important;
        width: 100%;
        height: auto;
        margin: 0;
    }
    
    .track-lane {
        display: none;
    }
    
    /* Compact race car design for mobile */
    .race-car {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.75rem;
        gap: 0.75rem;
        background: rgba(0, 0, 0, 0.8);
        border: 1px solid rgba(0, 255, 0, 0.3);
        border-radius: 8px;
    }
    
    .race-car:hover {
        transform: none !important;
    }
    
    /* Left section: icon and symbol */
    .car-icon {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        flex-shrink: 0;
    }
    
    .car-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        min-width: 0;
    }
    
    .car-symbol {
        font-size: 0.9rem;
        font-weight: 600;
        color: #00ff00;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .car-volume {
        font-size: 0.85rem;
        color: #00ff00;
        font-weight: 500;
    }
    
    /* Position badge on the right */
    .car-position {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        width: auto;
        min-width: 24px;
        height: 24px;
        font-size: 0.75rem;
        padding: 0 0.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.125rem;
        background: rgba(0, 0, 0, 0.9);
        border: 1px solid rgba(0, 255, 0, 0.3);
        border-radius: 4px;
    }
    
    /* Progress bar container */
    .race-car::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        height: 3px;
        background: linear-gradient(90deg, #00ff00, #10b981);
        border-radius: 0 0 8px 8px;
        transition: width 0.5s ease;
        width: var(--progress, 0%);
    }
    
    /* Energy orb progress indicator */
    .race-progress-icon {
        position: absolute;
        bottom: -6px;
        left: var(--progress, 0%);
        transform: translateX(-50%);
        width: 12px;
        height: 12px;
        z-index: 3;
        transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Energy orb core */
    .energy-orb {
        position: relative;
        width: 6px;
        height: 6px;
        margin: 3px;
        background: #00ff00;
        border-radius: 50%;
        box-shadow: 
            0 0 4px #00ff00,
            0 0 8px #00ff00,
            0 0 12px rgba(0, 255, 0, 0.5);
        animation: orbPulse 1s ease-in-out infinite;
    }
    
    /* Inner glow ring */
    .energy-orb::before {
        content: '';
        position: absolute;
        top: -3px;
        left: -3px;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(0, 255, 0, 0.6) 0%, transparent 70%);
        animation: innerGlow 1s ease-in-out infinite;
    }
    
    /* Outer glow ring */
    .energy-orb::after {
        content: '';
        position: absolute;
        top: -6px;
        left: -6px;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(0, 255, 0, 0.3) 0%, transparent 70%);
        animation: outerGlow 1s ease-in-out infinite;
    }
    
    /* Energy trail effect */
    .energy-trail {
        position: absolute;
        top: 50%;
        right: 100%;
        transform: translateY(-50%);
        width: 20px;
        height: 2px;
        background: linear-gradient(90deg, transparent, #00ff00, transparent);
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    /* Spark particles container */
    .energy-sparks {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 20px;
        height: 20px;
        pointer-events: none;
    }
    
    .spark {
        position: absolute;
        width: 2px;
        height: 2px;
        background: #00ff00;
        border-radius: 50%;
        opacity: 0;
    }
    
    /* Top positions special colors */
    .race-track:nth-child(1) .energy-orb {
        background: #ffd700;
        box-shadow: 
            0 0 6px #ffd700,
            0 0 12px #ffd700,
            0 0 20px rgba(255, 215, 0, 0.6);
        animation-duration: 0.6s;
    }
    
    .race-track:nth-child(1) .energy-orb::before {
        background: radial-gradient(circle, rgba(255, 215, 0, 0.7) 0%, transparent 70%);
    }
    
    .race-track:nth-child(1) .energy-orb::after {
        background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
    }
    
    .race-track:nth-child(2) .energy-orb {
        background: #c0c0c0;
        box-shadow: 
            0 0 6px #c0c0c0,
            0 0 12px #c0c0c0,
            0 0 18px rgba(192, 192, 192, 0.6);
        animation-duration: 0.7s;
    }
    
    .race-track:nth-child(2) .energy-orb::before {
        background: radial-gradient(circle, rgba(192, 192, 192, 0.7) 0%, transparent 70%);
    }
    
    .race-track:nth-child(2) .energy-orb::after {
        background: radial-gradient(circle, rgba(192, 192, 192, 0.4) 0%, transparent 70%);
    }
    
    .race-track:nth-child(3) .energy-orb {
        background: #cd7f32;
        box-shadow: 
            0 0 6px #cd7f32,
            0 0 12px #cd7f32,
            0 0 18px rgba(205, 127, 50, 0.6);
        animation-duration: 0.8s;
    }
    
    .race-track:nth-child(3) .energy-orb::before {
        background: radial-gradient(circle, rgba(205, 127, 50, 0.7) 0%, transparent 70%);
    }
    
    .race-track:nth-child(3) .energy-orb::after {
        background: radial-gradient(circle, rgba(205, 127, 50, 0.4) 0%, transparent 70%);
    }
    
    /* Accelerating state */
    .race-car.accelerating .energy-orb {
        background: #ffff00;
        box-shadow: 
            0 0 8px #ffff00,
            0 0 16px #ffff00,
            0 0 24px rgba(255, 255, 0, 0.7);
        animation-duration: 0.3s !important;
    }
    
    .race-car.accelerating .energy-trail {
        opacity: 0.8;
        width: 30px;
        background: linear-gradient(90deg, transparent, #ffff00 30%, #00ff00);
    }
    
    /* Boosting state */
    .race-car.boosting .energy-orb {
        background: #ff3300;
        box-shadow: 
            0 0 10px #ff3300,
            0 0 20px #ff3300,
            0 0 30px rgba(255, 51, 0, 0.8);
        animation-duration: 0.2s !important;
    }
    
    .race-car.boosting .energy-trail {
        opacity: 1;
        width: 40px;
        height: 3px;
        background: linear-gradient(90deg, transparent, #ff3300 20%, #ffff00 60%, #00ff00);
    }
    
    /* Animations */
    @keyframes orbPulse {
        0%, 100% {
            transform: scale(1);
            filter: brightness(1);
        }
        50% {
            transform: scale(1.2);
            filter: brightness(1.3);
        }
    }
    
    @keyframes innerGlow {
        0%, 100% {
            transform: scale(1);
            opacity: 0.6;
        }
        50% {
            transform: scale(1.3);
            opacity: 0.8;
        }
    }
    
    @keyframes outerGlow {
        0%, 100% {
            transform: scale(1);
            opacity: 0.3;
        }
        50% {
            transform: scale(1.5);
            opacity: 0.5;
        }
    }
    
    @keyframes sparkBurst {
        0% {
            transform: translate(0, 0);
            opacity: 1;
        }
        100% {
            transform: translate(var(--spark-x), var(--spark-y));
            opacity: 0;
        }
    }
    
    /* Hide animation effects on mobile */
    .speed-trail, .nitro-effect {
        display: none !important;
    }
    
    /* Race header adjustments */
    .volume-race-section h2 {
        font-size: 1.2rem;
    }
    
    .race-controls {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .race-type-selector {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        order: 2;
    }
    
    .race-type-btn {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .race-type-btn i {
        display: none;
    }
    
    .auto-update-indicator {
        order: 1;
        text-align: center;
        padding: 0.5rem;
        background: rgba(0, 255, 0, 0.1);
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }
    
    /* Race stats cards */
    .race-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem 0;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-icon {
        width: 20px !important;
        height: 20px !important;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-value {
        font-size: 0.85rem;
    }
    
    /* Position board hidden on mobile */
    .position-board {
        display: none;
    }
}


/* Token Race specific overrides for leaderboard items */
.token-stream-item {
    cursor: pointer;
}

/* Leaderboard Section */
.leaderboard-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.leaderboard-item:hover {
    background: var(--surface);
    border-color: var(--primary);
}

.leaderboard-position {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--surface);
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.875rem;
}

.leaderboard-token {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.leaderboard-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.leaderboard-info {
    display: flex;
    flex-direction: column;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--text-primary);
}

.leaderboard-symbol {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.leaderboard-stats {
    display: flex;
    gap: 2rem;
    margin-left: auto;
}

.leaderboard-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.leaderboard-stat-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.leaderboard-stat-value {
    font-weight: 600;
    color: var(--primary);
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    background: var(--background);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--primary);
}

.pagination-btn.active {
    background: var(--surface);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.prev,
.pagination-btn.next {
    padding: 0.5rem;
}

.pagination-dots {
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.pagination-info {
    margin: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.813rem;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .race-stats {
        grid-template-columns: 1fr;
    }
    
    .leaderboard-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
    }
    
    .pagination-info {
        width: 100%;
        text-align: center;
        margin: 0.5rem 0 0;
    }
}