/* ===========================
   GLOBAL THEME
   =========================== */

:root {
    --bg-body: #050814;
    --bg-surface: #111827;
    --bg-surface-soft: #0b1120;
    --bg-header: #020617;
    --bg-footer: #020617;
    --border-subtle: #1f2937;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --text-soft: #cbd5f5;
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.12);
    --success-soft: rgba(34, 197, 94, 0.18);
    --danger-soft: rgba(239, 68, 68, 0.18);
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background: var(--bg-body);
    color: var(--text-main);
}

a {
    color: var(--accent);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* ===========================
   LAYOUT
   =========================== */

.app-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
}

/* Utility spacing */

.mb-1 {
    margin-bottom: .25rem;
}

.mb-2 {
    margin-bottom: .5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.p-2 {
    padding: .5rem;
}

.p-3 {
    padding: 1rem;
}

/* Standings layout wrapper */

.standings-layout {
    max-width: 1100px;
    margin: 0 auto;
}

/* ===========================
   HEADER / NAV
   =========================== */

.navbar {
    background: var(--bg-header);
    color: var(--text-main);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.4rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    color: #f9fafb;
    text-decoration: none;
    font-size: 1.1rem;
}

    .navbar-brand:hover {
        text-decoration: none;
        color: #f9fafb;
    }

.navbar-nav {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
}

    .nav-link:hover {
        color: #f9fafb;
    }

/* Simple: no collapse yet */
.navbar-toggler {
    display: none;
}

/* ===========================
   FOOTER
   =========================== */

footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===========================
   TYPOGRAPHY HELPERS
   =========================== */

.text-muted {
    color: var(--text-muted);
}

.small {
    font-size: 0.8rem;
}

/* ===========================
   CARDS & ALERTS
   =========================== */

.card {
    background: var(--bg-surface-soft);
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    padding: 0.9rem 1rem;
}

    .card + .card {
        margin-top: 0.75rem;
    }

.card-title {
    margin: 0;
    font-size: 1rem;
}

.card-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-link {
    font-size: 0.9rem;
}

.alert {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin: 0.75rem 0;
}

.alert-info {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #bfdbfe;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fecaca;
}

/* ===========================
   EXPLAINER CARD
   =========================== */

.card-explainer {
    background: #020617;
    border: 1px solid #1f2937;
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
}

.card-explainer-title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.card-explainer-body,
.card-explainer-list,
.card-explainer-note {
    font-size: 0.85rem;
    color: #e5e7eb;
}

.card-explainer-list {
    margin: 0.25rem 0 0.25rem 1.25rem;
    padding: 0;
}

.card-explainer-note {
    color: #9ca3af;
}

/* ===========================
   STANDINGS HEADINGS
   =========================== */

.standings-title {
    margin-bottom: 0.25rem;
}

.standings-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.standings-conference-title {
    font-size: 1.1rem;
    margin: 0.75rem 0 0.5rem;
}

/* ===========================
   TABLES (STANDINGS)
   =========================== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* Main table class used in Standings.razor */
.table-standings {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--bg-surface);
    border-radius: 0.75rem;
    overflow: hidden;
}

/* Backwards-compat alias, in case anything still uses this */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--bg-surface);
    border-radius: 0.75rem;
    overflow: hidden;
}

    .table-standings thead,
    .standings-table thead {
        background: #020617;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .table-standings th,
    .table-standings td,
    .standings-table th,
    .standings-table td {
        padding: 0.5rem 0.75rem;
        text-align: left;
        border-bottom: 1px solid var(--border-subtle);
        white-space: nowrap;
        color: #d3d7df;
    }

    .table-standings th,
    .standings-table th {
        font-weight: 600;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--text-muted);
    }

    /* Alternating rows for readability */
    .table-standings tbody tr:nth-child(even) td,
    .standings-table tbody tr:nth-child(even) td {
        background: rgba(255, 255, 255, 0.015);
    }

    /* Hover highlight */
    .table-standings tbody tr:hover td,
    .standings-table tbody tr:hover td {
        background: rgba(15, 23, 42, 0.9);
    }

/* Division header row */
.division-header-row td {
    background: #0e1628;
    color: #c1c9d4;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-top: 0.4rem;
    padding-bottom: 0.3rem;
    font-weight: 600;
}

/* Numeric columns alignment */
.table-standings td:nth-child(4),
.table-standings td:nth-child(5),
.table-standings td:nth-child(6),
.table-standings td:nth-child(7),
.table-standings td:nth-child(8),
.standings-table td:nth-child(4),
.standings-table td:nth-child(5),
.standings-table td:nth-child(6),
.standings-table td:nth-child(7),
.standings-table td:nth-child(8) {
    text-align: center;
}

/* Magic / Tragic columns */

.table-standings th.magic-th,
.table-standings th.tragic-th,
.standings-table th.magic-th,
.standings-table th.tragic-th {
    text-align: center;
}

.table-standings th.magic-th,
.standings-table th.magic-th {
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-subtle);
}

