/* styles.css — deep-green / brass / cream heritage club look.
   Web-safe font stacks only, so nothing depends on the clubhouse network. */

:root {
  --bg: #0a231a;
  --bg2: #0d2c21;
  --panel: #11362a;
  --panel2: #16412f;
  --line: rgba(212, 175, 106, 0.22);
  --line-soft: rgba(244, 237, 221, 0.10);
  --text: #f4eddd;
  --muted: #9bb3a4;
  --brass: #d8b56a;
  --brass-dim: #b6912f;
  --green-accent: #2f7d52;
  --bad: #c8553d;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(47, 125, 82, 0.18), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(216, 181, 106, 0.08), transparent 55%),
    linear-gradient(160deg, var(--bg), var(--bg2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---- shell ---- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 34px) 60px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 6px 2px 18px; border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand .crest {
  font-family: var(--serif); font-size: 26px; color: var(--brass);
  letter-spacing: 0.04em;
}
.brand .sub { color: var(--muted); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.linkbtns { display: flex; gap: 8px; }
.linkbtns a {
  text-decoration: none; color: var(--muted); border: 1px solid var(--line-soft);
  padding: 7px 13px; border-radius: 999px; font-size: 13px; transition: .15s;
}
.linkbtns a:hover { color: var(--text); border-color: var(--line); }
.linkbtns a.active { color: var(--bg); background: var(--brass); border-color: var(--brass); font-weight: 600; }

/* ---- mode picker ---- */
.picker { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 22px; }
.tile {
  display: block; text-decoration: none; color: var(--text);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px;
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--brass-dim); }
.tile h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 24px; color: var(--brass); }
.tile p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tile .big { font-size: 30px; display: block; margin-bottom: 12px; }

/* ---- generic panels / forms ---- */
.panel {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 20px;
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.panel h2 { margin: 0 0 14px; font-family: var(--serif); font-size: 20px; color: var(--brass); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.field input, .field select {
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line-soft); color: var(--text);
  border-radius: 9px; padding: 10px 11px; font-size: 16px; min-width: 0;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brass-dim); }
.field.sm input { width: 78px; }
.field.grow { flex: 1; min-width: 160px; }

.btn {
  background: var(--brass); color: #1a1205; border: none; border-radius: 10px;
  padding: 11px 18px; font-size: 15px; font-weight: 600; letter-spacing: .01em;
}
.btn:hover { background: #e4c47e; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brass-dim); color: var(--brass); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(200,85,61,.4); }
.btn.sm { padding: 7px 12px; font-size: 13px; }

.tablewrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
table.grid th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
table.grid input { width: 70px; background: rgba(0,0,0,.25); border: 1px solid var(--line-soft); color: var(--text); border-radius: 7px; padding: 7px; font-size: 15px; }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.hint { color: var(--brass); font-size: 13px; }
.savechip { font-size: 12px; color: var(--muted); }
.savechip.on { color: var(--green-accent); }

/* ---- PIN gate ---- */
.gate { max-width: 360px; margin: 60px auto; text-align: center; }
.gate .panel { padding: 28px; }
.gate input { font-size: 26px; text-align: center; letter-spacing: 0.5em; width: 100%; padding: 12px; }
.gate .err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---- entry: hole cards ---- */
.playerpick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip {
  border: 1px solid var(--line); background: rgba(0,0,0,.2); color: var(--text);
  border-radius: 999px; padding: 9px 15px; font-size: 15px;
}
.chip.active { background: var(--brass); color: #1a1205; border-color: var(--brass); font-weight: 600; }
.chip .pc { color: var(--muted); font-size: 12px; margin-left: 6px; }
.chip.active .pc { color: #4a3a14; }

.holecard {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; margin-bottom: 9px;
  background: rgba(0,0,0,.16);
}
.holecard .holeno { font-family: var(--serif); font-size: 26px; color: var(--brass); text-align: center; }
.holecard .meta { color: var(--muted); font-size: 12px; }
.holecard .meta b { color: var(--text); font-weight: 600; }
.dots { letter-spacing: 2px; color: var(--brass); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--text); font-size: 22px; line-height: 1; }
.stepper .gross { width: 56px; text-align: center; font-size: 22px; padding: 7px; }
.holecard .pts { min-width: 64px; text-align: right; }
.holecard .pts .n { font-size: 26px; font-weight: 700; }
.holecard .pts .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.runtotal { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.runtotal .n { font-family: var(--serif); font-size: 34px; color: var(--brass); }

/* ---- leaderboard (big screen) ---- */
.board { max-width: 1300px; margin: 0 auto; padding: 18px clamp(14px, 2.5vw, 40px); }
.board .head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--brass-dim); margin-bottom: 10px; }
.board .head h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 52px); margin: 0; color: var(--brass); letter-spacing: .02em; }
.board .head .est { color: var(--muted); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: clamp(12px, 1.3vw, 15px); }
.live .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green-accent); box-shadow: 0 0 0 0 rgba(47,125,82,.7); animation: pulse 2s infinite; }
.live.stale .dot { background: var(--bad); animation: none; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(47,125,82,.6)} 70%{box-shadow:0 0 0 9px rgba(47,125,82,0)} 100%{box-shadow:0 0 0 0 rgba(47,125,82,0)} }

.lbhead, .lbrow { display: grid; grid-template-columns: 78px 1fr 110px 96px 110px 150px; align-items: center; gap: 10px; }
.lbhead { color: var(--muted); font-size: clamp(11px, 1.1vw, 14px); text-transform: uppercase; letter-spacing: .1em; padding: 10px 16px; }
.lbrow {
  padding: clamp(10px, 1.4vw, 18px) 16px; margin: 8px 0; border-radius: 12px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line-soft);
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lbrow.leader { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass-dim) inset, var(--shadow); }
.lbrow .pos { font-family: var(--serif); font-size: clamp(24px, 3vw, 40px); color: var(--brass); }
.lbrow .nm { font-size: clamp(20px, 2.6vw, 38px); font-weight: 600; }
.lbrow .nm .cb { color: var(--muted); font-size: 0.5em; margin-left: 10px; letter-spacing: .08em; }
.lbrow .cell { color: var(--text); font-size: clamp(15px, 1.8vw, 24px); }
.lbrow .cell.muted { color: var(--muted); }
.lbrow .pts { text-align: right; }
.lbrow .pts .n { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 70px); color: var(--brass); line-height: 1; }
.lbrow .pts .l { font-size: clamp(10px, 1vw, 13px); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.board .empty { text-align: center; color: var(--muted); padding: 80px 20px; font-size: 20px; }
.board .foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 18px; }

.toolbar { position: fixed; top: 12px; right: 14px; display: flex; gap: 8px; z-index: 5; }
.toolbar button { background: rgba(0,0,0,.4); color: var(--muted); border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 11px; font-size: 12px; }
.toolbar button:hover { color: var(--text); border-color: var(--line); }

.hide { display: none !important; }

@media (max-width: 620px) {
  .lbhead, .lbrow { grid-template-columns: 50px 1fr 80px; }
  .lbhead .h-hcp, .lbhead .h-start, .lbhead .h-thru,
  .lbrow .c-hcp, .lbrow .c-start, .lbrow .c-thru { display: none; }
}
