* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #2b2d31;
    --bg-secondary: #1e1f22;
    --bg-tertiary: #313338;
    --text-primary: #f2f3f5;
    --text-secondary: #b5bac1;
    --accent: #5865f2;
    --accent-hover: #4752c4;
    --success: #3ba55d;
    --danger: #ed4245;
    --border: #3f4147;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* header */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--text-primary);
}

.discord-button {
    background: #5865f2;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 500;
}

.discord-button:hover {
    background: #4752c4;
}

.discord-button svg {
    width: 16px;
    height: 16px;
}

/* hero section */
.hero {
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.hero p {
    color: var(--text-secondary);
    font-size: 18px;
}

/* stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* section titles */
.section {
    margin: 60px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 28px;
    font-weight: 600;
}

.view-all {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-all:hover {
    color: var(--accent-hover);
}

.view-all svg {
    width: 16px;
    height: 16px;
}

/* leaderboard preview */
.leaderboard-preview {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 60px 60px 1fr 120px 120px 120px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.leaderboard-item:hover {
    background: var(--bg-tertiary);
    cursor: pointer;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
}

.rank.gold { color: #ffd700; }
.rank.silver { color: #c0c0c0; }
.rank.bronze { color: #cd7f32; }

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    object-fit: cover;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-name {
    font-weight: 600;
}

.stat-column {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.stat-column .value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}

/* recent games */
.games-grid {
    display: grid;
    gap: 20px;
}

.game-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 20px;
    transition: border-color 0.2s;
}

.game-card:hover {
    border-color: var(--accent);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.game-winner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.winner-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.winner-badge {
    background: var(--success);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
}

.game-time {
    color: var(--text-secondary);
    font-size: 14px;
}

.game-stats {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.game-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-stats svg {
    width: 16px;
    height: 16px;
}

/* loading state */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* light mode */
body.light {
    --bg-primary: #ffffff;
    --bg-secondary: #f2f3f5;
    --bg-tertiary: #e3e5e8;
    --text-primary: #2e3338;
    --text-secondary: #5e6772;
    --border: #d8dadd;
}

/* responsive */
@media (max-width: 768px) {
    .leaderboard-item {
        grid-template-columns: 40px 50px 1fr;
        gap: 10px;
    }
    
    .stat-column {
        display: none;
    }
    
    nav {
        display: none;
    }

}
