/* ============================================================
   PPI National Matchplay Championship 2026 — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Playfair+Display:wght@400;600;700&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:           #0d1b3e;
  --navy-light:     #e6eaf4;
  --navy-xlight:    #f0f2f8;
  --gold:           #c9a84c;
  --gold-light:     #fdf3d8;
  --gold-mid:       #a07820;
  --white:          #ffffff;
  --off-white:      #f8f7f4;
  --surface:        #f1eff8;
  --border:         rgba(0,0,0,0.08);
  --border-mid:     rgba(0,0,0,0.14);
  --text-primary:   #0a0f1e;
  --text-secondary: #6b6f7a;
  --text-muted:     #9da0aa;
  --green:          #2d6a1f;
  --green-light:    #eaf3e6;
  --red:            #8b2020;
  --red-light:      #fdf0f0;
  --amber:          #92600a;
  --amber-light:    #fef7e6;
  --official-bg:    #fffbf0;
  --official-border:rgba(201,168,76,0.35);
  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      12px;
  --radius-xl:      16px;
  --shadow-sm:      0 1px 4px rgba(0,0,0,0.06);
  --transition:     0.15s ease;
  --max-w:          1120px;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'DM Sans', sans-serif; background: var(--off-white); color: var(--text-primary); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: 'DM Sans', sans-serif; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: 'DM Sans', sans-serif; }

/* ---- HEADER ---- */
.site-header { background: #0d1b3e; position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.header-inner { max-width: var(--max-w); margin: 0 auto; padding: 14px 20px 0; }
.header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.header-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-family: 'Cinzel', serif; color: var(--white); font-size: 14px; font-weight: 600; line-height: 1.2; letter-spacing: 0.04em; }
.brand-sub { font-family: 'Cinzel', serif; font-size: 9px; color: var(--gold); font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 3px; }
.btn-admin { display: flex; align-items: center; gap: 6px; padding: 6px 13px; border: 0.5px solid rgba(201,168,76,0.4); border-radius: var(--radius-sm); color: var(--gold); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; transition: background var(--transition); }
.btn-admin:hover { background: rgba(201,168,76,0.1); }
.btn-admin.is-active { background: rgba(201,168,76,0.15); border-color: var(--gold); }
.btn-admin svg { width: 12px; height: 12px; }
.comp-tabs { display: flex; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.comp-tabs::after { content: ''; flex: 0 0 16px; }
@media (min-width: 780px) {
  .comp-tabs { justify-content: center; }
}
.comp-tabs::-webkit-scrollbar { display: none; }
.comp-tab { display: block; padding: 9px 16px; font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.4); border-bottom: 2px solid transparent; white-space: nowrap; transition: color var(--transition), border-color var(--transition); letter-spacing: 0.02em; }
.comp-tab:hover { color: rgba(255,255,255,0.72); }
.comp-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ---- ADMIN BAR ---- */
.admin-bar { background: var(--official-bg); border-bottom: 1px solid var(--official-border); padding: 8px 20px; display: none; }
.admin-bar.visible { display: block; }
.admin-bar-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-bar-text { font-size: 11px; color: var(--gold-mid); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.btn-logout { font-size: 11px; color: var(--gold-mid); border: 0.5px solid var(--official-border); border-radius: var(--radius-sm); padding: 4px 10px; transition: background var(--transition); }
.btn-logout:hover { background: rgba(201,168,76,0.1); }

/* ---- ROUND NAV ---- */
.round-nav { background: var(--white); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.round-nav::-webkit-scrollbar { display: none; }
.round-nav-inner { max-width: var(--max-w); margin: 0 auto; display: flex; padding: 0 24px; overflow-x: auto; scrollbar-width: none; }
@media (min-width: 780px) {
  .round-nav-inner { justify-content: center; }
}
.round-tab { padding: 11px 14px; font-size: 11px; font-weight: 500; color: var(--text-secondary); border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; transition: color var(--transition), border-color var(--transition); display: flex; align-items: center; gap: 5px; }
.round-tab:hover { color: var(--text-primary); }
.round-tab.active { color: #1a3d2b; border-bottom-color: #1a3d2b; }
.round-pill { font-size: 9px; background: var(--off-white); color: var(--text-muted); padding: 1px 5px; border-radius: 8px; font-weight: 500; }
.round-tab.active .round-pill { background: var(--navy-light); color: var(--navy); }
.round-tab.r-complete .round-pill { background: var(--green-light); color: var(--green); }

/* ---- LIVE STRIP ---- */
.live-strip { background: var(--white); border-bottom: 1px solid var(--border); padding: 7px 20px; }
.live-strip-inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.live-badge { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--gold-mid); font-weight: 500; letter-spacing: 0.04em; }
.live-dot { width: 6px; height: 6px; background: var(--gold); border-radius: 50%; animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 0%,100%{opacity:1;transform:scale(1);}50%{opacity:0.3;transform:scale(0.75);} }
.updated-text { font-size: 10px; color: var(--text-muted); }

/* ---- CONTENT ---- */
.page-content { max-width: var(--max-w); margin: 0 auto; padding: 20px 20px 80px; }
.section-label { font-size: 10px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 12px; }

.state-loading, .state-error, .state-empty { text-align: center; padding: 60px 20px; }
.spinner { width: 28px; height: 28px; border: 2px solid var(--border); border-top-color: var(--navy); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-loading p, .state-error p, .state-empty p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.state-error h3, .state-empty h3 { font-family: 'Playfair Display', serif; font-size: 18px; margin-bottom: 8px; }

/* ---- DAY GROUPS ---- */
.day-group { margin-bottom: 28px; }
.day-group-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.day-group-label { font-size: 11px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.day-group-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.day-line { flex: 1; height: 1px; background: var(--border); }

/* ---- MATCH CARDS ---- */
.matches-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color var(--transition); }
.match-card:hover { border-color: var(--border-mid); }
.match-card.is-live      { border-left: 3px solid var(--gold); }
.match-card.is-complete  { border-left: 3px solid var(--green); }
.match-card.is-walkover  { border-left: 3px solid var(--amber); }
.match-card.is-withdrawn { border-left: 3px solid var(--text-muted); opacity: 0.65; }

.match-card-header { display: flex; align-items: center; justify-content: space-between; padding: 7px 14px; background: var(--off-white); border-bottom: 1px solid var(--border); gap: 8px; }
.match-meta { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; overflow: hidden; }
.match-number { font-size: 10px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.04em; white-space: nowrap; }
.match-detail { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdot { color: var(--border-mid); margin: 0 1px; }
.status-badge { font-size: 10px; font-weight: 500; padding: 3px 8px; border-radius: 10px; letter-spacing: 0.03em; white-space: nowrap; flex-shrink: 0; }
.status-badge.upcoming  { background: var(--off-white); color: var(--text-secondary); border: 1px solid var(--border); }
.status-badge.live      { background: var(--official-bg); color: var(--gold-mid); }
.status-badge.complete  { background: var(--green-light); color: var(--green); }
.status-badge.walkover  { background: var(--amber-light); color: var(--amber); }
.status-badge.withdrawn { background: var(--off-white); color: var(--text-muted); }

.match-card-body { padding: 2px 0; }
.player-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; gap: 10px; }
.player-row:first-child { border-bottom: 1px solid var(--border); }
.player-row.is-winner { background: rgba(45,106,31,0.04); }
.player-row.is-winner .player-name { color: var(--green); }
.player-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.avatar { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.av-p1 .avatar-inner { background: var(--navy-light); color: var(--navy); }
.av-p2 .avatar-inner { background: var(--gold-light); color: var(--gold-mid); }
.player-info { min-width: 0; flex: 1; }
.player-name { font-size: 15px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; display: block; transition: color var(--transition); }
.player-name:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.player-name.tbd { color: var(--text-muted); font-style: italic; cursor: default; }
.player-name.tbd:hover { color: var(--text-muted); text-decoration: none; }
.player-club { font-size: 12px; color: var(--text-secondary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-pill { font-size: 10px; color: var(--gold-mid); background: var(--gold-light); padding: 1px 6px; border-radius: 8px; margin-left: 6px; white-space: nowrap; display: inline-block; }
.score-col { min-width: 52px; display: flex; justify-content: flex-end; align-items: center; }
.score-val { font-family: 'DM Sans', sans-serif; font-size: 17px; font-weight: 500; letter-spacing: 0.02em; color: var(--text-primary); text-align: right; }
.score-val.leading  { color: var(--navy); font-weight: 600; }
.score-val.trailing { color: var(--text-muted); font-size: 15px; font-weight: 400; }
.score-val.dash     { color: var(--text-muted); font-size: 14px; font-family: 'DM Sans', sans-serif; }
.score-val.winner   { font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500; color: var(--green); background: var(--green-light); padding: 3px 8px; border-radius: var(--radius-sm); }
.score-val.loser    { font-family: 'DM Sans', sans-serif; font-size: 11px; color: var(--text-muted); }
.score-val.wo       { font-family: 'DM Sans', sans-serif; font-size: 10px; color: var(--amber); background: var(--amber-light); padding: 3px 7px; border-radius: var(--radius-sm); }

.card-footer { border-top: 1px solid var(--border); padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.log-preview { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.log-item { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-secondary); overflow: hidden; }
.log-tag { font-size: 9px; font-weight: 500; padding: 1px 5px; border-radius: 3px; letter-spacing: 0.04em; flex-shrink: 0; }
.log-tag.official  { background: var(--gold-light); color: var(--gold-mid); border: 1px solid var(--official-border); font-weight: 600; }
.log-tag.spectator { background: #e8eeff; color: #3d5a9a; border: 1px solid #c8d4f0; }
.log-tag.edit      { background: var(--navy-light); color: var(--navy); }
.log-desc { font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-time { color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.no-log { font-size: 10px; color: var(--text-muted); font-style: italic; }
.btn-log { display: flex; align-items: center; gap: 5px; padding: 6px 11px; border: 1px solid var(--border-mid); border-radius: var(--radius-sm); font-size: 11px; font-weight: 500; color: var(--text-primary); background: var(--white); transition: all var(--transition); white-space: nowrap; flex-shrink: 0; }
.btn-log:hover { background: var(--off-white); border-color: var(--navy); color: var(--navy); }
.btn-log svg { width: 12px; height: 12px; }

.admin-actions { border-top: 1px solid var(--official-border); background: var(--official-bg); padding: 8px 14px; display: none; gap: 6px; flex-wrap: wrap; }
.admin-actions.show { display: flex; }
.btn-act { font-size: 11px; font-weight: 500; padding: 5px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-mid); background: var(--white); color: var(--text-primary); transition: all var(--transition); }
.btn-act:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-xlight); }
.btn-act.green { border-color: var(--green); color: var(--green); }
.btn-act.green:hover { background: var(--green-light); }
.btn-act.red   { border-color: var(--red); color: var(--red); }
.btn-act.red:hover   { background: var(--red-light); }
.btn-act.amber { border-color: var(--amber); color: var(--amber); }
.btn-act.amber:hover { background: var(--amber-light); }

/* ---- PROFILE PANEL ---- */
.overlay { position: fixed; inset: 0; background: rgba(10,15,30,0.5); z-index: 300; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.overlay.open { opacity: 1; pointer-events: all; }
.profile-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 92%;
  max-width: 420px;
  max-height: 85dvh;
  background: var(--white);
  z-index: 310;
  overflow-y: auto;
  border-radius: var(--radius-xl);
  transform: translate(-50%, -48%) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.2s ease;
  -webkit-overflow-scrolling: touch;
}
.profile-panel.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: all;
}
.profile-hd { 
  background: var(--navy); 
  padding: 28px 20px 24px; 
  position: relative; 
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.profile-close-btn { position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.65); font-size: 15px; transition: background var(--transition); }
.profile-close-btn:hover { background: rgba(255,255,255,0.2); color: var(--white); }
.profile-photo { 
  width: 88px; 
  height: 88px; 
  border-radius: 50%; 
  overflow: hidden; 
  border: 2.5px solid var(--gold); 
  margin-bottom: 16px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  background: rgba(201,168,76,0.15); 
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-initials { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; color: var(--gold); }
.profile-pname { font-family: 'Playfair Display', serif; color: var(--white); font-size: 19px; font-weight: 600; line-height: 1.2; margin-bottom: 3px; }
.profile-pclub { font-size: 12px; color: var(--gold); font-weight: 500; margin-bottom: 8px; }
.profile-rank-badge { display: inline-flex; align-items: center; background: rgba(201,168,76,0.18); color: var(--gold); font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 12px; }
.stats-strip { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--border); }
.stat-cell { padding: 14px 10px; text-align: center; border-right: 1px solid var(--border); }
.stat-cell:last-child { border-right: none; }
.stat-val { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.stat-lbl { font-size: 10px; color: var(--text-secondary); letter-spacing: 0.05em; text-transform: uppercase; }
.profile-body { padding: 18px 20px 24px; }
.profile-section { font-size: 10px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); margin: 18px 0 10px; }
.profile-section:first-child { margin-top: 0; }
.history-list { display: flex; flex-direction: column; gap: 5px; }
.history-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--off-white); border-radius: var(--radius-md); font-size: 13px; }
.h-year { color: var(--text-secondary); font-weight: 500; }
.h-result { font-weight: 500; }
.h-result.champion { color: var(--gold-mid); }
.h-result.runner { color: var(--navy); }
.achievement-list { display: flex; flex-direction: column; gap: 5px; }
.achievement-item { display: flex; align-items: flex-start; gap: 9px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 12px; line-height: 1.5; }
.ach-star { color: var(--gold); flex-shrink: 0; margin-top: 1px; }

/* ---- MODALS ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,15,30,0.65); z-index: 400; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; overflow-y: auto; }
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal { background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 480px; max-height: 90dvh; overflow-y: auto; transform: translateY(8px); transition: transform 0.22s ease; -webkit-overflow-scrolling: touch; margin: auto; }
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-hd { background: var(--navy); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1; }
.modal-title { font-family: 'Playfair Display', serif; color: var(--white); font-size: 16px; font-weight: 600; }
.modal-x { width: 26px; height: 26px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.6); font-size: 14px; transition: background var(--transition); }
.modal-x:hover { background: rgba(255,255,255,0.2); color: var(--white); }
.modal-bd { padding: 20px 20px 32px; }

/* PIN */
.pin-dots { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.pin-dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--navy); background: transparent; transition: background 0.1s; }
.pin-dot.filled { background: var(--navy); }
.pin-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.pin-key { padding: 14px 8px; background: var(--off-white); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 20px; font-weight: 500; font-family: 'Playfair Display', serif; color: var(--text-primary); text-align: center; transition: background var(--transition); }
.pin-key:hover { background: var(--surface); }
.pin-key:active { transform: scale(0.97); }
.pin-key.pin-act { font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--text-secondary); }
.pin-err { min-height: 18px; text-align: center; font-size: 12px; color: var(--red); margin-top: 14px; font-weight: 500; }

/* Forms */
.notice { padding: 10px 13px; border-radius: var(--radius-md); font-size: 12px; line-height: 1.55; margin-bottom: 16px; }
.notice.official {
  background: var(--official-bg);
  border: 1px solid var(--official-border);
  border-left: 3px solid var(--gold);
  color: var(--gold-mid);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notice.official::before {
  content: '★';
  font-size: 14px;
  flex-shrink: 0;
}
.notice.spectator {
  background: #f0f4ff;
  border: 1px solid #c8d4f0;
  border-left: 3px solid #6b8ccc;
  color: #3d5a9a;
}
.notice strong { color: var(--text-primary); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 7px; }
.form-select, .form-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-mid); border-radius: var(--radius-md); font-size: 13px; color: var(--text-primary); background: var(--off-white); -webkit-appearance: none; appearance: none; transition: border-color var(--transition); }
.form-select:focus, .form-input:focus { outline: none; border-color: var(--navy); }
.form-textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border-mid); border-radius: var(--radius-md); font-size: 13px; line-height: 1.5; color: var(--text-primary); background: var(--off-white); resize: vertical; min-height: 80px; }
.form-textarea:focus { outline: none; border-color: var(--navy); }
.toggle-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tog-btn { padding: 10px 8px; border: 1.5px solid var(--border-mid); border-radius: var(--radius-md); font-size: 12px; font-weight: 500; color: var(--text-secondary); text-align: center; line-height: 1.3; transition: all var(--transition); background: var(--white); }
.tog-btn:hover { border-color: var(--navy); color: var(--navy); }
.tog-btn.active { border-color: var(--navy); background: var(--navy); color: var(--white); }
.tog-btn .tsub { font-size: 10px; display: block; margin-top: 2px; opacity: 0.65; font-weight: 400; }
.lead-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 7px; }
.lead-btn { padding: 10px 8px; border: 1.5px solid var(--border-mid); border-radius: var(--radius-md); font-size: 12px; font-weight: 500; color: var(--text-secondary); text-align: center; line-height: 1.3; transition: all var(--transition); background: var(--white); }
.lead-btn:hover { border-color: var(--navy); color: var(--navy); }
.lead-btn.active { border-color: var(--navy); background: var(--navy); color: var(--white); }
.lead-btn .lsub { font-size: 10px; display: block; margin-top: 1px; opacity: 0.65; }
.as-btn { width: 100%; padding: 9px; border: 1.5px solid var(--border-mid); border-radius: var(--radius-md); font-size: 12px; font-weight: 500; color: var(--text-secondary); text-align: center; transition: all var(--transition); background: var(--white); }
.as-btn:hover { border-color: var(--navy); color: var(--navy); }
.as-btn.active { border-color: var(--navy); background: var(--navy-light); color: var(--navy); }
.hu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hu-label { font-size: 12px; color: var(--text-secondary); }
.hu-controls { display: flex; align-items: center; gap: 12px; }
.hu-btn { width: 34px; height: 34px; border: 1px solid var(--border-mid); border-radius: var(--radius-sm); background: var(--off-white); font-size: 20px; color: var(--text-primary); display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.hu-btn:hover { background: var(--surface); }
.hu-count { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 600; color: var(--navy); min-width: 32px; text-align: center; }
.score-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.score-block { display: flex; flex-direction: column; gap: 4px; }
.score-block-lbl { font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.score-big-input { padding: 10px; border: 1px solid var(--border-mid); border-radius: var(--radius-md); font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; text-align: center; color: var(--navy); background: var(--white); width: 100%; }
.score-big-input:focus { outline: none; border-color: var(--navy); }
.form-err { min-height: 16px; font-size: 11px; color: var(--red); margin-bottom: 12px; font-weight: 500; }
.modal-divider { height: 1px; background: var(--border); margin: 16px 0; }
.modal-section-lbl { font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 10px; }
.btn-primary { width: 100%; padding: 13px; background: var(--navy); color: var(--gold); border-radius: var(--radius-md); font-size: 13px; font-weight: 500; letter-spacing: 0.02em; transition: opacity var(--transition); }
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary.g { background: var(--green); color: var(--white); }
.btn-primary.a { background: var(--amber); color: var(--white); }
.btn-primary.r { background: var(--red); color: var(--white); }
.btn-secondary { width: 100%; padding: 11px; background: var(--white); color: var(--text-secondary); border: 1px solid var(--border-mid); border-radius: var(--radius-md); font-size: 13px; font-weight: 500; margin-top: 8px; transition: all var(--transition); }
.btn-secondary:hover { border-color: var(--navy); color: var(--navy); }

/* ---- INDEX ---- */
.index-hero { background: var(--navy); padding: 44px 20px 36px; text-align: center; }
.index-mark { width: 80px; height: 80px; display: block; margin: 0 auto 20px; overflow: hidden; border-radius: 8px; }
.index-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.index-ev { font-size: 11px; color: var(--gold); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.index-title { font-family: 'Playfair Display', serif; color: var(--white); font-size: 26px; font-weight: 700; line-height: 1.2; margin-bottom: 4px; }
.index-sub { font-size: 12px; color: rgba(255,255,255,0.38); margin-top: 4px; }
.index-content { max-width: 540px; margin: 0 auto; padding: 28px 20px 60px; }
.ix-section { font-size: 10px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 12px; }
.comp-cards { display: flex; flex-direction: column; gap: 8px; margin-bottom: 32px; }
.comp-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: border-color var(--transition), box-shadow var(--transition); }
.comp-card:hover { border-color: var(--border-mid); box-shadow: var(--shadow-sm); }
.cc-left { display: flex; align-items: center; gap: 12px; }
.cc-icon { width: 38px; height: 38px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.cc-icon.n { background: var(--navy-light); color: var(--navy); }
.cc-icon.g { background: var(--gold-light); color: var(--gold-mid); }
.cc-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.cc-detail { font-size: 11px; color: var(--text-secondary); }
.cc-right { display: flex; align-items: center; gap: 8px; }
.cc-badge { font-size: 10px; font-weight: 500; padding: 3px 8px; border-radius: 10px; }
.cc-badge.u { background: var(--off-white); color: var(--text-muted); }
.cc-badge.a { background: var(--official-bg); color: var(--gold-mid); }
.cc-arrow { color: var(--text-muted); font-size: 16px; }
.ix-admin { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--navy); border-radius: var(--radius-lg); transition: opacity var(--transition); }
.ix-admin:hover { opacity: 0.9; }
.ix-admin-lbl { font-size: 13px; font-weight: 500; color: var(--gold); margin-bottom: 2px; }
.ix-admin-sub { font-size: 11px; color: rgba(255,255,255,0.35); }
.ix-admin-arr { color: var(--gold); font-size: 16px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 780px) {
  .matches-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .header-inner { padding: 12px 16px 0; }
  .page-content { padding: 16px 16px 72px; }
  .round-nav-inner { padding: 0 16px; }
  .live-strip { padding: 7px 16px; }
  .admin-bar { padding: 8px 16px; }
  .match-card-header, .player-row, .card-footer, .admin-actions { padding-left: 12px; padding-right: 12px; }
  .profile-panel { max-width: 100%; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .comp-tab { padding: 9px 12px; font-size: 11px; }
  .brand-name { font-size: 13px; }
  .index-title { font-size: 22px; }
  .match-card-header { padding: 6px 10px; }
  .player-row { padding: 10px 10px; }
  .card-footer { padding: 7px 10px; }
  .admin-actions { padding: 7px 10px; }
  .avatar { width: 36px; height: 36px; }
  .player-name { font-size: 13px; }
  .player-club { font-size: 11px; }
}

.score-btn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.final-score-btn, .holes-up-btn-sm {
  padding: 8px 4px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  transition: all var(--transition);
}
.final-score-btn:hover, .holes-up-btn-sm:hover {
  border-color: var(--navy);
  color: var(--navy);
}
.final-score-btn.active, .holes-up-btn-sm.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.match-number::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: 10px;
  background: var(--border-mid);
  margin: 0 8px;
  vertical-align: middle;
}

.ticker-wrap {
  background: var(--navy);
  border-bottom: 1px solid rgba(201,168,76,0.2);
  overflow: hidden;
  padding: 0;
  height: 28px;
}
.ticker-inner {
  display: flex;
  align-items: center;
  height: 100%;
}
.ticker-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--navy);
  padding: 0 12px;
  white-space: nowrap;
  flex-shrink: 0;
  border-right: 1px solid rgba(201,168,76,0.2);
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 1;
}
.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker 28s linear infinite;
  gap: 0;
  padding-left: 16px;
}
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 0 12px;
}
.ticker-winner { color: var(--white); font-weight: 500; }
.ticker-score  { color: var(--gold); font-size: 10px; font-weight: 600; }
.ticker-loser  { color: rgba(255,255,255,0.45); }
.ticker-sep    { color: rgba(201,168,76,0.4); padding: 0 4px; }

