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

body {
    background: #000000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
    min-height: 100vh;
    overflow-x: auto;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(80, 80, 80, 0.5);
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.5rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(80, 80, 80, 0.3);
    border-top: 4px solid #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.category-section {
    margin-bottom: 50px;
}

.category-header {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 15px;
    font-weight: bold;
    color: white;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(80, 80, 80, 0.5);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #00ff88;
    margin-bottom: 5px;
}

.chart-container {
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(80, 80, 80, 0.5);
    overflow-x: auto;
}

.chart-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #00ff88;
}

.chart {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    min-height: 500px;
    padding: 20px 0;
    min-width: max-content;
}

.runner-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.runner-bar:hover {
    transform: scale(1.05);
}

.bar-stack {
    display: flex;
    flex-direction: column-reverse;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.5s ease;
    animation: barGrow 1s ease-out forwards;
    transform: scaleY(0);
    transform-origin: bottom;
}

@keyframes barGrow {
    to { transform: scaleY(1); }
}

.level-segment {
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.level-segment:hover {
    filter: brightness(1.2);
    z-index: 10;
}

.runner-name {
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
    word-break: break-word;
    max-width: 100px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.runner-time {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sum-of-bests {
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.sum-of-bests h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.best-time {
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.level-colors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.level-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(60, 60, 60, 0.6);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.footer {
    margin-top: 50px;
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(80, 80, 80, 0.5);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.footer h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

.footer p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.footer a {
    color: #00ff88;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #4ecdc4;
}

@media (max-width: 768px) {
    .header h1 { font-size: 2rem; }
    .chart { gap: 10px; }
    .runner-bar { min-width: 60px; }
}
