/* ======================== BASE STRUCTURE & LAYOUT ======================== */
.scorecard {
  border: 4px solid #000;
  border-collapse: collapse;
  width: auto;
  margin: 0 auto;
  font-size: 13px;
  min-width: 720px;
}

.scorecard th {
  border-bottom: 3px solid #000;
}

.scorecard td,
.scorecard th {
  border: 1px solid rgba(0, 0, 0, 0.35);
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
}

/* First Column Sticky Formatting */
.scorecard td:first-child,
.scorecard th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.85) !important;
  color: #c8f7c5;
  text-align: left;
  font-weight: 600;
  padding-left: 10px;
}

/* ======================== ROWS & HEADERS ======================== */
.scorecard-header th,
.scorecard-header td {
  background: rgba(0, 0, 0, 0.85);
  color: white;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hole-row td {
  background: rgba(0, 0, 0, 0.25);
  color: white;
  font-weight: 600;
}

.hcp-row td {
  background: #1b7f3a;
  color: white;
}

.par-row td {
  background: rgba(0, 0, 0, 0.2);
  color: white;
}

/* ======================== TEES & COLORS ======================== */
.tee td {
  border-top: 2px solid rgba(0, 0, 0, 0.4);
}

.tee td:first-child {
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Global Tee Color Signatures */
.tee.blue td,
.men-back td {
  background: #1e6fb6;
  color: white;
}
.tee.white td,
.men-front td {
  background: #f5f5f5;
  color: #111;
}
.tee.red td,
.women-front td {
  background: #c62828;
  color: white;
}
.tee.gold td,
.women-back td {
  background: #d4af37;
  color: #111;
}

/* ======================== BANDS & DIVIDERS ======================== */
/* FRONT 9 & BACK 9 (Dark bands) */
.scorecard td:nth-child(n + 2):nth-child(-n + 10),
.scorecard th:nth-child(n + 2):nth-child(-n + 10),
.scorecard td:nth-child(n + 12):nth-child(-n + 20),
.scorecard th:nth-child(n + 12):nth-child(-n + 20) {
  background: rgba(255, 255, 255, 0.06);
}

/* MEN split columns (white → blue) */
.tee.men td:nth-child(n + 2):nth-child(-n + 11) {
  background: #f5f5f5;
  color: #111;
}
.tee.men td:nth-child(n + 12):nth-child(-n + 21) {
  background: #1e6fb6;
  color: white;
}

/* WOMEN split columns (red → gold) */
.tee.women td:nth-child(n + 2):nth-child(-n + 11) {
  background: #c62828;
  color: white;
}
.tee.women td:nth-child(n + 12):nth-child(-n + 21) {
  background: #d4af37;
  color: #111;
}

/* Column Separator Formatting */
.scorecard td:nth-child(11),
.scorecard th:nth-child(11),
.scorecard td:nth-child(21),
.scorecard th:nth-child(21) {
  border-right: 3px solid rgba(0, 0, 0, 0.7);
}

.scorecard td:nth-child(12),
.scorecard th:nth-child(12) {
  padding-left: 8px;
}

/* TOTAL column styling */
.scorecard td:nth-child(22),
.scorecard th:nth-child(22) {
  font-weight: 700;
  color: rgb(209, 188, 188);
  background: rgba(0, 0, 0, 0.25);
}

/* ======================== WRAPPERS & TEXT ELEMENTS ======================== */
.course-info {
  text-align: center;
  margin-bottom: 20px;
}

.course-info p {
  margin: 4px 0;
  color: rgba(255, 255, 255, 0.8);
}

.scorecard-card {
  max-width: 1000px;
  margin: 20px auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.scorecard-section-header {
  text-align: center;
  margin-bottom: 14px;
}

.scorecard-section-header h3 {
  color: white;
  margin-bottom: 2px;
}

.scorecard-section-header p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

/* ======================== TEE TABLE ENHANCEMENTS ======================== */
.tee-card {
  max-width: 900px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.tee-card-header {
  text-align: center;
  margin-bottom: 10px;
}

.tee-card-header h2 {
  font-size: 20px;
  color: black;
  letter-spacing: 0.3px;
}

/*.tee-card-header::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  margin: 8px auto 0;
  background: rgba(255, 255, 255, 0.2);
}*/

.tee-table th {
  background: rgba(0, 0, 0, 0.25);
  color: #c8f7c5;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.tee-table td {
  padding: 10px 14px;
  color: rgb(23, 241, 41);
}

.tee-table td,
.tee-table th {
  transition: background 0.12s ease;
}

.tee-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.12);
}

.tee-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tee-table th:first-child,
.tee-table tbody th:first-child,
.tee-table tbody th:first-child.active-col {
  color: #c8f7c5;
  font-weight: 600;
}

.tee-table .active-col {
  background: rgba(255, 255, 255, 0.12);
}

/* ======================== RESPONSIVE MEDIA QUERIES ======================== */
@media (min-width: 769px) {
  .scorecard td,
  .scorecard th {
    padding: 5px 8px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .scorecard {
    min-width: 650px;
  }
  .scorecard td,
  .scorecard th {
    padding: 4px 5px;
    font-size: 12px;
  }
}

@media (orientation: portrait) and (max-width: 768px) {
  .scorecard-card {
    padding: 6px;
    margin: 10px auto;
  }
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .scorecard {
    min-width: 100%;
    width: 100%;
    font-size: 10px;
  }
  .scorecard td,
  .scorecard th {
    padding: 2px 3px;
    font-size: 10px;
  }
  .scorecard td:first-child,
  .scorecard th:first-child {
    min-width: 60px;
    padding-left: 4px;
    font-size: 10px;
  }
  .scorecard-section-header h3 {
    font-size: 16px;
  }
  .scorecard-section-header p {
    font-size: 11px;
  }
  .course-info p {
    font-size: 12px;
    line-height: 1.2;
  }
}

@media (orientation: landscape) and (max-width: 1024px) {
  .scorecard-card {
    padding: 6px;
    margin: 10px auto;
  }
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .scorecard {
    min-width: 100%;
    width: 100%;
    font-size: 10px;
  }
  .scorecard td,
  .scorecard th {
    padding: 2px 3px;
    font-size: 10px;
  }
  .scorecard td:first-child,
  .scorecard th:first-child {
    min-width: 60px;
    padding-left: 4px;
    font-size: 10px;
  }
  .scorecard-section-header h3 {
    font-size: 15px;
  }
  .scorecard-section-header p {
    font-size: 11px;
  }
  .course-info p {
    font-size: 11px;
    line-height: 1.2;
  }
}

/* ======================== TEE SHEET - SMALL PHONE FIX ======================== */

@media (max-width: 480px) {
  .main-wrapper {
    padding: 20px 8px;
  }

  .tee-card {
    padding: 8px;
    margin: 12px auto;
  }

  .tee-card-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .tee-sheet-title {
    font-size: 1.2rem;
  }

  .update-chip {
    width: fit-content;
    margin: 0 auto;
  }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tee-table {
    width: 100%;
    table-layout: fixed;
  }

  .tee-table th,
  .tee-table td {
    padding: 6px 2px;
    font-size: 0.82rem;
  }

  .tee-table td span {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .tee-note {
    font-size: 1rem;
  }
}