.ticker-comp {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.7;
  margin-right: 4px;
}

/* ---- SEARCH ---- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-search {
  position: relative;
}

.header-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
}

.search-icon {
  width: 13px;
  height: 13px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.header-search-input {
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 12px;
  width: 150px;
  padding: 0;
}

.header-search-input::placeholder {
  color: rgba(255,255,255,0.35);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: var(--white);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 500;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-results.open {
  display: block;
}

.search-group-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px 5px;
}

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item:focus {
  background: var(--off-white);
  outline: none;
}

.sr-players {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.sr-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}
.sr-dot.live     { background: var(--gold); }
.sr-dot.complete { background: var(--green); }
.sr-dot.walkover { background: var(--amber); }

.sr-vs {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.sr-name mark {
  background: var(--gold-light);
  color: var(--gold-mid);
  border-radius: 2px;
  padding: 0 1px;
}

.sr-score {
  font-size: 11px;
  color: var(--green);
  font-weight: 500;
  margin-bottom: 2px;
}

.sr-meta {
  font-size: 10px;
  color: var(--text-muted);
}

.search-empty {
  padding: 16px 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.search-highlight {
  animation: flashCard 1.2s ease;
}

@keyframes flashCard {
  0%   { background: var(--gold-light); }
  100% { background: var(--white); }
}

/* ---- MOBILE SEARCH PANEL ---- */
.search-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
}

