/* Mobile-first design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0d0d12;
    --bg-card: #16161e;
    --bg-hover: #1e1e28;
    --text: #ffffff;
    --text-dim: #888898;
    --gold: #f5c542;
    --green: #22c55e;
    --red: #ef4444;
    --blue: #3b82f6;
    --purple: #a855f7;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Nav */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(13, 13, 18, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-brand {
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 16px;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.nav-links a:hover { color: var(--text); }

/* Hero */
.hero {
    padding: 100px 20px 40px;
    text-align: center;
}

.hero h1 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.hero-years {
    font-size: 32px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 8px;
}

.hero-sub {
    color: var(--text-dim);
    font-size: 14px;
}

/* Quick Stats */
.quick-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 16px 32px;
    flex-wrap: wrap;
}

.stat-pill {
    background: var(--bg-card);
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    min-width: 100px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: var(--gold);
}

.stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sections */
.section {
    padding: 40px 16px;
    max-width: 800px;
    margin: 0 auto;
}

.section h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.section-desc {
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 20px;
}

/* Champions Timeline */
.timeline {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 16px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.timeline::-webkit-scrollbar { display: none; }

.champ-card {
    flex-shrink: 0;
    width: 120px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.champ-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.champ-year {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.champ-trophy { font-size: 24px; margin-bottom: 4px; }

.champ-name {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.champ-record {
    font-size: 11px;
    color: var(--text-dim);
}

/* Tabs */
.tabs, .records-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab, .rec-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active, .rec-tab.active {
    background: var(--gold);
    color: #000;
}

/* Leaderboard */
.leaderboard {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
}

.lb-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    padding: 12px 14px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.2s;
}

.lb-row:hover { background: var(--bg-hover); }
.lb-row:last-child { border-bottom: none; }

.lb-rank {
    font-weight: 800;
    font-size: 16px;
    text-align: center;
}

.lb-rank.r1 { color: var(--gold); }
.lb-rank.r2 { color: #c0c0c0; }
.lb-rank.r3 { color: #cd7f32; }

.lb-info { min-width: 0; }

.lb-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-name .retired {
    font-size: 9px;
    background: var(--text-dim);
    color: #000;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.lb-sub {
    font-size: 12px;
    color: var(--text-dim);
}

.lb-stat {
    text-align: right;
}

.lb-stat-value {
    font-weight: 800;
    font-size: 16px;
}

.lb-stat-value.good { color: var(--green); }
.lb-stat-value.bad { color: var(--red); }

.lb-stat-label {
    font-size: 10px;
    color: var(--text-dim);
}

/* Matchup Lookup */
.matchup-selectors {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.select {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.vs {
    font-weight: 700;
    color: var(--text-dim);
}

.matchup-results {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
}

.matchup-summary {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.matchup-score {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 4px;
}

.matchup-score .win { color: var(--green); }
.matchup-score .lose { color: var(--red); }

.matchup-label {
    font-size: 12px;
    color: var(--text-dim);
}

.matchup-game {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    padding: 12px 14px;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 13px;
}

.matchup-game:last-child { border-bottom: none; }

.matchup-game .left { text-align: left; }
.matchup-game .right { text-align: right; }
.matchup-game .center {
    color: var(--text-dim);
    font-size: 11px;
    text-align: center;
}

.matchup-game .score {
    font-weight: 700;
}

.matchup-game .score.won { color: var(--green); }
.matchup-game .score.lost { color: var(--red); }

/* Records */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: 10px;
}

.record-row:first-child {
    background: linear-gradient(135deg, rgba(245, 197, 66, 0.15), var(--bg-card));
    border: 1px solid rgba(245, 197, 66, 0.3);
}

.record-info { flex: 1; min-width: 0; }

.record-main {
    font-weight: 700;
    font-size: 14px;
}

.record-sub {
    font-size: 12px;
    color: var(--text-dim);
}

.record-value {
    font-weight: 800;
    font-size: 18px;
    color: var(--green);
}

/* Sacko */
.sacko-section {
    background: linear-gradient(180deg, transparent, rgba(239, 68, 68, 0.03), transparent);
}

.sacko-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
}

.sacko-card {
    flex-shrink: 0;
    width: 100px;
    padding: 14px 10px;
    background: var(--bg-card);
    border-radius: 10px;
    text-align: center;
    border-left: 3px solid var(--red);
}

.sacko-emoji { font-size: 20px; margin-bottom: 4px; }

.sacko-name {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sacko-count {
    font-size: 16px;
    font-weight: 800;
    color: var(--red);
}

/* Seasons Grid */
.seasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.season-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.season-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.season-year {
    font-size: 24px;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 8px;
}

.season-champ {
    font-size: 12px;
    margin-bottom: 4px;
}

.season-champ-name { font-weight: 700; }

.season-sacko {
    font-size: 11px;
    color: var(--text-dim);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 200;
    padding: 20px;
    overflow-y: auto;
}

.modal.open { display: flex; align-items: flex-start; justify-content: center; }

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    margin-top: 60px;
    position: relative;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

/* Manager Profile */
.profile-header {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.profile-name {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.profile-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.profile-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.profile-badge.champ { background: var(--gold); color: #000; }
.profile-badge.sacko { background: var(--red); color: #fff; }
.profile-badge.retired { background: var(--text-dim); color: #000; }

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(255,255,255,0.05);
}

.profile-stat {
    background: var(--bg-card);
    padding: 16px 12px;
    text-align: center;
}

.profile-stat-value {
    font-size: 20px;
    font-weight: 800;
}

.profile-stat-value.good { color: var(--green); }
.profile-stat-value.bad { color: var(--red); }

.profile-stat-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.profile-section {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.profile-section:last-child { border-bottom: none; }

.profile-section h3 {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.profile-season {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.profile-season:last-child { border-bottom: none; }

.profile-season .year { font-weight: 700; color: var(--gold); }
.profile-season .rank { color: var(--text-dim); }
.profile-season .rank.r1 { color: var(--gold); font-weight: 700; }
.profile-season .rank.rlast { color: var(--red); }

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 12px;
}

/* Desktop */
@media (min-width: 640px) {
    .nav { padding: 14px 24px; }
    .nav-brand { font-size: 16px; }
    .hero h1 { font-size: 36px; }
    .hero-years { font-size: 42px; }
    .section { padding: 60px 24px; }
    .section h2 { font-size: 24px; }
    .champ-card { width: 140px; padding: 20px 16px; }
    .lb-row { padding: 14px 18px; }
    .seasons-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
}

@media (min-width: 1024px) {
    .section { max-width: 900px; }
}
