:root {
    color-scheme: light;
    --ink: #16201b;
    --muted: #607067;
    --line: #dce4df;
    --bg: #f5f7f4;
    --band: #ffffff;
    --accent: #0b8f50;
    --accent-dark: #075b36;
    --warn: #8a4c00;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

a {
    color: var(--accent-dark);
    font-weight: 700;
}

.site-header {
    min-height: 260px;
    padding: 42px clamp(18px, 5vw, 72px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(4, 55, 34, 0.96), rgba(8, 105, 61, 0.86)),
        url("https://images.unsplash.com/photo-1535131749006-b7f58c99034b?auto=format&fit=crop&w=1800&q=80") center 58% / cover;
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0;
    font-weight: 700;
}

h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 0.98;
    letter-spacing: 0;
}

.subtitle {
    margin: 14px 0 0;
    max-width: 640px;
    font-size: 19px;
}

.sponsor-line {
    margin: 18px 0 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.86);
}

.sponsor-line a {
    color: #fff;
    text-decoration-color: rgba(255, 255, 255, 0.55);
}

.tour-logo {
    width: 112px;
    height: 112px;
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 64px;
}

.info-band {
    margin: -34px 0 28px;
    padding: 20px 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    background: var(--band);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(20, 40, 28, 0.08);
}

.info-band p {
    margin: 0;
    color: var(--muted);
}

dl {
    margin: 0;
    display: flex;
    gap: 18px;
}

dt {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
}

dd {
    margin: 2px 0 0;
    font-weight: 800;
}

.notice {
    margin-bottom: 24px;
    padding: 14px 18px;
    border: 1px solid #e9c078;
    border-radius: 8px;
    background: #fff8eb;
    color: var(--warn);
}

.standings-tabs > input,
.inline-result-tabs > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tab-controls {
    margin-bottom: 10px;
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--band);
}

.tab-controls label {
    min-width: 128px;
    padding: 9px 14px;
    border-radius: 6px;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
    cursor: pointer;
}

#tab-scratch:checked ~ .tab-controls label[for="tab-scratch"],
#tab-stableford:checked ~ .tab-controls label[for="tab-stableford"] {
    background: var(--accent);
    color: #fff;
}

.tab-panel {
    display: none;
}

#tab-scratch:checked ~ .tab-panel-scratch,
#tab-stableford:checked ~ .tab-panel-stableford {
    display: block;
}

.inline-panel {
    display: none;
}

.inline-result-tabs > input:nth-of-type(1):checked ~ .tab-controls label:nth-child(1),
.inline-result-tabs > input:nth-of-type(2):checked ~ .tab-controls label:nth-child(2) {
    background: var(--accent);
    color: #fff;
}

.inline-result-tabs > input:nth-of-type(1):checked ~ .inline-panels .inline-panel-scratch,
.inline-result-tabs > input:nth-of-type(2):checked ~ .inline-panels .inline-panel-stableford {
    display: block;
}

.section {
    margin-top: 34px;
}

.section-heading {
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
}

.section-heading h2,
.table-title h2 {
    margin: 0;
    font-size: 23px;
    letter-spacing: 0;
}

.section-heading p,
.table-title span {
    margin: 0;
    color: var(--muted);
}

.table-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--band);
}

.table-title {
    min-height: 58px;
    padding: 15px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.num {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.standings-table {
    min-width: 980px;
}

.standings-table th,
.standings-table td {
    height: 44px;
}

.rank-col {
    width: 48px;
    text-align: center;
}

.player-col {
    min-width: 180px;
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--band);
}

thead .player-col {
    z-index: 2;
}

.event-score-col {
    width: 72px;
    min-width: 72px;
    text-align: right;
}

.total-col {
    width: 84px;
    min-width: 84px;
    font-weight: 900;
    background: #eef6f1;
}

.is-empty {
    color: transparent;
    background: repeating-linear-gradient(
        -45deg,
        #f8faf7,
        #f8faf7 7px,
        #eef3ef 7px,
        #eef3ef 8px
    );
}

.events {
    display: grid;
    gap: 8px;
}

.event-row {
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--band);
}

.event-row.is-active {
    border-color: var(--accent);
    box-shadow: 0 10px 24px rgba(20, 80, 48, 0.08);
}

.event-summary {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.event-row h3 {
    margin: 0;
    font-size: 16px;
}

.event-row p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.event-actions {
    min-width: 170px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
}

.event-results {
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
}

.event-results-heading {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.event-results-heading h4 {
    margin: 0;
    font-size: 16px;
}

.event-results-heading p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.event-results-heading a {
    flex: 0 0 auto;
    font-size: 14px;
}

.inline-result-tabs .tab-controls {
    margin-bottom: 8px;
}

.inline-result-tabs .tab-controls label {
    min-width: 112px;
    padding: 7px 12px;
    font-size: 13px;
}

.compact-results .table-title {
    min-height: 46px;
    padding: 10px 12px;
}

.compact-results .table-title h2 {
    font-size: 17px;
}

.compact-results .table-title span {
    font-size: 13px;
}

.compact-results table {
    font-size: 13px;
}

.compact-results th,
.compact-results td {
    padding: 7px 9px;
}

.admin-body {
    background: #eef3ef;
}

.admin-main {
    width: min(980px, calc(100% - 28px));
    margin: 34px auto;
}

.admin-panel .table-title h1 {
    margin: 0;
    font-size: 24px;
}

.admin-login,
.admin-event-row {
    padding: 16px;
}

.admin-login {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.admin-events {
    display: grid;
    gap: 1px;
    background: var(--line);
}

.admin-event-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(240px, 1.5fr) minmax(160px, auto) auto;
    gap: 12px;
    align-items: end;
    background: var(--band);
}

.admin-event-row strong,
.admin-event-row span,
.admin-login label,
.admin-event-row label {
    display: block;
}

.admin-event-row span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.admin-login label,
.admin-event-row label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.admin-login input,
.admin-event-row input[type="text"],
.admin-event-row input[type="password"] {
    width: 100%;
    margin-top: 5px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
}

.checkbox-label {
    min-height: 40px;
    display: flex !important;
    gap: 8px;
    align-items: center;
    color: var(--ink) !important;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
}

button,
.text-button {
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.text-button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-dark);
}

.admin-alert,
.admin-help {
    margin: 16px;
    padding: 12px 14px;
    border-radius: 6px;
}

.admin-help {
    background: #eef6f1;
    color: var(--muted);
}

.admin-alert.is-error {
    background: #fff0f0;
    color: #9b1c1c;
}

.admin-alert.is-success {
    background: #ecf8f0;
    color: #0a6b3e;
}

@media (max-width: 820px) {
    .site-header,
    .info-band,
    .section-heading,
    .event-summary {
        display: block;
    }

    .tour-logo {
        margin-top: 24px;
    }

    .info-band {
        margin-top: -20px;
    }

    dl {
        margin-top: 16px;
        flex-wrap: wrap;
    }

    .tab-controls {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .tab-controls label {
        min-width: 0;
    }

    .event-actions {
        margin-top: 10px;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .event-results-heading {
        display: block;
    }

    .event-results-heading a {
        display: inline-block;
        margin-top: 8px;
    }

    .admin-login,
    .admin-event-row {
        grid-template-columns: 1fr;
    }
}