.search-mobile-panel {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--navy);
  border-bottom: 1px solid rgba(201,168,76,0.25);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 600;
  padding: 12px 16px;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.search-mobile-panel.open {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.search-mobile-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.search-mobile-inner .search-icon {
  width: 14px;
  height: 14px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.search-mobile-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 14px;
  padding: 0;
}

.search-mobile-input::placeholder {
  color: rgba(255,255,255,0.35);
}

.search-mobile-close {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color var(--transition);
}

.search-mobile-close:hover {
  color: var(--white);
}

.search-results-mobile {
  margin-top: 8px;
  position: static;
  width: 100%;
  max-height: 55vh;
  box-shadow: none;
  border-radius: var(--radius-md);
}

@media (max-width: 640px) {
  .search-toggle-btn { display: flex; }
  .header-search-wrap { background: none; border: none; padding: 0; }
  .header-search-input { display: none; }
  .search-results:not(.search-results-mobile) { display: none !important; }
  .btn-admin-hidden { display: none !important; }
}

/* ---- HELP BUTTON & MODAL ---- */
.help-fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy);
  border: 1.5px solid rgba(201,168,76,0.4);
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  z-index: 350;
  transition: background var(--transition), border-color var(--transition);
  cursor: pointer;
}
.help-fab:hover {
  background: #162d5e;
  border-color: var(--gold);
}

