:root {
  --forest-950: #10291f;
  --forest-900: #183a2c;
  --forest-800: #23503d;
  --forest-700: #32644d;
  --forest-100: #dfe9dc;
  --cream: #f5f0e4;
  --parchment: #fffaf0;
  --paper: #fffdf7;
  --ink: #26352d;
  --muted: #6f796f;
  --gold: #c69543;
  --gold-light: #ead5a0;
  --rust: #b75c3d;
  --rust-dark: #8e402b;
  --line: #ddd7c8;
  --shadow: 0 20px 55px rgba(32, 47, 37, 0.12);
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--cream); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 22%, rgba(198, 149, 67, .08) 0 2px, transparent 3px),
    linear-gradient(115deg, rgba(255,255,255,.35), transparent 45%),
    var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-150%); padding: 10px 14px; background: white; border-radius: 8px; color: var(--forest-900); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.forest-canopy { position: fixed; inset: 0 0 auto 0; height: 7px; z-index: 20; background: linear-gradient(90deg, var(--forest-950), var(--forest-700) 42%, var(--forest-900)); }
.leaf { position: absolute; top: 0; width: 90px; height: 6px; background: #6f8b56; border-radius: 100% 0; opacity: .45; }
.leaf-one { left: 11%; transform: rotate(4deg); }
.leaf-two { left: 47%; transform: rotate(-2deg); }
.leaf-three { right: 8%; transform: rotate(3deg); }

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 92px;
  padding: 14px clamp(22px, 5vw, 72px) 8px;
  background: rgba(245, 240, 228, .88);
  border-bottom: 1px solid rgba(67, 79, 68, .12);
  backdrop-filter: blur(16px);
}

.brand { display: inline-flex; align-items: center; justify-self: start; gap: 11px; border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 45px; height: 45px; background: var(--forest-900); color: var(--gold-light); border-radius: 50% 50% 45% 50%; box-shadow: 0 6px 16px rgba(24,58,44,.17); transform: rotate(-3deg); }
.brand-mark svg { width: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; color: var(--forest-900); font-family: var(--serif); font-size: 20px; line-height: 1; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }

.main-nav { display: flex; justify-content: center; gap: 6px; padding: 4px; border: 1px solid rgba(69, 76, 66, .13); border-radius: 999px; background: rgba(255,255,255,.44); }
.nav-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; color: #667169; font-size: 13px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.nav-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-button:hover { color: var(--forest-900); }
.nav-button.is-active { background: var(--paper); color: var(--forest-900); box-shadow: 0 3px 12px rgba(35, 49, 40, .09); }
.count-badge { display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 10px; background: var(--forest-100); font-size: 10px; }

.install-button, .text-button { justify-self: end; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--forest-800); font-size: 13px; font-weight: 700; cursor: pointer; }
.install-button svg, .text-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

main { width: 100%; }
.view { animation: view-in .35s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }

