/* ── Reset & Base ─────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1b23;
    --bg-card: #1f2029;
    --bg-input: #252630;
    --text-primary: #f0f0f5;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --accent-blue: #3b82f6;
    --accent-purple: #a855f7;
    --accent-gold: #f59e0b;
    --accent-orange: #f97316;
    --border: #2d2e3a;
    --border-hover: #4b5563;
    --radius: 12px;
    --transition: 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────── */
header {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    background: linear-gradient(180deg, #15161e 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f0f0f5 0%, #a855f7 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
}

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

.hero-intro {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0.75rem auto 0;
}

.hero-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.hero-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.875rem 1.5rem;
    text-align: center;
}

.hero-stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Controls ────────────────────────────────────────── */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.control-group {
    flex: 1;
    min-width: 160px;
}

.control-group-wide {
    flex: 2;
    min-width: 280px;
}

.control-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

select {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

select:hover {
    border-color: var(--accent-purple);
}

select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Utility classes ──────────────────────────────────── */
.help-text {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

/* ── Focus-visible for keyboard navigation ───────────── */
button:focus-visible,
.tab-btn:focus-visible,
.team-chip:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* ── Chart Mode Toggle ───────────────────────────────── */
.chart-mode-toggle {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 10;
    display: flex;
    gap: 0.4rem;
}

.chart-mode-toggle button {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.chart-mode-toggle button.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.chart-mode-toggle button:hover:not(.active) {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* ── Chart Container ─────────────────────────────────── */
#chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    min-height: 450px;
}

#wp-chart {
    width: 100%;
    height: 450px;
}

#placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

#placeholder.hidden {
    display: none;
}

.placeholder-icon {
    font-size: 4rem;
    opacity: 0.3;
}

#placeholder p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ── Key Plays ───────────────────────────────────────── */
#key-plays {
    margin-top: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

#key-plays.hidden {
    display: none;
}

#key-plays h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#key-plays-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.key-play-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border-left: 3px solid;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.key-play-card.positive {
    border-left-color: var(--accent-green);
}

.key-play-card.negative {
    border-left-color: var(--accent-red);
}

.key-play-desc {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.key-play-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.key-play-shift {
    font-size: 0.85rem;
    font-weight: 700;
}

.key-play-shift.positive {
    color: var(--accent-green);
}

.key-play-shift.negative {
    color: var(--accent-red);
}

/* ── Game Summary ────────────────────────────────────── */
#game-summary {
    margin-top: 1rem;
    text-align: center;
    padding: 1rem;
}

#game-summary.hidden {
    display: none;
}

#summary-content {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Advanced Stats ──────────────────────────────────── */
#adv-stats {
    margin-top: 2.5rem;
    animation: fadeIn 0.5s ease;
}

#adv-stats.hidden {
    display: none;
}

#adv-stats h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.stat-card.full-width {
    grid-column: 1 / -1;
}

.stat-card h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    font-weight: 600;
}

.runs-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 250px;
    overflow-y: auto;
}

.run-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--text-muted);
}

.run-item.team-a {
    border-left-color: var(--accent-red);
}

.run-item.team-b {
    border-left-color: var(--accent-blue);
}

.run-score {
    font-size: 1.2rem;
    font-weight: 800;
}

.run-score.team-a {
    color: var(--accent-red);
}

.run-score.team-b {
    color: var(--accent-blue);
}

.run-meta {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lineups-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 350px;
    overflow-y: auto;
}

.lineup-item {
    display: flex;
    flex-direction: column;
    padding: 0.8rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--text-muted);
}

.lineup-item.team-a {
    border-left-color: var(--accent-red);
}

.lineup-item.team-b {
    border-left-color: var(--accent-blue);
}

.lineup-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.lineup-names {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.lineup-score {
    font-size: 1.1rem;
    font-weight: 800;
}

.lineup-score.positive {
    color: var(--accent-green);
}

.lineup-score.negative {
    color: var(--accent-red);
}

.shot-toggle {
    display: flex;
    gap: 0.5rem;
}

.shot-toggle button {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.shot-toggle button.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.shot-toggle button:hover:not(.active) {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.box-score-wrap {
    overflow-x: auto;
}

.box-score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    white-space: nowrap;
}

.box-score-table th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 0.6rem 0.8rem;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    text-align: right;
}

.box-score-table th:first-child {
    text-align: left;
}

.box-score-table td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    text-align: right;
}

