/* Ranwa Golf Management — brand stylesheet (deep fairway green + Zimbabwean gold) */
:root {
  --green-950: #0b2e1a;
  --green-900: #14532d;
  --green-800: #166534;
  --green-700: #15803d;
  --green-500: #22c55e;
  --green-100: #dcfce7;
  --green-50: #f0fdf4;
  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
  --red-600: #b91c1c;
  --red-50: #fef2f2;
  --blue-600: #1d4ed8;
  --blue-50: #eff6ff;
  --ink: #1c2421;
  --muted: #5f6b66;
  --line: #e3e8e5;
  --paper: #ffffff;
  --bg: #f6f8f6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 26, .06), 0 6px 20px rgba(16, 40, 26, .06);
  --serif: "Cinzel", Georgia, 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); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 15px; }
a { color: var(--green-800); text-decoration: none; }
a:hover { color: var(--gold-600); }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
h1, h2, .serif { font-family: var(--serif); letter-spacing: .02em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.section { padding: 56px 0; }
.section-alt { background: var(--paper); }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 700; color: var(--gold-600); margin-bottom: .6rem; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 60ch; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: .9rem; cursor: pointer; background: var(--green-800); color: #fff; font-family: inherit; line-height: 1.2; transition: background .15s, transform .05s; }
.btn:hover { background: var(--green-900); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold-500); color: var(--green-950); }
.btn-gold:hover { background: var(--gold-400); color: var(--green-950); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { background: var(--green-50); color: var(--green-900); border-color: var(--green-700); }
.btn-ghost-light { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.35); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.18); }
.btn-danger { background: var(--red-600); }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- cards & panels ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-tight { padding: 14px; }
.card h3 { margin-bottom: .35em; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.panel-green { background: linear-gradient(135deg, var(--green-900), var(--green-950)); color: #fff; border: 0; }
.panel-green .muted, .panel-green small { color: rgba(255,255,255,.7); }
.panel-green a { color: var(--gold-400); }

.kpi { padding: 16px 18px; }
.kpi .value { font-size: 1.7rem; font-weight: 700; font-family: var(--serif); color: var(--green-900); }
.kpi .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.kpi.alert .value { color: var(--gold-600); }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; background: #eef2ef; color: var(--muted); white-space: nowrap; }
.badge-green, .badge-sent, .badge-confirmed, .badge-completed, .badge-verified, .badge-signed, .badge-delivered, .badge-complete { background: var(--green-100); color: var(--green-900); }
.badge-gold, .badge-queued, .badge-pending, .badge-open, .badge-submitted, .badge-new, .badge-negotiating, .badge-proposal { background: #fef3c7; color: #92400e; }
.badge-live, .badge-in_progress { background: #fee2e2; color: #991b1b; }
.badge-live::before { content: "● "; animation: pulse 1.4s infinite; }
.badge-blue, .badge-skipped, .badge-closed, .badge-waitlist, .badge-scheduled { background: var(--blue-50); color: var(--blue-600); }
.badge-red, .badge-failed, .badge-withdrawn, .badge-dq, .badge-cancelled, .badge-lost { background: var(--red-50); color: var(--red-600); }
@keyframes pulse { 50% { opacity: .3; } }
.totem-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; }
.totem-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--green-800); flex: none; }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: #fafbfa; }
.table tbody tr:hover { background: var(--green-50); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .pos { font-weight: 700; width: 48px; }
.table-compact th, .table-compact td { padding: 6px 8px; }
.row-muted td { color: var(--muted); }
.leader td { background: #fffbeb; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .85rem; }
.field .help { font-size: .76rem; color: var(--muted); }
.field .errorlist { margin: 0; padding: 0; list-style: none; color: var(--red-600); font-size: .8rem; }
.input, select.input, textarea.input { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid #cfd8d3; background: #fff; font: inherit; color: inherit; }
.input:focus { outline: 2px solid var(--gold-400); outline-offset: 0; border-color: var(--gold-500); }
input[type=color].input { padding: 2px; height: 40px; }
.checkbox { width: 18px; height: 18px; accent-color: var(--green-800); }
.field-check { flex-direction: row; align-items: flex-start; gap: 10px; }
.field-check label { font-weight: 500; }
.form-errors { background: var(--red-50); color: var(--red-600); border: 1px solid #fecaca; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.form-errors ul { margin: 0; padding-left: 18px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; background: #fff; }
legend { font-weight: 700; padding: 0 6px; font-family: var(--serif); }

/* ---------- messages ---------- */
.messages { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.messages li { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.messages .success { background: var(--green-50); border-color: #bbf7d0; color: var(--green-900); }
.messages .error { background: var(--red-50); border-color: #fecaca; color: var(--red-600); }
.messages .warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.messages .info { background: var(--blue-50); border-color: #bfdbfe; color: var(--blue-600); }

/* ---------- public header / footer ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--green-900); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--serif); font-weight: 700; letter-spacing: .12em; }
.logo:hover { color: #fff; }
.logo-mark { width: 36px; height: 36px; border-radius: 50%; background: var(--gold-500); color: var(--green-950); display: grid; place-items: center; font-size: 1.1rem; font-weight: 800; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { color: rgba(255,255,255,.85); padding: 8px 10px; border-radius: 6px; font-size: .88rem; font-weight: 500; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 64px; left: 0; right: 0; background: var(--green-950); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; display: none; }
  .nav.open { display: flex; }
}
.site-footer { background: var(--green-950); color: rgba(255,255,255,.75); padding: 44px 0 24px; font-size: .9rem; }
.site-footer h4 { color: var(--gold-400); font-family: var(--serif); letter-spacing: .08em; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footnote { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 16px; font-size: .78rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.hero { position: relative; color: #fff; min-height: 520px; display: flex; align-items: center; background: var(--green-950) center/cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(8,35,20,.92) 0%, rgba(8,35,20,.65) 55%, rgba(8,35,20,.35) 100%); }
.hero .container { position: relative; padding-top: 60px; padding-bottom: 60px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); max-width: 16ch; }
.hero h1 em { color: var(--gold-400); font-style: normal; }
.hero p { max-width: 54ch; font-size: 1.1rem; color: rgba(255,255,255,.85); }
.page-hero { background: linear-gradient(120deg, var(--green-900), var(--green-950)); color: #fff; padding: 40px 0 34px; }
.page-hero .muted, .page-hero small { color: rgba(255,255,255,.75); }
.page-hero a { color: var(--gold-400); }
.page-hero a.btn-gold, .panel-green a.btn-gold { color: var(--green-950); }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-top: 28px; }
.stat-strip .n { font-family: var(--serif); font-size: 2rem; color: var(--gold-400); font-weight: 700; }
.stat-strip .l { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.75); }

.event-card { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.event-card .date { font-family: var(--serif); color: var(--gold-600); font-weight: 700; font-size: .9rem; }
.event-card .meta { font-size: .85rem; color: var(--muted); }
.event-card .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }

.zodiac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.zodiac { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.zodiac .sym { font-size: 1.7rem; color: var(--gold-600); }
.zodiac .sign { font-weight: 700; }
.zodiac .totem { font-family: var(--serif); color: var(--green-800); font-weight: 700; }
.zodiac.found { outline: 3px solid var(--gold-500); }

.sponsor-strip { display: flex; flex-wrap: wrap; gap: 14px 34px; justify-content: center; align-items: center; }
.sponsor-strip span { font-family: var(--serif); font-weight: 700; color: var(--green-900); font-size: 1.05rem; letter-spacing: .05em; opacity: .8; }

/* ---------- manage layout ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--green-950); color: rgba(255,255,255,.8); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { padding: 4px 8px 16px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar .group { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold-400); margin: 14px 10px 4px; font-weight: 700; }
.sidebar a { color: rgba(255,255,255,.82); padding: 8px 10px; border-radius: 7px; display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.sidebar a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.active { background: var(--green-800); color: #fff; }
.sidebar .count { margin-left: auto; background: var(--gold-500); color: var(--green-950); border-radius: 99px; font-size: .7rem; padding: 0 7px; font-weight: 700; }
.main { padding: 24px 28px 60px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 1.6rem; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.mobile-bar { display: none; }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; background: var(--green-900); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 40; }
  .mobile-bar button { background: none; border: 0; color: #fff; font-size: 1.4rem; }
  .main { padding: 18px 16px 50px; }
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active, .tabs a:hover { color: var(--green-900); border-color: var(--gold-500); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .92rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }
.bar { height: 8px; background: #edf1ee; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-700), var(--gold-500)); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--green-800); color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 700; }

/* ---------- scorecard grid ---------- */
.scorecard { border-collapse: separate; border-spacing: 0; font-size: .85rem; min-width: 760px; }
.scorecard th, .scorecard td { border-bottom: 1px solid var(--line); border-right: 1px solid #eef1ef; text-align: center; padding: 5px 3px; min-width: 34px; }
.scorecard th:first-child, .scorecard td:first-child { text-align: left; padding-left: 10px; min-width: 170px; position: sticky; left: 0; background: #fff; z-index: 1; }
.scorecard thead th { background: var(--green-900); color: #fff; font-weight: 600; }
.scorecard thead th:first-child { background: var(--green-900); }
.scorecard .meta-row td { background: #f7faf8; color: var(--muted); font-size: .75rem; }
.scorecard .tot { background: #f3f6f4; font-weight: 700; min-width: 42px; }
.scorecard input.hole { width: 34px; height: 34px; text-align: center; border: 1px solid #cfd8d3; border-radius: 6px; font: inherit; font-weight: 700; padding: 0; -moz-appearance: textfield; }
.scorecard input.hole:focus { outline: 2px solid var(--gold-500); border-color: var(--gold-500); }
.scorecard input.hole::-webkit-outer-spin-button, .scorecard input.hole::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.scorecard .dots { display: block; font-size: .55rem; color: var(--gold-600); line-height: 1; height: 6px; letter-spacing: -1px; }
.scorecard .calc td { font-size: .78rem; color: var(--muted); }
.scorecard .team-row td { background: #fffbeb; font-weight: 700; }
.scorecard .match-row td { background: var(--green-50); font-weight: 700; font-size: .72rem; }
.sc-eagle { background: #fde68a !important; border-radius: 50%; }
.sc-birdie { background: #fecaca !important; border-radius: 50%; }
.sc-bogey { background: #dbeafe !important; }
.sc-double { background: #bfdbfe !important; }
.win-a { color: var(--green-800); }
.win-b { color: var(--blue-600); }
.score-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.score-summary .card { padding: 10px 14px; }
.score-summary .v { font-size: 1.35rem; font-weight: 800; font-family: var(--serif); color: var(--green-900); }

/* ---------- leaderboard ---------- */
.lb-score { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.under { color: var(--red-600); }
.over { color: var(--ink); }
.cb-flag { font-size: .65rem; color: var(--gold-600); font-weight: 700; margin-left: 4px; }
details.lb-details summary { cursor: pointer; list-style: none; }
details.lb-details summary::-webkit-details-marker { display: none; }

/* ---------- bracket ---------- */
.bracket { display: flex; gap: 22px; overflow-x: auto; padding-bottom: 10px; }
.bracket-col { min-width: 230px; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.bracket-col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-600); text-align: center; }
.bm { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); font-size: .86rem; }
.bm .side { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; }
.bm .side + .side { border-top: 1px solid var(--line); }
.bm .side.win { background: var(--green-50); font-weight: 700; }
.bm .side .seed { color: var(--muted); font-size: .72rem; margin-right: 4px; }
.bm .foot { background: #fafbfa; border-top: 1px solid var(--line); padding: 4px 10px; font-size: .74rem; color: var(--muted); display: flex; justify-content: space-between; }

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .sidebar, .mobile-bar, .no-print, .btn { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ---------- admin manual ---------- */
.help-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; background: var(--green-900); color: #fff; padding: 9px 14px; border-radius: 99px; font-size: .85rem; font-weight: 600; box-shadow: var(--shadow); }
.help-fab:hover { background: var(--gold-500); color: var(--green-950); }
.manual { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.manual-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; font-size: .88rem; }
.manual-toc .group { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-600); font-weight: 700; margin: 12px 0 4px; }
.manual-toc a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--ink); }
.manual-toc a:hover, .manual-toc a.current { background: var(--green-50); color: var(--green-900); }
.manual-section { scroll-margin-top: 16px; margin-bottom: 18px; }
.manual-section h2 { margin-top: 0; font-size: 1.35rem; }
.manual-section h3 { margin: 22px 0 6px; font-size: 1.05rem; color: var(--green-900); }
.manual-section p, .manual-section li { max-width: 78ch; }
.manual-section ul, .manual-section ol:not(.steps) { padding-left: 20px; }
.manual-section .steps { margin: 10px 0; }
.manual-section table { margin: 10px 0; }
.callout { border-left: 4px solid var(--green-700); background: var(--green-50); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 12px 0; font-size: .92rem; }
.callout.warn { border-color: var(--gold-500); background: #fffbeb; }
.callout.danger { border-color: var(--red-600); background: var(--red-50); }
.callout strong:first-child { display: block; margin-bottom: 2px; }
.ui { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); font-size: .85em; font-weight: 600; white-space: nowrap; }
kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: #fff; font-size: .82em; }
.manual-search { position: relative; }
.manual-search input { padding-right: 70px; }
.manual-search small { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
mark { background: #fde68a; padding: 0 1px; border-radius: 2px; }
.manual .hidden-by-search { display: none; }
@media (max-width: 900px) { .manual { grid-template-columns: minmax(0, 1fr); } .manual-toc { position: static; max-height: none; } }
@media print { .manual { display: block; } .manual-toc, .help-fab { display: none !important; } .manual-section { break-inside: avoid-page; box-shadow: none; border: 0; } }

/* ---------- responsive layer (phones & small tablets) ---------- */
.grid > *, .flex > * { min-width: 0; }
.dl dd { min-width: 0; overflow-wrap: anywhere; }
.live-list { display: grid; gap: 10px; width: 100%; }
.live-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.live-item .btn { margin-left: auto; }
@media (max-width: 900px) {
  /* two-column layouts with inline column sizes stack on small screens */
  .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .card { padding: 16px; }
  .card { overflow-x: auto; }                 /* anything too wide scrolls inside its card, never the page */
  .table th, .table td { padding: 8px 8px; }
  .hide-sm { display: none !important; }
  .sm-hide-1 tr > :nth-child(1), .sm-hide-2 tr > :nth-child(2), .sm-hide-3 tr > :nth-child(3),
  .sm-hide-4 tr > :nth-child(4), .sm-hide-5 tr > :nth-child(5), .sm-hide-6 tr > :nth-child(6),
  .sm-hide-7 tr > :nth-child(7), .sm-hide-8 tr > :nth-child(8) { display: none; }
  .topbar h1 { font-size: 1.35rem; }
  .topbar > .flex, .topbar > form { width: 100%; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; justify-content: center; }
  .help-fab { right: 12px; bottom: 12px; padding: 0; width: 44px; height: 44px; display: grid; place-items: center; font-size: 0; }
  .help-fab::before { content: "?"; font-size: 1.2rem; font-weight: 800; }
  .main { padding-bottom: 80px; }
  /* knockout draw: rounds stacked top-to-bottom instead of side-by-side */
  .bracket { flex-direction: column; overflow-x: visible; gap: 8px; }
  .bracket-col { min-width: 0; justify-content: flex-start; gap: 10px; }
  .bracket-col h3 { text-align: left; margin: 14px 0 2px; }
}
@media (max-width: 600px) {
  /* KPI tiles two-up instead of one tall tile per row */
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-4 .kpi { padding: 12px; }
  .kpi .value { font-size: 1.25rem; overflow-wrap: anywhere; }
  .kpi .label { font-size: .66rem; letter-spacing: .05em; }
  .kpi small { font-size: .72rem; }
  .grid { gap: 14px; }
  .input, select.input, textarea.input { font-size: 16px; }   /* stops iOS zooming into fields */
}

/* ---------- phone scorecard: one hole at a time ---------- */
.hole-stepper { display: none; }
.sc-toggle { display: none; }
@media (max-width: 760px) {
  .hole-stepper:not([hidden]) { display: block; margin-bottom: 12px; }
  .hole-stepper:not([hidden]) ~ .sc-table-wrap:not(.show) { display: none; }
  .sc-toggle:not([hidden]) { display: inline-flex; margin-top: 10px; }
}
.hs-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.hs-chips button { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: .85rem; color: var(--muted); }
.hs-chips button.done { background: var(--green-100); color: var(--green-900); border-color: transparent; }
.hs-chips button.current { background: var(--gold-500); color: var(--green-950); border-color: var(--gold-600); }
.hs-head { display: flex; align-items: center; gap: 10px; background: var(--green-950); color: #fff; border-radius: 10px; padding: 10px; margin: 6px 0 10px; }
.hs-nav { width: 44px; height: 44px; border-radius: 8px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 1.6rem; line-height: 1; }
.hs-nav:disabled { opacity: .3; }
.hs-title { flex: 1; text-align: center; }
.hs-hole { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; }
.hs-meta { color: #cfe9d8 !important; font-size: .85rem; }
.hs-player { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; }
.hs-player.side-a { border-left: 4px solid var(--green-700); }
.hs-player.side-b { border-left: 4px solid var(--blue-600); }
.hs-name strong { display: block; }
.hs-name small { font-size: .78rem; }
.hs-entry { display: flex; align-items: center; gap: 6px; }
.hs-dots { color: var(--gold-600); font-weight: 800; letter-spacing: -1px; }
.hs-input { width: 56px; height: 48px; text-align: center; font-size: 1.4rem; font-weight: 700; border: 2px solid #cfd8d3; border-radius: 10px; }
.hs-input:focus { outline: none; border-color: var(--gold-500); }
.hs-quick { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.hs-q { height: 44px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 1.05rem; font-weight: 700; }
.hs-q.par { border-color: var(--green-700); }
.hs-q.on { background: var(--green-800); color: #fff; border-color: var(--green-800); }
.hs-status { font-weight: 700; color: var(--green-900); min-height: 1.2em; }
@media (max-width: 600px) {
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
}
.scorecard thead th.tot { background: var(--green-800); color: #fff; }
@media (min-width: 601px) and (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* laptops: fit all 18 holes + totals without sideways scrolling */
@media (max-width: 1440px) {
  .scorecard { min-width: 0; }
  .scorecard th, .scorecard td { padding: 4px 1px; min-width: 30px; }
  .scorecard th:first-child, .scorecard td:first-child { min-width: 130px; padding-left: 8px; }
  .scorecard .tot { min-width: 34px; }
  .scorecard input.hole { width: 30px; height: 32px; }
}

/* ---------- auto-save indicator ---------- */
.autosave-bar { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 10px; min-height: 1.4em; }
.as-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5d0; flex: none; }
.autosave-bar[data-state="pending"] .as-dot { background: var(--gold-500); animation: pulse 1s infinite; }
.autosave-bar[data-state="saved"] { color: var(--green-800); }
.autosave-bar[data-state="saved"] .as-dot { background: var(--green-700); }
.autosave-bar[data-state="offline"], .autosave-bar[data-state="error"] { color: var(--red-600); font-weight: 600; }
.autosave-bar[data-state="offline"] .as-dot, .autosave-bar[data-state="error"] .as-dot { background: var(--red-600); }

/* ---------- live leaderboard ---------- */
.live-status { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; margin-top: 8px; }
.page-hero .live-status { color: #dcfce7; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); animation: live-ping 1.6s infinite; }
@keyframes live-ping { 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
@keyframes live-flash { 0%, 35% { background: #fde68a; } 100% { background: transparent; } }
.live-flash, .live-flash > td { animation: live-flash 3s ease-out; }
@media (prefers-reduced-motion: reduce) { .live-dot, .live-flash, .live-flash > td { animation: none; } }

/* ---------- pictures: logos, banners, gallery ---------- */
.small { font-size: .85rem; }
.danger-text { color: var(--red-600); }
.logo-img { height: 40px; width: auto; max-width: 140px; object-fit: contain; display: block; }
.sidebar .logo-img { height: 34px; }
.brand-preview { background: var(--green-950); border-radius: 8px; padding: 14px 16px; }
.img-input { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.img-input-preview { flex: 0 0 auto; display: block; border: 1px solid var(--line); border-radius: 8px; padding: 4px;
  background: repeating-conic-gradient(#f1f5f3 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.img-input-preview img { display: block; max-width: 180px; max-height: 110px; object-fit: contain; }
.img-input-controls { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.img-input-controls input[type=file] { max-width: 100%; }
.img-input-clear { font-size: .85rem; color: var(--red-600); display: flex; gap: 6px; align-items: center; }

.sponsor-strip .sponsor-item { display: inline-flex; align-items: center; }
.sponsor-item img { height: 56px; width: auto; max-width: 160px; object-fit: contain; filter: grayscale(.15); transition: filter .2s, transform .2s; }
.sponsor-item:hover img { filter: none; transform: scale(1.04); }
.sponsor-name, .sponsor-strip span.sponsor-name { font-family: var(--serif); font-weight: 700; color: var(--green-900); font-size: 1.05rem; letter-spacing: .05em; opacity: .8; }
.event-sponsor { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.event-sponsor .sponsor-item img { height: 44px; max-width: 96px; }
.event-sponsor .sponsor-item .sponsor-name { display: none; }
.event-sponsor .sponsor-item:has(.sponsor-name) { display: none; }
.sponsored-by img { height: 22px; width: auto; max-width: 90px; object-fit: contain; vertical-align: middle; margin-left: 4px; }

.event-card-img { display: block; margin: -20px -20px 4px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 16 / 7; background: var(--green-50); }
.event-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.event-card:hover .event-card-img img { transform: scale(1.03); }
.page-hero-img { position: relative; background-size: cover; background-position: center; padding: 90px 0 34px; }
.page-hero-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,35,20,.35) 0%, rgba(8,35,20,.9) 75%); }
.page-hero-img > .container { position: relative; }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.album-tile { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: inherit; }
.album-tile:hover { color: inherit; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.album-cover { aspect-ratio: 4 / 3; background: var(--green-50); display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-meta { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.photo-grid a { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--green-50); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.photo-grid a:hover img { transform: scale(1.04); }
.photo-grid span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; color: #fff; font-size: .82rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.photo-strip a { display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--green-50); }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.photo-admin { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.photo-admin img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.photo-admin-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .85rem; }
.photo-admin-row label { display: flex; gap: 4px; align-items: center; }
.input-sm { padding: 4px 8px; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5,15,10,.94); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: calc(100vw - 120px); max-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 80px); object-fit: contain; border-radius: 4px; }
.lightbox figcaption { color: rgba(255,255,255,.85); font-size: .9rem; padding: 10px 8px 0; text-align: center; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; width: 46px; height: 46px; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 760px) {
  .lightbox figure { max-width: 100vw; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
  .lb-prev { left: calc(50% - 60px); } .lb-next { right: calc(50% - 60px); }
  .lightbox img { max-height: calc(100vh - 150px); }
  .photo-grid, .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .album-meta { padding: 8px 10px 10px; }
  .photo-grid span { display: none; }
  .sponsor-item img { height: 44px; max-width: 120px; }
  .logo-img { height: 34px; max-width: 110px; }
  .page-hero-img { padding-top: 70px; }
  .event-card-img { margin: -16px -16px 4px; }
}
