.fantasy-team {
    padding-block: 8px 40px;
}

.fantasy-team h1,
.fantasy-team h2,
.fantasy-team h3,
.fantasy-team p,
.fantasy-team dl,
.fantasy-team dd {
    margin: 0;
}

.fantasy-team h2 { font-size: 23px; line-height: 1.2; }
.fantasy-team h3 { font-size: 17px; line-height: 1.3; }

.fantasy-team-heading,
.fantasy-team-section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fantasy-team-heading {
    margin-block: 18px 24px;
}

.fantasy-team-heading h1 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
    overflow-wrap: anywhere;
    letter-spacing: -.035em;
}

.fantasy-team-heading p,
.fantasy-team-section-heading p {
    margin-top: 6px;
    color: hsl(var(--muted));
}

.fantasy-team-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 22px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.fantasy-team-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 12px;
    border-radius: 7px;
    color: inherit;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
}

.fantasy-team-nav a:hover,
.fantasy-team-nav a[aria-current] {
    background: #edf5ef;
    color: #214b41;
}

.fantasy-team .fantasy-team-deadline,
.fantasy-team .fantasy-team-notice {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #f3f6f4;
    color: #294b3f;
}

.fantasy-team-notice p {
    margin-bottom: 10px;
}

.fantasy-team .fantasy-team-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 28px;
}

.fantasy-team-stats div {
    padding: 13px 16px;
    border-radius: 8px;
    background: #f5f7f6;
}

.fantasy-team-stats dt {
    margin-bottom: 5px;
    font-size: 13px;
    color: hsl(var(--muted));
}