.box-score-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.box-score-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.08);
}

.box-score-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.box-score-table tbody tr:nth-child(even):hover {
    background: rgba(139, 92, 246, 0.08);
}

.box-score-table .highlight-pts {
    color: var(--accent-green);
    font-weight: 700;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Footer ──────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* ── Loading animation ───────────────────────────────── */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
    header h1 {
        font-size: 1.5rem;
    }

    .controls {
        flex-direction: column;
    }

    .control-group,
    .control-group-wide {
        min-width: 100%;
    }

    #wp-chart {
        height: 350px;
    }
}

/* ═══════════════════════════════════════════════════════════
   SEASON HUB STYLES
   ═══════════════════════════════════════════════════════════ */

/* ── Site Navigation ─────────────────────────────────────── */
.site-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-right: auto;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.12);
}

/* ── Playoff Banner ──────────────────────────────────────── */
.playoff-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.14), rgba(249, 115, 22, 0.14));
    border-bottom: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background var(--transition);
}

.playoff-banner:hover {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.24), rgba(249, 115, 22, 0.24));
}

.playoff-banner-label {
    color: var(--accent-gold);
    letter-spacing: 0.02em;
}

.playoff-banner-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.playoff-banner-arrow {
    color: var(--accent-gold);
    font-weight: 700;
    transition: transform var(--transition);
}

.playoff-banner:hover .playoff-banner-arrow {
    transform: translateX(3px);
}

@media (max-width: 640px) {
    .playoff-banner {
        font-size: 0.85rem;
        gap: 0.5rem;
        padding: 0.55rem 1rem;
    }
    .playoff-banner-text {
        display: none;
    }
}

/* ── Tab Bar ─────────────────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition);
    margin-bottom: -1px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

/* ── Hidden utility ─────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ── Sortable table headers (reusable) ────────────────────── */
.sortable-th {
    cursor: pointer;
    user-select: none;
}
.sortable-th:hover {
    color: var(--text-primary);
}
.sort-active {
    color: var(--accent-purple);
}

/* ── Season grid (2-col layout) ──────────────────────────── */
.season-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ── Loading placeholder ─────────────────────────────────── */
.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Standings table ─────────────────────────────────────── */
.standings-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.standings-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
    white-space: nowrap;
}

.standings-tbl th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
}

.standings-tbl th.sortable {
    cursor: pointer;
    user-select: none;
}

.standings-tbl th.sortable:hover {
    color: var(--text-primary);
}

.standings-tbl th.sort-active {
    color: var(--accent-purple);
}

.standings-tbl td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.standings-tbl tbody tr:hover {
    background: rgba(168, 85, 247, 0.07);
}

.standings-tbl tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.standings-tbl tbody tr:nth-child(even):hover {
    background: rgba(168, 85, 247, 0.07);
}

/* ── Form dots (Last 5) ─────────────────────────────────── */
.form-dots {
    display: flex;
    gap: 3px;
    justify-content: center;
    align-items: center;
}

.form-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0;
}

