:root {
    --bg-main: #f4f4f7;
    --sidebar-top: #4a0a4f;
    --sidebar-bottom: #1a001d;
    --ink: #ffffff;
    --ink-muted: #d9c7de;
    --surface: #ffffff;
    --surface-soft: #faf8fa;
    --outline: #e3dbe4;
    --brand: #37003c;
    --brand-bright: #00ff87;
    --navy: #151d34;
    --success: #17a34a;
    --danger: #d74747;
    --text-dark: #131225;
    --text-muted: #67627b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-dark);
    font-family: 'Outfit', sans-serif;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 99;
    background: #fff;
    color: #111;
    padding: 8px 10px;
}

.skip-link:focus {
    left: 10px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 310px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--sidebar-top), var(--sidebar-bottom));
    color: var(--ink);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-block {
    padding: 20px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(130deg, #37003c, #00ff87);
    display: grid;
    place-items: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-mark--logo {
    background: #fff;
    padding: 3px;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.brand-block h1 {
    margin: 0;
    font-size: 26px;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
}

.brand-block p {
    margin: 3px 0 0;
    color: var(--ink-muted);
    font-size: 15px;
}

.sidebar-nav {
    padding: 16px 10px 24px;
    display: grid;
    gap: 6px;
}

.nav-label {
    margin: 12px 8px 6px;
    text-transform: uppercase;
    letter-spacing: 0.11rem;
    font-size: 12px;
    color: #b8a8db;
}

.sidebar-nav a {
    display: block;
    color: #f7efff;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 16px;
    min-height: 44px;
    line-height: 1.4;
    transition: background 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.14);
}

.main-panel {
    min-width: 0;
}

.topbar {
    height: 82px;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 24px;
}

.topbar h2 {
    margin: 0;
    font-size: 22px;
    font-family: 'Space Grotesk', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-button {
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    background: transparent;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 44px;
    min-height: 44px;
}

.sidebar-toggle::before {
    content: "\2630";
    font-size: 16px;
    line-height: 1;
}

.sidebar-toggle[aria-expanded="true"]::before {
    content: "\2715";
}

.main-content {
    padding: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.team-hero {
    border-radius: 20px;
    background: #2b0030;
    color: #fff;
    padding: 26px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12rem;
    color: #00ff87;
    font-size: 15px;
}

.team-hero h3 {
    margin: 10px 0 0;
    font-size: 32px;
    font-family: 'Space Grotesk', sans-serif;
}

.ghost-button,
.chip {
    color: #d5ccf5;
    text-decoration: none;
    border: 1px solid rgba(213, 204, 245, 0.35);
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 16px;
}

.status-grid,
.insight-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.season-card,
.tracker-card,
.card {
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: 20px;
    padding: 22px;
}

.season-card h4,
.tracker-card h4,
.card h4 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 19px;
}

.season-card p,
.tracker-card p {
    color: var(--text-muted);
    font-size: 15px;
    margin: 10px 0 0;
}

.ball-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, #41a7ff, #6f4dff);
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 10px;
}

.countdown {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.countdown div {
    min-width: 64px;
    flex: 1 1 64px;
    background: var(--navy);
    border-radius: 14px;
    padding: 10px;
    text-align: center;
    color: #f7fbff;
}

.countdown strong {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    line-height: 1;
}

.countdown span {
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    font-size: 11px;
    color: #b8c0e6;
}

.deadline {
    margin-top: 14px;
    color: #8a88a8;
    font-size: 14px;
}

.tracker-card--wide {
    grid-column: span 2;
}

.tracker-form {
    margin-top: 14px;
    display: grid;
    gap: 9px;
}

.tracker-form label {
    color: #7b7198;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    font-size: 12px;
    font-weight: 700;
}

.tracker-form input,
.tracker-form select {
    border: 1px solid #d4cee9;
    border-radius: 12px;
    font-size: 16px;
    padding: 12px;
    min-height: 44px;
    background: #fff;
    font-family: 'Outfit', sans-serif;
    color: #131225;
}

.tracker-form input:focus,
.tracker-form select:focus {
    outline: none;
    border-color: #00b368;
    box-shadow: 0 0 0 3px rgba(0, 255, 135, 0.25);
}

.tracker-form button {
    border: 0;
    border-radius: 12px;
    padding: 12px;
    min-height: 44px;
    background: linear-gradient(120deg, #00b368, #00ff87);
    color: #04231a;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
}

.inline-error {
    margin-top: 10px;
    color: var(--danger);
    font-size: 14px;
}

.save-note {
    margin-top: 10px;
    color: #197a40;
    font-size: 14px;
    font-weight: 500;
}

.tracker-divider {
    margin: 14px 0 6px;
    color: #7f7897;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04rem;
}

.pick-link {
    color: #37003c;
    text-decoration: none;
    font-weight: 600;
}

.pick-link:hover {
    text-decoration: underline;
}

.is-hidden {
    display: none;
}

.top-stats-board {
    border-radius: 28px;
    padding: 22px;
    background: linear-gradient(120deg, #37003c, #005a37 54%, #00b368);
}

.top-stats-board h4 {
    margin: 0 0 14px;
    text-align: center;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
}

.top-stats-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-spotlight {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 18px;
    text-align: center;
    color: #f9efff;
}

.stat-spotlight--scorer {
    background: rgba(55, 0, 60, 0.6);
}

.stat-spotlight--assist {
    background: rgba(0, 90, 55, 0.6);
}

.stat-spotlight--clean-sheet {
    background: rgba(0, 60, 70, 0.6);
}

.stat-spotlight h5 {
    margin: 0 0 12px;
    font-size: 20px;
}

.stat-spotlight img,
.player-fallback {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    display: grid;
    place-items: center;
}

.player-fallback {
    background: rgba(255, 255, 255, 0.08);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 48px;
}

.stat-name {
    margin: 12px 0 4px;
    color: #fff;
    font-size: 18px;
    font-family: 'Space Grotesk', sans-serif;
}

.stat-value {
    margin: 0;
    color: #d7c2e9;
    font-size: 13px;
}

.live-fixtures-board {
    border-radius: 22px;
    background: #2b0030;
    color: #fff;
    padding: 16px;
}

.live-fixtures-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.live-fixtures-head h4 {
    margin: 0;
    font-size: 20px;
    font-family: 'Space Grotesk', sans-serif;
}

.live-fixtures-head span {
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 14px;
}

.live-fixtures-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.live-fixture-card {
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fixture-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
}

.fixture-teams strong {
    font-size: 17px;
}

.fixture-teams span {
    color: #cab9ef;
    font-size: 13px;
}

.fixture-status {
    width: max-content;
    margin: 0 auto 6px;
    border-radius: 8px;
    padding: 2px 8px;
    background: rgba(203, 220, 255, 0.22);
    color: #f2f4ff;
    font-size: 12px;
}

.live-fixture-card p {
    margin: 0;
    text-align: center;
    color: #ddcffd;
    font-size: 14px;
}

.card-header {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.card-header span {
    color: #7f7897;
    font-size: 12px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

th,
td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #efeaf8;
    font-size: 15px;
}

th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04rem;
    color: #7f7798;
}

td small {
    color: #948fa7;
}

.fixtures-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.fixtures-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border: 1px solid #eee7fa;
    border-radius: 12px;
    padding: 10px;
    background: var(--surface-soft);
}

.fixtures-list p {
    margin: 0;
    font-size: 16px;
}

.fixtures-list small {
    color: #8a84a3;
    font-size: 14px;
}

.difficulty {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    min-width: 46px;
    text-align: center;
    font-weight: 700;
}

.difficulty-1,
.difficulty-2,
.difficulty-3 {
    background: rgba(23, 163, 74, 0.14);
    color: var(--success);
}

.difficulty-4,
.difficulty-5,
.difficulty-6 {
    background: rgba(215, 71, 71, 0.14);
    color: var(--danger);
}

.leaders-grid {
    display: grid;
    gap: 10px;
}

.leader-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #eee7fa;
    border-radius: 12px;
    padding: 10px;
    background: var(--surface-soft);
}

.leader-row p {
    margin: 3px 0 0;
    color: #908aa7;
    font-size: 12px;
}

.score-cell {
    text-align: right;
}

.score-cell strong {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
}

.score-cell span {
    color: #5d5792;
    font-size: 12px;
}

.manager-meta {
    display: grid;
    gap: 6px;
}

.manager-meta p {
    margin: 0;
    color: #4f496b;
    font-size: 15px;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 700;
}

.status-pill--safe {
    background: rgba(23, 163, 74, 0.16);
    color: #12733a;
}

.status-pill--steady {
    background: rgba(45, 129, 208, 0.16);
    color: #1c5f9e;
}

.status-pill--chasing {
    background: rgba(215, 71, 71, 0.16);
    color: #9a2727;
}

.reveal {
    opacity: 0;
    transform: translateY(12px);
    animation: rise 540ms ease forwards;
}

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

@media (max-width: 1260px) {
    .app-shell {
        grid-template-columns: 230px 1fr;
    }

    .brand-block h1 {
        font-size: 21px;
    }

    .topbar h2 {
        font-size: 19px;
    }

    .team-hero h3 {
        font-size: 26px;
    }

    .season-card h4,
    .tracker-card h4,
    .card h4 {
        font-size: 17px;
    }

    .season-card p,
    .tracker-card p,
    .manager-meta p,
    th,
    td,
    .fixtures-list p,
    .fixtures-list small,
    .deadline {
        font-size: 14px;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 6, 20, 0.55);
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

@media (max-width: 1020px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(280px, 82vw);
        transform: translateX(-102%);
        transition: transform 0.25s ease;
        z-index: 20;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-lock {
        overflow: hidden;
    }

    .status-grid,
    .insight-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .top-stats-grid,
    .live-fixtures-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tracker-card--wide {
        grid-column: span 1;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .topbar-button,
    .ghost-button {
        min-height: 40px;
    }
}

@media (max-width: 620px) {
    .main-content {
        padding: 12px;
        gap: 14px;
    }

    .topbar {
        padding: 10px 12px;
        gap: 8px;
    }

    .topbar h2 {
        font-size: 16px;
    }

    .topbar-button {
        padding: 8px 10px;
        font-size: 13px;
    }

    .team-hero,
    .season-card,
    .tracker-card,
    .card,
    .top-stats-board,
    .live-fixtures-board {
        padding: 16px;
        border-radius: 16px;
    }

    .team-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .team-hero h3 {
        font-size: 26px;
    }

    .countdown {
        gap: 8px;
    }

    .countdown div {
        flex: 1 1 60px;
        padding: 8px;
    }

    .countdown strong {
        font-size: 20px;
    }

    .stat-spotlight img,
    .player-fallback {
        width: 120px;
        height: 120px;
    }

    .player-fallback {
        font-size: 38px;
    }

    .sidebar-nav a {
        font-size: 17px;
    }
}

@media (max-width: 380px) {
    .countdown div {
        flex: 1 1 46%;
    }

    .top-stats-grid {
        gap: 10px;
    }

    .team-hero h3 {
        font-size: 22px;
    }
}
