:root{
  --green:#14372a; --green-2:#1d4a39; --green-3:#2b6b4b; --pine:#0d2a1f;
  --ivory:#faf6ec; --cream:#f1e9d6; --sand:#e4d7b8; --line:#ddd0b0;
  --navy:#13233f; --gold:#c9a24c; --gold-d:#a8852f; --ink:#1b201d; --muted:#5e665f;
  --red:#b3262d; --red-l:#f8e3e1; --blue:#1f4f9c; --blue-l:#e1e9f6;
  --serif:"Fraunces", Georgia, "Times New Roman", serif;
  --sans:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r:14px; --shadow:0 1px 2px rgba(20,30,25,.06), 0 8px 24px rgba(20,40,30,.08);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--ivory);color:var(--ink);font:16px/1.55 var(--sans);-webkit-font-smoothing:antialiased}
img,svg{max-width:100%}
a{color:var(--green-3)}
h1,h2,h3{font-family:var(--serif);font-weight:600;letter-spacing:-.01em;line-height:1.15;margin:0 0 .4em;color:var(--green)}
h1{font-size:clamp(2.1rem,6vw,3.6rem)} h2{font-size:clamp(1.5rem,4vw,2.1rem)} h3{font-size:1.2rem}
p{margin:0 0 1em}
.wrap{max-width:1080px;margin:0 auto;padding:0 18px}
.eyebrow{font:600 .72rem/1 var(--sans);letter-spacing:.18em;text-transform:uppercase;color:var(--gold-d)}
.muted{color:var(--muted)} .small{font-size:.86rem}
.center{text-align:center}
.hidden{display:none!important}

