/* =============================================
   Troy Pines Bucket Golf — style.css
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --green:       #2d5a1b;
  --green-mid:   #3d7a27;
  --green-light: #5a9e3a;
  --green-dark:  #1e3d12;
  --tan:         #f5f0e8;
  --tan-dark:    #e0d8c4;
  --gold:        #c9a227;
  --gold-light:  #e8c547;
  --red:         #c0392b;
  --text:        #1a1a1a;
  --text-mid:    #444;
  --text-muted:  #888;
  --white:       #fff;
}

html, body {
  font-family: 'Barlow', sans-serif;
  background: var(--tan);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.header {
  background: var(--green);
  border-bottom: 4px solid var(--gold);
}
.header-inner {
  padding: 14px 16px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.header img {
  height: 64px;
  object-fit: contain;
  display: block;
}
.header h1 {
  font-family: 'Teko', sans-serif;
  color: var(--gold-light);
  font-size: 2rem;
  letter-spacing: 2px;
  font-weight: 700;
  line-height: 1;
}
.header p {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}

/* ── NAV ── */
.nav {
  background: var(--green-dark);
  display: flex;
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 200;
}
.nav button {
  flex: 1;
  padding: 11px 4px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  color: rgba(255,255,255,0.5);
  font-family: 'Teko', sans-serif;
  font-size: 1rem;
  letter-spacing: .5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
  touch-action: manipulation;
}
.nav button .nav-icon { font-size: 18px; }
.nav button.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold-light);
  background: rgba(255,255,255,0.06);
}
.nav button:hover:not(.active) {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

/* ── PAGES ── */
.page {
  display: none;
  padding: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: 40px;
}
.page.active { display: block; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: filter .15s;
  letter-spacing: .2px;
}
.btn:active { filter: brightness(.9); }
.btn-green  { background: var(--green); color: #fff; }
.btn-gold   { background: var(--gold);  color: #000; }
.btn-red    { background: var(--red);   color: #fff; }
.btn-full   { width: 100%; padding: 13px; }
.btn-sm     { padding: 7px 12px; font-size: 13px; }

/* ── INPUTS ── */
input {
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  padding: 10px 12px;
  border: 1.5px solid var(--tan-dark);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
input:focus {
  outline: none;
  border-color: var(--green-mid);
}
/* Hide camera input */
#cameraInput { display: none; }

/* ── SECTION TITLE ── */
.sec-title {
  font-family: 'Teko', sans-serif;
  font-size: 1.1rem;
  color: var(--green);
  letter-spacing: .5px;
  padding: 10px 0 6px;
  border-bottom: 2px solid var(--tan-dark);
  margin-bottom: 10px;
}

/* ── ADD ROW ── */
.add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.add-row input { flex: 1; }

/* ── CAMERA STRIP ── */
.camera-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1e3d12, #2d5a1b);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  cursor: pointer;
  touch-action: manipulation;
  transition: filter .15s;
}
.camera-strip:active { filter: brightness(.88); }
.camera-icon-wrap {
  width: 50px;
  height: 50px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.camera-icon-wrap svg { width: 28px; height: 28px; }
.camera-text { flex: 1; }
.camera-text strong {
  display: block;
  font-family: 'Teko', sans-serif;
  font-size: 1.15rem;
  color: var(--gold-light);
  letter-spacing: .5px;
  line-height: 1.1;
}
.camera-text span {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  display: block;
  margin-top: 2px;
}
.camera-arrow {
  color: var(--gold-light);
  font-size: 22px;
  flex-shrink: 0;
}

/* ── PHOTO MODAL ── */
.photo-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 998;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.photo-modal.open { display: flex; }
.photo-modal img {
  max-width: 100%;
  max-height: 65vh;
  border-radius: 10px;
  border: 2px solid var(--gold);
  object-fit: contain;
}
.photo-caption {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}
.photo-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.photo-close {
  position: fixed;
  top: 12px;
  right: 12px;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  touch-action: manipulation;
}

/* ── NINE SELECTOR ── */
.nine-selector {
  display: flex;
  margin-bottom: 14px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--green);
}
.nine-btn {
  flex: 1;
  padding: 10px;
  background: var(--white);
  border: none;
  font-family: 'Teko', sans-serif;
  font-size: 1.05rem;
  letter-spacing: .5px;
  cursor: pointer;
  color: var(--green);
  touch-action: manipulation;
  transition: background .15s, color .15s;
}
.nine-btn:first-child { border-right: 1px solid var(--tan-dark); }
.nine-btn.active { background: var(--green); color: var(--gold-light); }

/* ── PLAYER CARDS ── */
.player-card {
  background: var(--white);
  border-radius: 10px;
  border: 1.5px solid var(--tan-dark);
  margin-bottom: 10px;
  overflow: hidden;
}
.player-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--green);
  cursor: pointer;
  user-select: none;
}
.player-card-name {
  font-family: 'Teko', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: .5px;
}
.player-card-score {
  display: flex;
  align-items: center;
  gap: 8px;
}
.total-badge {
  font-family: 'Teko', sans-serif;
  font-size: 1.3rem;
  color: var(--gold-light);
  font-weight: 700;
}
.diff-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  color: #fff;
}
.diff-under { background: rgba(30,120,30,.7); }
.diff-over  { background: rgba(180,40,40,.7); }
.del-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  touch-action: manipulation;
}
.del-btn:active { color: #fff; }
.toggle-arrow {
  color: rgba(255,255,255,.55);
  font-size: 13px;
  transition: transform .2s;
  display: inline-block;
}
.toggle-arrow.open { transform: rotate(180deg); }

/* Nine-total chips in card header */
.nine-totals {
  display: flex;
  gap: 5px;
}
.nine-tot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,0.2);
  border-radius: 5px;
  padding: 2px 7px;
}
.nine-tot-label { font-size: 9px; color: rgba(255,255,255,0.75); letter-spacing: .3px; }
.nine-tot-val   { font-family: 'Teko', sans-serif; font-size: 1rem; color: var(--gold-light); line-height: 1.1; }

