:root {
    color-scheme: light;
    --ink: #142c25;
    --muted: #526860;
    --paper: #fbfaf5;
    --panel: #fffefa;
    --line: #dce3d9;
    --green: #135241;
    --wash: #e6efe7;
    --gold: #f0d791;
    --radius: 17px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55; }
a { color: var(--green); text-underline-offset: .19em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #9b4b08; outline-offset: 3px; }
.container { width: min(100% - 3rem, 1250px); margin-inline: auto; }
.skip { position: absolute; top: -10rem; color: white; background: var(--green); padding: .6rem; }
.skip:focus { z-index: 3; top: .2rem; }
.top { background: #103b31; border-bottom: 3px solid #d7bc71; color: white; }
.top nav { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.top a { color: white; text-decoration: none; }
.wordmark { display: flex; gap: .65rem; align-items: center; font-size: 1.15rem; font-weight: 750; }
.wordmark span { color: #f0d791; font-size: 1.6rem; line-height: 1; }
.admin-link { font-size: .88rem; padding: .48rem .75rem; border: 1px solid #77928a; border-radius: .5rem; }
.admin-link:hover { background: #245446; }
main { padding-bottom: 3rem; }
.page-heading { margin: 2.3rem 0 1.6rem; }
.club-heading { display: flex; align-items: center; gap: 1rem; }
.context { margin: 0 0 .2rem; color: var(--muted); font-weight: 600; font-size: .9rem; }
h1, h2, h3 { line-height: 1.22; margin: 0; }
h1 { font-family: Georgia, serif; font-weight: 600; font-size: clamp(1.8rem, 4vw, 3.2rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.13rem, 2vw, 1.35rem); }
h3 { font-size: 1.03rem; }
h2 small, h3 small { color: var(--muted); font-weight: 550; font-size: .8em; margin-left: .35rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; padding: clamp(.8rem, 2.2vw, 1.5rem); box-shadow: 0 2px 10px #23422207; min-width: 0; }
.narrow { max-width: 520px; }
.toolbar, .controls { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.toolbar { justify-content: space-between; gap: 1rem; }
.calendar-toolbar { margin-bottom: 1rem; }
.calendar-toolbar h2 { text-align: center; min-width: 9rem; }
.button, button, input, select { min-height: 40px; border: 1px solid var(--line); border-radius: .55rem; font: inherit; padding: .45rem .68rem; }
input, select { color: var(--ink); background: white; min-width: 0; max-width: 100%; }
.button, button { display: inline-flex; justify-content: center; align-items: center; background: var(--green); color: white; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none; }
.button:hover, button:hover { filter: brightness(.91); }
.secondary { background: var(--wash); color: var(--green); }
.logo { background: white; object-fit: contain; border: 1px solid var(--line); border-radius: .6rem; padding: .25rem; flex: 0 0 auto; }
.club-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px,100%), 1fr)); gap: .8rem; }
.club-card { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.club-card:hover { border-color: var(--green); }
.club-card small, label small, .managed-events small { display: block; color: var(--muted); font-weight: 500; }
.arrow { margin-inline-start: auto; }
.calendar-scroll, .table-scroll { overflow: auto; }
.calendar-grid, .data-table { border-collapse: collapse; width: 100%; text-align: left; }
.calendar-grid { table-layout: fixed; min-width: 620px; }
.calendar-grid th { background: var(--wash); color: var(--green); padding: .6rem; font-size: .78rem; }
.calendar-grid td { border: 1px solid var(--line); padding: .42rem; height: 85px; vertical-align: top; }
.calendar-grid .empty-day { background: #f4f5ee; }
.calendar-grid .today { background: #fbf4df; }
.date-num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .82rem; font-weight: 700; }
.event-link { display: block; text-decoration: none; line-height: 1.32; font-size: .84rem; color: #104333; font-weight: 750; padding: .43rem .45rem; border-radius: .35rem; background: var(--wash); margin-top: .28rem; overflow-wrap: anywhere; }
.event-link:hover { background: #d6e5da; text-decoration: underline; }
.event-link time { font-size: .76em; display: block; color: var(--muted); }
.calendar-day-list { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.calendar-day-list:last-child { border-bottom: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin: 1.1rem 0 -.95rem; font-size: .9rem; }
.breadcrumb a + a::before { content: "›"; padding-right: .75rem; color: var(--muted); display: inline-block; }
.ranking section { margin-top: 1.15rem; }
.ranking h3 { margin-bottom: .55rem; }
.data-table th, .data-table td { padding: .58rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table thead th { color: var(--green); background: var(--wash); font-size: .78rem; white-space: nowrap; }
.data-table tbody tr:nth-child(even) { background: #f5f7f0; }
.data-table tbody td { font-size: .92rem; }
.data-table .number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .own-table { background: #f9ebbb !important; }
.table-scroll .data-table { min-width: 730px; margin-top: .75rem; }
.data-table .round-heading th { background: #e6efe7; padding-block: .45rem; color: var(--green); font-size: .86rem; }
.board-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.board-list .button { min-width: 40px; }
.card-table { margin-top: 1rem; display: grid; grid-template-columns: 1fr minmax(135px,.52fr) 1fr; grid-template-areas: "n n n" "w meta e" "s s s"; align-items: center; justify-items: stretch; gap: .7rem; background: radial-gradient(ellipse at center, #31775c, #174b3d); border-radius: 13px; padding: clamp(.5rem, 1.8vw, 1.25rem); }
.seat-n { grid-area: n; }
.seat-e { grid-area: e; }
.seat-s { grid-area: s; }
.seat-w { grid-area: w; }
.hand { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: .5rem; gap: .35rem; background: #0f382ec9; border-color: #719386; color: white; }
.hand:hover { filter: none; border-color: var(--gold); }
.seat-n, .seat-s { width: min(100%, 520px); justify-self: center; }
.seat-label { font-size: .89rem; text-align: left; }
.cards { display: grid; grid-template-columns: repeat(13, minmax(0,1fr)); gap: 2px; align-items: start; }
.card-face { display: block; width: 100%; height: auto; aspect-ratio: 5 / 7; border-radius: 8%; background: #faf8ed; box-shadow: 0 1px 3px #0008; }
.card-face.is-lead { outline: 3px solid #ffdb5f; outline-offset: 1px; z-index: 1; position: relative; }
.table-meta { grid-area: meta; color: white; text-align: center; display: grid; align-content: center; gap: .22rem; line-height: 1.25; font-size: .87rem; }
.table-meta strong { font: 700 1.2rem Georgia, serif; color: #f6df92; }
.table-meta small { font-size: .75rem; min-height: 1.25em; color: #fff1c5; }
.lead-button { padding: .23rem .5rem; min-height: 32px; color: var(--green); background: var(--wash); }
.lead-button[aria-pressed=true] { background: var(--gold); }
dialog { color: var(--ink); width: min(94%, 760px); border-radius: var(--radius); border: 1px solid var(--line); padding: 1rem; }
dialog::backdrop { background: #10271fc9; }
.enlarged-cards { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: .35rem; padding-top: .75rem; }
.admin-grid { display: grid; grid-template-columns: 1.18fr 1fr; gap: 1rem; align-items: start; }
.form { display: grid; gap: .8rem; margin-top: .75rem; }
.form label { display: grid; gap: .25rem; font-size: .93rem; font-weight: 690; min-width: 0; }
.form button { justify-self: start; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.message { padding: .55rem .75rem; background: var(--wash); border-radius: .5rem; color: var(--green); }
.error { background: #f9e4dc; color: #813219; }
.managed-events { padding: 0; list-style: none; }
.managed-events li { display: flex; justify-content: space-between; gap: .6rem; align-items: center; padding: .45rem 0; border-top: 1px solid var(--line); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 850px) {
    .container { width: calc(100% - 1.6rem); }
    .card-table { grid-template-columns: 1fr 1fr; grid-template-areas: "meta meta" "n n" "w e" "s s"; }
    .seat-w .cards, .seat-e .cards { grid-template-columns: repeat(7,minmax(0,1fr)); }
}
@media (max-width: 600px) {
    .container { width: calc(100% - 1rem); }
    .page-heading { margin: 1.6rem 0 1.1rem; }
    .top nav { min-height: 55px; }
    .admin-grid { grid-template-columns: 1fr; gap: 0; }
    .calendar-toolbar .controls { flex: 1 0 100%; }
    .calendar-toolbar .controls:last-child { flex: 1 1 auto; }
    .calendar-grid { min-width: 510px; }
    .calendar-grid td { height: 68px; padding: .3rem; }
    .calendar-grid th { padding: .35rem; }
    .ranking-table td, .ranking-table th { padding: .45rem .35rem; }
    .pair-names a { display: block; }
    .pair-dash { display: none; }
    .card-table { gap: .45rem; }
    .hand { padding: .34rem; }
    .enlarged-cards { grid-template-columns: repeat(5, minmax(0,1fr)); }
}
