* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f6f7; color: #222;
}
.topbar { background: #1A5C3A; padding: 12px 16px; }
.topbar .brand { color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; }
.wrap { max-width: 480px; margin: 0 auto; padding: 16px; padding-bottom: 48px; }
h1 { font-size: 19px; margin: 4px 0 14px; }
h3 { font-size: 13px; color: #666; margin: 18px 0 8px; }
.muted { color: #888; }
.small { font-size: 11px; }
.back { display: inline-block; color: #1A5C3A; text-decoration: none; font-size: 13px; margin-bottom: 10px; }
.section { margin-bottom: 14px; }

.card {
  display: block; background: #fff; border: 1px solid #e8e8e8; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; text-decoration: none; color: inherit;
}
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.chip { font-size: 10px; padding: 2px 9px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.chip.live { background: #FFEBEE; color: #C62828; }
.chip.draft { background: #FFF8E1; color: #F57F17; }
.chip.done { background: #eee; color: #999; }

.btn-primary, .btn-outline, .btn-link {
  display: inline-block; text-align: center; text-decoration: none; cursor: pointer;
  font-size: 14px; font-weight: 600; border-radius: 8px; padding: 11px 16px; width: 100%;
}
.btn-primary { background: #1A5C3A; color: #fff; border: none; }
.btn-outline { background: #fff; color: #1A5C3A; border: 1px solid #1A5C3A; margin-bottom: 8px; }
.btn-link { background: none; border: none; color: #888; font-weight: 400; text-decoration: underline; width: auto; padding: 0; }
.btn-icon { background: none; border: 1px solid #eee; border-radius: 50%; width: 28px; height: 28px; color: #aaa; cursor: pointer; font-size: 16px; }

.form label { display: block; font-size: 11px; color: #888; margin: 10px 0 3px; }
.form input, .form select {
  width: 100%; padding: 9px 11px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; background: #fff;
}
.form.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.form.inline input, .form.inline select { width: auto; flex: 1; min-width: 110px; }
.form button { margin-top: 14px; }

.error { color: #B71C1C; background: #FFEBEE; padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.ok { color: #1B5E20; background: #E8F5E9; padding: 8px 12px; border-radius: 8px; font-size: 13px; }

.link-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.play-link { font-size: 11px; color: #1A5C3A; word-break: break-all; flex: 1; text-decoration: underline; }
.link-row .btn-icon { flex-shrink: 0; font-size: 12px; }

.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.step { flex: 1; text-align: center; text-decoration: none; font-size: 12px; padding: 7px 4px; border-radius: 20px; background: #eee; color: #666; }
.step.on { background: #1A5C3A; color: #fff; font-weight: 600; }

.pl-row { display: flex; justify-content: space-between; align-items: flex-start; background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.pl-row code { font-size: 10px; background: #f5f5f5; padding: 1px 4px; border-radius: 4px; }

.grp-block { border: 1px solid #eee; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.grp-hdr { background: #1A5C3A; color: #fff; padding: 7px 12px; font-size: 12px; font-weight: 600; }
.grp-row { padding: 7px 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.grp-row:last-child { border-bottom: none; }

.freshness { display: flex; align-items: center; gap: 5px; font-size: 10px; color: #aaa; margin-bottom: 8px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #C62828; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.match-card { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 10px 12px; margin-bottom: 9px; }
.match-top { display: flex; align-items: center; gap: 8px; }
.match-names { flex: 1; font-size: 12px; line-height: 1.4; min-width: 0; }
.match-score { font-size: 12px; font-weight: 700; color: #1A5C3A; text-align: center; min-width: 92px; flex-shrink: 0; }
.hole-ribbon { display: flex; gap: 2px; margin: 8px 0 6px; }
.hdot { flex: 1; height: 14px; border-radius: 3px; background: #eee; }
.hdot.a { background: #66BB6A; }
.hdot.b { background: #42A5F5; }
.hdot.draw { background: #ccc; }
.match-status { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: #888; }
.match-status .finished { color: #1B5E20; font-weight: 600; }
.match-status .playing { color: #C62828; font-weight: 600; }

.lb-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.lb-table th, .lb-table td { padding: 8px 10px; font-size: 13px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.lb-table th { background: #f5f5f5; font-size: 10px; color: #888; text-transform: uppercase; }
.lb-table .rank { width: 24px; color: #888; }
.lb-table .val { font-weight: 700; color: #1B5E20; }
.lb-table .thru { color: #888; font-size: 11px; }
.lb-table a { color: inherit; text-decoration: none; font-weight: 600; }

.totals-bar { display: flex; background: #1A5C3A; color: #fff; border-radius: 10px; padding: 10px; margin-bottom: 14px; }
.totals-bar div { flex: 1; text-align: center; }
.totals-bar b { display: block; font-size: 20px; margin-top: 2px; }

.hole-row { display: flex; justify-content: space-between; align-items: center; background: #fff; border-bottom: 1px solid #f0f0f0; padding: 10px 4px; }
.hole-meta b { font-size: 16px; margin-right: 8px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.step-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #1A5C3A; background: #fff; color: #1A5C3A; font-size: 18px; cursor: pointer; }
.step-btn.main { background: #1A5C3A; color: #fff; border: none; }
.step-val { min-width: 22px; text-align: center; font-size: 17px; font-weight: 600; }

.scroll-x { overflow-x: auto; }
.sc-table { border-collapse: collapse; font-size: 12px; }
.sc-table td { padding: 5px 7px; text-align: center; border-bottom: 1px solid #f0f0f0; }