.form-w {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.form-l {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── Playoff cutoff dividers ────────────────────────────── */
.cutoff-row td {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    position: relative;
}

.cutoff-label {
    display: block;
    text-align: right;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 0.75rem;
    opacity: 0.8;
}

.pct-cell {
    display: inline-block;
    min-width: 52px;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-align: right;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ── Team badge ─────────────────────────────────────────── */
.team-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 22px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    vertical-align: middle;
    flex-shrink: 0;
}

.team-badge.sm {
    width: 28px;
    height: 18px;
    font-size: 0.58rem;
}

/* ── Playoff probability grid ────────────────────────────── */
.playoff-grid-inner {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.playoff-header-row {
    display: grid;
    grid-template-columns: 1fr 80px 90px 90px 90px;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.ph-team { text-align: left; }
.ph-xwins, .ph-tile { text-align: center; }

.playoff-row {
    display: grid;
    grid-template-columns: 1fr 80px 90px 90px 90px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: background var(--transition);
}

.playoff-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.pr-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.pr-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pr-xwins {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.pr-tile {
    display: flex;
    align-items: center;
    justify-content: center;
}

.playoff-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 30px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: opacity var(--transition);
}

/* ── Oracle header bar ───────────────────────────────────── */
.oracle-header-bar {
    margin-bottom: 1.5rem;
}

.oracle-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.oracle-round-badge {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.oracle-acc-badge {
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── Oracle cards grid ───────────────────────────────────── */
.oracle-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Last card alone on a row spans all columns */
.oracle-cards-grid > .oracle-card:last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
    max-width: calc(33.33% - 0.67rem);
}

.oracle-placeholder {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.oracle-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: border-color var(--transition);
}

.oracle-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
}

.oracle-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.oracle-team {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
}

.oracle-team.home-team {
    justify-content: flex-start;
}

.oracle-team.away-team {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.oracle-team-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.oracle-vs {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.ha-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    height: 18px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.ha-home {
    background: rgba(34, 197, 94, 0.18);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.ha-away {
    background: rgba(59, 130, 246, 0.18);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.winner-glow .oracle-team-name {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.winner-glow .team-badge {
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

/* ── Win probability bar ─────────────────────────────────── */
.wp-bar-wrap {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.wp-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    transition: width 0.4s ease;
    min-width: 28px;
}

.wp-home {
    justify-content: flex-start;
    padding-left: 6px;
}

.wp-away {
    justify-content: flex-end;
    padding-right: 6px;
}

/* ── Oracle footer ───────────────────────────────────────── */
.oracle-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.oracle-margin {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.oracle-conf {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.conf-high {
    background: rgba(34, 197, 94, 0.18);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.35);
    font-weight: 700;
}

.conf-med {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.conf-low {
    background: rgba(156, 163, 175, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(156, 163, 175, 0.15);
}

.oracle-predicted {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.35rem 0;
    border-top: 1px solid var(--border);
    gap: 0.5rem;
}
.oracle-predicted strong {
    font-size: 0.9rem;
}
.coin-flip-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    background: rgba(156,163,175,0.12);
    border: 1px solid rgba(156,163,175,0.3);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    white-space: nowrap;
    margin-right: 0.25rem;
}

.oracle-headline {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border);
}

.insight-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}
.insight-pill {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.45rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.insight-key-players {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-style: italic;
}

/* ── Last updated stamp ─────────────────────────────────── */
.last-updated {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    letter-spacing: 0.02em;
}

/* ── Oracle game date ───────────────────────────────────── */
.oracle-game-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* ── Player forecast controls ───────────────────────────── */
.forecast-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.forecast-controls select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.forecast-toggle-btn {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: var(--accent-purple);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.forecast-toggle-btn:hover {
    background: rgba(168, 85, 247, 0.25);
}

.forecast-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 0.4rem;
    padding-right: 0.5rem;
}

.fc-sortable {
    user-select: none;
}

.fc-sortable:hover {
    color: var(--text-primary);
}

.fc-sort-active {
    color: var(--accent-purple) !important;
}

/* Inline team name next to badge */
.fc-team-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Player forecast table ───────────────────────────────── */
.forecast-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.forecast-tbl th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.6rem;
    border-bottom: 2px solid var(--border);
    text-align: right;
}

.forecast-tbl th:first-child,
.forecast-tbl th:nth-child(2) {
    text-align: left;
}

.forecast-tbl td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    text-align: right;
    vertical-align: middle;
}

.forecast-tbl td:first-child,
.forecast-tbl td:nth-child(2) {
    text-align: left;
}

.forecast-tbl tbody tr:hover {
    background: rgba(168, 85, 247, 0.07);
}

/* ── Accuracy stats ─────────────────────────────────────── */
.accuracy-stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.acc-stat-box {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.8rem 0.5rem;
    text-align: center;
}

.acc-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.acc-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .season-grid {
        grid-template-columns: 1fr;
    }

    .accuracy-stat-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .playoff-header-row,
    .playoff-row {
        grid-template-columns: 1fr 60px 72px 72px 72px;
    }

    .playoff-tile {
        width: 68px;
        font-size: 0.72rem;
    }

    .oracle-cards-grid {
        grid-template-columns: 1fr;
    }

    .oracle-team-name {
        max-width: 80px;
    }
}

@media (max-width: 480px) {
    .site-nav {
        padding: 0.5rem 0.75rem;
    }

    .site-nav-brand {
        font-size: 0.85rem;
    }

    .nav-link {
        font-size: 0.78rem;
        padding: 0.3rem 0.6rem;
    }

    .tab-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.82rem;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    header {
        padding: 1.5rem 0.75rem 1rem;
    }

    main {
        padding: 1rem 0.6rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .playoff-header-row,
    .playoff-row {
        grid-template-columns: 1fr 55px 65px 65px 65px;
    }

    .playoff-tile {
        width: 60px;
        font-size: 0.68rem;
    }

    .hero-intro {
        font-size: 0.85rem;
    }

    .hero-stats {
        gap: 0.6rem;
    }

    .hero-stat {
        padding: 0.6rem 0.8rem;
    }

    .hero-stat-number {
        font-size: 1.3rem;
    }
}

/* ── Site Footer ───────────────────────────────────────────── */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.8;
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.site-footer a:hover {
    color: var(--accent-purple);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.footer-sep {
    color: var(--border);
}
/* ── Explore Section ──────────────────────────────────────── */
.explore-section {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.explore-section h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.explore-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.explore-grid-bottom {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 66.666%;
    margin: 0.75rem auto 0;
}

.explore-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 0.75rem;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition);
    display: block;
}

.explore-card:hover {
    border-color: var(--accent-purple);
}

.explore-card-emoji {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.explore-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.explore-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

@media (max-width: 480px) {
    .explore-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .explore-grid-bottom {
        grid-template-columns: 1fr;
        max-width: 50%;
    }
}

/* ── Series Hub ────────────────────────────────────────────────────────── */

.series-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.back-link {
  display: inline-block;
  color: #9fb7d9;
  text-decoration: none;
  margin-bottom: 16px;
  font-size: 14px;
}
.back-link:hover { color: #fff; }

.series-section { margin-bottom: 28px; }
.series-section-title {
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #9fb7d9;
  margin: 0 0 12px;
}

.series-hero {
  background: #1e3a5f;
  border: 1px solid #60a5fa;
  border-radius: 8px;
  padding: 24px;
}
.series-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.series-title {
  margin: 0;
  font-size: 22px;
  color: #fff;
}
.series-hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.series-status-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.series-status-chip.awaiting { background: #2a4a70; color: #9fb7d9; }
.series-status-chip.not-started { background: #2a4a70; color: #e8efff; }
.series-status-chip.completed { background: #FFD700; color: #0e1a2a; }
.series-status-chip.live { background: #00E676; color: #0e1a2a; }
.series-format-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #2a4a70;
  color: #9fb7d9;
}

.series-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.series-team-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--team-color, #60a5fa) 18%, #132a44);
  border: 1px solid color-mix(in srgb, var(--team-color, #60a5fa) 50%, transparent);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.series-team-panel-winner {
  background: color-mix(in srgb, var(--team-color, #60a5fa) 30%, #132a44);
  border-color: var(--team-color, #60a5fa);
  box-shadow: 0 0 0 1px var(--team-color, #60a5fa) inset;
}
.series-team-pending {
  background: #132a44;
  border: 1px dashed #3a5a80;
}
.series-team-logo-wrap {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px;
}
.series-team-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.series-team-logo-placeholder {
  font-size: 28px;
  color: #9fb7d9;
  font-weight: 600;
}
.series-team-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.series-team-seed {
  font-size: 11px;
  color: #9fb7d9;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.series-team-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.series-team-prob {
  font-size: 20px;
  font-weight: 700;
  color: var(--team-color, #fff);
  margin-top: 2px;
}
.series-team-winner-tag {
  font-size: 11px;
  color: #FFD700;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.series-vs {
  color: #9fb7d9;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.series-prob-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #132a44;
}
.series-prob-fill { height: 100%; transition: width 0.3s ease; }

.series-timeline {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.series-game-box {
  flex: 0 0 140px;
  background: #1e3a5f;
  border: 1px solid #3a5a80;
  border-top: 3px solid var(--home-color, #3a5a80);
  border-radius: 6px;
  padding: 12px;
  color: #e8efff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.series-game-box.completed { border-color: #3a5a80; border-top-color: var(--home-color, #60a5fa); }
.series-game-box.completed:hover { background: #2a4a70; }
.series-game-num { font-weight: 600; font-size: 14px; color: #fff; }
.series-game-score { display: flex; flex-direction: column; gap: 2px; }
.series-game-score .winner { font-weight: 700; color: #fff; }
.series-game-date { color: #9fb7d9; }
.series-game-status { color: #60a5fa; font-size: 11px; }
.series-game-wp { color: #f59e0b; font-size: 11px; }
.series-game-venue { color: #9fb7d9; font-size: 11px; }

.series-h2h-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.series-h2h-card {
  background: #1e3a5f;
  border: 1px solid #3a5a80;
  border-left: 4px solid var(--winner-color, #3a5a80);
  border-radius: 6px;
  padding: 14px;
  color: #e8efff;
}
.series-h2h-round {
  color: #9fb7d9;
  font-size: 12px;
  margin-bottom: 10px;
}
.series-h2h-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.series-h2h-side {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #9fb7d9;
}
.series-h2h-side.winner {
  color: var(--winner-color, #60a5fa);
  font-weight: 700;
}
.series-h2h-side.winner .series-h2h-score-val {
  color: #fff;
  font-size: 18px;
}
.series-h2h-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.series-h2h-team { font-weight: 600; }
.series-h2h-score-val { font-size: 16px; font-weight: 700; }
.series-h2h-dash { color: #9fb7d9; }
.series-h2h-summary {
  margin-top: 10px;
  color: #9fb7d9;
  font-size: 13px;
}

.series-recaps { display: flex; flex-direction: column; gap: 10px; }
.series-recap-card {
  background: #1e3a5f;
  border: 1px solid #3a5a80;
  border-radius: 6px;
  padding: 14px;
  color: #e8efff;
}
.recap-title { font-size: 13px; color: #9fb7d9; margin-bottom: 6px; }
.recap-score { font-size: 16px; margin-bottom: 4px; }
.recap-pre { font-size: 12px; color: #9fb7d9; }
.recap-upset {
  background: #f59e0b;
  color: #0e1a2a;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-left: 6px;
}

.series-empty { color: #9fb7d9; font-size: 14px; }
.series-error { text-align: center; padding: 40px 16px; }
.series-error h1 { color: #fff; }
.series-error p { color: #9fb7d9; }
.series-index { list-style: none; padding: 0; }
.series-index li { padding: 8px 0; border-bottom: 1px solid #2a4a70; }
.series-index a { color: #60a5fa; text-decoration: none; }
.series-index a:hover { color: #fff; }

.series-hub-link {
  position: absolute;
  top: 4px;
  right: 6px;
  color: #9fb7d9;
  text-decoration: none;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 3px;
  z-index: 2;
}
.series-hub-link:hover { color: #fff; background: #2a4a70; }
.matchup { position: relative; }

.recap-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.recap-card-link .recap-card:hover {
  background: #2a4a70;
  cursor: pointer;
}

.recap-replay-link {
  color: #9fb7d9;
  text-decoration: none;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(90, 130, 200, 0.18);
  border: 1px solid rgba(120, 160, 220, 0.35);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.recap-replay-link:hover {
  color: #fff;
  background: rgba(120, 160, 220, 0.45);
}

@media (max-width: 640px) {
  .series-h2h-cards { grid-template-columns: 1fr; }
  .series-teams { grid-template-columns: 1fr; }
  .series-vs { justify-self: center; }
  .series-hero-top { flex-direction: column; }
}
