/* =====================================================================
   One Putt Open · Semi-Final scoreboard
   Public board: 18 & Co. navy and gold with One Putt Open sky blue
   Staff pages: light, high contrast for outdoors
   ===================================================================== */
:root {
  --navy: #1B1E3E; --navy-2: #22264B; --navy-3: #2B3060; --navy-ink: #13152E;
  --gold: #C9A86C; --gold-2: #E3C98F; --gold-dim: rgba(201, 168, 108, .28);
  --sky: #5DC0EC; --sky-dim: rgba(93, 192, 236, .14);
  --ink: #F4F1EA; --muted: #AEB1CC; --line: rgba(244, 241, 234, .09);
  --cream: #F6F4EF; --paper: #FFFFFF; --text: #171A33; --text-2: #565A75; --rule: #E2DFD6;
  --ok: #1E8E5A; --ok-bg: #E4F4EB; --warn: #9A6A00; --warn-bg: #FFF4D6; --bad: #B3261E; --bad-bg: #FBE6E4;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* ---------- Public board ---------- */
body.board { background: var(--navy); color: var(--ink); padding-bottom: 110px; }
.b-wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.b-head { padding: 18px 0 8px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.opo-logo { height: 52px; width: auto; border-radius: 6px; }
.co-logo { height: 56px; width: auto; }
.eyebrow { margin: 22px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.b-title { margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 9vw, 48px); line-height: 1.05; color: var(--ink); }
.b-rule { height: 1px; background: linear-gradient(90deg, var(--gold), var(--gold-dim) 60%, transparent); margin: 18px 0 0; border: 0; }
.b-now { display: inline-flex; align-items: center; gap: 10px; margin: 16px 0 0; padding: 8px 14px; border: 1px solid rgba(93, 192, 236, .45); border-radius: 999px; background: var(--sky-dim); font-size: 14px; color: var(--ink); }
.b-now b { letter-spacing: .06em; text-transform: uppercase; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 0 rgba(93, 192, 236, .7); animation: ping 1.8s infinite; flex: 0 0 auto; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(93, 192, 236, .6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(93, 192, 236, 0); } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

.b-card { margin: 22px 0 0; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-2); overflow: hidden; }
.b-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; }
.b-card-head h2 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--gold-2); }
.b-card-head span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.b-note { margin: 0; padding: 0 16px 14px; font-size: 13px; color: var(--muted); }
.b-card-head { align-items: center; }
.info-btn { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--gold); background: transparent; color: var(--gold-2); font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.info-btn[aria-expanded="true"] { background: var(--gold); color: var(--navy-ink); }
.info-box { margin: 0 16px 14px; padding: 12px 14px; border-radius: 10px; background: rgba(201, 168, 108, .1); border: 1px solid var(--gold-dim); font-size: 13.5px; color: var(--ink); display: grid; gap: 6px; }
.info-box p { margin: 0; }
.lb li.cutline { display: block; padding: 0; height: 0; margin: 3px 0; border-top: 0; border-bottom: 2px dashed var(--gold); }
.lb li.cutline + li { border-top-color: transparent; }

.slots { list-style: none; margin: 0; padding: 0 8px 8px; }
.slot { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 8px; border-top: 1px solid var(--line); }
.slot:first-child { border-top: 0; }
.slot .k { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sky); }
.slot .n { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.slot .n .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.slot .r { font-weight: 700; color: var(--ink); }
.slot.empty .n { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; font-style: italic; }
.slot.me { background: rgba(201, 168, 108, .16); border-radius: 8px; }

.lb { list-style: none; margin: 0; padding: 0 8px 8px; }
.lb li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 8px; border-top: 1px solid var(--line); position: relative; scroll-margin: 90px; }
.lb li:first-child { border-top: 0; }
.lb .p { color: var(--gold); font-weight: 600; text-align: right; }
.lb .n { font-weight: 600; letter-spacing: .05em; text-transform: uppercase; display: block; min-width: 0; }
.lb .n .line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.lb .n .line > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lb .tag { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--sky); }
.lb li.empty .line > span:first-child { color: var(--muted); font-style: italic; font-weight: 500; text-transform: none; letter-spacing: 0; }
.list > li.r.cut { border-bottom: 2px dashed var(--gold); padding-bottom: 12px; }
.list > li.r.cut + li { border-top-color: transparent; }
.lb .r { font-weight: 700; text-align: right; }
.lb li.q { background: linear-gradient(90deg, var(--sky-dim), transparent 70%); border-radius: 8px; }
.lb li.q::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--sky); }
.lb li.me { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 8px; }
.lb li.cut { border-top: 1px dashed var(--gold-dim); }
.chip { flex: 0 0 auto; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; line-height: 1.2; }
.chip.in { background: var(--sky); color: var(--navy-ink); }
.chip.tie { background: var(--gold); color: var(--navy-ink); }
.chip.you { background: transparent; color: var(--gold-2); border: 1px solid var(--gold); }
.holed { color: var(--gold-2); letter-spacing: .1em; text-transform: uppercase; font-size: 14px; }
.b-empty { padding: 26px 16px 30px; text-align: center; color: var(--muted); }
.b-empty b { display: block; font-family: var(--serif); font-size: 22px; color: var(--ink); margin-bottom: 6px; }
.b-foot { margin: 30px 0 0; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: .04em; }

