#hole-result-tile.hidden {
  display: none !important;
}

/* Generic hidden utility */
.hidden {
  display: none !important;
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9998;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: rgb(200, 190, 164);
  padding: 24px 32px;
  border-radius: 12px;
  max-width: 500px;
  text-align: left;
  color: #333;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Nine Holes summary styling to match site brand */
#nineholes-summary-modal .modal-content {
  background: linear-gradient(180deg, #f7f4ea 0%, #efe7ca 100%);
  color: #14351f;
  max-width: 720px;
  padding: 20px 28px;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}

/* Make the summary heading use the Shrikhand display font */
#nineholes-summary-modal .modal-content h2 {
  font-family: 'Shrikhand', cursive;
  font-size: 1.6rem;
  margin: 0 0 10px 0;
  color: #0f3a1a;
}

/* Make the Nine Holes info modal match site styling */
#nineholes-modal .modal-content {
  background: linear-gradient(180deg, #f7f4ea 0%, #efe7ca 100%);
  color: #14351f;
  max-width: 720px;
  padding: 20px 28px;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}

#nineholes-modal .modal-content h2 {
  font-family: 'Shrikhand', cursive;
  font-size: 1.5rem;
  margin: 0 0 10px 0;
  color: #0f3a1a;
}

#close-nineholes-modal {
  background-color: #2e7d32;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'Shrikhand', cursive;
  cursor: pointer;
}

#close-nineholes-modal:hover { filter: brightness(1.05); }

/* Help modal styling to match site */
#help-modal .modal-content {
  background: linear-gradient(180deg, #d6ccab 0%, #efe7ca 100%);
  color: #14351f;
  max-width: 680px;
  padding: 20px 28px;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}

#help-modal .modal-content h2 {
  font-family: 'Shrikhand', cursive;
  font-size: 1.4rem;
  margin: 0 0 8px 0;
  color: #0f3a1a;
}

#close-help {
  background-color: #2e7d32;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'Shrikhand', cursive;
  cursor: pointer;
}

#close-help:hover { filter: brightness(1.05); }
.summary-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 18px;
}