/* header */
.site-header{background:var(--green);color:var(--ivory);position:sticky;top:0;z-index:40;border-bottom:3px solid var(--gold)}
.site-header .wrap{display:flex;align-items:center;gap:14px;height:62px}
.brand{display:flex;align-items:center;gap:10px;color:inherit;text-decoration:none;margin-right:auto}
.brand img{width:34px;height:40px}
.brand b{font:600 1.08rem/1 var(--serif);letter-spacing:.01em}
.brand small{display:block;font:500 .62rem/1.4 var(--sans);letter-spacing:.2em;text-transform:uppercase;color:var(--gold)}
.nav{display:flex;gap:2px}
.nav a{color:#e9e2cf;text-decoration:none;font-weight:500;font-size:.93rem;padding:8px 11px;border-radius:9px}
.nav a:hover{background:rgba(255,255,255,.08)}
.nav a.active{color:#fff;background:rgba(201,162,76,.22)}
.nav a.cta{background:var(--gold);color:var(--pine);font-weight:700}
.menu-btn{display:none;background:none;border:1px solid rgba(255,255,255,.25);color:#fff;border-radius:10px;width:44px;height:40px;font-size:1.2rem}
@media (max-width:820px){
  .menu-btn{display:block}
  .nav{display:none;position:absolute;left:0;right:0;top:65px;background:var(--green);flex-direction:column;padding:8px 14px 16px;border-bottom:3px solid var(--gold)}
  .nav.open{display:flex}
  .nav a{padding:13px 12px;font-size:1.05rem}
}

/* hero */
.hero{position:relative;color:var(--ivory);background:
  radial-gradient(1200px 400px at 70% -10%, rgba(201,162,76,.18), transparent 60%),
  linear-gradient(180deg,#173f30 0%, #14372a 55%, #0f2c21 100%);overflow:hidden}
.hero .wrap{position:relative;z-index:2;padding:56px 18px 120px;text-align:center}
.hero h1{color:var(--ivory);margin:.35em 0 .2em}
.hero .crest{width:96px;height:112px;filter:drop-shadow(0 6px 18px rgba(0,0,0,.35))}
.hero .meta{font-size:1.05rem;color:#e7dfc9}
.hero .meta span{white-space:nowrap}
.hero .dot{color:var(--gold);margin:0 .5em}
@media (max-width:560px){.hero .meta span{display:block}.hero .meta .dot{display:none}}
.pines{position:absolute;left:0;right:0;bottom:-1px;height:120px;z-index:1}
.tagline{font-family:var(--serif);font-style:italic;color:var(--gold);font-size:1.15rem}

.countdown{display:inline-flex;gap:10px;margin-top:22px}
.countdown div{background:rgba(250,246,236,.08);border:1px solid rgba(201,162,76,.35);border-radius:12px;padding:10px 12px;min-width:68px}
.countdown b{display:block;font:600 1.7rem/1 var(--serif);color:#fff}
.countdown small{font-size:.66rem;letter-spacing:.16em;text-transform:uppercase;color:#d7cdb2}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:12px;padding:12px 18px;font:600 1rem/1 var(--sans);cursor:pointer;text-decoration:none;min-height:46px}
.btn-gold{background:var(--gold);color:var(--pine)} .btn-gold:hover{background:#d5b061}
.btn-green{background:var(--green);color:#fff} .btn-green:hover{background:var(--green-2)}
.btn-ghost{background:transparent;color:inherit;border:1.5px solid currentColor}
.btn-light{background:#fff;color:var(--green);border:1px solid var(--line)}
.btn-danger{background:#fff;color:var(--red);border:1.5px solid var(--red)}
.btn-sm{min-height:36px;padding:8px 12px;font-size:.88rem;border-radius:10px}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:22px}

/* sections */
section{padding:52px 0}
.section-head{text-align:center;max-width:640px;margin:0 auto 28px}
.card{background:#fff;border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:20px}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
.g3{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.g4{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.stat{text-align:center;padding:18px 10px}
.stat b{display:block;font:600 2.1rem/1 var(--serif);color:var(--green)}
.stat small{color:var(--muted);font-size:.8rem;letter-spacing:.08em;text-transform:uppercase}
.band{background:var(--cream);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.page-head{background:var(--green);color:var(--ivory);padding:38px 0 30px;border-bottom:1px solid var(--pine)}
.page-head h1{color:var(--ivory);font-size:clamp(1.8rem,5vw,2.8rem);margin:.2em 0 .1em}
.page-head p{color:#ddd4bd;margin:0}

/* cup score */
.cup{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;max-width:640px;margin:0 auto}
.cup .side{border-radius:16px;padding:16px 10px;text-align:center;color:#fff}
.cup .side.red{background:linear-gradient(160deg,#c3333a,#8f1c22)}
.cup .side.blue{background:linear-gradient(160deg,#2a62b8,#173d7a)}
.cup .side small{display:block;font-size:.7rem;letter-spacing:.2em;text-transform:uppercase;opacity:.85}
.cup .side b{display:block;font:600 clamp(2.6rem,10vw,4rem)/1 var(--serif);margin-top:6px}
.cup .side em{display:block;font-style:normal;font-size:.8rem;opacity:.85;margin-top:4px}
.cup .vs{font:600 .85rem var(--sans);color:var(--muted);text-align:center}
.cup .vs b{display:block;font:600 1.2rem var(--serif);color:var(--gold-d)}
.progress{position:relative;height:12px;border-radius:99px;background:#e9e1cb;overflow:hidden;max-width:640px;margin:16px auto 6px;display:flex}
.progress .r{background:var(--red)} .progress .b{background:var(--blue);margin-left:auto}
.progress .mid{position:absolute;left:50%;top:-3px;bottom:-3px;width:2px;background:var(--pine)}
.dark .cup .vs, .hero .cup .vs{color:#d7cdb2}

/* schedule */
.day{display:grid;grid-template-columns:92px 1fr;gap:16px;padding:18px 0;border-bottom:1px solid var(--line)}
.day:last-child{border-bottom:0}
.day .date{text-align:center;background:var(--green);color:var(--ivory);border-radius:12px;padding:10px 6px;align-self:start}
.day .date b{display:block;font:600 1.9rem/1 var(--serif)}
.day .date small{font-size:.68rem;letter-spacing:.16em;text-transform:uppercase;color:var(--gold)}
.round{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;flex-wrap:wrap;padding:6px 0}
.round h3{margin:0}
.pill{display:inline-flex;align-items:center;gap:6px;font:600 .72rem/1 var(--sans);letter-spacing:.06em;text-transform:uppercase;border-radius:99px;padding:6px 10px;background:var(--cream);color:var(--green);border:1px solid var(--line)}
.pill.live{background:#fff4d6;color:#7a5a07;border-color:#ecd28a}
.pill.live::before{content:"";width:7px;height:7px;border-radius:50%;background:#d39b08;animation:pulse 1.4s infinite}
.pill.final{background:var(--green);color:#fff;border-color:var(--green)}
.pill.red{background:var(--red-l);color:var(--red);border-color:#efc3bf}
.pill.blue{background:var(--blue-l);color:var(--blue);border-color:#c2d2ec}
@keyframes pulse{50%{opacity:.25}}

/* teams */
.team{border-radius:var(--r);overflow:hidden;border:1px solid var(--line);background:#fff;box-shadow:var(--shadow)}
.team header{padding:18px 20px;color:#fff}
.team.red header{background:linear-gradient(135deg,#c3333a,#8f1c22)}
.team.blue header{background:linear-gradient(135deg,#2a62b8,#173d7a)}
.team header h2{color:#fff;margin:0}
.team ul{list-style:none;margin:0;padding:6px 0}
.team li{display:flex;align-items:center;gap:12px;padding:11px 20px;border-bottom:1px solid #f0e9d8}
.team li:last-child{border:0}
.avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;font:700 .85rem var(--sans);background:var(--cream);color:var(--green);flex:none;overflow:hidden}
.avatar.has-photo{padding:0;background:#d9d0bc}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.team.red .avatar{background:var(--red-l);color:var(--red)} .team.blue .avatar{background:var(--blue-l);color:var(--blue)}
.pill .avatar{width:22px;height:22px;font-size:.62rem;margin-left:-4px}
.admin-face{width:38px;height:38px;border-radius:50%;overflow:hidden;flex:none;align-self:end;background:var(--cream)}
.admin-face img,.admin-face .avatar{width:100%;height:100%;object-fit:cover;display:block}
.tbd{color:var(--muted);font-style:italic}

/* matches */
.session{margin-bottom:28px}
.session-head{display:flex;justify-content:space-between;align-items:flex-end;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.session-head h3{margin:0}
.tabs{display:flex;gap:6px;overflow-x:auto;padding-bottom:6px;margin-bottom:16px;scrollbar-width:none}
.tabs button{flex:none;border:1px solid var(--line);background:#fff;border-radius:99px;padding:10px 14px;font:600 .88rem var(--sans);color:var(--green);cursor:pointer;min-height:42px}
.tabs button.on{background:var(--green);color:#fff;border-color:var(--green)}
.match{display:block;text-decoration:none;color:inherit;background:#fff;border:1px solid var(--line);border-radius:var(--r);margin-bottom:10px;overflow:hidden;box-shadow:var(--shadow)}
.match .row{display:grid;grid-template-columns:1fr auto 1fr;align-items:stretch}
.match .nm{padding:12px 14px;font-weight:600;line-height:1.3;font-size:.95rem}
.match .nm.red{border-left:5px solid var(--red)} .match .nm.blue{border-right:5px solid var(--blue);text-align:right}
.match .nm.lead.red{background:var(--red-l)} .match .nm.lead.blue{background:var(--blue-l)}
.match .mid{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:6px 10px;min-width:104px;text-align:center;background:#fbf8f0;border-left:1px solid #f0e9d8;border-right:1px solid #f0e9d8}
.match .mid b{font:600 1rem var(--serif);color:var(--green)}
.match .mid small{font-size:.72rem;color:var(--muted)}
.match .segs{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid #f0e9d8;font-size:.78rem}
.match .segs div{padding:7px 8px;text-align:center;border-right:1px solid #f0e9d8}
.match .segs div:last-child{border:0}
.match .segs span{display:block;font-size:.64rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.seg-red{color:var(--red);font-weight:700}.seg-blue{color:var(--blue);font-weight:700}.seg-as{color:var(--green);font-weight:600}
.seg-done.seg-red{background:var(--red-l)} .seg-done.seg-blue{background:var(--blue-l)} .seg-done.seg-as{background:var(--cream)}

/* scorecard table */
.sc-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:#fff}
table.sc{border-collapse:collapse;width:100%;font-size:.84rem;min-width:720px}
.sc th,.sc td{padding:7px 4px;text-align:center;border-bottom:1px solid #f0e9d8;min-width:30px}
.sc th:first-child,.sc td:first-child{text-align:left;padding-left:10px;min-width:120px;position:sticky;left:0;background:#fff;z-index:1}
.sc thead th{background:var(--green);color:#fff;font-weight:600}
.sc thead th:first-child{background:var(--green)}
.sc tr.par td{background:var(--cream);color:var(--muted)}
.sc tr.par td:first-child{background:var(--cream)}
.sc td.tot{font-weight:700;background:#fbf8f0}
.sc tr.redrow td:first-child{border-left:4px solid var(--red)} .sc tr.bluerow td:first-child{border-left:4px solid var(--blue)}
.sc tr.best td{font-weight:700}
.sc td.w-red{background:var(--red);color:#fff;font-weight:700} .sc td.w-blue{background:var(--blue);color:#fff;font-weight:700} .sc td.w-half{background:var(--sand)}
.sc td.counts{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}
.sc .stroke{font-size:.6rem;vertical-align:super;color:var(--gold-d)}

/* scoring entry */
.score-shell{max-width:560px;margin:0 auto;padding:18px}
.holebar{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--green);color:#fff;border-radius:16px;padding:10px;margin-bottom:12px;position:sticky;top:70px;z-index:5;box-shadow:var(--shadow)}
.holebar button{width:56px;height:56px;border-radius:12px;border:0;background:rgba(255,255,255,.12);color:#fff;font-size:1.6rem;cursor:pointer}
.holebar .h{text-align:center}
.holebar .h b{display:block;font:600 2rem/1 var(--serif)}
.holebar .h small{font-size:.75rem;color:#d7cdb2;letter-spacing:.08em}
.holedots{display:grid;grid-template-columns:repeat(9,1fr);gap:5px;margin:0 0 14px}
.holedots button{height:34px;border-radius:8px;border:1px solid var(--line);background:#fff;font:600 .8rem var(--sans);color:var(--muted);cursor:pointer;padding:0}
.holedots button.done{background:var(--cream);color:var(--green)}
.holedots button.w-red{background:var(--red);color:#fff;border-color:var(--red)}
.holedots button.w-blue{background:var(--blue);color:#fff;border-color:var(--blue)}
.holedots button.w-half{background:var(--sand);color:var(--ink)}
.holedots button.cur{outline:3px solid var(--gold);outline-offset:1px}
.pcard{background:#fff;border:1px solid var(--line);border-radius:16px;padding:12px;margin-bottom:10px;box-shadow:var(--shadow)}
.pcard.red{border-left:6px solid var(--red)} .pcard.blue{border-left:6px solid var(--blue)}
.pcard .top{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;gap:8px}
.pcard .top b{font-size:1.02rem}
.pcard .top small{color:var(--muted);font-size:.75rem}
.stepper{display:grid;grid-template-columns:64px 1fr 64px;gap:8px;align-items:center}
.stepper button{height:64px;border-radius:14px;border:0;font-size:2rem;font-weight:600;cursor:pointer;background:var(--cream);color:var(--green)}
.stepper button:active{transform:scale(.97)}
.stepper .val{text-align:center;font:600 2.6rem/64px var(--serif);height:64px;border-radius:14px;background:#fbf8f0;border:2px dashed var(--line)}
.stepper .val.set{border-style:solid;border-color:var(--green-3);background:#fff}
.stepper .val.pu{font-size:1.2rem;color:var(--muted)}
.quick{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-top:8px}
.quick button{height:44px;border-radius:10px;border:1px solid var(--line);background:#fff;font:600 .95rem var(--sans);color:var(--green);cursor:pointer}
.quick button.sel{background:var(--green);color:#fff;border-color:var(--green)}
.readonly .stepper button,.readonly .quick{display:none}
.readonly .stepper{grid-template-columns:1fr}
.status-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:12px 0}
.status-strip div{background:#fff;border:1px solid var(--line);border-radius:12px;padding:8px;text-align:center;font-size:.82rem}
.status-strip span{display:block;font-size:.62rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.savebar{font-size:.82rem;color:var(--muted);text-align:center;min-height:1.3em;margin:6px 0}

/* forms */
label{display:block;font-weight:600;font-size:.88rem;margin:0 0 6px;color:var(--green)}
input,select,textarea{width:100%;font:16px var(--sans);padding:12px;border:1.5px solid var(--line);border-radius:11px;background:#fff;color:var(--ink);min-height:46px}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--green-3);box-shadow:0 0 0 3px rgba(43,107,75,.15)}
.field{margin-bottom:14px}
.pin-input{font:600 1.8rem/1 var(--serif);letter-spacing:.4em;text-align:center}
.notice{border-radius:12px;padding:12px 14px;background:#fff4d6;border:1px solid #ecd28a;color:#6b4f05;font-size:.92rem;margin-bottom:14px}
.notice.err{background:#fbe5e3;border-color:#efbcb7;color:#8c1c22}
.notice.ok{background:#e4f1e9;border-color:#b9dcc6;color:#1d4a39}

/* admin */
.admin-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px}
.admin-row{display:grid;grid-template-columns:38px 1.5fr 1fr .8fr .6fr .8fr auto;gap:8px;align-items:end;padding:10px 0;border-bottom:1px solid #f0e9d8}
.admin-row:last-child{border:0}
.admin-row input,.admin-row select{min-height:42px;padding:9px}
.mini{font-size:.72rem;color:var(--muted);font-weight:500}
.pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px 0;border-bottom:1px solid #f0e9d8}
.pair .side-red label{color:var(--red)} .pair .side-blue label{color:var(--blue)}
.pair select{margin-bottom:6px}
.inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.inline input[type=number]{width:84px}
.chk{display:flex;align-items:center;gap:8px;font-weight:500}
.chk input{width:22px;height:22px;min-height:0}
@media (max-width:600px){ .admin-row{grid-template-columns:1fr 1fr} .pair{grid-template-columns:1fr} }

/* modal */
.modal{position:fixed;inset:0;background:rgba(10,20,15,.55);display:grid;place-items:center;z-index:100;padding:18px}
.modal .card{max-width:420px;width:100%}

/* rules */
.rules h3{margin-top:1.2em}
.rules li{margin-bottom:.45em}
.points-table{width:100%;border-collapse:collapse;font-size:.95rem}
.points-table td,.points-table th{padding:10px;border-bottom:1px solid var(--line);text-align:left}
.points-table th{color:var(--green);font-family:var(--serif)}

footer.site{background:var(--pine);color:#b9b29e;padding:34px 0;font-size:.86rem;margin-top:40px}
footer.site .wrap{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap}
footer.site a{color:#e2d9c0}
.toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);background:var(--pine);color:#fff;padding:12px 18px;border-radius:12px;z-index:120;box-shadow:var(--shadow);font-weight:600}
.live-dot{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;color:var(--muted)}
.live-dot::before{content:"";width:8px;height:8px;border-radius:50%;background:#3aa06b;box-shadow:0 0 0 3px rgba(58,160,107,.2)}
.live-dot.stale::before{background:#c8902c}
