/* === RESET & BASE === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0e27;
    color: #e0e0e0;
    min-height: 100vh;
}

/* === HEADER === */
header {
    background: linear-gradient(135deg, #1a1a4e, #2d1b69);
    padding: 30px 20px 15px;
    text-align: center;
    border-bottom: 3px solid #ff6b2b;
}

h1 {
    font-size: 2.5em;
    background: linear-gradient(90deg, #ff6b2b, #ffaa33, #ff6b2b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.subtitle {
    color: #8888cc;
    font-size: 1.1em;
    margin: 5px 0 20px;
}

/* === NAV === */
nav {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.25s;
}

.nav-btn:hover {
    background: rgba(255, 107, 43, 0.2);
    color: #ff9955;
    border-color: #ff6b2b;
}

.nav-btn.active {
    background: #ff6b2b;
    color: white;
    border-color: #ff6b2b;
    font-weight: bold;
}

/* === MAIN === */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 25px 20px;
}

.section { display: none; }
.section.active { display: block; }

h2 {
    font-size: 1.8em;
    color: #ffaa33;
    margin-bottom: 10px;
}

.section-intro {
    color: #8888cc;
    margin-bottom: 20px;
}

/* === YEAR SELECTOR === */
.year-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.arrow-btn {
    background: #ff6b2b;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.4em;
    cursor: pointer;
    transition: background 0.2s;
}

.arrow-btn:hover { background: #ff8844; }

#year-select {
    background: #1a1a4e;
    color: #ffaa33;
    border: 2px solid #ff6b2b;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
}

/* === BRACKET CARD === */
.bracket-card {
    background: linear-gradient(145deg, #141432, #1c1c4a);
    border: 1px solid rgba(255, 107, 43, 0.3);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.bracket-card h3 {
    text-align: center;
    font-size: 1.6em;
    color: #ffaa33;
    margin-bottom: 20px;
}

.champion-banner {
    text-align: center;
    background: linear-gradient(135deg, #ff6b2b, #ff9933);
    color: white;
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.champion-banner .team-name {
    font-size: 1.5em;
    font-weight: bold;
    display: block;
}

.champion-banner .seed-badge {
    background: rgba(0, 0, 0, 0.2);
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.7em;
    margin-left: 8px;
}

.championship-score {
    text-align: center;
    color: #8888cc;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.final-four-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.ff-team {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    transition: transform 0.2s;
}

.ff-team:hover { transform: scale(1.03); }

.ff-team .team-name {
    font-weight: bold;
    font-size: 1.15em;
    color: white;
}

.ff-team .seed-num {
    display: inline-block;
    background: #ff6b2b;
    color: white;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    font-size: 0.85em;
    font-weight: bold;
    margin-right: 6px;
}

.ff-team .region {
    color: #6666aa;
    font-size: 0.85em;
    margin-top: 4px;
}

.ff-team.champion-team {
    border-color: #ffaa33;
    background: rgba(255, 170, 51, 0.1);
}

.ff-team.runner-up-team {
    border-color: #888;
    background: rgba(200, 200, 200, 0.05);
}

.bracket-notes {
    background: rgba(255, 255, 255, 0.04);
    padding: 14px;
    border-radius: 10px;
    color: #aaaadd;
    font-style: italic;
    line-height: 1.5;
    border-left: 3px solid #ff6b2b;
}

.cancelled-card {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.cancelled-card .big-x {
    font-size: 4em;
    color: #ff4444;
}

/* === SEED GRID === */
.seed-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.seed-tile {
    background: linear-gradient(145deg, #141432, #1c1c4a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
}

.seed-tile:hover {
    border-color: #ff6b2b;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 43, 0.2);
}

.seed-tile.selected {
    border-color: #ffaa33;
    background: rgba(255, 170, 51, 0.15);
}

.seed-tile .seed-number {
    font-size: 2em;
    font-weight: bold;
    color: #ff6b2b;
}

.seed-tile .seed-ff {
    font-size: 0.8em;
    color: #8888cc;
    margin-top: 4px;
}

.seed-detail-card {
    background: linear-gradient(145deg, #141432, #1c1c4a);
    border: 1px solid rgba(255, 170, 51, 0.3);
    border-radius: 16px;
    padding: 25px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.seed-detail-card h3 {
    color: #ffaa33;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-label { color: #8888cc; }
.stat-value { color: white; font-weight: bold; }

.progress-bar-container {
    margin: 15px 0;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    color: #8888cc;
    font-size: 0.85em;
    margin-bottom: 4px;
}

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    height: 22px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #ff6b2b, #ffaa33);
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 0.75em;
    font-weight: bold;
    color: white;
    min-width: fit-content;
}

.progress-bar-zero {
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 10px;
    font-size: 0.75em;
    color: #555;
    font-style: italic;
}

/* === LINE CHART === */
.chart-container {
    background: linear-gradient(145deg, #141432, #1c1c4a);
    border: 1px solid rgba(255, 107, 43, 0.3);
    border-radius: 16px;
    padding: 25px;
    margin-top: 25px;
}

.chart-container h3 {
    color: #ffaa33;
    font-size: 1.3em;
    margin-bottom: 5px;
}

.chart-container .chart-subtitle {
    color: #8888cc;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.chart-canvas-wrap {
    position: relative;
    width: 100%;
    overflow-x: auto;
}

canvas#seed-line-chart {
    display: block;
    width: 100%;
    height: 420px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82em;
    color: #aaa;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.legend-item.dimmed {
    opacity: 0.3;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.seed-note {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid #ff6b2b;
    border-radius: 6px;
    color: #aaaadd;
    font-style: italic;
}

/* === QUESTION SECTION === */
.question-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.q-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #ccccee;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s;
    text-align: left;
}

.q-btn:hover {
    background: rgba(255, 107, 43, 0.15);
    border-color: #ff6b2b;
    color: white;
}

.answer-box {
    background: linear-gradient(145deg, #141432, #1c1c4a);
    border: 1px solid rgba(255, 170, 51, 0.3);
    border-radius: 16px;
    padding: 25px;
    line-height: 1.7;
    animation: slideIn 0.3s ease;
}

.answer-box h3 {
    color: #ffaa33;
    margin-bottom: 12px;
    font-size: 1.3em;
}

.answer-box .big-stat {
    font-size: 3em;
    font-weight: bold;
    color: #ff6b2b;
    text-align: center;
    margin: 15px 0;
}

.answer-box .detail {
    color: #aaaadd;
    margin-top: 10px;
}

.answer-box ul {
    margin: 10px 0 10px 20px;
}

.answer-box li {
    margin: 6px 0;
    color: #ccccee;
}

.answer-box li strong {
    color: #ffaa33;
}

/* === HEATMAP === */
.heatmap-wrap {
    overflow-x: auto;
    padding-bottom: 10px;
}

.heatmap-table {
    border-collapse: collapse;
    margin: 0 auto;
}

.heatmap-table th {
    padding: 6px 4px;
    font-size: 0.8em;
    color: #8888cc;
    text-align: center;
    min-width: 42px;
}

.heatmap-table th.row-header {
    color: #ffaa33;
    font-size: 0.9em;
    text-align: right;
    padding-right: 8px;
    white-space: nowrap;
}

.heatmap-table th.col-header {
    color: #ffaa33;
}

.heatmap-table td {
    width: 42px;
    height: 38px;
    text-align: center;
    font-size: 0.78em;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: default;
    position: relative;
    transition: transform 0.15s;
}

.heatmap-table td:hover {
    outline: 2px solid white;
    z-index: 2;
}

.heatmap-table td.hm-self {
    background: rgba(255, 255, 255, 0.03);
    color: #444;
    font-size: 0.7em;
}

.heatmap-table td.hm-nodata {
    background: rgba(255, 255, 255, 0.02);
    color: #333;
    font-size: 0.65em;
}

.heatmap-tooltip {
    position: fixed;
    pointer-events: none;
    background: rgba(20, 20, 50, 0.96);
    border: 1px solid rgba(255, 170, 51, 0.5);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: white;
    display: none;
    z-index: 100;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    line-height: 1.6;
}

/* === UPSETS === */
.upset-category {
    margin-bottom: 30px;
}

.upset-category h3 {
    color: #ff4444;
    font-size: 1.4em;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(255, 68, 68, 0.3);
}

.upset-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: border-color 0.2s;
}

.upset-card:hover { border-color: #ff4444; }

.upset-year {
    background: #ff4444;
    color: white;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 1.1em;
    white-space: nowrap;
}

.upset-info .matchup {
    font-weight: bold;
    color: white;
    font-size: 1.05em;
}

.upset-info .upset-note {
    color: #8888cc;
    font-size: 0.9em;
    margin-top: 3px;
}

/* === FUN FACTS === */
.fact-card {
    background: linear-gradient(145deg, #141432, #1c1c4a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 12px;
    font-size: 1.05em;
    line-height: 1.5;
    transition: border-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.fact-card:hover { border-color: #ff6b2b; }

.fact-number {
    background: #ff6b2b;
    color: white;
    width: 32px;
    height: 32px;
    min-width: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9em;
}

.hidden { display: none; }

/* === FOOTER === */
footer {
    text-align: center;
    padding: 30px;
    color: #555;
    font-size: 0.85em;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    h1 { font-size: 1.7em; }
    .seed-grid { grid-template-columns: repeat(4, 1fr); }
    .final-four-grid { grid-template-columns: 1fr; }
    .nav-btn { padding: 8px 12px; font-size: 0.85em; }
    .bracket-card { padding: 18px; }
}