.b-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(19, 21, 46, .96); border-top: 1px solid var(--gold-dim); backdrop-filter: blur(6px); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.b-bar-in { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.b-prog { flex: 1 1 auto; min-width: 0; }
.b-count { font-size: 15px; color: var(--ink); }
.b-count b { font-weight: 800; }
.b-sub { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-sub .dot { width: 7px; height: 7px; }
.b-sub.off .dot { background: #E5A93B; animation: none; }
.track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); margin-top: 8px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 4px; transition: width .6s ease; }
.btn-find { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--gold); background: transparent; color: var(--gold-2); font-weight: 600; font-size: 14px; letter-spacing: .04em; }

.b-dlg { width: min(520px, calc(100vw - 24px)); border: 1px solid var(--gold-dim); border-radius: 16px; background: var(--navy-2); color: var(--ink); padding: 0; }
.b-dlg::backdrop { background: rgba(8, 9, 20, .7); }
.b-dlg form { padding: 20px; display: grid; gap: 14px; }
.b-dlg h2 { margin: 0; font-family: var(--serif); font-size: 24px; color: var(--gold-2); }
.b-dlg p { margin: 0; color: var(--muted); font-size: 14px; }
.b-dlg input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--gold-dim); background: var(--navy); color: var(--ink); font-size: 17px; }
.find-list { list-style: none; margin: 0; padding: 0; max-height: 45vh; overflow: auto; }
.find-list button { width: 100%; display: flex; justify-content: space-between; gap: 10px; min-height: 48px; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.find-list button span:last-child { color: var(--gold); text-transform: none; letter-spacing: 0; font-weight: 500; }
.dlg-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.b-dlg .ghost { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); }