.summary-row {
  display: grid;
  grid-template-columns: 72px 72px 1fr 88px; /* hole / par / golfer / score */
  gap: 10px;
  align-items: center;
}
.summary-row > div {
  background: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
}
.summary-row .hole-cell { font-size: 0.95rem; color: #444; }
.summary-row .par-cell { color: #2e7d32; font-size: 0.95rem; }
.summary-row .golfer-cell { font-size: 0.95rem; color: #12331f; font-weight: 600; text-align: left; padding-left: 12px; }
.summary-row .score-cell { font-size: 1.05rem; }
.summary-grid .green { background: linear-gradient(180deg,#2e7d32,#276a2b); color: #fff; box-shadow: 0 6px 18px rgba(46,125,50,0.18); }
.summary-grid .yellow { background: linear-gradient(180deg,#f0d72f,#d7b21f); color: #111; box-shadow: 0 6px 18px rgba(240,215,47,0.12); }
.summary-grid .red { background: linear-gradient(180deg,#d9534f,#b33b38); color: #fff; box-shadow: 0 6px 18px rgba(217,83,79,0.12); }

.summary-total {
  font-family: 'Shrikhand', cursive;
  font-size: 1.05rem;
  color: #12421e;
  margin-top: 8px;
}

#play-again-btn, #close-summary-btn {
  background-color: #2e7d32;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'Shrikhand', cursive;
  font-size: 16px;
  cursor: pointer;
}
#play-again-btn:hover, #close-summary-btn:hover { filter: brightness(1.05); }

@media (max-width: 720px) {
  #nineholes-summary-modal .modal-content { padding: 16px 18px; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .summary-grid > div { padding: 8px; }
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9998;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: rgb(200, 190, 164);
  padding: 24px 32px;
  border-radius: 12px;
  max-width: 500px;
  text-align: left;
  color: #333;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
body {
  font-family: Arial;
  text-align: center;
  background-color: #a1cd87; 
  color: #080808;
}
video {
  border: 3px solid #fff;
  margin-top: 20px;
}
input {
  padding: 10px;
  font-size: 16px;
}
button {
  padding: 10px;
  font-size: 16px;
  margin-left: 5px;
}
.guess-box {
  margin: 20px auto;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap; /* optional if screen is narrow */
}
#guess {
  padding: 10px;
  font-size: 1rem;
  border: 2px solid #2e7d32;
  border-radius: 6px;
  background-color: #f9f9f9;
  color: #2e7d32;
  box-sizing: border-box;
  width: 100%;
}

#submit-btn, #give-up-btn {
  font-family: 'Shrikhand', cursive;
  color: #2e7d32;
  border-radius: 6px;
  border: none;
  background-color: #ffffff;
}

#stroke-btn {
  font-family: 'Shrikhand', cursive;
  color: #2e7d32;
  border-radius: 6px;
  border: none;
  background-color: #ffffff;
  position: relative;
}

.stroke-counter {
  position: absolute;
  top: -12px;
  right: -12px;
  /*font-family: 'Shrikhand', cursive;*/
  font-weight: lighter;
  font-size: 15px;
  color: white;
  background-color: #2e7d32;
  padding: 2px 6px;
  border-radius: 10px;
  border: none;
  display: inline-block;
  min-width: 24px;
  text-align: center;
  line-height: 1.2;
}

#stroke-btn:hover {
  background-color: #f7efc9;
}

/* Visual state when stroke has been used (disabled for this round/hole) */
.stroke-used {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(20%);
}

#submit-btn:hover {
  background-color: #c8f0b7;
}

#give-up-btn:hover {
  background-color: #e8bfbf;
}

.tile-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: center;
}

/* Leaderboard ad (468x60) - reduce gap to grid */
.leaderboard-ad {
  margin-top: 8px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

/* Custom autocomplete dropdown */
.guess-input-wrapper {
  position: relative;
  width: 200px;
  flex-shrink: 0;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #2e7d32;
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-radius: 4px;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
  color: #2e7d32;
}

.autocomplete-item:hover {
  background-color: #e8f5e9;
}

.autocomplete-item.selected {
  background-color: #c8e6c9;
}
.tile {
  width: 100px;
  height: 60px;
  background-color: #e2e2e2;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}
.tile.header {
  background-color: #333;
  color: white;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


.grid {
  display: grid;
  grid-template-columns: repeat(7, 100px);
  grid-auto-rows: 60px;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.tile.grid-tile {
  background-color: #f0f0f0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
}
.match-green {
  background-color: #2e7d32 !important;
  color: #ffffff;
  font-weight: bold;
  border: none;
  box-shadow: 0 0 8px rgba(46, 125, 50, 0.6);
  transition: background-color 0.3s ease;
}
.match-yellow {
  background-color: #f0d72f !important;
  color: #ffffff;
  font-weight: bold;
  border: none;
  box-shadow: 0 0 8px #f0d72f;
  transition: background-color 0.3s ease;
}

/* Top Banner */
#top-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  height: 120px;
  background-color: #2e7d32;
  padding: 0 24px;
}

#banner-logo {
  height: 100px;
  width: auto; /* preserves aspect ratio */
}

#banner-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

#banner-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#mode-select {
  padding: 6px 12px;
  font-family: 'Shrikhand', cursive;
  font-size: 18px;
  color: #2e7d32;
  border-radius: 6px;
  border: none;
}

/* Style the difficulty select to match header controls */
#difficulty-select {
  padding: 6px 12px;
  font-family: 'Shrikhand', cursive;
  font-size: 28px;
  color: #2e7d32;
  border-radius: 6px;
  border: none;
  background-color: #ffffff;
  cursor: pointer;
}

#difficulty-select:hover {
  background-color: #e1e0e0;
}

#difficulty-select:focus {
  outline: 2px solid rgba(46,125,50,0.25);
}

/* Circular slider style for difficulty toggle */
#difficulty-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  user-select: none;
}

.difficulty-label {
  font-family: 'Shrikhand', cursive;
  color: #ffffff;
  font-size: 20px;
}

.toggle-wrap {
  width: 56px;
  height: 32px;
  display: flex;
  align-items: center;
}

.toggle-track {
  position: relative;
  width: 56px;
  height: 32px;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(46,125,50,0.15);
}

.toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2e7d32;
  transition: transform 220ms cubic-bezier(.2,.9,.2,1), background 200ms ease;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

/* State when toggled 'hard' - knob slides to the right and color flips */
#difficulty-toggle[aria-checked="true"] .toggle-knob {
  transform: translateX(24px);
  background: #c0392b; /* red-ish for hard */
}

#difficulty-toggle[aria-checked="true"] .toggle-track {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(192,57,43,0.12);
}

#difficulty-toggle:focus {
  outline: none;
}

#difficulty-toggle:focus .toggle-track {
  box-shadow: 0 0 0 4px rgba(46,125,50,0.12);
}