.table-standings td.magic-td,
.table-standings td.tragic-td,
.standings-table td.magic-td,
.standings-table td.tragic-td {
    text-align: center;
}

.table-standings td.magic-td,
.standings-table td.magic-td {
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-subtle);
}

/* Team cell (logo + name) */

.standings-team {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.standings-team-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.standings-team-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
}

    .standings-team-link:hover {
        text-decoration: underline;
    }

/* Highlight rows near clinch / elimination */

.row-close-clinch td {
    background: rgba(22, 163, 74, 0.12);
}

.row-close-elim td {
    background: rgba(220, 38, 38, 0.10);
}

/* ===========================
   BADGES (MAGIC / TRAGIC)
   =========================== */

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.bg-success {
    background: #16a34a;
    color: #ecfdf5;
}

.bg-danger {
    background: #dc2626;
    color: #fee2e2;
}

/* Magic & Tragic pill badges */

.badge-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 2.3rem;
}

/* Neutral (blue-ish) */
.badge-neutral {
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid rgba(56, 189, 248, 0.55);
    color: #a5eaff;
}

/* Good (green) – closer to clinching or clinched */
.badge-good {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.55);
    color: #d1fae5;
}

/* Danger (red) – closer to elimination or eliminated */
.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.55);
    color: #fecaca;
}

/* ===========================
   TEAM PAGE
   =========================== */

.team-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.team-logo-lg {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-header-title {
    font-size: 1.35rem;
    margin: 0;
}

.team-header-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===========================
   SUBSCRIBE PAGE
   =========================== */

.input-text {
    background: #020617;
    border-radius: 0.4rem;
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 0.5rem;
    color: var(--text-main);
    width: 260px;
    max-width: 100%;
}

    .input-text:focus {
        outline: none;
        border-color: var(--accent);
    }

.btn-primary {
    background: var(--accent);
    border: none;
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    color: #0b1120;
    font-weight: 600;
    cursor: pointer;
}

    .btn-primary:hover {
        filter: brightness(1.1);
    }

.teams-grid {
    max-height: 260px;
    overflow-y: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border-subtle);
    padding: 0.5rem 0.75rem;
    background: #020617;
}

.team-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    padding: 0.2rem 0;
}

/* ===========================
   MOBILE TWEAKS
   =========================== */

@media (max-width: 768px) {
    main .container {
        padding: 1rem;
    }

    .table-standings th,
    .table-standings td,
    .standings-table th,
    .standings-table td {
        padding: 0.4rem 0.45rem;
        font-size: 0.78rem;
    }

    .navbar {
        padding: 0.4rem 0.75rem;
    }

    .team-logo-lg {
        width: 48px;
        height: 48px;
    }
}

/* ===========================
   TEAM PAGE (ENHANCED)
   =========================== */

.team-page {
    max-width: 1100px;
    margin: 0 auto;
}

.team-header-card {
    padding: 1rem 1.1rem;
}

.team-header-top {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.team-header-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,.35));
}

.team-header-text h1 {
    margin: 0;
}

.team-race-text {
    margin: 0.4rem 0 0;
    color: var(--text-soft);
    opacity: 0.95;
    font-size: 0.9rem;
}

.team-number-chips {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.9rem;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

    .chip span {
        color: var(--text-muted);
        font-size: 0.8rem;
    }

    .chip strong {
        font-size: 1.05rem;
        color: #ffffff;
    }

.chip-magic {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
}

.chip-tragic {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.08);
}

.team-help-callout {
    margin-top: 0.9rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: #dbeafe;
    font-size: 0.9rem;
}

/* Rooting guide */

.team-rooting-guide {
    padding: 1rem 1.1rem;
}

.rooting-guide-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.rooting-subhead {
    margin: 1rem 0 0.5rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.rooting-guide-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.rooting-guide-item {
    padding: 0.85rem 0.95rem;
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}

.rooting-guide-main {
    line-height: 1.35;
    color: #e5e7eb;
}

.rooting-guide-tags {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Delta chips */
.delta-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.03);
    color: #e5e7eb;
}

    .delta-chip.magic {
        border-color: rgba(34, 197, 94, 0.35);
    }

    .delta-chip.tragic {
        border-color: rgba(56, 189, 248, 0.35);
    }

    .delta-chip.good {
        background: rgba(34, 197, 94, 0.12);
    }

    .delta-chip.bad {
        background: rgba(239, 68, 68, 0.10);
        border-color: rgba(239, 68, 68, 0.35);
    }

    .delta-chip.special {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255,255,255,0.12);
        color: #ffffff;
    }

/* Mobile */
@media (max-width: 768px) {
    .team-header-top {
        align-items: flex-start;
    }

    .team-header-logo {
        width: 52px;
        height: 52px;
    }
}

/* ===========================
   TEAM PAGE (ENHANCED)
   Paste at bottom of app.css
   =========================== */

.btn-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

    .btn-link:hover {
        text-decoration: underline;
    }

.team-page {
    max-width: 1100px;
    margin: 0 auto;
}

.team-breadcrumbs {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.team-hero {
    padding: 1rem 1rem;
}

.team-hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 1rem;
    align-items: start;
}