.fantasy-team-stats dd {
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.fantasy-team-overview,
.fantasy-team-picker,
.fantasy-team-lineup {
    display: grid;
    align-items: start;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: clamp(16px, 3vw, 36px);
}

.fantasy-team-shape,
.fantasy-team-budget {
    padding: 7px 12px;
    border-radius: 7px;
    background: #eaf3ed;
    color: #214b41;
    font-weight: 750;
    white-space: nowrap;
}

.fantasy-team .fantasy-team-pitch {
    min-height: 386px;
    margin-top: 14px;
    padding: 10px 3%;
}

.fantasy-team-player {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    min-width: 0;
    min-height: 68px;
    padding: 4px;
    border-radius: 6px;
    background: #fff;
    color: #183d33;
    text-align: center;
    line-height: 1.15;
}

.fantasy-team-pitch .fantasy-team-player { flex: 0 1 112px; }
.fantasy-team-player img { display: block; object-fit: contain; }
.fantasy-team-player:hover { background: #eaf3ed; }

.fantasy-team-player strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 12px;
}

.fantasy-team-player small { font-size: 11px; }
.fantasy-team-mark,
.fantasy-team-alert {
    position: absolute;
    top: 3px;
    padding: 2px 3px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 750;
    text-decoration: none;
}

.fantasy-team-mark { left: 3px; color: #fff; background: #214b41; }
.fantasy-team-alert { right: 3px; color: #721b16; background: #ffebe8; }

.fantasy-team-bench {
    margin-top: 18px;
    padding: 14px;
    border-radius: 8px;
    background: #f5f7f6;
}

.fantasy-team-bench ol {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
}

.fantasy-team-sidebar {
    display: grid;
    gap: 22px;
}

.fantasy-team-sidebar dl,
.fantasy-team-chips {
    display: grid;
    gap: 5px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.fantasy-team-sidebar dl div,
.fantasy-team-chips li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f5f7f6;
}

.fantasy-team-sidebar dd { font-weight: 750; }
.fantasy-team-chips small { display: block; color: hsl(var(--muted)); }
.fantasy-team-chip-status { color: #31594a; font-size: 12px; font-weight: 700; }
.fantasy-team-links,
.fantasy-team-pagination,
.fantasy-team-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.fantasy-team a.primary,
.fantasy-team button,
.fantasy-team input,
.fantasy-team select { min-height: 44px; }

.fantasy-team-form { max-width: 1100px; }
.fantasy-team-form input,
.fantasy-team-form select {
    width: 100%;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid #bccac3;
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
}

.fantasy-team-form :disabled { opacity: .65; cursor: default; }
.fantasy-team-form label { display: block; font-size: 14px; font-weight: 650; }
.fantasy-team-name { display: grid; gap: 7px; max-width: 430px; margin-bottom: 16px; }

.fantasy-team-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    color: hsl(var(--muted));
}

.fantasy-team-steps li { padding: 6px 10px; border-radius: 6px; font-size: 14px; }
.fantasy-team-steps [aria-current] { background: #edf5ef; color: #214b41; font-weight: 750; }

.fantasy-team-editor-message:not(:empty),
.fantasy-team-catalog-status:not(:empty) { margin-block: 10px; color: #294b3f; }
.fantasy-team-picker, .fantasy-team-lineup { margin-block: 16px; }
.fantasy-team-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(108px, .65fr);
    gap: 5px 10px;
}

.fantasy-team-filters label[for="fantasy-team-position"] { grid-area: 1 / 2; }
.fantasy-team-catalog,
.fantasy-team-selected ul,
.fantasy-team-bench-editor {
    display: grid;
    gap: 5px;
    margin: 10px 0;
    padding: 0;
    list-style: none;
}

.fantasy-team-catalog li,
.fantasy-team-selected li,
.fantasy-team-bench-editor li {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border-radius: 6px;
    background: #f5f7f6;
}

.fantasy-team-catalog li > div,
.fantasy-team-selected li > span,
.fantasy-team-bench-editor li > span { flex: 1; overflow-wrap: anywhere; }
.fantasy-team-catalog small { display: block; color: hsl(var(--muted)); }
.fantasy-team-selected { padding: 12px; border-radius: 8px; background: #f5f7f6; }
.fantasy-team-selected p { margin-top: 6px; }
.fantasy-team-selected li { background: #fff; }
.fantasy-team-selected button, .fantasy-team-bench-editor button { min-width: 44px; }
.fantasy-team-form fieldset {
    display: grid;
    gap: 6px;
    min-width: 0;
    margin: 10px 0;
    padding: 6px 10px 10px;
    border: 1px solid #d9e4de;
    border-radius: 7px;
}

.fantasy-team-lineup h3 { margin-block: 8px; }
.fantasy-team-lineup label { margin-block: 6px; }
.fantasy-team-fallback-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-block: 10px;
}

@media (max-width: 820px) {
    .fantasy-team-overview,
    .fantasy-team-picker,
    .fantasy-team-lineup { grid-template-columns: minmax(0, 1fr); }
    .fantasy-team .fantasy-team-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fantasy-team .fantasy-team-pitch { min-height: 320px; }
    .fantasy-team-selected ul { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
}

@media (max-width: 510px) {
    .fantasy-team-nav { flex-wrap: wrap; gap: 4px; }
    .fantasy-team-nav a { padding-inline: 8px; }

    .fantasy-team .fantasy-team-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .fantasy-team-stats div { grid-column: span 2; }
    .fantasy-team-stats div:nth-child(n+4) { grid-column: span 3; }
    .fantasy-team-stats div { padding: 9px 10px; }
    .fantasy-team .fantasy-team-pitch { min-height: 290px; }
    .fantasy-team-player strong { font-size: 10px; }
    .fantasy-team-player small { font-size: 9px; }
    .fantasy-team-player img { width: 26px; height: 26px; }
    .fantasy-team-player .fantasy-player-placeholder { width: 24px; height: 24px; }
    .fantasy-team-bench { padding: 8px; }
}

@media (max-width: 880px) {
    .fantasy-team-actions {
        position: sticky;
        z-index: 2;
        bottom: calc(62px + env(safe-area-inset-bottom));
        padding-block: 8px;
        background: #fff;
    }
}

@media (max-width: 380px) {
    .site-header .home-brand {
        min-width: 0;
        flex-shrink: 1;
    }
}
