:root {
    color-scheme: light;
    --ink: #271f26;
    --muted: #62555f;
    --accent: #850b43;
    --wine: #45112d;
    --line: #e3d8df;
    --paper: #fcfaf8;
    --white: #fff;
    font: 1rem/1.55 system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column }
a { color: var(--accent); text-underline-offset: .2em }
:focus-visible { outline: 3px solid #006c83; outline-offset: 4px }
.shell { max-width: 75rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 3rem); width: 100% }
.skip { position: fixed; top: .5rem; left: .5rem; z-index: 3; background: white; padding: .6rem; transform: translateY(-200%) }
.skip:focus { transform: none }
.main { padding-block: clamp(1.5rem, 5vw, 3.5rem); min-width: 0 }
h1, h2, h3 { line-height: 1.14; margin-block: 0 .75rem; overflow-wrap: anywhere }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.045em; max-width: 30ch }
h2 { font-size: clamp(1.25rem, 3vw, 1.7rem); letter-spacing: -.025em }
h3 { font-size: 1.05rem }
.section { margin-top: clamp(1.4rem, 4vw, 2.5rem) }
.hero { background: var(--wine); color: white; border-radius: .5rem; display: grid; grid-template-columns: 1.25fr 1fr; overflow: hidden; min-height: 15rem }
.hero-copy { align-self: center; padding: clamp(1.25rem, 5vw, 3rem) }
.hero-copy p { margin-block: 0 .55rem; color: #ffd1e1; font-weight: 650 }
.hero h1 { font-size: clamp(2.4rem, 6vw, 5rem); line-height: .96; letter-spacing: -.062em; margin: 0 }
.hero-mark { display: grid; place-items: center; background: white; padding: 1.5rem; clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%) }
.hero-mark img { width: min(100%, 18rem); height: auto }
.hero-banner { width: 100%; max-height: 23rem; height: 100%; object-fit: cover; display: block }
.entry-grid, .card-list { display: grid; gap: .75rem; margin-top: 1rem }
.entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.club-grid { grid-template-columns: minmax(0, 1fr) }
@media (min-width: 64rem) {
    .club-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) }
}
.card-list, .matches { padding: 0; list-style: none }
.entry-card { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 4rem; padding: 1rem; border: 1px solid var(--line); border-radius: .4rem; background: white; color: var(--ink); text-decoration: none; overflow-wrap: anywhere }
.entry-card.featured { border-left: .25rem solid var(--accent) }
a.entry-card:hover { border-color: var(--accent); background: #fff5fa }
.entry-card strong, .entry-card small { display: block }
.entry-card strong { font-size: clamp(1.05rem, 2.4vw, 1.35rem) }
.entry-card small { color: var(--muted) }
.club-card { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .4rem }
.club-card address { font-style: normal; color: var(--muted) }
.club-contact-label { color: var(--muted); margin-inline-end: .25rem }
.club-map { margin-top: auto; padding-block: .4rem; font-weight: 650 }
.manifesto { max-width: 72ch }
.legal-copy { max-width: 76ch }
.legal-copy h2 { margin-top: 1.5rem }
.legal-copy a, .legal-copy code { overflow-wrap: anywhere }
.cookie-inventory { overflow-x: auto }
.cookie-inventory th, .cookie-inventory td { padding: .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top }
.back { display: inline-block; margin-bottom: .9rem; font-weight: 650 }
.tabs { display: flex; gap: .55rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; flex-wrap: wrap }
.tabs a { padding: .65rem .6rem; text-decoration: none; border-bottom: .18rem solid transparent }
.tabs a[aria-current] { border-color: var(--accent); font-weight: 700 }
.filters, .actions { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; margin-block: .75rem }
.filters label { display: grid; gap: .25rem; max-width: 100% }
button, select { font: inherit; color: inherit; border: 1px solid var(--line); background: var(--white); border-radius: .3rem; padding: .5rem .65rem; min-height: 2.75rem; max-width: 100% }
button, summary { cursor: pointer }
.notice { background: #f4e9ef; border-radius: .4rem; padding: .9rem 1rem }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch }
dt { font-weight: 700 }
dd { margin: 0 0 .65rem }
.actions { align-items: center; gap: .65rem 1.1rem }
.share-code svg { display: block; background: white; margin-top: .5rem }
.round-picker { position: sticky; top: 0; z-index: 1; background: var(--paper); display: flex; align-items: center; gap: .5rem; padding-block: .65rem }
.round-picker button { min-width: 2.75rem; font-size: 1.35rem; line-height: 1; color: var(--accent) }
.round-picker button:disabled { opacity: .4; cursor: default }
.round-picker select { min-width: 0 }
.rounds { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(14rem, 1fr); gap: 1rem; overflow-x: auto; margin-block: 1rem }
.round { display: grid; grid-template-rows: auto 1fr; min-width: 0 }
.round h2 { font-size: 1.15rem }
.matches { display: grid; grid-auto-rows: 1fr; margin: 0 }
.match { display: flex; align-items: center; padding-block: .35rem; position: relative; min-width: 0 }
.match-card { width: 100%; border: 1px solid var(--line); border-radius: .45rem; background: white; position: relative; scroll-margin-block: 5rem 1rem }
.match-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .5rem; background: #f6f1f3; padding: .55rem .65rem; border-radius: .45rem .45rem 0 0 }
.match h3 { font-size: .9rem; margin: 0 }
.match-status { font-size: .78rem; font-weight: 650; color: var(--muted) }
.slot { display: flex; align-items: center; gap: .45rem; padding: .55rem .65rem; overflow-wrap: anywhere; border-right: .4rem solid }
.slot + .slot { border-top: 1px solid var(--line) }
.slot:last-child { border-radius: 0 0 .4rem .4rem }
.slot-red { border-right-color: #dc2626 }
.slot-blue { border-right-color: #2563eb }
.slot-source { display: block; font-size: .85rem; color: var(--muted) }
.slot-muted { color: var(--muted) }
.won, .winner-banner { background: #edf6ee; color: #204e2e }
.club-badge { display: inline-block; padding: .15rem .4rem; border-radius: .25rem; font-size: .76rem; font-weight: 750; line-height: 1.3; text-align: center; overflow-wrap: anywhere }
.slot .club-badge { flex: 0 0 auto; max-width: 40% }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.match-advance { display: none; border-top: 1px solid var(--line); align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .65rem; min-height: 2.75rem; font-size: .84rem; font-weight: 650 }
.standings { overflow-x: auto }
.standings table { width: 100%; border-collapse: collapse; text-align: left; background: white }
.standings th, .standings td { padding: .55rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere }

@media (width > 64rem) {
    .rounds-connected:not([data-single-round]) { --connector-gap: 2rem; --connector-color: #9c7389; gap: var(--connector-gap); padding: .25rem .25rem .8rem }
    .rounds-connected:not([data-single-round]) .round h2 { min-height: 2.5rem }
    .rounds-connected:not([data-single-round]) .round:not(:last-child) .match::after,
    .rounds-connected:not([data-single-round]) .round:not(:first-child) .match::before {
        content: "";
        position: absolute;
        width: calc(var(--connector-gap) / 2 + 1px);
    }
    .rounds-connected:not([data-single-round]) .round:not(:first-child) .match::before {
        right: 100%;
        top: calc(50% - 1px);
        border-top: 2px solid var(--connector-color);
    }
    .rounds-connected:not([data-single-round]) .round:not(:last-child) .match::after {
        left: 100%;
        height: calc(50% + 2px);
        border-right: 2px solid var(--connector-color);
    }
    .rounds-connected:not([data-single-round]) .round:not(:last-child) .match:nth-child(odd)::after {
        top: calc(50% - 1px);
        border-top: 2px solid var(--connector-color);
    }
    .rounds-connected:not([data-single-round]) .round:not(:last-child) .match:nth-child(even)::after {
        bottom: calc(50% - 1px);
        border-bottom: 2px solid var(--connector-color);
    }
}

.rounds[data-single-round] { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row }
.rounds[data-single-round] .matches { grid-auto-rows: auto }

@media (max-width: 64rem), (hover: none) and (pointer: coarse) {
    .round-picker select { flex: 1; min-height: 2.75rem }
    .rounds { display: block; overflow: visible }
    .round { margin-bottom: 1.25rem }
    .matches { grid-auto-rows: auto }
    .match-advance { display: flex }
    .rounds-connected .match::before, .rounds-connected .match::after { display: none }
}

@media (max-width: 38rem) {
    .hero { grid-template-columns: 1fr; min-height: auto }
    .hero-mark { clip-path: none; padding: .65rem; min-height: 5rem }
    .hero-mark img { width: 10rem }
    .hero-banner { max-height: 12rem }
    .entry-grid { grid-template-columns: 1fr }
}
