
#scorecard {
  width: 160px;
  font-family: 'Patrick Hand', cursive;
  background: rgb(63, 147, 2);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  color: #373333;
}

#hole-status {
  width: 180px;
  font-family: 'Shrikhand', cursive;
  color: #2e7d32;
  text-align: center;
}

#hole-status p {
  margin: 8px 0;
  font-size: 1.2em;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px rgba(255,255,255,0.6);
}

/* New golf-style hole marker */
.hole-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.marker-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6bbf59, #2e7d32);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(46,125,50,0.35), inset 0 2px 0 rgba(255,255,255,0.2);
  border: 3px solid #ffffffaa;
}
.marker-number {
  font-family: 'Shrikhand', cursive;
  font-size: 1.6rem;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.marker-label {
  font-family: 'Shrikhand', cursive;
  font-size: 1rem;
  color: #2e7d32;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  margin-bottom: -6px;
}
.marker-par {
  background: #f1c27d;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: bold;
  color: #2e4e23;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-size: 0.95rem;
}

/* Score badge */
.hole-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.score-label {
  font-size: 0.9rem;
  color: #2e7d32;
  font-weight: bold;
}
.score-badge {
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 20px;
  font-weight: bold;
  color: #2e7d32;
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
  min-width: 44px;
  text-align: center;
}

.score-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  font-weight: bold;
  border-bottom: 2px solid rgba(255,255,255,0.5);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  row-gap: 6px;
}

.score-cell {
  text-align: center;
  padding: 4px;
  background-color: rgb(195, 245, 179);
  border-radius: 6px;
  position: relative;
  min-width: 40px;
}

/* Golf scorecard shapes */
.score-value {
  position: relative;
  display: inline-block;
  font-weight: bold;
  min-width: 28px;
  line-height: 1;
}

/* Hole in One: Triangle */
.score-value.hole-in-one::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  /*
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 32px solid currentColor;
  pointer-events: none;
  */
}

/* Eagle: Double Circle */
.score-value.eagle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 50%;
  pointer-events: none;
}

.score-value.eagle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 50%;
  pointer-events: none;
}

/* Birdie: Circle */
.score-value.birdie::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border: 2px solid currentColor;
  border-radius: 50%;
  pointer-events: none;
}

/* Par: Blank (no shape) */
.score-value.par::before {
  display: none;
}

/* Bogey: Square */
.score-value.bogey::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border: 2px solid currentColor;
  pointer-events: none;
}

/* Double Bogey: Double Square */
.score-value.double-bogey::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  pointer-events: none;
}

.score-value.double-bogey::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  pointer-events: none;
}

/* Position score text above the shape */
.score-value {
  position: relative;
  z-index: 2;
}

#hole-result-modal .modal-content {
  background-color: #f4dac3;
  border: 4px #2e7d32 solid;
  font-family: 'Shrikhand', cursive;
  color: #2e7d32;
  text-align: center;
}

.summary-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.summary-row {
  display: grid;
  grid-template-columns: 72px 72px 1fr 88px;
  gap: 8px;
  align-items: center;
}
.summary-row > div {
  padding: 6px 8px;
  border-radius: 6px;
  background: #fff;
}
.summary-total {
  margin-top: 16px;
  font-weight: bold;
}
.score-cell.green {
  background-color: #4CAF50;
  color: white;
}
.score-cell.yellow {
  background-color: #FFEB3B;
  color: black;
}
.score-cell.red {
  background-color: #F44336;
  color: white;
}
.score-cell.gold {
  background-color: #e7bf48;
  color: black;
}

/* Row layout: left panel, centered video, right panel */
.play-row {
  display: flex;
  align-items: flex-start;
  justify-content: center; /* centers the whole row */
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 12px auto;
}

.play-row #swing {
  order: 2;
  flex: 0 1 640px; /* prefer 640px but allow shrinking */
  max-width: 100%;
  height: auto;
  display: block;
}

.play-row #scorecard { order: 1; }
.play-row #hole-status { order: 3; }

/* When the screen is too narrow, stack the panels below the video */
@media (max-width: 1000px) {
  .play-row { flex-direction: column; align-items: center; }
  .play-row #scorecard, .play-row #hole-status {
    width: calc(100% - 32px);
    margin: 8px auto;
  }
  .play-row #swing { width: 100%; max-height: 50vh; }
}

/* Ensure video stays centered and responsive */
#swing {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: 640px; /* preferred width on large screens */
  height: auto;
}

/* Prevent overlap: when viewport is too narrow to host video + both panels side-by-side,
   stack panels below the video. The threshold is chosen based on video (640) + panel widths.
   This avoids the small window-range overlap you reported. */
@media (max-width: 1100px) {
  #scorecard, #hole-status {
    position: static !important;
    width: calc(100% - 32px) !important;
    margin: 12px auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
  }

  /* Make sure video doesn't grow too tall on small screens */
  #swing {
    width: 100% !important;
    max-width: 640px;
    max-height: 50vh;
  }
}

/* Extra safety for short viewports: force stacking regardless of width */
@media (max-height: 780px) {
  #scorecard, #hole-status {
    position: static !important;
    width: calc(100% - 32px) !important;
    margin: 8px auto !important;
  }
  #swing { max-height: 45vh !important; }
}