:root {
  --green: #1f4d2b;
  --green-light: #2e6b3d;
  --gold: #c9a227;
  --bg: #f5f3ec;
  --card: #ffffff;
  --text: #1d231f;
  --muted: #5d6a61;
  --line: #e2ded2;
  --bad: #b23b3b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
header {
  background: var(--green);
  color: #fff;
  border-bottom: 4px solid var(--gold);
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
header .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; font-weight: bold; color: #fff; text-decoration: none; letter-spacing: .5px; }
.brand span { color: var(--gold); }
.brand { display: inline-flex; align-items: center; white-space: pre; }
.brand .logo { height: 48px; width: auto; margin-right: 10px; }
nav a { color: #fff; text-decoration: none; margin-left: 18px; font-weight: 500; opacity: .85; white-space: nowrap; }
nav a:first-child { margin-left: 0; }
nav a:hover, nav a.active { opacity: 1; border-bottom: 2px solid var(--gold); }
main.wrap { padding-top: 28px; padding-bottom: 48px; }
h1 { font-family: Georgia, serif; color: var(--green); margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.leader td { background: #fbf6e3; font-weight: 600; }
.pts { font-weight: 700; color: var(--green); }
form { display: flex; gap: 10px; flex-wrap: wrap; }
input[type=text], input[type=password] { flex: 1; min-width: 200px; padding: 10px 12px; font-size: 1rem; border: 1px solid var(--line); border-radius: 6px; }
button { background: var(--green); color: #fff; border: 0; border-radius: 6px; padding: 10px 18px; font-size: 1rem; cursor: pointer; }
button:hover { background: var(--green-light); }
button.danger { background: var(--bad); }
button.small { padding: 4px 10px; font-size: .85rem; }
.msg { margin-top: 10px; min-height: 1.5em; }
.msg.error { color: var(--bad); }
.msg.ok { color: var(--green-light); }
ol.players { margin: 0; padding-left: 1.5em; }
ol.players { list-style: decimal; }
ol.players li { padding: 4px 0; }
.cta { display: inline-block; background: var(--gold); color: var(--green); font-weight: 700; padding: 10px 18px; border-radius: 6px; text-decoration: none; }
.show-sm { display: none; }
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .of { display: none; }
  th { letter-spacing: 0; }
  .card { padding: 10px; }
  th, td { padding: 8px 3px; }
  th { font-size: .7rem; }
  nav { display: flex; flex-wrap: wrap; row-gap: 6px; }
  nav a { margin-left: 0; margin-right: 14px; }
}
footer a { color: inherit; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 20px 0; }
.week-picker { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.week-picker select { padding: 6px 10px; font-size: 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
button:disabled { opacity: .4; cursor: default; }
form select { flex: 1; min-width: 200px; padding: 10px 12px; font-size: 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
ol.players li span:first-child { display: inline-block; }
ol.players li .hcap { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.list-head { display: flex; justify-content: space-between; margin: 0 0 4px 1.5em; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.card.scroll { overflow-x: auto; padding: 12px; }
table.eclectic th, table.eclectic td { padding: 6px 6px; white-space: nowrap; }
table.eclectic .name { position: sticky; left: 0; background: var(--card); z-index: 1; }
table.eclectic .par-row td { font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--line); }
table.eclectic td.num, table.eclectic th.num { text-align: center; }
table.eclectic td.total { background: #b7b7b7; font-weight: 700; text-align: center; }
table.eclectic tfoot td { color: var(--muted); font-style: italic; border-bottom: 0; }
.eagle { background: #ea9999; }
.birdie { background: #ffff00; }
.par { background: #a4c2f4; }
.bogey { background: #d9d9d9; }
.bogey-plus { background: #666666; color: #fff; }
.key { display: flex; flex-wrap: wrap; gap: 6px; }
.key span { padding: 4px 12px; border-radius: 4px; font-size: .9rem; }
.next-game { display: inline-block; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 6px; padding: 8px 14px; margin: 0 0 16px; }
.next-game strong { color: var(--green); }
a.player { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
a.player:hover { color: var(--green); border-bottom-color: var(--green); }
.back { margin: 0 0 8px; }
.back a, td a { color: var(--green-light); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin-bottom: 20px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; text-align: center; }
.stats span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.stats strong { font-size: 1.3rem; color: var(--green); }
.of { color: var(--muted); font-size: .8em; }
.chart-card { padding: 0; }
.chart-card summary { cursor: pointer; padding: 14px 20px; font-weight: 600; color: var(--green); }
.chart-wrap { position: relative; padding: 0 12px 12px; }
#hcap-svg { width: 100%; height: auto; display: block; overflow: visible; }
#hcap-svg .grid { stroke: var(--line); stroke-width: 1; }
#hcap-svg .axis { fill: var(--muted); font-size: 12px; }
#hcap-svg .line { fill: none; stroke: var(--green-light); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
#hcap-svg .dot { fill: var(--green-light); stroke: var(--card); stroke-width: 2; }
#hcap-svg .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; visibility: hidden; }
#hcap-svg .hit { fill: transparent; }
.tip { position: absolute; transform: translate(-50%, -100%); background: var(--text); color: #fff; border-radius: 6px; padding: 4px 8px; font-size: .85rem; pointer-events: none; white-space: nowrap; }
.tip span { opacity: .75; margin-right: 6px; }
td.date { white-space: nowrap; }
/* Honours boards: a modern take on clubhouse boards. Dark polished wood, gold-leaf lettering. */
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.board {
  --gold-leaf: #e2c169;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.18)),
    repeating-linear-gradient(92deg, rgba(0,0,0,.05) 0 3px, transparent 3px 11px),
    linear-gradient(135deg, #4a2617, #3a1c10 55%, #2c140b);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.06);
  color: var(--gold-leaf);
}
.board > * { position: relative; }
.board h2, .board ol { border: 1px solid rgba(226,193,105,.55); }
.board h2 {
  margin: 0; padding: 14px 10px 12px; text-align: center; border-bottom: 0; border-radius: 6px 6px 0 0;
  font-family: Cinzel, Georgia, serif; font-weight: 700; font-size: 1.25rem; letter-spacing: 3px; text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
}
.board h2 span { border-bottom: 2px solid var(--gold-leaf); padding-bottom: 4px; }
.board ol { list-style: none; margin: 0; padding: 6px 16px 14px; border-top: 0; border-radius: 0 0 6px 6px; }
.board li { display: flex; gap: 16px; padding: 5px 0; font-family: Cinzel, Georgia, serif; font-weight: 500; letter-spacing: 1px; text-shadow: 0 1px 0 rgba(0,0,0,.55); border-bottom: 1px solid rgba(226,193,105,.12); }
.board li:last-child { border-bottom: 0; }
.board .yr { flex: 0 0 3.2em; opacity: .85; font-variant-numeric: tabular-nums; }
.board .nm { flex: 1; }
.board li.latest { color: #f6dd92; font-weight: 700; font-size: 1.08rem; }
.player-honours {
  background: linear-gradient(135deg, #4a2617, #3a1c10 55%, #2c140b); color: #e2c169;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.player-honours h2 { margin: 0 0 6px; font-family: Cinzel, Georgia, serif; font-size: 1rem; letter-spacing: 3px; text-transform: uppercase; }
.player-honours h2 a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(226,193,105,.6); }
.player-honours ul { list-style: none; margin: 0; padding: 0; }
.player-honours li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 6px 0; border-top: 1px solid rgba(226,193,105,.18); font-family: Cinzel, Georgia, serif; }
.player-honours li:first-child { border-top: 0; }
.player-honours .title { font-weight: 700; color: #f6dd92; }
.player-honours .times { font-weight: 500; opacity: .85; }
.player-honours .years { font-variant-numeric: tabular-nums; opacity: .9; }

/* Records page */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chips button { font: inherit; font-size: .9rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--green); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
table.records tr.hio td { background: #faf4dc; font-weight: 600; }
table.records tr.divider td { background: var(--bg); color: var(--muted); font-style: italic; text-align: center; font-size: .9rem; }
table.records td.num { white-space: nowrap; }
@media (max-width: 600px) {
  .card.records-card { padding: 8px; }
  table.records th, table.records td { padding: 8px 5px; font-size: .9rem; }
  table.accounts th, table.accounts td { padding: 8px 5px; font-size: .9rem; }
  table.records .when, table.accounts .when { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
}

/* Accounts page */
table.accounts td.num { white-space: nowrap; }
table.accounts tr.spend td.out { color: var(--bad); font-weight: 600; }
.neg { color: var(--bad) !important; }
.stats.money { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 600px) {
  .stats.money { grid-template-columns: 1fr 1fr; }
  .stats.money strong { font-size: 1.15rem; }
}

/* Hall of Fame: champions' photos in gold frames on dark wood */
.hof {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.18)),
    repeating-linear-gradient(92deg, rgba(0,0,0,.05) 0 3px, transparent 3px 11px),
    linear-gradient(135deg, #4a2617, #3a1c10 55%, #2c140b);
  border-radius: 10px; padding: 20px; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.champ { margin: 0; text-align: center; color: #e2c169; font-family: Cinzel, Georgia, serif; }
.champ .frame {
  aspect-ratio: 1; padding: 6px; border-radius: 4px;
  background: linear-gradient(135deg, #f6dd92, #b8902e 45%, #e9c86a 70%, #8a6a1e);
  box-shadow: 0 4px 10px rgba(0,0,0,.45);
}
.champ img, .champ .ph { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.champ .ph { display: grid; place-items: center; background: #2c140b; color: #e2c169; font-size: 2.6rem; letter-spacing: 2px; }
.champ figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.champ .yr { font-size: 1.3rem; font-weight: 700; letter-spacing: 2px; color: #f6dd92; }
.champ .nm { font-weight: 500; letter-spacing: 1px; }
.champ .nm a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(226,193,105,.5); }
.champ .nth { font-family: inherit; font-size: .75rem; letter-spacing: 1px; opacity: .8; text-transform: uppercase; }
.champ.latest { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 280px) auto; justify-content: center; align-items: center; gap: 24px; }
.champ.latest figcaption { margin: 0; text-align: left; }
.champ.latest .yr { font-size: 2.2rem; }
.champ.latest .nm { font-size: 1.5rem; }
.champ.latest figcaption::before { content: 'Reigning Champion'; font-size: .8rem; letter-spacing: 3px; text-transform: uppercase; opacity: .85; }
@media (max-width: 600px) {
  .hof { grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; }
  .champ .yr { font-size: 1.1rem; }
  .champ .nm { font-size: .9rem; }
  .champ.latest { grid-template-columns: 1fr; gap: 10px; }
  .champ.latest figcaption { text-align: center; }
}

/* Match reports */
.card.report { border-left: 4px solid var(--gold); }
.card.report .kicker { margin: 0 0 2px; font-size: .75rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.card.report h2 { margin: 0 0 10px; color: var(--green); font-family: Georgia, serif; }
.card.report p { margin: 0 0 12px; line-height: 1.6; }
.card.report p:last-child { margin-bottom: 0; }
.admin-login { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-login input { flex: 1 1 200px; }
.admin-menu { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.admin-menu a.card { display: block; margin: 0; text-decoration: none; color: var(--text); }
.admin-menu a.card:hover { border-color: var(--green-light); }
.admin-menu strong { display: block; color: var(--green); font-size: 1.1rem; margin-bottom: 4px; }
.admin-menu span { color: var(--muted); }
.report-form { display: grid; gap: 14px; }
.report-form label { display: grid; gap: 6px; font-weight: 600; }
.report-form input, .report-form select, .report-form textarea { font: inherit; font-weight: 400; width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0; }
.report-form textarea { line-height: 1.5; resize: vertical; }
.report-form .actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
[hidden] { display: none !important; }
.report-form .actions a { color: var(--green); }
footer .credit { white-space: nowrap; }
footer .credit img { height: 1.2em; width: auto; vertical-align: -.25em; margin-right: 4px; }
.import-list { margin: 0 0 12px; padding-left: 1.4em; display: grid; gap: 4px; }
.import-list strong { color: var(--green); margin-right: 6px; }
.import-list li.skip { color: var(--muted); }
.card-title { margin: 0 0 4px; font-size: 1.15rem; color: var(--green); }
.card .card-title + .sub { margin-top: 0; }
.table-scroll { overflow-x: auto; }
button.secondary { background: #fff; color: var(--green); border: 1px solid var(--green); }
button.secondary:hover { background: #f1f6f2; }
button:disabled { opacity: .55; cursor: default; }
.report-form .card { margin: 0; min-width: 0; }
.report-form { grid-template-columns: minmax(0, 1fr); }
.score-entry { min-width: 560px; }
.score-entry th, .score-entry td { padding: 4px; border-bottom: 0; }
.report-form .score-entry input, .report-form .score-entry select { padding: 7px 8px; }
.report-form .score-entry input.num { width: 4.2em; text-align: center; }
.score-entry td:first-child { min-width: 170px; }
.score-entry button.remove { background: none; color: var(--muted); font-size: 1.3rem; padding: 2px 8px; }
.score-entry button.remove:hover { color: var(--bad); }
.price-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-top: 10px; }
.tick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 16px; margin-top: 12px; }
.report-form .tick-list label { display: flex; align-items: center; gap: 8px; font-weight: 400; padding: 4px 0; }
.report-form .tick-list input, .report-form td.tick input { width: auto; width: 1.15em; height: 1.15em; accent-color: var(--green); }
.report-form input[type=search] { margin-top: 4px; }
td.tick { text-align: center; }
.pay-entry { min-width: 640px; }
.report-form .pay-entry input.amount { width: 5.5em; }
.report-form .pay-entry input[type=date] { width: 10.5em; }
.owed { border-left: 4px solid var(--green); }
.owed-table { width: auto; min-width: 280px; margin: 8px 0; }
.owed-table td { padding: 6px 14px 6px 0; }
.owed-table tr.total td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.price-grid { align-items: end; }
.sub a { color: var(--green); }
.msg:empty { display: none; }