/* ── HOLE GRID ── */
.hole-grid { padding: 10px 12px 12px; }
.hole-grid.collapsed { display: none; }
.hole-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.hole-row:last-child { margin-bottom: 0; }
.hole-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f9f9f6;
  border: 1px solid var(--tan-dark);
  border-radius: 8px;
  padding: 6px 4px;
  gap: 3px;
}
.hole-label   { font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: .3px; }
.hole-par-txt { font-size: 10px; color: var(--green); font-weight: 600; }

/* ── SCORE SELECTOR ── */
.score-sel {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.score-dec, .score-inc {
  width: 28px;
  height: 38px;
  border: 1.5px solid var(--tan-dark);
  border-radius: 6px;
  background: var(--white);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-mid);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1;
}
.score-dec:active, .score-inc:active { background: var(--tan-dark); }
.score-display {
  flex: 1;
  height: 38px;
  border: 1.5px solid var(--tan-dark);
  border-radius: 6px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  transition: background .1s, border-color .1s;
}
.score-display.empty  { color: #ccc; font-size: 14px; }
.score-display.bucket { border-color: #5b00b5; background: #ede0ff; color: #5b00b5; }
.score-display.eagle  { border-color: #0a5a0a; background: #c8f0c8; color: #0a5a0a; }
.score-display.birdie { border-color: #1a7a1a; background: #e8f7e8; color: #1a6b1a; }
.score-display.bogey  { border-color: #b09030; background: #fff9e0; color: #8a6d10; }
.score-display.double { border-color: var(--red); background: #fff0f0; color: var(--red); }
.score-display.triple { border-color: #8b0000; background: #ffe0e0; color: #8b0000; }

/* ── SUMMARY CARD ── */
.summary-card {
  background: var(--white);
  border-radius: 10px;
  border: 1.5px solid var(--tan-dark);
  padding: 12px;
  margin-bottom: 12px;
}
.summary-card h3 {
  font-family: 'Teko', sans-serif;
  color: var(--green);
  font-size: 1.1rem;
  margin-bottom: 8px;
  letter-spacing: .5px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--tan-dark);
}
.summary-row:last-child { border-bottom: none; }
.summary-name  { font-weight: 600; font-size: 15px; }
.summary-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.summary-total { font-size: 1.1rem; font-weight: 700; }
.summary-diff  { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: var(--tan-dark); }
.summary-nine  { font-size: 11px; color: var(--text-muted); }
.s-under { color: #1a6b1a; }
.s-over  { color: var(--red); }
.s-even  { color: var(--text-mid); }

/* ── SCREENSHOT NOTICE ── */
.screenshot-notice {
  background: var(--green-mid);
  border: 2px dashed var(--gold);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  margin-bottom: 10px;
}
.screenshot-notice p { color: #fff; font-size: 15px; font-weight: 500; line-height: 1.4; }
.screenshot-notice strong { color: var(--gold-light); font-weight: 700; }

/* ── ACTION STACK ── */
.action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

/* ── MAP ── */
.map-wrap { position: relative; margin-bottom: 12px; }
.map-wrap img {
  width: 100%;
  border-radius: 10px;
  border: 2px solid var(--green-light);
  display: block;
  cursor: pointer;
}
.map-hint { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.map-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.map-modal.open { display: flex; }
.map-modal img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  border: 2px solid var(--gold);
}
.map-close {
  position: fixed;
  top: 12px;
  right: 12px;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  touch-action: manipulation;
}

/* ── LEADERBOARD ── */
.lb-banner {
  background: var(--green);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lb-banner h2 {
  font-family: 'Teko', sans-serif;
  color: var(--gold-light);
  font-size: 1.4rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lb-date-txt { font-size: 11px; color: rgba(255,255,255,.65); }
.lb-entry {
  background: var(--white);
  border-radius: 10px;
  border: 1.5px solid var(--tan-dark);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lb-entry.gold-row   { border-color: var(--gold); background: #fffdf0; }
.lb-entry.silver-row { border-color: #b0b0b0; }
.rank-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tan-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Teko', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.rank-gold   { background: var(--gold); color: #000; }
.rank-silver { background: #b0b0b0; color: #fff; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 700; font-size: 15px; color: var(--green); }
.lb-meta { font-size: 11px; color: var(--text-muted); }
.lb-right { text-align: right; flex-shrink: 0; }
.lb-score-big { font-family: 'Teko', sans-serif; font-size: 1.6rem; font-weight: 700; line-height: 1; }
.lb-diff { font-size: 12px; font-weight: 600; }
.lb-note {
  background: rgba(45,90,27,0.08);
  border: 1px solid rgba(45,90,27,0.2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ── FORM CARDS ── */
.form-card {
  background: var(--white);
  border-radius: 10px;
  border: 1.5px solid var(--tan-dark);
  padding: 12px;
  margin-bottom: 12px;
  margin-top: 8px;
}
.form-card h3 {
  font-family: 'Teko', sans-serif;
  color: var(--green);
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.form-field { margin-bottom: 8px; }
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

/* ── CHAMPION CARDS ── */
.champ-card {
  background: var(--white);
  border-radius: 10px;
  border: 1.5px solid var(--tan-dark);
  padding: 14px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.champ-pinecone {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 52px;
}
.champ-info { flex: 1; min-width: 0; }
.champ-event { font-family: 'Teko', sans-serif; font-size: .95rem; color: var(--green); letter-spacing: .3px; }
.champ-name  { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.champ-date  { font-size: 12px; color: var(--text-muted); }
.champ-right { text-align: right; flex-shrink: 0; }
.champ-score { font-family: 'Teko', sans-serif; font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1; }
.champ-diff  { font-size: 12px; font-weight: 600; }

/* ── CHAMPIONS HEADING ── */
.champs-heading { display: flex; align-items: center; gap: 8px; }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 36px 16px; color: var(--text-muted); }
.empty-icon { font-size: 44px; opacity: .35; margin-bottom: 8px; }

/* ── RESPONSIVE ── */
@media (min-width: 480px) {
  .header h1 { font-size: 2.4rem; }
  .nav button { font-size: 1.05rem; }
}
