:root {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --accent: #10b981;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --gold: #fbbf24;
    --silver: #cbd5e1;
    --bronze: #b45309;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.5;
    padding: 2rem 1rem;
}

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

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #10b981, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.last-updated {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--card-bg);
    border-radius: 9999px;
    font-size: 0.825rem;
    border: 1px solid #334155;
}

.leaderboard-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    border: 1px solid #334155;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

th {
    background-color: #0f172a;
    padding: 1rem 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid #334155;
}

td {
    padding: 1.25rem;
    border-bottom: 1px solid #334155;
    vertical-align: middle;
    transition: background-color 0.2s;
}

tr:last-child td {
    border-bottom: none;
}

tr.rank-1 {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.05) 0%, rgba(0,0,0,0) 100%);
}

tr.rank-1 td {
    border-left: 4px solid var(--gold);
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.875rem;
}

.rank-badge.first {
    background-color: var(--gold);
    color: #000;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.rank-badge.second {
    background-color: var(--silver);
    color: #000;
}

.rank-badge.third {
    background-color: var(--bronze);
    color: #fff;
}

.rank-badge.other {
    color: var(--text-muted);
}

.participant-name {
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.winner-crown {
    color: var(--gold);
    font-size: 1.125rem;
}

.teams-grid {
    display: flex;
    gap: 0.5rem;
}

.team-crest-wrapper {
    position: relative;
    display: inline-block;
}

.team-crest {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
    transition: transform 0.2s;
    cursor: help;
}

.team-crest:hover {
    transform: scale(1.3);
}

.tooltip {
    visibility: hidden;
    width: 200px;
    background-color: #0f172a;
    color: #fff;
    text-align: left;
    border-radius: 0.5rem;
    padding: 0.75rem;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    border: 1px solid #475569;
    pointer-events: none;
    font-size: 0.75rem;
}

.tooltip-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid #475569;
    padding-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
}

.team-crest-wrapper:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.text-bold {
    font-weight: bold;
}

.text-center {
    text-align: center;
}

.points-highlight {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent);
}

/* Styles for Upcoming Matches Section */
.mt-8 {
    margin-top: 2rem;
}
.filter-bar {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    display: none; /* hidden by default */
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.9rem;
}
.filter-bar.active {
    display: flex;
}
.clear-filter-btn {
    background-color: var(--accent);
    color: #000;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: opacity 0.2s;
}
.clear-filter-btn:hover {
    opacity: 0.9;
}
#leaderboard-card .leaderboard-table tbody tr {
    cursor: pointer;
}
.leaderboard-table tr {
    transition: opacity 0.2s, background-color 0.2s;
}
.leaderboard-table tr.dimmed {
    opacity: 0.4;
}
.leaderboard-table tr.active-filter-row td {
    border-left: 4px solid var(--accent) !important;
    background-color: rgba(16, 185, 129, 0.05);
}
.p-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background-color: #334155;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    border: 1px solid #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}
.p-badge:hover {
    background-color: #475569;
    border-color: #64748b;
    color: #fff;
}
.p-badge.active-filter {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    background-color: rgba(16, 185, 129, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

/* Extracted UI classes from inline styles */
.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid #334155;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.card-body {
    padding: 1.25rem;
}

.fixture-time {
    width: 250px;
    font-weight: 500;
    color: var(--text-muted);
}

.matchup-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.matchup-crest {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
}

.matchup-team {
    font-weight: 600;
}

.interest-col {
    width: 250px;
    text-align: center;
}

.interest-badge-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
}

.badge-vs {
    color: var(--text-muted);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
    td, th {
        padding: 0.75rem;
    }
}
