:root {
  --pine-950: #09271e;
  --pine-900: #123c2f;
  --pine-800: #194b3b;
  --pine-700: #28614d;
  --pine-100: #dfe9e3;
  --cream: #f4f0e6;
  --paper: #fffdf7;
  --ink: #17231e;
  --muted: #657169;
  --line: #d9d6cb;
  --coral: #d94b38;
  --coral-dark: #a8382a;
  --blue: #27618e;
  --gold: #b58a3a;
  --success: #26714a;
  --warning: #a46613;
  --danger: #a9362a;
  --shadow: 0 18px 48px rgb(9 39 30 / 10%);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .56; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--coral) 75%, white);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--pine-900);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 72px;
  padding: 10px clamp(16px, 4vw, 64px);
  border-bottom: 1px solid rgb(255 255 255 / 13%);
  background: var(--pine-900);
  color: white;
}

.site-brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  width: max-content;
  color: white;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-seal {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  color: inherit;
  font-family: var(--serif);
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.site-header nav { display: flex; align-items: center; gap: clamp(10px, 3vw, 32px); }
.site-header nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: rgb(255 255 255 / 76%);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-header nav a:hover { color: white; }

.page-root { min-height: calc(100vh - 142px); }
.page-container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.narrow-container { width: min(820px, calc(100% - 32px)); margin-inline: auto; }

.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 55vh;
  color: var(--pine-700);
  font-weight: 750;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #48ba78;
  box-shadow: 0 0 0 5px rgb(72 186 120 / 14%);
}
.live-dot.warning { background: #e1a33b; box-shadow: 0 0 0 5px rgb(225 163 59 / 15%); }

.hero {
  overflow: hidden;
  padding: clamp(40px, 7vw, 96px) 0 clamp(46px, 7vw, 88px);
  background: var(--pine-900);
  color: white;
}

.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-topline, .section-heading, .match-meta, .card-top, .status-row, .admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #f2a596; }
.hero-topline { color: rgb(255 255 255 / 66%); font-size: .82rem; }
.hero-topline p { margin: 0; }
.hero-topline .live-dot { margin-right: 9px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, .8fr);
  gap: clamp(32px, 7vw, 90px);
  align-items: end;
  margin-top: clamp(28px, 5vw, 58px);
}

h1, h2, h3, h4, p { overflow-wrap: anywhere; }
h1, h2, h3, h4 { margin-top: 0; }
.hero h1, .record-hero h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-family: var(--serif);
  font-size: clamp(3.1rem, 8vw, 7rem);
  font-weight: 500;
  letter-spacing: -.065em;
  line-height: .88;
}
.hero-copy { max-width: 520px; margin: 0; color: rgb(255 255 255 / 65%); font-size: clamp(1rem, 2vw, 1.22rem); }

.scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: var(--radius-lg);
  background: rgb(4 28 20 / 42%);
  box-shadow: 0 28px 80px rgb(0 0 0 / 16%);
}
.team-score { padding: clamp(20px, 4vw, 36px); }
.team-score:last-child { text-align: right; }
.team-score span { display: block; color: rgb(255 255 255 / 48%); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.team-score strong { display: block; margin: 7px 0; font-family: var(--serif); font-size: clamp(1.15rem, 3vw, 1.65rem); font-weight: 500; }
.team-score b { font-family: var(--serif); font-size: clamp(2.8rem, 8vw, 5.4rem); font-weight: 500; line-height: 1; }
.score-divider { display: grid; min-width: 58px; place-content: center; text-align: center; color: rgb(255 255 255 / 48%); font-size: .62rem; font-weight: 900; letter-spacing: .13em; }
.score-divider::before { content: ""; width: 1px; height: 34px; margin: 0 auto 8px; background: rgb(255 255 255 / 17%); }
.score-divider b { margin-top: 5px; color: white; font-family: var(--serif); font-size: 1.3rem; letter-spacing: normal; }
.projection { margin: 12px 8px 0; text-align: center; color: rgb(255 255 255 / 58%); font-size: .76rem; }
.projection strong { color: white; }

.round-tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(1080px, calc(100% - 32px));
  margin: -24px auto 0;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.round-tab {
  min-height: 88px;
  padding: 17px clamp(13px, 3vw, 26px);
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
}
.round-tab:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.round-tab:last-child { border-right: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.round-tab.active { background: var(--pine-800); color: white; }
.round-tab span { display: block; font-size: .68rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.round-tab strong { display: block; margin: 3px 0; font-family: var(--serif); font-size: clamp(1.02rem, 2.2vw, 1.34rem); }
.round-tab small { color: inherit; opacity: .68; }

.content-section { padding: clamp(52px, 8vw, 96px) 0; }
.section-heading { margin-bottom: 28px; align-items: end; }
.section-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.8rem); font-weight: 500; letter-spacing: -.045em; line-height: .95; }
.section-heading > span, .refresh-label { color: var(--muted); font-size: .78rem; font-weight: 700; }
.refresh-label .live-dot { margin-right: 8px; }

.match-grid, .history-grid { display: grid; gap: 16px; }
.match-card, .history-card, .paper-card, .admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 10px 35px rgb(9 39 30 / 5%);
}
.match-card { padding: clamp(19px, 4vw, 30px); }
.match-meta { margin-bottom: 18px; color: var(--muted); font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.match-meta time { color: var(--ink); }
.pairing-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 18px; align-items: center; }
.pairing-grid > div:last-child { text-align: right; }
.team-label { color: var(--muted); font-size: .67rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.player-names { margin: 4px 0; font-family: var(--serif); font-size: clamp(1.05rem, 2.8vw, 1.45rem); line-height: 1.2; }
.versus { color: var(--line); font-family: var(--serif); font-style: italic; }
.result-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.result-pill { display: inline-flex; min-height: 34px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--pine-100); color: var(--pine-900); font-size: .73rem; font-weight: 900; }
.result-pill.side-2 { background: #f1ded8; color: var(--coral-dark); }
.result-pill.final { background: var(--ink); color: white; }
.text-link, .primary-link, .secondary-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  font-weight: 850;
  text-decoration: none;
}
.text-link { color: var(--pine-700); font-size: .78rem; }
.text-link::after { content: "→"; margin-left: 8px; transition: transform .15s ease; }
.text-link:hover::after { transform: translateX(3px); }
.primary-link, .secondary-link { padding: 11px 18px; border-radius: 999px; }
.primary-link { border: 1px solid var(--pine-900); background: var(--pine-900); color: white; }
.secondary-link { border: 1px solid var(--line); background: transparent; color: var(--pine-900); }