#sub-title {
  font-family: 'Shrikhand', cursive;
  color: #2e7d32;
  border-radius: 6px;
  border: none;
}

@media (max-width: 600px) {
  #top-banner {
    flex-direction: column;
    height: auto;
    padding: 16px;
  }

  #banner-logo {
    height: 80px;
  }
}

/* ─── Help Modal ─────────────────────────────────────────────────────────── */

#hole-result-tile {
  display: none;
  background-color: #f4dac3;
  border: 2px solid #2e7d32;
  padding: 20px;
  color: #2e7d32;
  text-align: center;
  margin: 30px auto;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#hole-result-tile.visible {
  display: block;
}

#hole-result-title {
  font-family: 'Shrikhand', cursive;
  font-size: 20px;
  margin-bottom: 16px;
}

#hole-result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

#hole-result-actions button {
  background-color: #ffffff;
  color: #2e7d32;
  border: 2px solid #2e7d32;
  font-family: 'Shrikhand', cursive;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s ease;
}

#hole-result-actions button:hover {
  background-color: #d8f2cd;
}

#help-button {
  background-color: #ffffff;
  color: #2e7d32;
  border: 2px solid #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Shrikhand', cursive;
  font-size: 18px;
}

#help-button:hover {
  background-color: #e1e0e0;
}

#nine-holes-button {
  background-color: #ffffff;
  color: #2e7d32;
  border: 2px solid #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Shrikhand', cursive;
  font-size: 18px;
}

#nine-holes-button:hover {
  background-color: #e1e0e0;
}

.contact-button {
  background-color: #ffffff;
  color: #2e7d32;
  border: 2px solid #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Shrikhand', cursive;
  font-size: 18px;
  text-decoration: none;
}
.contact-button:hover {
  background-color: #e1e0e0;
}

/* Small 'NEW' badge for Play Nine Holes button */
.contact-button.play-nine {
  position: relative; /* allow badge positioning */
  padding-right: 28px; /* make space for badge */
}
.new-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff5a3c;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  padding: 2px 6px;
  border-radius: 12px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  pointer-events: none;
}

@media (max-width: 600px) {
  .new-badge { top: -4px; right: -4px; font-size: 10px; padding: 1px 5px; }
  .contact-button.play-nine { padding-right: 20px; }
}

/* Donation button (BuyMeACoffee) */
.donate-btn {
  display: inline-block;
  background: #ff813f; /* BuyMeACoffee orange */
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  font-size: 1rem;
}
.donate-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.15);
}
.donate-btn:active { transform: translateY(-1px); }

@media (max-width: 600px) {
  .donate-btn { font-size: 0.95rem; padding: 8px 12px; }
}


/* ─── End Round Tile (Inline Replacement) ───────────────────────────────── */
#end-round-tile {
  display: none;
  background-color: #f4dac3;
  border: 2px solid #2e7d32;
  padding: 20px;
  color: #2e7d32;
  text-align: center;
  margin: 30px auto;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#end-round-tile.visible {
  display: block;
}

#end-round-message {
  font-family: 'Shrikhand', cursive;
  font-size: 20px;
  margin-bottom: 16px;
}

#end-round-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

#end-round-actions button {
  background-color: #ffffff;
  color: #2e7d32;
  border: 2px solid #2e7d32;
  font-family: 'Shrikhand', cursive;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s ease;
}

#end-round-actions button:hover {
  background-color: #d8f2cd;
}

/* Shake Animation for invalid guess */
.feedback-message {
  font-family: 'Shrikhand', cursive;
  margin-top: 8px;
  font-size: 1rem;
  color: rgb(246, 50, 50);
  text-align: center;
  min-height: 1.2em; /* prevents layout shift */
}

.stroke-hint {
  margin-top: 8px;
  font-weight: bold;
  color: #2e7d32;
  min-height: 1.2em;
  position: relative;
  z-index: 2;
}

.shake {
  animation: shake 0.3s;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

/*Toast for clipboard message*/
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* Removed Adsterra widget styles */

/* Removed non-Google ad styles (Adsterra) for AdSense review and to avoid serving non-authorized ad units. */

/* Separate boxes for marker and score to improve readability */
.marker-box, .score-box {
  background: linear-gradient(135deg, #f4dac3, #d6c2a1);
  border: 3px solid #2e7d32;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  text-align: center;
}
.marker-box { margin-bottom: 10px; }
.score-box .score-badge { font-size: 1.1rem; padding: 10px 14px; }
