:root {
    --fire-primary: #ff4500;
    --fire-secondary: #ff8c00;
    --fire-accent: #ffd700;
    --dark-bg: #1a1a1a;
    --darker-bg: #0d0d0d;
    --text-light: #f5f5f5;
    --text-dim: #cccccc;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Fire Background Animation */
.fire-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.7;
}

.fire-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: 
        moveFire 25s infinite alternate ease-in-out,
        colorChange 20s infinite ease-in-out;
    mix-blend-mode: screen;
}

.fire-circle-1 { width: 400px; height: 400px; top: 20%; left: 10%; animation-delay: 0s; }
.fire-circle-2 { width: 300px; height: 300px; top: 60%; left: 15%; animation-delay: 3s; }
.fire-circle-3 { width: 500px; height: 500px; top: 30%; right: 10%; animation-delay: 2s; }
.fire-circle-4 { width: 350px; height: 350px; top: 50%; right: 15%; animation-delay: 5s; }
.fire-circle-5 { width: 250px; height: 250px; bottom: 20%; right: 25%; animation-delay: 4s; }
.fire-circle-6 { width: 200px; height: 200px; bottom: 30%; left: 30%; animation-delay: 1s; }

@keyframes moveFire {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, 30px) scale(1.05); }
    50% { transform: translate(-30px, 40px) scale(0.95); }
    75% { transform: translate(40px, -20px) scale(1.03); }
}

@keyframes colorChange {
    0% { background: radial-gradient(circle, rgba(255, 69, 0, 0.5) 0%, transparent 70%); }
    16% { background: radial-gradient(circle, rgba(255, 100, 0, 0.5) 0%, transparent 70%); }
    32% { background: radial-gradient(circle, rgba(255, 140, 0, 0.4) 0%, transparent 70%); }
    48% { background: radial-gradient(circle, rgba(255, 165, 0, 0.4) 0%, transparent 70%); }
    64% { background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%); }
    80% { background: radial-gradient(circle, rgba(255, 100, 0, 0.4) 0%, transparent 70%); }
    100% { background: radial-gradient(circle, rgba(255, 69, 0, 0.5) 0%, transparent 70%); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding: 20px 0;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    margin: 0;
    background: linear-gradient(to right, var(--fire-primary), var(--fire-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(255, 69, 0, 0.3);
    letter-spacing: 2px;
}

.subtitle {
    color: var(--text-dim);
    margin-top: 5px;
    font-size: 1.2rem;
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 69, 0, 0.3);
}

.tab {
    padding: 10px 25px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dim);
    transition: all 0.3s ease;
    position: relative;
}

.tab.active {
    color: var(--fire-accent);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--fire-primary), var(--fire-accent));
    border-radius: 3px 3px 0 0;
}

.tab:hover:not(.active) {
    color: var(--fire-secondary);
}

.leaderboard {
    background-color: var(--darker-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 50px 1fr 100px 100px 100px 100px 100px 100px;
    padding: 15px 20px;
    background: linear-gradient(to right, var(--fire-primary), var(--fire-secondary));
    color: white;
    font-weight: 1000;
    font-size: 18px;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 50px 1fr 100px 100px 100px 100px 100px 100px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.leaderboard-row:hover {
    background-color: rgba(255, 69, 0, 0.05);
}

.leaderboard-row:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.leaderboard-row:nth-child(even):hover {
    background-color: rgba(255, 69, 0, 0.08);
}

.rank {
    font-weight: 600;
    color: var(--fire-accent);
}

.username {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.elo {
    font-weight: 600;
    color: var(--fire-accent);
}

.positive {
    color: #4caf50;
}

.negative {
    color: #f44336;
}

.streak {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.streak.positive {
    background-color: rgba(76, 175, 80, 0.2);
}

.streak.negative {
    background-color: rgba(244, 67, 54, 0.2);
}

.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-dim);
}

.flame-icon {
    display: inline-block;
    margin-right: 5px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
    border: 2px solid var(--fire-secondary);
}

.search-container {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

#search-input {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid var(--fire-secondary);
    background-color: var(--darker-bg);
    color: var(--text-light);
    font-family: 'Kanit', sans-serif;
}

#search-button, #reset-button {
    padding: 10px 20px;
    background: linear-gradient(to right, var(--fire-primary), var(--fire-secondary));
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    transition: all 0.2s ease;
}

#search-button:hover, #reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(255, 69, 0, 0.3);
}

#reset-button {
    background: linear-gradient(to right, #555, #777);
}

@media (max-width: 768px) {
    .fire-circle {
        filter: blur(20px);
    }
    .fire-circle-1, .fire-circle-3 { 
        width: 250px; 
        height: 250px; 
    }
    .fire-circle-2, .fire-circle-4, .fire-circle-5 { 
        width: 180px; 
        height: 180px; 
    }
    .fire-circle-6 {
        width: 150px;
        height: 150px;
    }
    
    .leaderboard-header, .leaderboard-row {
        grid-template-columns: 30px 1fr 80px 80px;
        font-size: 0.9rem;
    }
    
    .leaderboard-header div:nth-child(5),
    .leaderboard-header div:nth-child(6),
    .leaderboard-header div:nth-child(7),
    .leaderboard-row div:nth-child(5),
    .leaderboard-row div:nth-child(6),
    .leaderboard-row div:nth-child(7) {
        display: none;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    #search-button, #reset-button {
        width: 100%;
    }
}