.record-hero {
  padding: clamp(54px, 9vw, 112px) 0;
  background: var(--pine-900);
  color: white;
}
.record-hero p:last-child { max-width: 620px; margin-bottom: 0; color: rgb(255 255 255 / 63%); }
.history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.history-card { display: block; padding: clamp(22px, 4vw, 36px); color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.history-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-top { color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.card-top em { padding: 4px 9px; border-radius: 999px; background: var(--pine-100); color: var(--pine-700); font-style: normal; }
.history-card h2 { margin: 25px 0 5px; font-family: var(--serif); font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 500; line-height: 1; }
.winner-line { min-height: 24px; color: var(--muted); }
.history-score { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.history-score div { padding: 14px; border-radius: var(--radius-sm); background: var(--cream); }
.history-score span { display: block; color: var(--muted); font-size: .67rem; font-weight: 800; }
.history-score strong { font-family: var(--serif); font-size: 2rem; font-weight: 500; }

.cup-hero { padding: clamp(45px, 7vw, 80px) 0; background: var(--pine-900); color: white; }
.cup-hero h1 { margin: 12px 0 30px; font-family: var(--serif); font-size: clamp(2.8rem, 8vw, 6.4rem); font-weight: 500; letter-spacing: -.06em; line-height: .9; }
.cup-round { margin-bottom: 26px; }
.cup-round > header { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 13px; }
.cup-round h2 { margin: 0; font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 500; }
.cup-round header p { margin: 0; color: var(--muted); font-size: .82rem; text-align: right; }

.match-detail-hero { padding: clamp(38px, 6vw, 70px) 0; background: var(--pine-900); color: white; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; color: rgb(255 255 255 / 68%); font-size: .78rem; font-weight: 800; text-decoration: none; }
.match-detail-title { margin: 28px 0 12px; font-family: var(--serif); font-size: clamp(2.3rem, 7vw, 5.4rem); font-weight: 500; letter-spacing: -.055em; line-height: .94; text-align: center; }
.match-detail-subtitle { margin: 0; color: rgb(255 255 255 / 62%); text-align: center; }
.centered-eyebrow { text-align: center; }
.detail-score { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 23px 0 0; }
.detail-score strong { font-family: var(--serif); font-size: clamp(2rem, 6vw, 4rem); font-weight: 500; }
.detail-score span { color: rgb(255 255 255 / 55%); }
.roster-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.side-card { padding: 22px; }
.side-card:last-child { text-align: right; }
.side-card h2 { margin: 5px 0 18px; font-family: var(--serif); font-size: 1.8rem; font-weight: 500; }
.golfer-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.side-card:last-child .golfer-line { flex-direction: row-reverse; }
.tee-pill { padding: 3px 8px; border-radius: 999px; background: var(--cream); color: var(--muted); font-size: .66rem; font-weight: 850; text-transform: uppercase; }

.hole-table { overflow: hidden; }
.hole-row { display: grid; grid-template-columns: 62px 1fr 75px; align-items: center; min-height: 52px; padding: 6px 18px; border-top: 1px solid var(--line); }
.hole-row:first-child { border-top: 0; }
.hole-number { font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.hole-outcome { text-align: center; font-weight: 800; }
.hole-margin { color: var(--muted); font-size: .72rem; font-weight: 800; text-align: right; }

.empty-panel { padding: clamp(35px, 7vw, 70px); border: 1px dashed #c4c7bd; border-radius: var(--radius); text-align: center; }
.empty-panel h2 { margin-bottom: 8px; font-family: var(--serif); font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 500; }
.empty-panel p { max-width: 560px; margin: 0 auto 22px; color: var(--muted); }

.state-page {
  display: grid;
  min-height: 100vh;
  align-content: center;
  justify-items: center;
  padding: 30px;
  text-align: center;
}
.state-page .brand-seal { margin-bottom: 22px; background: var(--pine-900); color: white; }
.state-page h1 { max-width: 700px; margin-bottom: 12px; font-family: var(--serif); font-size: clamp(2.3rem, 7vw, 4.8rem); font-weight: 500; letter-spacing: -.05em; line-height: .95; }
.state-page > p:not(.eyebrow) { max-width: 540px; margin: 0 0 25px; color: var(--muted); }
.noscript { padding: 16px; background: var(--danger); color: white; text-align: center; }

/* Mobile scoring */
body[data-page="score"] { background: var(--paper); }
.score-entry { max-width: 720px; margin: 0 auto; padding: 22px 16px 110px; }
.scorer-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scorer-top a { min-height: 44px; display: inline-flex; align-items: center; color: var(--pine-700); font-size: .78rem; font-weight: 850; text-decoration: none; }
.sync-badge { display: inline-flex; min-height: 34px; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 999px; background: var(--pine-100); color: var(--pine-700); font-size: .7rem; font-weight: 900; }
.sync-badge.offline { background: #f6ead4; color: var(--warning); }
.scorer-heading { margin: 25px 0; text-align: center; }
.scorer-heading p { margin: 0; color: var(--muted); font-size: .76rem; font-weight: 850; }
.scorer-heading h1 { margin: 7px 0; font-family: var(--serif); font-size: clamp(2.3rem, 10vw, 4.5rem); font-weight: 500; letter-spacing: -.06em; line-height: .94; }
.scorer-heading .match-status { color: var(--pine-700); }
.scorer-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 11px; align-items: center; margin: 20px 0; }
.scorer-side { min-width: 0; }
.scorer-side:last-child { text-align: right; }
.scorer-side strong { display: block; font-family: var(--serif); font-size: clamp(1.15rem, 5vw, 1.6rem); font-weight: 500; line-height: 1.1; }
.scorer-side span { display: block; overflow: hidden; margin-top: 5px; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.scorer-vs { color: var(--line); font-family: var(--serif); font-style: italic; }
.hole-picker { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin: 22px 0; }
.hole-chip { aspect-ratio: 1; min-width: 0; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--muted); font-size: .72rem; font-weight: 850; }
.hole-chip.complete { border-color: var(--pine-700); background: var(--pine-100); color: var(--pine-900); }
.hole-chip.active { border-color: var(--coral); background: var(--coral); color: white; box-shadow: 0 0 0 4px rgb(217 75 56 / 14%); }
.hole-chip.pending { border-style: dashed; }
.entry-card { padding: clamp(21px, 5vw, 34px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--cream); text-align: center; }
.entry-card .entry-kicker { margin: 0; color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.entry-card h2 { margin: 5px 0 22px; font-family: var(--serif); font-size: clamp(2.4rem, 11vw, 4.3rem); font-weight: 500; line-height: 1; }
.outcome-buttons { display: grid; gap: 10px; }
.outcome-button { min-height: 66px; padding: 12px; border: 0; border-radius: 15px; color: white; font-weight: 900; }
.outcome-button small { display: block; margin-top: 2px; opacity: .7; font-size: .67rem; font-weight: 700; }
.outcome-button.side-one { background: var(--pine-800); }
.outcome-button.halved { background: var(--ink); }
.outcome-button.side-two { background: var(--coral); }
.scorer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }
.delete-result-panel { display: grid; gap: 7px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.delete-result-panel small { color: var(--muted); font-size: .72rem; }
.delete-result-button { width: 100%; min-height: 52px; }
.ghost-button, .danger-button, .small-button, .primary-button, .secondary-button {
  min-height: 44px;
  padding: 9px 15px;
  border-radius: 10px;
  font-weight: 850;
}
.ghost-button, .small-button, .secondary-button { border: 1px solid var(--line); background: white; color: var(--pine-900); }
.danger-button { border: 1px solid #e3b8af; background: #fff4f1; color: var(--danger); }
.primary-button { border: 1px solid var(--pine-900); background: var(--pine-900); color: white; }
.score-notice { margin-top: 15px; color: var(--muted); font-size: .78rem; text-align: center; }
.score-notice.error { color: var(--danger); }
.score-notice.success { color: var(--success); }
.queue-conflict { margin-top: 18px; padding: 16px; border: 1px solid #d9b56d; border-radius: var(--radius); background: #fff8e8; color: var(--ink); text-align: left; }
.queue-conflict > strong { display: block; font-family: var(--serif); font-size: 1.12rem; font-weight: 600; }
.queue-conflict p { margin: 6px 0 13px; color: var(--muted); font-size: .88rem; }
.queue-conflict small { display: block; margin-top: 10px; color: var(--muted); font-size: .72rem; }
.queue-conflict-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.queue-conflict-actions button { flex: 1 1 150px; }
.token-missing { padding: 30px; border: 1px solid #ebc4bb; border-radius: var(--radius); background: #fff4f1; text-align: center; }
.token-missing h1 { font-family: var(--serif); font-weight: 500; }

/* Administrator */
body[data-page="admin"] { background: #ece9df; }
.admin-page { width: min(1320px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 80px; }
.admin-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.admin-hero h1 { margin: 4px 0; font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 4.7rem); font-weight: 500; letter-spacing: -.055em; line-height: .95; }
.admin-hero p:last-child { margin: 0; color: var(--muted); }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.admin-main, .admin-rail { display: grid; gap: 18px; }
.admin-rail { position: sticky; top: 18px; }
.admin-card { padding: clamp(20px, 4vw, 32px); }
.admin-card h2 { margin: 0; font-family: var(--serif); font-size: clamp(1.55rem, 3vw, 2.2rem); font-weight: 500; }
.admin-card h3 { margin-bottom: 10px; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.admin-heading { align-items: start; margin-bottom: 22px; }
.admin-heading p { max-width: 520px; margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-wide { grid-column: 1 / -1; }
label.field, .field { display: grid; gap: 5px; min-width: 0; }
.field > span, fieldset > legend { color: var(--muted); font-size: .67rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #cfcfc5;
  border-radius: 9px;
  background: white;
  color: var(--ink);
}
input[type="color"] { padding: 4px; }
input[type="checkbox"] { width: 20px; min-height: 20px; }
.check-field { display: flex; min-height: 44px; align-items: center; gap: 8px; color: var(--ink); font-size: .78rem; font-weight: 750; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.team-edit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.team-edit { display: grid; grid-template-columns: 1fr 62px; gap: 10px; padding: 15px; border-radius: var(--radius-sm); background: var(--cream); }
.team-edit .field:first-child { grid-column: 1 / -1; }
.player-list, .admin-match-list { display: grid; gap: 9px; }
.player-row { display: grid; grid-template-columns: 1.5fr 1fr .8fr auto auto; gap: 9px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.round-editor { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.round-editor:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.spaced-block { margin-top: 24px; }
.spaced-form { margin-top: 20px; }
.add-match-form { margin-top: 22px; }
.round-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.round-tee-panel { margin-top: 20px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--cream); }
.round-tee-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.round-tee-heading h4 { margin: 2px 0 0; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.round-tee-heading > p { max-width: 390px; margin: 0; color: var(--muted); font-size: .74rem; }
.round-tee-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.round-tee-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, .8fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.round-tee-row > span { display: grid; gap: 2px; min-width: 0; }
.round-tee-row strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.round-tee-row small { color: var(--muted); font-size: .66rem; }
.status-badge { padding: 4px 9px; border-radius: 999px; background: var(--pine-100); color: var(--pine-700); font-size: .66rem; font-weight: 900; text-transform: uppercase; }
.match-admin-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 13px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.match-admin-row > strong { font-family: var(--serif); font-size: 1.5rem; }
.match-admin-row p { margin: 0; font-size: .8rem; }
.match-admin-row small { color: var(--muted); }
.hole-result-editor { grid-column: 1 / -1; padding: 15px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; background: var(--cream); }
.hole-result-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.hole-result-heading h4 { margin: 0; font-family: var(--serif); font-size: 1.18rem; }
.hole-result-heading p { max-width: 590px; margin: 3px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.admin-hole-list { display: grid; gap: 7px; }
.admin-hole-row { display: grid; grid-template-columns: 68px minmax(180px, 1fr) auto; align-items: end; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.admin-hole-row > strong { align-self: center; font-family: var(--serif); font-size: 1rem; }
.admin-hole-row .row-actions { align-self: end; }
.empty-panel.compact { padding: 17px; }
.empty-panel.compact h4 { margin: 0 0 4px; font-family: var(--serif); }
.lineup-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 13px 0; }
.lineup-picker fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.player-option { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.score-link-box { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border-radius: 10px; background: var(--pine-100); }
.score-link-box input { min-width: 0; font-size: .75rem; }
.score-link-box p { grid-column: 1 / -1; margin: 0; color: var(--pine-700); font-size: .7rem; }
.admin-message {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  font-size: .82rem;
}
.admin-message.error { background: var(--danger); }
.rail-list { display: grid; gap: 7px; }
.rail-list a { display: flex; min-height: 42px; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; color: var(--pine-900); font-size: .8rem; font-weight: 800; text-decoration: none; }
.rail-list a:hover, .rail-list a.active { background: var(--pine-100); }
.muted { color: var(--muted); }

.site-footer {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px clamp(16px, 4vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}
.site-footer a { min-height: 44px; display: inline-flex; align-items: center; color: var(--pine-700); text-decoration: none; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-rail { position: static; grid-row: 1; }
  .rail-list { grid-template-columns: repeat(3, 1fr); }
  .player-row { grid-template-columns: 1fr 1fr; }
  .player-row .row-actions { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
  .site-header { grid-template-columns: auto 1fr; }
  .site-header nav { justify-content: end; gap: 8px; }
  .site-header nav a { font-size: .64rem; letter-spacing: .04em; }
  .site-brand > span:last-child { display: none; }
  .hero-topline, .section-heading, .admin-hero { align-items: flex-start; flex-direction: column; }
  .hero-topline p:last-child { display: none; }
  .round-tabs { grid-template-columns: 1fr; margin-top: 0; border-radius: 0; }
  .round-tab, .round-tab:first-child, .round-tab:last-child { min-height: 72px; border-right: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .round-tab div { display: flex; align-items: baseline; gap: 8px; }
  .scoreboard { border-radius: var(--radius); }
  .score-divider { min-width: 42px; }
  .team-score { padding: 18px 12px; }
  .pairing-grid { grid-template-columns: 1fr; gap: 9px; }
  .pairing-grid > div:last-child { text-align: left; }
  .versus { display: none; }
  .result-row { align-items: flex-start; flex-direction: column; }
  .history-score { grid-template-columns: 1fr 1fr; }
  .cup-round > header { align-items: flex-start; flex-direction: column; }
  .cup-round header p { text-align: left; }
  .roster-sides { grid-template-columns: 1fr; }
  .side-card:last-child { text-align: left; }
  .side-card:last-child .golfer-line { flex-direction: row; }
  .hole-picker { grid-template-columns: repeat(6, 1fr); }
  .form-grid, .form-grid.three, .team-edit-grid, .lineup-picker { grid-template-columns: 1fr; }
  .round-tee-heading, .hole-result-heading { flex-direction: column; }
  .round-tee-grid { grid-template-columns: 1fr; }
  .round-tee-row { grid-template-columns: 1fr; }
  .round-tee-row strong { overflow: visible; text-overflow: clip; white-space: normal; }
  .player-row { grid-template-columns: 1fr; }
  .match-admin-row { grid-template-columns: 50px 1fr; }
  .match-admin-row .row-actions { grid-column: 1 / -1; }
  .admin-hole-row { grid-template-columns: 1fr; align-items: stretch; }
  .admin-hole-row .row-actions { width: 100%; }
  .admin-hole-row .row-actions button { flex: 1 1 130px; }
  .rail-list { grid-template-columns: 1fr; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