.team-hero-left {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1rem;
    align-items: start;
}

.team-hero-logoWrap {
    width: 160px;
    height: 160px;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.team-hero-logo {
    width: 100%;
    height: 100%;
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.4));
}

.team-name {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.2;
}

.team-meta {
    margin-top: .35rem;
    color: var(--text-muted);
    font-size: .9rem;
}

.team-meta-sep {
    margin: 0 .5rem;
    color: rgba(255,255,255,0.18);
}

.team-race {
    margin-top: .65rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .6rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.06);
    color: #cfefff;
    font-size: .85rem;
}

.team-race-label {
    color: rgba(255,255,255,0.65);
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    font-size: .72rem;
}

.team-race-vs {
    color: rgba(255,255,255,0.75);
}

.team-hero-right {
    display: grid;
    gap: .85rem;
}

.team-number-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}

.chip {
    border-radius: 0.85rem;
    padding: .65rem .75rem;
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.02);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

    .chip span {
        color: rgba(255,255,255,0.72);
        font-size: .82rem;
        font-weight: 600;
    }

    .chip strong {
        font-size: 1.25rem;
        letter-spacing: .02em;
    }

.chip-magic {
    border-color: rgba(34, 197, 94, 0.30);
    background: rgba(34, 197, 94, 0.06);
}

.chip-tragic {
    border-color: rgba(56, 189, 248, 0.30);
    background: rgba(56, 189, 248, 0.06);
}

.team-quick-model {
    border-radius: 0.85rem;
    padding: .75rem .85rem;
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.015);
}

.team-quick-title {
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: .35rem;
}

.team-quick-body {
    color: rgba(255,255,255,0.75);
    font-size: .85rem;
    line-height: 1.35;
}

    .team-quick-body .spacer {
        display: inline-block;
        width: .6rem;
    }

.dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    margin-right: .35rem;
    transform: translateY(-1px);
}

.dot-magic {
    background: rgba(34, 197, 94, 0.9);
}

.dot-tragic {
    background: rgba(56, 189, 248, 0.9);
}

/* Rooting guide polish */
.team-rooting {
    padding: 1rem 1rem;
}

.team-rooting-title {
    margin: 0;
    font-size: 1.15rem;
}

.team-rooting-subtitle {
    margin-top: .25rem;
    color: var(--text-muted);
    font-size: .9rem;
}

.team-rooting-groupTitle {
    margin-top: 1rem;
    margin-bottom: .5rem;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,0.65);
}

.rooting-guide-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .55rem;
}

.rooting-guide-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .75rem;
    align-items: center;
    padding: .7rem .75rem;
    border-radius: .75rem;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}

.rooting-guide-main {
    color: rgba(255,255,255,0.90);
    font-size: .92rem;
    line-height: 1.35;
}

.rooting-guide-tags {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
}

.delta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .01em;
    border: 1px solid rgba(255,255,255,0.12);
}

    .delta-chip.magic {
        background: rgba(34, 197, 94, 0.10);
        border-color: rgba(34, 197, 94, 0.45);
        color: #d1fae5;
    }

    .delta-chip.tragic {
        background: rgba(56, 189, 248, 0.10);
        border-color: rgba(56, 189, 248, 0.50);
        color: #cfefff;
    }

/* Mobile: stack hero and make logo smaller */
@media (max-width: 900px) {
    .team-hero-grid {
        grid-template-columns: 1fr;
    }

    .team-hero-left {
        grid-template-columns: 120px 1fr;
    }

    .team-hero-logoWrap {
        width: 120px;
        height: 120px;
    }

    .team-hero-logo {
        max-width: 104px;
        max-height: 104px;
    }

    .rooting-guide-item {
        grid-template-columns: 1fr;
    }

    .rooting-guide-tags {
        justify-content: flex-start;
    }
}

.team-race-row {
    margin-top: .45rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: baseline;
    font-size: .9rem;
}

.team-race-label {
    color: var(--text-muted);
    font-weight: 600;
}

.team-race-text {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}

.team-race-vs {
    color: rgba(255,255,255,0.65);
    font-weight: 600;
}


/* ===========================
   CHIP STATES MATCH STANDINGS BADGES
   =========================== */

.chip.chip-neutral {
    background: rgba(56, 189, 248, 0.10) !important;
    border-color: rgba(56, 189, 248, 0.55) !important;
    color: #a5eaff !important;
}

.chip.chip-good {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.55) !important;
    color: #d1fae5 !important;
}

.chip.chip-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.55) !important;
    color: #fecaca !important;
}

/* Make the label + number follow the chip tone (optional, but usually looks better) */
.chip.chip-neutral span,
.chip.chip-neutral strong {
    color: #a5eaff !important;
}

.chip.chip-good span,
.chip.chip-good strong {
    color: #d1fae5 !important;
}

.chip.chip-danger span,
.chip.chip-danger strong {
    color: #fecaca !important;
}

.delta-chip.impact {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

    .delta-chip.impact:hover {
        filter: brightness(1.1);
        text-decoration: none;
    }

