* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --border-color: #333;
    --hover-bg: #2a2a2a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.header-actions {
    display: flex;
    gap: 10px;
}

header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back-btn {
    padding: 8px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.search-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.toggle-section {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-text {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

.toggle-checkbox {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-secondary);
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle-checkbox:checked + .toggle-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-checkbox:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: white;
}

.search-controls {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.control-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.leaderboard-select {
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    min-width: 300px;
}

.leaderboard-select:hover {
    border-color: var(--accent-primary);
}

.leaderboard-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.leaderboard-select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 10px;
}

.control-group input {
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.control-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-btn {
    padding: 10px 30px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.results-section {
    margin-bottom: 30px;
}

.results-section h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.leaderboard-info,
.search-info {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.leaderboard-info h3,
.search-info h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
}

.table-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.table-title {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.3rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: var(--hover-bg);
}

tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.error-message {
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 8px;
    color: #ef4444;
    text-align: center;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.loading-progress {
    height: 100%;
    background: #ef4444;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.loading-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}


@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .search-controls {
        flex-direction: column;
    }
    
    .control-group {
        width: 100%;
    }
    
    .search-btn {
        width: 100%;
    }
}