.setup-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .72fr); align-items: center; gap: clamp(40px, 7vw, 110px); width: min(1180px, calc(100% - 44px)); min-height: calc(100vh - 151px); margin: 0 auto; padding: 42px 0 28px; }
.intro-copy { position: relative; padding: 20px 0 0 clamp(0px, 2vw, 28px); }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--rust); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow span { width: 30px; height: 1px; background: currentColor; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 20px; color: var(--forest-900); font-family: var(--serif); font-size: clamp(46px, 6vw, 78px); line-height: .98; letter-spacing: -.05em; }
.intro-text { max-width: 550px; margin-bottom: 12px; color: #657168; font-size: clamp(16px, 2vw, 19px); line-height: 1.7; }
.season-ornament { width: min(560px, 100%); margin-top: 14px; color: var(--forest-900); opacity: .9; }
.season-ornament svg { display: block; width: 100%; overflow: visible; }
.hill-back { fill: #cdd8be; }
.hill-front { fill: #aebf99; }
.trees { fill: #416a4e; stroke: #416a4e; stroke-width: 3; }
.mushrooms { fill: #b96846; stroke: #b96846; stroke-width: 3; stroke-linecap: round; }

.setup-card { position: relative; padding: clamp(28px, 4vw, 42px); background: rgba(255,253,247,.94); border: 1px solid rgba(70, 71, 59, .13); border-radius: 5px 24px 5px 24px; box-shadow: var(--shadow); }
.setup-card::before { content: ""; position: absolute; inset: 8px; pointer-events: none; border: 1px solid rgba(198,149,67,.22); border-radius: 3px 18px 3px 18px; }
.card-kicker { position: relative; margin-bottom: 12px; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.setup-card h2, .history-layout h2 { position: relative; margin-bottom: 8px; color: var(--forest-900); font-family: var(--serif); font-size: clamp(28px, 3vw, 36px); line-height: 1.15; letter-spacing: -.03em; }
.setup-card > p { position: relative; color: var(--muted); font-size: 14px; }
.player-form { position: relative; display: grid; grid-template-columns: 1fr 46px; gap: 8px; margin-top: 28px; }
.player-form input { min-width: 0; height: 48px; padding: 0 15px; border: 1px solid var(--line); outline: 0; border-radius: 7px; background: #fffcf5; color: var(--ink); transition: .2s; }
.player-form input::placeholder { color: #a3a79f; }
.player-form input:focus { border-color: var(--forest-700); box-shadow: 0 0 0 3px rgba(50,100,77,.1); }
.add-player-button { display: grid; place-items: center; border: 0; border-radius: 7px; background: var(--forest-800); color: white; cursor: pointer; transition: .2s; }
.add-player-button:hover { background: var(--forest-900); transform: translateY(-1px); }
.add-player-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.form-error { min-height: 18px; margin: 5px 0 0 !important; color: var(--rust-dark) !important; font-size: 11px !important; }
.player-list { position: relative; display: flex; flex-wrap: wrap; gap: 8px; min-height: 42px; margin: 6px 0 19px; }
.player-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 12px; border-radius: 17px; background: #edf0e7; color: var(--forest-900); font-size: 12px; font-weight: 700; animation: pill-in .25s ease both; }
@keyframes pill-in { from { opacity: 0; transform: scale(.9); } }
.player-pill button { display: grid; width: 23px; height: 23px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #829087; cursor: pointer; }
.player-pill button:hover { background: white; color: var(--rust); }
.player-pill svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.primary-button, .secondary-button, .danger-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 11px; min-height: 50px; border-radius: 7px; font-weight: 800; cursor: pointer; transition: transform .2s, background .2s, opacity .2s; }
.primary-button { width: 100%; border: 0; background: var(--rust); color: #fffdf8; box-shadow: 0 7px 18px rgba(142,64,43,.2); }
.primary-button:hover:not(:disabled) { background: var(--rust-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.primary-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.local-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 16px 0 0 !important; font-size: 10px !important; }
.local-note svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.scoring-layout, .history-layout { width: min(1210px, calc(100% - 44px)); min-height: calc(100vh - 151px); margin: 0 auto; padding: 48px 0 42px; }
.page-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 32px; }
.page-heading-row .eyebrow { margin-bottom: 12px; }
.page-heading-row h1 { margin-bottom: 10px; font-size: clamp(42px, 5vw, 62px); }
.page-heading-row p:last-child { margin-bottom: 0; color: var(--muted); }
.text-button { margin-bottom: 9px; padding: 10px 0; }
.text-button:hover { color: var(--rust); }

.scorecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 18px; align-items: start; }
.scorecard { overflow: hidden; background: var(--paper); border: 1px solid rgba(70, 71, 59, .14); border-radius: 5px 20px 5px 20px; box-shadow: 0 13px 30px rgba(35,49,40,.08); }
.scorecard-header { display: flex; align-items: center; justify-content: space-between; min-height: 84px; padding: 18px 22px; color: white; background: var(--forest-900); }
.scorecard-header h2 { overflow: hidden; margin: 0; font-family: var(--serif); font-size: 25px; text-overflow: ellipsis; white-space: nowrap; }
.scorecard-total { display: flex; flex-shrink: 0; align-items: baseline; gap: 5px; color: var(--gold-light); }
.scorecard-total strong { font-family: var(--serif); font-size: 38px; line-height: 1; }
.scorecard-total small { font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.score-rows { padding: 10px 18px 14px; }
.score-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 11px; min-height: 60px; border-bottom: 1px solid #ebe6da; }
.score-row:last-child { border-bottom: 0; }
.category-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #edf1e8; color: var(--forest-700); }
.category-icon svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.score-row label { font-size: 12px; font-weight: 700; line-height: 1.2; }
.score-row label small { display: block; margin-top: 3px; color: #9a9f98; font-size: 9px; font-weight: 500; }
.score-input-wrap { display: flex; align-items: center; width: 82px; height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fffcf5; transition: .2s; }
.score-input-wrap:focus-within { border-color: var(--forest-700); box-shadow: 0 0 0 3px rgba(50,100,77,.1); }
.score-input-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--forest-900); font-size: 16px; font-weight: 800; text-align: right; appearance: textfield; }
.score-input-wrap input::-webkit-inner-spin-button { appearance: none; }
.score-input-wrap span { margin-left: 5px; color: #aaa89f; font-size: 9px; font-weight: 700; }
.scorecard.is-leader .scorecard-header { background: linear-gradient(120deg, var(--forest-900), #2c5b44); }
.scorecard.is-leader { outline: 2px solid rgba(198,149,67,.42); outline-offset: -2px; }

.save-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 17px 18px 17px 24px; background: rgba(255,253,247,.85); border: 1px solid rgba(70, 71, 59, .13); border-radius: 4px 14px 4px 14px; }
.leader-preview { display: flex; align-items: center; gap: 10px; color: var(--forest-800); font-family: var(--serif); font-size: 15px; }
.acorn { color: var(--gold); font-size: 13px; transform: rotate(45deg); }
.save-button { width: auto; min-width: 175px; padding: 0 22px; }

.history-heading-row { align-items: center; }
.compact-button { width: auto; min-width: 145px; padding: 0 20px; }
.history-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.summary-card { display: flex; align-items: center; gap: 13px; padding: 17px 20px; background: rgba(255,253,247,.75); border: 1px solid rgba(70,71,59,.12); border-radius: 4px 13px 4px 13px; }
.summary-icon { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: var(--forest-100); color: var(--forest-700); }
.summary-icon svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.summary-card strong { display: block; color: var(--forest-900); font-family: var(--serif); font-size: 20px; line-height: 1.1; }
.summary-card span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.history-list { display: grid; gap: 14px; }
.history-card { background: var(--paper); border: 1px solid rgba(70,71,59,.14); border-radius: 4px 16px 4px 16px; box-shadow: 0 10px 25px rgba(35,49,40,.06); }
.history-card summary { position: relative; display: grid; grid-template-columns: 180px 1fr auto 24px; align-items: center; gap: 22px; min-height: 90px; padding: 18px 22px; list-style: none; cursor: pointer; }
.history-card summary::-webkit-details-marker { display: none; }
.history-date strong { display: block; color: var(--forest-900); font-family: var(--serif); font-size: 17px; }
.history-date span { color: var(--muted); font-size: 11px; }
.history-players { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.history-player { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; background: #f0f1eb; border-radius: 4px 10px 4px 10px; font-size: 11px; font-weight: 700; }
.history-player.winner { background: #f2e6c5; color: #73552a; }
.history-player .crown { color: var(--gold); }
.history-high-score { text-align: right; }
.history-high-score strong { display: block; color: var(--forest-900); font-family: var(--serif); font-size: 25px; line-height: 1; }
.history-high-score span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.chevron { width: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; transition: transform .2s; }
.history-card[open] .chevron { transform: rotate(180deg); }
.history-details { padding: 0 22px 20px; }
.history-table-wrap { overflow-x: auto; border-top: 1px solid #e8e3d8; }
.history-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.history-table th, .history-table td { padding: 9px 12px; border-bottom: 1px solid #eee9de; text-align: right; white-space: nowrap; }
.history-table th:first-child, .history-table td:first-child { padding-left: 0; text-align: left; }
.history-table thead th { color: var(--forest-800); font-weight: 800; }
.history-table tbody th { color: var(--muted); font-weight: 600; }
.history-table .total-row th, .history-table .total-row td { border-bottom: 0; color: var(--forest-900); font-weight: 800; }
.history-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.delete-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 0 7px 10px; border: 0; background: transparent; color: var(--rust); font-size: 10px; font-weight: 800; cursor: pointer; }
.delete-button svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.empty-state { display: grid; justify-items: center; max-width: 440px; margin: 44px auto; text-align: center; }
.empty-illustration { width: 150px; color: var(--forest-700); }
.empty-illustration svg { width: 100%; }
.book { fill: #e6ddc7; stroke: var(--forest-700); stroke-width: 2; stroke-linejoin: round; }
.book-line { fill: none; stroke: #81927e; stroke-width: 1.5; stroke-linecap: round; }
.sprig { fill: #9eb487; stroke: var(--forest-700); stroke-width: 1.5; }
.empty-state h2 { margin: 5px 0 8px; }
.empty-state p { color: var(--muted); }
.secondary-button { min-height: 42px; padding: 0 18px; border: 1px solid var(--forest-700); background: transparent; color: var(--forest-800); }
.secondary-button:hover { background: #edf1e8; }
.danger-button { min-height: 42px; padding: 0 18px; border: 0; background: var(--rust); color: white; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; display: flex; align-items: center; min-width: 230px; max-width: calc(100% - 32px); min-height: 48px; padding: 12px 18px; border-radius: 5px 14px 5px 14px; background: var(--forest-950); color: white; box-shadow: 0 12px 30px rgba(16,41,31,.25); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.confirm-dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 6px 20px 6px 20px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(16,41,31,.35); }
.confirm-dialog::backdrop { background: rgba(16,41,31,.6); backdrop-filter: blur(3px); }
.confirm-dialog form { padding: 30px; text-align: center; }
.dialog-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 14px; place-items: center; border-radius: 50%; background: #f4dfd8; color: var(--rust); }
.dialog-icon svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.confirm-dialog h2 { margin-bottom: 8px; color: var(--forest-900); font-family: var(--serif); }
.confirm-dialog p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }

footer { display: flex; align-items: center; justify-content: space-between; min-height: 59px; padding: 0 clamp(22px, 5vw, 72px); border-top: 1px solid rgba(67,79,68,.12); color: #7a8179; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.offline-indicator { display: flex; align-items: center; gap: 6px; }
.offline-indicator i { width: 6px; height: 6px; border-radius: 50%; background: #779b67; box-shadow: 0 0 0 3px rgba(119,155,103,.13); }

:focus-visible { outline: 3px solid rgba(198,149,67,.65); outline-offset: 3px; }

@media (max-width: 860px) {
  .site-header { grid-template-columns: 1fr auto; min-height: 78px; padding-top: 12px; }
  .main-nav { position: fixed; right: 16px; bottom: 14px; left: 16px; z-index: 50; padding: 5px; background: rgba(255,253,247,.96); box-shadow: 0 10px 35px rgba(16,41,31,.22); backdrop-filter: blur(16px); }
  .nav-button { flex: 1; justify-content: center; }
  .install-button { grid-column: 2; grid-row: 1; }
  .setup-layout { grid-template-columns: 1fr; min-height: auto; padding: 45px 0 70px; }
  .intro-copy { text-align: center; }
  .intro-copy .eyebrow { justify-content: center; }
  .intro-text { margin-right: auto; margin-left: auto; }
  .season-ornament { margin-right: auto; margin-left: auto; }
  .setup-card { width: min(480px, 100%); margin: -10px auto 0; }
  .scoring-layout, .history-layout { padding-bottom: 100px; }
  .history-card summary { grid-template-columns: 145px 1fr auto 20px; gap: 14px; }
  footer { padding-bottom: 78px; }
}

@media (max-width: 600px) {
  .site-header { padding-right: 18px; padding-left: 18px; }
  .brand-mark { width: 39px; height: 39px; }
  .brand strong { font-size: 18px; }
  .brand small { font-size: 8px; }
  .install-button { font-size: 0; }
  .install-button svg { width: 22px; }
  .setup-layout, .scoring-layout, .history-layout { width: min(100% - 28px, 1210px); }
  .setup-layout { gap: 12px; padding-top: 34px; }
  .intro-copy { padding-top: 0; }
  h1 { font-size: clamp(42px, 14vw, 59px); }
  .intro-text { font-size: 15px; line-height: 1.6; }
  .season-ornament { margin-top: 0; }
  .setup-card { padding: 30px 24px; }
  .page-heading-row { align-items: flex-start; margin-bottom: 24px; }
  .page-heading-row h1 { font-size: 41px; }
  .text-button { font-size: 0; }
  .text-button svg { width: 23px; }
  .scorecards { grid-template-columns: 1fr; }
  .save-bar { position: sticky; bottom: 83px; z-index: 30; padding: 11px; background: rgba(255,253,247,.95); backdrop-filter: blur(12px); }
  .leader-preview { display: none; }
  .save-button { width: 100%; }
  .history-heading-row { display: grid; grid-template-columns: 1fr auto; }
  .history-heading-row > div { grid-column: 1 / -1; }
  .history-heading-row .compact-button { grid-column: 2; grid-row: 1; min-width: 44px; width: 44px; min-height: 44px; padding: 0; font-size: 0; }
  .history-summary { grid-template-columns: 1fr; }
  .history-card summary { grid-template-columns: 1fr auto 18px; min-height: 0; padding: 17px; }
  .history-date { grid-column: 1; }
  .history-players { grid-column: 1 / -1; grid-row: 2; }
  .history-high-score { grid-column: 2; grid-row: 1; }
  .chevron { grid-column: 3; grid-row: 1; }
  .history-details { padding: 0 17px 17px; }
  footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Storybook art direction — v2 */
body {
  background:
    linear-gradient(rgba(22, 38, 29, .92), rgba(22, 38, 29, .92)),
    repeating-linear-gradient(90deg, #263d2e 0 2px, #203528 2px 5px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  opacity: .16;
  background-image:
    radial-gradient(circle at 18% 8%, rgba(255, 232, 168, .5) 0 1px, transparent 2px),
    radial-gradient(circle at 77% 65%, rgba(255, 232, 168, .35) 0 1px, transparent 2px);
  background-size: 38px 38px, 53px 53px;
}

.forest-canopy {
  height: 9px;
  background: linear-gradient(90deg, #7a361f, #d1a23e 20%, #6b2f20 48%, #d1a23e 72%, #244734);
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}

.site-header {
  min-height: 96px;
  color: #f8ebca;
  background:
    linear-gradient(180deg, rgba(27, 19, 13, .78), rgba(41, 28, 18, .92)),
    repeating-linear-gradient(94deg, #47301f 0 11px, #3b281a 11px 14px, #513725 14px 25px);
  border-bottom: 3px solid #a8722d;
  box-shadow: 0 5px 22px rgba(0,0,0,.32), inset 0 -1px #e0ba62;
  backdrop-filter: none;
}

.site-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 7px;
  background: radial-gradient(ellipse at 50% 0, #9c6d2e 0 3px, transparent 4px) 0 0 / 28px 7px repeat-x;
  opacity: .8;
}

.brand-mark {
  width: 52px;
  height: 52px;
  color: #ffe29a;
  background: radial-gradient(circle at 35% 30%, #436c45, #173526 68%);
  border: 2px solid #c69742;
  box-shadow: 0 0 0 3px #2e1f15, 0 7px 16px rgba(0,0,0,.35);
}

.brand strong { color: #fff0c9; font-size: 22px; text-shadow: 0 2px #1d160f; }
.brand small { color: #d7ba78; }

.main-nav {
  padding: 5px;
  border: 1px solid #8a6530;
  background: rgba(25, 18, 12, .52);
  box-shadow: inset 0 0 0 1px rgba(240,203,119,.12);
}

.nav-button { color: #d5c39c; }
.nav-button:hover { color: #fff1ca; }
.nav-button.is-active {
  color: #4a2d1b;
  background:
    linear-gradient(rgba(255,249,225,.92), rgba(232,214,170,.96)),
    #ead8aa;
  box-shadow: inset 0 0 0 1px #fff5d6, 0 3px 12px rgba(0,0,0,.25);
}
.count-badge { background: #9e382c; color: #fff0cb; }
.install-button { color: #efd28b; }

.setup-layout {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: calc(100vh - 96px);
  padding: clamp(58px, 8vh, 100px) clamp(26px, 7vw, 120px) clamp(72px, 9vh, 112px);
  overflow: hidden;
}

.setup-layout::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image: url("assets/woodland-hall.jpg");
  background-size: cover;
  background-position: center;
  transform: scale(1.01);
}

.setup-layout::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(8,25,24,.88) 0%, rgba(12,29,27,.62) 36%, rgba(12,24,19,.16) 65%, rgba(10,18,14,.38) 100%),
    linear-gradient(0deg, rgba(9,23,18,.78), transparent 35%, rgba(11,20,16,.16));
}

.intro-copy {
  max-width: 650px;
  padding: 32px clamp(18px, 3vw, 48px);
  border-left: 2px solid rgba(231,191,102,.75);
  background: linear-gradient(90deg, rgba(12,32,28,.74), rgba(12,32,28,.24), transparent);
  text-shadow: 0 3px 18px rgba(0,0,0,.68);
}

.intro-copy .eyebrow { color: #f1c65f; }
.intro-copy h1 { color: #fff1c9; font-size: clamp(50px, 6vw, 82px); letter-spacing: -.04em; }
.intro-text { max-width: 600px; color: #f2e6c5; font-size: clamp(16px, 1.6vw, 19px); }
.season-ornament { display: none; }
.story-flourish { display: flex; align-items: center; width: min(360px, 80%); gap: 13px; margin-top: 26px; color: #eac870; }
.story-flourish i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.story-flourish i:last-child { background: linear-gradient(90deg, currentColor, transparent); }
.story-flourish span { font-family: var(--serif); font-size: 24px; }

.setup-card {
  padding: clamp(34px, 4.2vw, 52px);
  background:
    linear-gradient(rgba(255,250,225,.92), rgba(234,213,166,.94)),
    repeating-linear-gradient(3deg, rgba(92,57,26,.05) 0 1px, transparent 1px 5px),
    #efe1b9;
  border: 6px solid #4c2f1d;
  border-radius: 18px 6px 22px 7px;
  box-shadow:
    0 0 0 2px #c79745,
    0 0 0 6px rgba(42,25,16,.72),
    0 28px 70px rgba(0,0,0,.52),
    inset 0 0 34px rgba(115,71,28,.16);
  transform: rotate(.35deg);
}

.setup-card::before {
  inset: 10px;
  border: 2px solid rgba(126,76,29,.38);
  border-radius: 12px 3px 16px 4px;
  box-shadow: inset 0 0 0 3px rgba(255,249,221,.3);
}

.setup-card::after {
  content: "❧";
  position: absolute;
  right: 20px;
  bottom: 12px;
  color: rgba(92,58,29,.33);
  font-family: var(--serif);
  font-size: 30px;
}

.card-kicker {
  display: inline-block;
  margin: -18px 0 22px -58px;
  padding: 11px 30px 10px 50px;
  color: #ffe4a2;
  background:
    linear-gradient(rgba(101,56,31,.9), rgba(67,37,23,.94)),
    #56351f;
  border: 2px solid #2d1d14;
  border-radius: 4px 18px 18px 4px;
  box-shadow: inset 0 0 0 1px #a7753e, 0 5px 10px rgba(0,0,0,.25);
  font-size: 10px;
  text-shadow: 0 1px #25170f;
}

.setup-card h2 { color: #3b2a1c; font-size: clamp(31px, 3vw, 42px); }
.setup-card > p { color: #725d42; }
.player-form input {
  height: 52px;
  border: 2px solid #9f8054;
  border-radius: 5px 14px 5px 14px;
  background: rgba(255,251,232,.82);
  box-shadow: inset 0 2px 7px rgba(90,59,29,.1);
}
.add-player-button {
  border: 2px solid #3b2418;
  border-radius: 5px 13px 5px 13px;
  background: linear-gradient(#527451, #294b37);
  box-shadow: inset 0 0 0 1px #78966b, 0 4px 8px rgba(0,0,0,.2);
}
.player-pill {
  height: 36px;
  padding-left: 14px;
  color: #4b311e;
  background: #e7d19c;
  border: 1px solid #a98750;
  border-radius: 4px 13px 4px 13px;
  box-shadow: inset 0 0 8px rgba(98,62,24,.1);
}

.primary-button {
  min-height: 54px;
  color: #fff0c4;
  background:
    linear-gradient(rgba(159,69,47,.96), rgba(111,43,31,.98)),
    #8d432f;
  border: 2px solid #56281d;
  border-radius: 5px 16px 5px 16px;
  box-shadow: inset 0 0 0 1px #cf8667, 0 7px 0 #49251b, 0 12px 20px rgba(65,36,20,.3);
  text-shadow: 0 2px rgba(62,27,19,.7);
  letter-spacing: .02em;
}
.primary-button:hover:not(:disabled) { background: linear-gradient(#b55c3d, #823725); transform: translateY(-2px); }
.primary-button:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 0 0 1px #cf8667, 0 3px 0 #49251b, 0 6px 12px rgba(65,36,20,.3); }
.primary-button:disabled { border-color: #8d795b; background: #a99a7d; color: #e1d7bd; }

.local-note { color: #765e3f !important; }

.scoring-layout,
.history-layout {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 96px);
  padding: 58px clamp(24px, 6vw, 96px) 70px;
  background:
    linear-gradient(rgba(13,35,29,.9), rgba(13,35,29,.96)),
    url("assets/woodland-hall.jpg") center / cover fixed;
}

.scoring-layout::before,
.history-layout::before {
  content: "";
  position: absolute;
  inset: 24px clamp(10px, 3vw, 48px);
  pointer-events: none;
  border: 1px solid rgba(219,174,84,.38);
  border-radius: 4px 30px 4px 30px;
}

.page-heading-row { position: relative; }
.page-heading-row h1 { color: #fff0c5; text-shadow: 0 3px 14px rgba(0,0,0,.5); }
.page-heading-row p:last-child { color: #d8c9a8; }
.page-heading-row .eyebrow { color: #e9bd57; }
.text-button { color: #efce7e; }

.scorecards { position: relative; gap: 24px; }
.scorecard {
  border: 5px solid #4c2e1c;
  border-radius: 17px 5px 21px 6px;
  background:
    linear-gradient(rgba(255,250,228,.94), rgba(230,207,160,.95)),
    #edddb3;
  box-shadow: 0 0 0 2px #b6863c, 0 18px 36px rgba(0,0,0,.34), inset 0 0 22px rgba(97,61,28,.18);
}
.scorecard.is-leader { outline: 4px solid #e5be56; outline-offset: 2px; }
.scorecard-header,
.scorecard.is-leader .scorecard-header {
  min-height: 92px;
  padding: 18px 22px;
  background:
    linear-gradient(90deg, rgba(28,60,43,.95), rgba(57,91,57,.92)),
    repeating-linear-gradient(92deg, #294d37 0 7px, #244330 7px 10px);
  border-bottom: 3px solid #b7863e;
  box-shadow: inset 0 -2px #1d3124, inset 0 2px rgba(255,255,255,.08);
}
.scorecard-header h2 { color: #fff1c7; font-size: 29px; text-shadow: 0 2px #18251c; }
.scorecard-total {
  display: grid;
  width: 68px;
  height: 68px;
  place-content: center;
  text-align: center;
  color: #493112;
  background: radial-gradient(circle at 34% 28%, #ffdf69, #c58d23 67%, #805814 70%);
  border: 3px solid #f3d16f;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #5b3b1b, 0 6px 12px rgba(0,0,0,.35), inset 0 2px 5px rgba(255,255,255,.5);
}
.scorecard-total strong { font-size: 32px; line-height: .9; }
.scorecard-total small { color: #624517; font-size: 8px; }
.score-rows { padding: 12px 18px 18px; }
.score-row { min-height: 64px; border-color: rgba(119,83,42,.22); }
.score-row label { color: #493621; font-family: var(--serif); font-size: 13px; }
.score-row label small { color: #8b7659; font-family: var(--sans); }
.category-icon { width: 34px; height: 34px; color: white; border: 2px solid rgba(63,42,25,.55); box-shadow: inset 0 1px rgba(255,255,255,.35), 0 2px 5px rgba(0,0,0,.18); }
.score-row:nth-child(1) .category-icon { background: #4d6e94; }
.score-row:nth-child(2) .category-icon {
  color: #5a390d;
  background: radial-gradient(circle at 35% 28%, #ffe275, #d29a25 68%, #8c5e14 72%);
  border-color: #765016;
  box-shadow: inset 0 1px 3px rgba(255,255,255,.65), 0 2px 5px rgba(0,0,0,.22);
}
.score-row:nth-child(3) .category-icon { background: #655489; }
.score-row:nth-child(4) .category-icon { background: #7c5144; }
.score-row:nth-child(5) .category-icon { background: #557b49; }
.score-row:nth-child(6) .category-icon { background: #a34f3f; }
.score-input-wrap { height: 42px; background: #fff8df; border: 2px solid #a88957; border-radius: 4px 12px 4px 12px; box-shadow: inset 0 2px 6px rgba(81,53,25,.1); }
.score-input-wrap input { color: #49301c; font-family: var(--serif); font-size: 19px; }

.save-bar {
  position: relative;
  margin-top: 30px;
  color: #4a311e;
  background: linear-gradient(rgba(255,248,218,.96), rgba(229,203,150,.97));
  border: 4px solid #4b2e1c;
  border-radius: 5px 18px 5px 18px;
  box-shadow: 0 0 0 2px #b8863d, 0 12px 26px rgba(0,0,0,.25);
}
.leader-preview { color: #49311e; font-size: 17px; }

.history-summary { position: relative; }
.summary-card,
.history-card {
  color: #4a331f;
  background: linear-gradient(rgba(255,249,225,.95), rgba(232,210,163,.96));
  border: 3px solid #573722;
  box-shadow: 0 0 0 1px #ba8c43, 0 10px 24px rgba(0,0,0,.25), inset 0 0 16px rgba(94,60,28,.12);
}
.summary-card strong,
.history-date strong,
.history-high-score strong { color: #3f2d1d; }
.summary-card span,
.history-date span,
.history-high-score span { color: #7d684b; }
.summary-icon { background: #d9c287; color: #3b6447; border: 1px solid #9b7e48; }
.history-player { background: #d8c798; color: #4a341f; border: 1px solid #aa8c55; }
.history-player.winner { background: #e5bd54; color: #51370f; }
.history-table th,
.history-table td { border-color: rgba(105,74,38,.2); }
.history-table thead th,
.history-table .total-row th,
.history-table .total-row td { color: #43301e; }
.history-table tbody th { color: #78664e; }
.chevron { stroke: #725b3e; }
.empty-state { position: relative; padding: 38px; color: #4a331f; background: rgba(244,227,187,.94); border: 4px solid #50321f; border-radius: 6px 20px 6px 20px; box-shadow: 0 0 0 2px #b98b40, 0 20px 40px rgba(0,0,0,.28); }
.empty-state p { color: #79654a; }

footer {
  color: #cbb887;
  background: linear-gradient(#2b1f16, #1d1711);
  border-top: 3px solid #9d6c2f;
}

@media (max-width: 860px) {
  .site-header { min-height: 80px; }
  .main-nav { border: 2px solid #664324; background: rgba(39,27,18,.96); }
  .nav-button.is-active { background: #ead8aa; }
  .setup-layout { grid-template-columns: 1fr; min-height: auto; padding: 58px 24px 105px; }
  .setup-layout::after { background: linear-gradient(rgba(8,25,22,.42), rgba(8,25,22,.78)); }
  .intro-copy { max-width: 680px; margin: 0 auto; background: rgba(12,32,28,.58); border: 1px solid rgba(231,191,102,.5); border-radius: 4px 22px 4px 22px; }
  .setup-card { margin-top: 18px; transform: none; }
  .card-kicker { margin-left: -42px; }
  .scoring-layout,
  .history-layout { padding-bottom: 120px; }
}

@media (max-width: 600px) {
  .brand-mark { width: 42px; height: 42px; }
  .setup-layout { width: 100%; padding: 36px 14px 105px; }
  .intro-copy { padding: 28px 22px; text-align: left; }
  .intro-copy .eyebrow { justify-content: flex-start; }
  .intro-copy h1 { font-size: 46px; }
  .story-flourish { margin-right: auto; margin-left: auto; }
  .setup-card { width: calc(100% - 8px); padding: 32px 23px; border-width: 4px; }
  .card-kicker { margin-left: -37px; padding-left: 36px; }
  .scoring-layout,
  .history-layout { width: 100%; padding: 42px 15px 110px; }
  .scoring-layout::before,
  .history-layout::before { display: none; }
  .scorecard { border-width: 4px; }
  .save-bar { bottom: 87px; }
}

@media (max-width: 600px) {
  .save-bar {
    position: relative;
    inset: auto;
    z-index: 1;
    margin-top: 26px;
    margin-bottom: 12px;
    backdrop-filter: none;
  }
}
