:root{
  --turf-dark:#132C24;
  --turf:#1F4A38;
  --turf-light:#3D6B52;
  --linen:#F2EEE1;
  --linen-dim:#E8E1CE;
  --sand:#C9B48C;
  --flag:#A6402F;
  --ink:#1A231E;
  --gold:#C6A15B;
  --gold-light:#E4CD93;
  --slate:#5C6B63;
  --white:#FDFCF7;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;background:var(--linen);color:var(--ink);font-family:'Inter',sans-serif;}
body{padding:0 0 60px 0;}
h1,h2,h3,h4{font-family:'Fraunces',serif;margin:0;letter-spacing:-0.01em;}
.mono{font-family:'IBM Plex Mono',monospace;}
a{color:inherit;}

/* ---------- Header ---------- */
.hero{
  background:
    radial-gradient(ellipse at 20% -20%, rgba(198,161,91,0.25), transparent 55%),
    linear-gradient(180deg, var(--turf-dark), var(--turf) 120%);
  color:var(--white);
  padding:36px 20px 26px;
  position:relative;
  overflow:hidden;
}
.hero::after{
  content:"";
  position:absolute; inset:0;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 46px);
  pointer-events:none;
}
.hero-inner{max-width:1080px;margin:0 auto;position:relative;}
.eyebrow{
  font-family:'IBM Plex Mono',monospace;
  font-size:11px; letter-spacing:0.18em; text-transform:uppercase;
  color:var(--gold-light); margin-bottom:10px; display:flex; align-items:center; gap:10px;
}
.eyebrow .line{height:1px;flex:1;background:linear-gradient(90deg, var(--gold-light), transparent);}
.hero h1{font-size:clamp(28px,5vw,50px); font-weight:700; color:var(--white); text-shadow:0 2px 14px rgba(0,0,0,0.25);}
.hero-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;}
.hero-link{
  font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--gold-light);
  border:1px solid rgba(255,255,255,0.3); padding:7px 12px; border-radius:20px;
  text-decoration:none; white-space:nowrap;
}
.hero-link:hover{background:rgba(255,255,255,0.08);}
.crest-strip{display:flex; gap:10px; margin-top:26px; flex-wrap:wrap;}
.crest-chip{
  background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.14);
  border-radius:10px; padding:8px 12px 8px 8px; display:flex; align-items:center; gap:8px; min-width:0;
}
.crest-chip img{width:28px;height:28px;object-fit:contain;border-radius:5px;background:rgba(255,255,255,0.85);padding:2px;}
.crest-chip .cname{font-size:11px;color:var(--linen-dim);white-space:nowrap;}
.crest-chip .cdate{font-family:'IBM Plex Mono',monospace;font-size:10px;color:var(--gold-light);}

.page{max-width:1080px;margin:0 auto;padding:0 20px 40px;}