/* ---------- Staff pages ---------- */
body.staff { background: var(--cream); color: var(--text); }
.s-top { background: var(--navy); color: var(--ink); }
.s-top-in { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.s-top .co { height: 40px; width: auto; }
.s-top .who { flex: 1 1 auto; min-width: 0; }
.s-top .who b { display: block; font-family: var(--serif); font-size: 19px; color: var(--gold-2); line-height: 1.1; }
.s-top .who span { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.s-top .out { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(244, 241, 234, .3); background: none; color: var(--ink); font-size: 14px; }
.s-stats { background: var(--navy-2); color: var(--ink); border-top: 1px solid rgba(255, 255, 255, .06); }
.s-stats-in { max-width: 980px; margin: 0 auto; padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.s-stats b { color: var(--ink); font-weight: 700; }
.s-stats .conn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.s-stats .conn.off { color: #FFCF70; }
.tabs { position: sticky; top: 0; z-index: 10; background: var(--cream); border-bottom: 1px solid var(--rule); }
.tabs-in { max-width: 980px; margin: 0 auto; padding: 0 8px; display: flex; overflow-x: auto; }
.tabs button { flex: 0 0 auto; min-height: 50px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 600; color: var(--text-2); position: relative; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold); }
.tabs .badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.s-main { max-width: 980px; margin: 0 auto; padding: 16px 16px 60px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 16px; }
.card h2 { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h2 small { font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 13px; }
.muted { color: var(--text-2); }
.btn { min-height: 46px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy-ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.big { min-height: 58px; font-size: 18px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.green-card { border: 2px solid var(--sky); background: linear-gradient(180deg, #F1FAFE, var(--paper)); }
.green-label { font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #1B7DAA; display: flex; align-items: center; gap: 8px; }
.green-name { font-family: var(--serif); font-size: clamp(30px, 8vw, 44px); font-weight: 700; line-height: 1.08; margin: 6px 0 4px; overflow-wrap: anywhere; }
.green-sub { color: var(--text-2); font-size: 15px; }
.gchip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--cream); border: 1px solid var(--rule); font-size: 12px; font-weight: 700; color: var(--text-2); vertical-align: middle; }

.confirm-card { border: 2px solid var(--gold); background: #FFFBF1; border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.confirm-card + .confirm-card { margin-top: 10px; }
.confirm-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.confirm-name { font-size: 20px; font-weight: 700; }
.confirm-cm { font-size: 34px; font-weight: 800; letter-spacing: -.01em; }
.confirm-meta { font-size: 13px; color: var(--text-2); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1 1 180px; min-width: 0; }
.list .nm { font-weight: 600; overflow-wrap: anywhere; }
.list .sub { font-size: 13px; color: var(--text-2); }
.list .pos { width: 30px; text-align: right; font-weight: 700; color: var(--gold); }
.list li.next { background: #F1FAFE; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.st { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st.registered { background: var(--cream); color: var(--text-2); border: 1px solid var(--rule); }
.st.in_line { background: #E6F5FC; color: #1B6E96; }
.st.up { background: var(--sky); color: var(--navy-ink); }
.st.pending { background: var(--warn-bg); color: var(--warn); }
.st.done { background: var(--ok-bg); color: var(--ok); }
.st.dns, .st.dq { background: var(--bad-bg); color: var(--bad); }
.st.q { background: var(--navy); color: var(--gold-2); }
.st.tie { background: var(--gold); color: var(--navy-ink); }
.res { font-weight: 800; white-space: nowrap; }
li.verified { background: linear-gradient(90deg, var(--ok-bg), transparent 75%); border-radius: 10px; padding-left: 8px; }
.list > li.r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; }
.list > li.r.has-pos { grid-template-columns: 26px minmax(0, 1fr) auto; }
.list > li.r.inline { grid-template-columns: minmax(0, 1fr) auto auto; }
.list > li.r.has-pos.inline { grid-template-columns: 26px minmax(0, 1fr) auto; }
.list > li.r .acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.list > li.r.has-pos .acts { grid-column: 2 / -1; }
.list > li.r.inline .acts { grid-column: auto; flex-wrap: nowrap; }
.list > li.r .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.list > li.r .pos { width: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.btn.wrap { white-space: normal; text-align: center; height: auto; padding-top: 8px; padding-bottom: 8px; line-height: 1.3; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }
.field input, .field select, .field textarea, input.search { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #CFCBC0; border-radius: 10px; background: var(--paper); font-size: 17px; }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.4; }
.field small { color: var(--text-2); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.err { color: var(--bad); font-weight: 600; min-height: 0; margin: 0; }
.err:empty { display: none; }
.note { background: var(--warn-bg); color: #5C4300; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.ok { background: var(--ok-bg); color: #145C3B; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.filters button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); font-size: 14px; font-weight: 600; color: var(--text-2); }
.filters button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.log { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.log li { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--rule); }
.log li:first-child { border-top: 0; }
.log time { color: var(--text-2); font-variant-numeric: tabular-nums; }
.log b { font-weight: 700; }
.log .by { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin-right: 6px; }
details.card summary { cursor: pointer; font-weight: 700; }
.danger-zone { border-color: #F0C4C0; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); display: inline-flex; align-items: center; justify-content: center; color: var(--text); text-decoration: none; }
.icon-btn.call { color: var(--ok); }
.icon-btn.text { color: #1B6E96; }

/* scorer */
.dist { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; }
.dist input { min-height: 72px; font-size: 40px; font-weight: 800; text-align: center; border: 2px solid #CFCBC0; border-radius: 12px; padding: 6px 10px; width: 100%; background: var(--paper); font-variant-numeric: tabular-nums; }
.dist input:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(93, 192, 236, .35); }
.dist .unit { display: flex; align-items: center; font-size: 22px; font-weight: 700; color: var(--text-2); padding: 0 6px; }
.holed-btn[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--navy-ink); }
.sent { border-radius: 12px; padding: 14px; font-size: 16px; }
.sent.wait { background: var(--warn-bg); color: #5C4300; }
.sent.okk { background: var(--ok-bg); color: #145C3B; }
.sent b { font-size: 20px; }

/* dialog */
dialog.s-dlg { width: min(520px, calc(100vw - 24px)); border: 0; border-radius: 16px; padding: 0; background: var(--paper); color: var(--text); }
dialog.s-dlg::backdrop { background: rgba(15, 17, 38, .55); }
.s-dlg form { padding: 20px; display: grid; gap: 14px; }
.s-dlg h2 { margin: 0; font-size: 22px; }
.s-dlg .foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* sign in */
.login { max-width: 420px; margin: 40px auto; padding: 0 16px; }
.login .card { display: grid; gap: 14px; padding: 22px; }
.login h1 { margin: 0; font-family: var(--serif); font-size: 28px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 18px; background: var(--navy); border-radius: 14px; padding: 16px; }
.login-brand img { height: 46px; width: auto; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.toast.bad { background: var(--bad); }
.loading { padding: 60px 16px; text-align: center; color: var(--text-2); }
body.board .loading { color: var(--muted); }

@media (max-width: 420px) {
  .slot { grid-template-columns: 80px minmax(0, 1fr) auto; }
  .opo-logo { height: 44px; }
  .co-logo { height: 48px; }
}
