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

:root {
    --primary: #FFD700;
    --secondary: #FF1744;
    --dark: #0A0A0F;
    --accent: #00E5FF;
    --text: #E8E8E8;
    --surface: #1A1A24;
    --border: rgba(255, 215, 0, 0.2);
}

body {
    font-family: 'Barlow', sans-serif;
    background: linear-gradient(135deg, #0A0A0F 0%, #1A1A24 50%, #0F0A14 100%);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 23, 68, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' /%3E%3C/svg%3E");
    z-index: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 2;
}

header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    }
    to {
        filter: drop-shadow(0 0 20px rgba(255, 23, 68, 0.5));
    }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--primary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-weight: 600;
}

/* Social Links */
.socials {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.social-icon {
    width: 22px;
    height: 22px;
    fill: var(--text);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.socials a:hover .social-icon {
    opacity: 1;
    fill: var(--primary);
}

/* Sponsors */
.sponsors-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    padding: 15px 0;
}

.sponsor-logo {
    height: 50px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    filter: grayscale(30%);
}

.sponsor-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* Season Selector */
.season-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.season-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text);
    padding: 12px 30px;
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.season-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.5s;
}

.season-btn:hover::before {
    left: 100%;
}

.season-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.season-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: var(--primary);
    color: var(--dark);
    font-weight: 800;
}

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

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.stat-label {
    font-size: 0.9rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.05em;
}

/* Rankings Table */
.rankings-table {
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 60px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-header {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 23, 68, 0.1) 100%);
    padding: 20px 30px;
    border-bottom: 2px solid var(--primary);
    position: sticky;
    left: 0;
}

.table-header h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 0.1em;
    color: var(--primary);
}

.table-hint {
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.5;
    margin-top: 5px;
}

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

thead {
    background: rgba(255, 215, 0, 0.05);
}

th {
    padding: 20px 15px;
    text-align: left;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
}

th:first-child {
    padding-left: 30px;
}

td {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

td:first-child {
    padding-left: 30px;
}

tbody tr {
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: rgba(255, 215, 0, 0.05);
}

.rank {
    font-weight: 800;
    font-size: 1.3rem;
    font-family: 'Bebas Neue', sans-serif;
    color: var(--primary);
    min-width: 50px;
}

.rank-1 {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rank-2 {
    color: #C0C0C0;
}

.rank-3 {
    color: #CD7F32;
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.player-name a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.player-name a:hover {
    color: var(--primary);
    text-decoration: underline;
}

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

/* Week Results */
.week-results {
    margin-top: 40px;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.week-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    transition: all 0.3s ease;
}

.week-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
    border-color: var(--primary);
}

.week-header {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    letter-spacing: 0.1em;
}

.week-result {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.week-result:last-child {
    border-bottom: none;
}

.week-player {
    font-weight: 600;
}

.week-player a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.week-player a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.week-points {
    color: var(--accent);
    font-weight: 600;
}

/* Player Profile Page */
.player-banner {
    position: relative;
    border: 1px solid var(--border);
    margin-bottom: 50px;
    padding: 80px 30px;
    text-align: center;
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    background-color: var(--surface);
    overflow: hidden;
}

.player-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.85) 0%, rgba(26, 26, 36, 0.7) 50%, rgba(10, 10, 15, 0.85) 100%);
    z-index: 1;
}

.player-banner-content {
    position: relative;
    z-index: 2;
}

.player-banner-content h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

.player-record {
    font-size: 1.5rem;
    color: var(--text);
    font-weight: 600;
}

.player-record .winrate {
    color: var(--accent);
}

.section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    color: var(--primary);
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.h2h-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.h2h-table th:first-child,
.h2h-table td:first-child {
    width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h2h-table th:nth-child(2),
.h2h-table td:nth-child(2),
.h2h-table th:nth-child(3),
.h2h-table td:nth-child(3),
.h2h-table th:nth-child(4),
.h2h-table td:nth-child(4) {
    width: 18%;
    text-align: center;
}

.h2h-table .wins {
    color: #4CAF50;
    font-weight: 800;
}

.h2h-table .losses {
    color: var(--secondary);
    font-weight: 800;
}

.character-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 50px;
}

.character-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.character-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.char-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
}

.char-icon-sm {
    width: 28px;
    height: 28px;
    border-radius: 3px;
}

.character-name {
    font-weight: 600;
}

.character-count {
    color: var(--accent);
    font-weight: 800;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
}

/* H2H Character Matchup */
.h2h-chars {
    padding: 5px 0;
}

.char-matchup {
    display: flex;
    align-items: center;
    gap: 8px;
}

.char-icons {
    display: flex;
    gap: 3px;
}

.vs-label {
    color: var(--primary);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.7;
}

.back-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 30px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
}

/* Loading & Error */
.loading {
    text-align: center;
    padding: 100px 20px;
    font-size: 1.5rem;
    color: var(--primary);
}

.error {
    text-align: center;
    padding: 50px 20px;
    color: var(--secondary);
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid var(--secondary);
    margin: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 10px;
    }

    header {
        margin-bottom: 30px;
    }

    .logo {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 0.9rem;
        letter-spacing: 0.15em;
    }

    .season-selector {
        gap: 8px;
        margin-bottom: 30px;
    }

    .season-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 30px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    table {
        min-width: 500px;
    }

    .h2h-table {
        min-width: 0;
    }

    th, td {
        padding: 12px 8px;
        font-size: 0.85rem;
    }

    th:first-child, td:first-child {
        padding-left: 12px;
    }

    .table-header {
        padding: 15px 15px;
    }

    .table-header h2 {
        font-size: 1.5rem;
    }

    .rank {
        font-size: 1.1rem;
    }

    .player-name {
        font-size: 0.95rem;
    }

    .points {
        font-size: 1rem;
    }

    .week-grid {
        grid-template-columns: 1fr;
    }

    .character-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .char-icon {
        width: 32px;
        height: 32px;
    }

    .char-icon-sm {
        width: 24px;
        height: 24px;
    }

    .player-banner {
        padding: 50px 15px;
    }

    .player-banner-content h1 {
        font-size: 2.5rem;
    }

    .player-record {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .sponsors-bar {
        gap: 15px;
    }

    .sponsor-logo {
        height: 35px;
    }
}