/* ---------- Honours board (leaderboard) ---------- */
.board{
  background:var(--white); border-radius:0 12px 12px 12px;
  box-shadow:0 10px 30px rgba(19,44,36,0.10); padding:6px; margin-top:24px;
}
.board-head{padding:20px 22px 8px; display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:8px;}
.board-head h2{font-size:22px;color:var(--turf-dark);}
.board-head .asof{font-size:12px;color:var(--slate);font-family:'IBM Plex Mono',monospace;}
table.standings{width:100%; border-collapse:collapse;}
table.standings th{
  text-align:left; font-size:10px; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--slate); font-weight:600; padding:8px 10px; border-bottom:1px solid var(--linen-dim);
}
table.standings td{padding:10px 10px; border-bottom:1px solid var(--linen-dim); font-size:14px; vertical-align:middle;}
table.standings tr:last-child td{border-bottom:none;}
.rank{font-family:'IBM Plex Mono',monospace; font-weight:700; font-size:15px; color:var(--slate); width:22px; display:inline-block;}
tr.lead td.playercell .pname{color:var(--turf-dark);}
.playercell{display:flex;align-items:center;gap:10px;}
.avatar{width:38px;height:38px;border-radius:50%;object-fit:cover;border:2px solid var(--linen-dim);flex-shrink:0;}
tr.lead .avatar{border-color:var(--gold);}
.medal{width:20px;text-align:center;}
.pname{font-weight:600; font-size:15px;}
.pts{font-family:'IBM Plex Mono',monospace; font-weight:700; font-size:19px; color:var(--turf-dark); text-shadow:0 1px 0 rgba(255,255,255,0.6);}
tr.lead .pts{color:var(--turf);}
.ptslabel{font-size:10px;color:var(--slate);text-transform:uppercase;letter-spacing:0.06em;margin-left:4px;}
.roundpips{display:flex;gap:4px;}
.pip{width:22px;height:22px;border-radius:5px;display:flex;align-items:center;justify-content:center;font-family:'IBM Plex Mono',monospace; font-size:10px; font-weight:600; background:var(--linen); color:var(--slate);}
.pip.wide{width:30px;font-size:9.5px;}
.pip.entered{background:var(--turf); color:var(--white);}
.pip.empty{background:transparent; color:#CFC9B4; border:1px dashed #CFC9B4;}
.board + .board{margin-top:16px;}

/* ---------- Round cards ---------- */
.rounds-grid{margin-top:14px; display:flex; flex-direction:column; gap:14px;}
.round-card{
  background:var(--white); border-radius:12px; padding:16px 18px;
  box-shadow:0 6px 18px rgba(19,44,36,0.07); display:grid; grid-template-columns:56px 1fr auto; gap:14px; align-items:start;
}
.round-card img.rlogo{width:56px;height:56px;object-fit:contain;}
.round-card .rmeta{display:flex; flex-direction:column; gap:2px;}
.round-card h3{font-size:17px;color:var(--turf-dark);}
.round-card .rwhen{font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--slate);}
.round-status{font-family:'IBM Plex Mono',monospace; font-size:10px; text-transform:uppercase; letter-spacing:0.06em; padding:4px 9px; border-radius:20px; white-space:nowrap; height:fit-content;}
.round-status.final{background:#E4F0E9;color:var(--turf);}
.round-status.live{background:#FBECE2;color:var(--flag);}
.round-status.pending{background:var(--linen);color:var(--slate);}
.round-status.locked{background:#F0E3E0;color:var(--flag);}
.teams-row{grid-column:1 / -1; display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:6px;}
.foursome{background:var(--linen); border-radius:9px; padding:10px 12px;}
.team-line{display:flex; justify-content:space-between; align-items:center; padding:4px 0; font-size:13px;}
.team-line .tp{font-family:'IBM Plex Mono',monospace; font-weight:700; color:var(--turf-dark); font-size:14px;}
.team-line .tinfo{display:flex;flex-direction:column;}
.team-line .tname{font-weight:700; color:var(--turf); font-size:12.5px; text-transform:uppercase; letter-spacing:0.03em;}
.team-line .tplayers{color:var(--ink); font-size:11.5px;}
.vs{text-align:center;font-size:10px;color:var(--slate);letter-spacing:.1em;margin:2px 0;font-family:'IBM Plex Mono',monospace;}

/* ---------- Login ---------- */
.lockbox{
  background:var(--white); border-radius:12px; padding:40px 30px; text-align:center;
  max-width:380px; margin:60px auto; box-shadow:0 10px 30px rgba(19,44,36,0.1);
}
.lockbox h2{color:var(--turf-dark); font-size:22px; margin-bottom:6px;}
.lockbox p{color:var(--slate); font-size:13px; margin:0 0 18px;}
.lockbox input{
  width:100%; padding:11px 12px; border-radius:8px; border:1px solid #D8D2BE;
  font-size:15px; font-family:'IBM Plex Mono',monospace; margin-bottom:12px; background:var(--linen);
}
.btn{background:var(--turf); color:var(--white); border:none; padding:11px 18px; border-radius:8px; font-family:'Inter',sans-serif; font-weight:600; font-size:14px; cursor:pointer; width:100%;}
.btn:hover{background:var(--turf-dark);}
.btn.secondary{background:transparent; color:var(--turf); border:1px solid var(--turf); width:auto;}
.btn.small{padding:7px 12px; font-size:12px; width:auto;}
.btn:disabled{opacity:0.5;cursor:not-allowed;}
.errtext{color:var(--flag); font-size:12px; margin-top:-4px; margin-bottom:10px;}
.okmsg{font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--turf);}

/* ---------- Scorekeeper ---------- */
.sk-top{display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; margin:20px 0 16px;}
.sk-who{display:flex;align-items:center;gap:10px;}
.sk-who .avatar{width:36px;height:36px;}
.sk-who .name{font-weight:700;color:var(--turf-dark);font-size:15px;}
.sk-who .role{font-family:'IBM Plex Mono',monospace;font-size:10px;color:var(--slate);text-transform:uppercase;}

.round-selector{display:flex; gap:6px; flex-wrap:wrap;}
.rs-btn{font-family:'IBM Plex Mono',monospace; font-size:12px; padding:8px 12px; border-radius:7px; border:1px solid #D8D2BE; background:var(--white); color:var(--ink); cursor:pointer;}
.rs-btn.active{background:var(--turf); color:var(--white); border-color:var(--turf);}
.rs-btn .dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--gold);margin-left:6px;}
.rs-btn.rslocked{opacity:0.55;}

.entry-card{background:var(--white); border-radius:12px; padding:18px 20px; margin-bottom:18px; box-shadow:0 6px 18px rgba(19,44,36,0.07);}
.entry-card h3{font-size:16px; color:var(--turf-dark); margin-bottom:2px;}
.entry-card .sub{font-size:12px;color:var(--slate);margin-bottom:12px;font-family:'IBM Plex Mono',monospace;}
.lock-row{display:flex; align-items:center; gap:10px; margin-bottom:14px; background:var(--linen); padding:10px 12px; border-radius:8px;}
.lock-row .lbl{font-size:13px; font-weight:600;}
.toggle{position:relative; width:42px; height:24px; flex-shrink:0;}
.toggle input{opacity:0; width:0; height:0;}
.toggle .slider{position:absolute; cursor:pointer; inset:0; background:#D8D2BE; border-radius:24px; transition:.15s;}
.toggle .slider::before{content:""; position:absolute; width:18px; height:18px; left:3px; top:3px; background:white; border-radius:50%; transition:.15s;}
.toggle input:checked + .slider{background:var(--turf);}
.toggle input:checked + .slider::before{transform:translateX(18px);}
.locked-note{background:#F0E3E0;color:#7A3222;font-size:13px;padding:14px;border-radius:8px;font-family:'Inter',sans-serif;}

table.scoregrid{border-collapse:collapse; width:100%; font-size:12px;}
table.scoregrid th{font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:10px; color:var(--slate); padding:4px 3px; text-align:center; border-bottom:1px solid var(--linen-dim);}
table.scoregrid td{padding:3px 2px; text-align:center; border-bottom:1px solid #F2EFE4;}
table.scoregrid td.rowlabel{text-align:left; font-weight:600; font-size:12.5px; color:var(--ink); white-space:nowrap; padding-right:8px;}
table.scoregrid input{width:32px; text-align:center; padding:5px 2px; border-radius:5px; border:1px solid #DBD6C4; font-family:'IBM Plex Mono',monospace; font-size:12.5px; background:var(--linen);}
table.scoregrid input:focus{outline:2px solid var(--turf); background:var(--white);}
table.scoregrid input:disabled{background:#EEEAE0; color:#B7B0A0;}

/* PGA-tour-style score shapes, applied to gross score inputs while entering */
table.scoregrid input.score-circle{border-radius:50%; border:2px solid var(--turf); background:var(--white);}
table.scoregrid input.score-dcircle{border-radius:50%; border:3px double var(--turf); background:var(--white);}
table.scoregrid input.score-square{border-radius:3px; border:2px solid var(--flag); background:var(--white);}
table.scoregrid input.score-dsquare{border-radius:3px; border:3px double var(--flag); background:var(--white);}
.ptsrow td{color:var(--turf); font-family:'IBM Plex Mono',monospace; font-size:11px; font-weight:700;}
.teamtotal-row td{font-weight:700; color:var(--turf-dark);}
.strokecell{background:#EEF3EC !important;}
.team-block{margin-bottom:14px;}
.team-block-title{font-size:12px; font-weight:700; color:var(--turf); margin-bottom:6px; display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.team-block-title .badge{background:var(--turf); color:var(--white); font-family:'IBM Plex Mono',monospace; font-size:10px; padding:2px 8px; border-radius:20px;}
.save-row{display:flex; justify-content:flex-end; gap:10px; margin-top:6px; align-items:center;}
.savemsg{font-size:12px;color:var(--turf); align-self:center; font-family:'IBM Plex Mono',monospace;}

/* ---------- Table scroll wrappers (mobile) ---------- */
.table-scroll{overflow-x:auto; -webkit-overflow-scrolling:touch; margin:0 -2px; padding:0 2px;}
.table-scroll::-webkit-scrollbar{height:6px;}
.table-scroll::-webkit-scrollbar-thumb{background:var(--sand); border-radius:4px;}
.table-scroll table{min-width:max-content;}
table.standings td.playercell, table.standings th.stickyhdr{position:sticky; left:0; background:var(--white); z-index:2;}
table.scoregrid td.rowlabel, table.scoregrid th.stickyhdr{position:sticky; left:0; background:var(--white); z-index:2;}
.scrollhint{display:none; font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--slate); margin-bottom:4px; letter-spacing:0.04em;}

footer.note{max-width:1080px;margin:24px auto 0;padding:0 20px;color:var(--slate);font-size:11px;text-align:center;}
.loading{padding:80px 20px;text-align:center;color:var(--slate);font-family:'IBM Plex Mono',monospace;}

@media (max-width: 640px){
  .hero{padding:26px 16px 22px;}
  .page{padding:0 16px 32px;}
  .crest-chip{padding:6px 10px 6px 6px;}
  .crest-chip .cname{max-width:120px;overflow:hidden;text-overflow:ellipsis;}
  .board-head{padding:16px 14px 6px;}
  table.standings th, table.standings td{padding:9px 8px;}
  .entry-card{padding:14px 14px;}
  .lockbox{max-width:calc(100% - 24px); margin:40px auto; padding:30px 20px;}
  .scrollhint{display:block;}
  .teams-row{grid-template-columns:1fr;}
  .round-card{grid-template-columns:44px 1fr;}
  .round-status{grid-column:2;justify-self:start;}
  .avatar{width:32px;height:32px;}
}
