:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --ink: #1a1a1a;
    --muted: #5c6370;
    --line: #e4e6eb;
    --accent: #4caf50;
    --accent-ink: #ffffff;
    --danger: #c62828;
    --radius: 12px;
    --max: 840px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
}

a {
    color: #1b5e20;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--accent);
}

.site-header {
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 40;
}

.site-header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.site-brand span span,
.site-footer-brand span {
    color: var(--accent);
}

.site-brand img {
    display: block;
    border-radius: 8px;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.95rem;
}

.site-nav a {
    color: #e8e8e8;
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    color: var(--accent);
}

.site-nav-cta {
    background: var(--accent);
    color: var(--accent-ink) !important;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
}

.breadcrumbs {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0.75rem 1rem 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.breadcrumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin-left: 0.35rem;
    color: #9aa0a6;
}

.site-main {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1rem 1rem 5rem;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    margin-top: 2rem;
}

.site-footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.site-footer-brand {
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.site-footer-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.page-header h1,
.team-hero h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.2;
}

.page-header p,
.team-hero-sub {
    color: var(--muted);
    margin: 0 0 1rem;
}

.team-hero {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.team-hero-identity {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.team-hero-logo {
    border-radius: 12px;
    background: #fafafa;
}

.next-match {
    background: #f7faf7;
    border: 1px solid #d7ead8;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.next-match-label {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.next-match-vs {
    margin: 0.25rem 0;
    font-size: 1.15rem;
    font-weight: 650;
}

.next-match-when {
    margin: 0.25rem 0;
    font-size: 1.05rem;
}

.next-match-venue,
.next-match-comp {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.subscribe-cta {
    margin-top: 0.75rem;
}

.btn-primary,
.btn-secondary {
    appearance: none;
    border: none;
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    font-size: 1rem;
    font-weight: 650;
    cursor: pointer;
    width: 100%;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover {
    filter: brightness(0.95);
}

.btn-secondary {
    background: #eef0f3;
    color: var(--ink);
    margin-top: 0.5rem;
}

.subscribe-hint {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.subscribe-fallback {
    margin-top: 0.75rem;
}

.subscribe-fallback input {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.85rem;
}

.subscribe-error {
    color: var(--danger);
    font-size: 0.9rem;
}

.form-pills {
    list-style: none;
    display: flex;
    gap: 0.35rem;
    padding: 0;
    margin: 0.5rem 0 0;
}

.form-pills li {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 4px;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.form-w { background: #2e7d32; }
.form-d { background: #757575; }
.form-l { background: #c62828; }

.match-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0.75rem 0 1.5rem;
}

.match-row {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    align-items: center;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    min-width: 0;
}

.match-team img {
    flex-shrink: 0;
}

.match-team span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-team-away {
    justify-content: flex-end;
    text-align: right;
}

.match-team.is-highlight span {
    color: #1b5e20;
}

.match-score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 3rem;
    text-align: center;
}

.match-score-vs,
.match-score-tbd {
    color: var(--muted);
    font-weight: 500;
}

.match-meta {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.month-heading {
    margin: 1.25rem 0 0.5rem;
    font-size: 1.05rem;
}

.view-toggle {
    display: inline-flex;
    background: #e9ebef;
    border-radius: 999px;
    padding: 0.2rem;
    margin-bottom: 1rem;
}

.view-toggle-btn {
    border: none;
    background: transparent;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    color: var(--muted);
}

.view-toggle-btn.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 1.5rem;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.cal-dow {
    background: #eef0f3;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 650;
    padding: 0.4rem 0;
    color: var(--muted);
}

.cal-cell {
    background: var(--surface);
    min-height: 4.5rem;
    padding: 0.3rem;
    font-size: 0.72rem;
}

.cal-cell.is-muted {
    background: #f3f4f6;
    color: #aaa;
}

.cal-cell.has-match {
    background: #f3faf3;
}

.cal-day {
    display: block;
    font-weight: 650;
    margin-bottom: 0.15rem;
}

.cal-match {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1b5e20;
}

.team-directory {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.team-directory-card {
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: inherit;
}

.team-directory-card img {
    grid-row: 1 / span 2;
}

.team-directory-name {
    font-weight: 700;
}

.team-directory-next {
    grid-column: 2;
    font-size: 0.85rem;
    color: var(--muted);
}

.week-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0 1.5rem;
}

.week-nav-item {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    font-size: 0.85rem;
}

.week-nav-item.is-current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.link-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.link-grid a {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
}

.team-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0;
}

.team-chip {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.team-chip.is-selected {
    background: #e8f5e9;
    border-color: var(--accent);
    color: #1b5e20;
    font-weight: 600;
}

.matchup-forms {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 700px) {
    .matchup-forms {
        grid-template-columns: 1fr 1fr;
    }
}

.matchup-when {
    font-size: 1.15rem;
    font-weight: 600;
}

.data-stamp {
    margin: 2rem 0 1rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.sticky-cta {
    display: none;
}

@media (max-width: 700px) {
    .sticky-cta {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.92);
        border-top: 1px solid var(--line);
        backdrop-filter: blur(8px);
        z-index: 30;
    }

    body.page-team,
    body.page-matchup {
        padding-bottom: 4.5rem;
    }
}

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin: 1.5rem 0;
}

.prose {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.prose h1 {
    margin-top: 0;
}

.prose h2 {
    margin-top: 1.5rem;
}

.empty-note {
    color: var(--muted);
}

.internal-links {
    margin-top: 2rem;
}