.help-modal-bd {
  padding: 0 0 28px;
}
.help-section {
  padding: 18px 20px 0;
}
.help-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-mid);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.help-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.help-section p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 8px;
}
.help-section p:last-child {
  margin-bottom: 0;
}
.help-section strong {
  color: var(--text-primary);
  font-weight: 500;
}
.help-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.help-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 10px;
  white-space: nowrap;
}
.help-tag.official  { background: var(--gold-light);  color: var(--gold-mid);  border: 1px solid var(--official-border); }
.help-tag.spectator { background: #e8eeff; color: #3d5a9a; border: 1px solid #c8d4f0; }
.help-tag.live      { background: var(--official-bg); color: var(--gold-mid); }
.help-tag.complete  { background: var(--green-light); color: var(--green); }

/* ---- PWA INSTALL BANNER ---- */
.pwa-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy);
  border-top: 1px solid rgba(201,168,76,0.3);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 400;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.pwa-banner.visible {
  transform: translateY(0);
}
.pwa-banner-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}
.pwa-banner-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pwa-banner-text {
  flex: 1;
  min-width: 0;
}
.pwa-banner-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2px;
}
.pwa-banner-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}
.pwa-banner-sub strong {
  color: var(--gold);
  font-weight: 500;
}
.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pwa-btn-add {
  background: var(--gold);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: opacity var(--transition);
}
.pwa-btn-add:hover { opacity: 0.85; }
.pwa-btn-dismiss {
  color: rgba(255,255,255,0.4);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  transition: color var(--transition);
}
.pwa-btn-dismiss:hover { color: rgba(255,255,255,0.7); }