:root {
  --primary-team-color: #4F2683; /* Default value */
  --secondary-team-color: #FFC62F; /* Default value */
  --primary-text-color: #fff;
  --secondary-text-color: #000;
}

body {
  margin: 0;
  padding-top: calc(env(safe-area-inset-top) + 50px);
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top);
  background-color: #4F2185;
  z-index: 9999;
}

/* Universal User Header Bar */
#user-header-bar {
  background: #4F2185;
  color: white;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: fixed;
  top: env(safe-area-inset-top);
  left: 0;
  right: 0;
  z-index: 1000;
}

.user-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#user-header-name {
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.15s ease;
}

#user-header-name:hover {
  opacity: 0.7;
}

/* Hamburger Menu */
.hamburger-menu-container {
  position: relative;
}

#hamburger-menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 40px;
  height: 36px;
}

#hamburger-menu-btn span {
  display: block;
  width: 100%;
  height: 4px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s;
}

#hamburger-menu-btn:hover span {
  background: rgba(255, 255, 255, 0.8);
}

.hamburger-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  z-index: 1001;
  overflow: hidden;
}

.hamburger-dropdown.show {
  display: block;
}

.hamburger-dropdown button {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: white;
  color: #333;
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.hamburger-dropdown button:last-child {
  border-bottom: none;
}

.hamburger-dropdown button:hover {
  background: #f5f5f5;
}

.hamburger-dropdown button:active {
  background: #e8e8e8;
}

header {
  /* Keep header background behind scoreboard */
  background: #2a9d8f;
  padding: 0;
}

/*ensure that text is readable on any background
.auto-contrast {
    position: relative;
    color: white;
    mix-blend-mode: difference;
      will-change: color, mix-blend-mode;
}

*/

.scoreboard {
  display: flex;
  width: 100%;
  border: 1px solid #000;
  box-sizing: border-box; /* ensures border doesn't affect width */
}

.scoreboard > div {
  width: 50%;
  padding: 0.5rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.team-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
  color: #fff;
}

.team-score {
  font-size: 2.5rem;
  font-weight: bold;
  color: #fff;
}


#teamA {
  background: #4F2683;
}

#teamB {
  background: #FFC62F;
}

.scoreboard span {
  color: #000; /* numeric score color */
}

.team-golfer-table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
  background: transparent;
}
.team-golfer-table td {
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  border-left: none;
  border-right: none;
  padding: 6px 0;
  text-align: center;
  font-size: 1.1rem;
}

nav {
  background: var(--primary-team-color)

}

.tabs {
  display: flex;
}

.tabs button {
  flex: 1;
  padding: 1rem;
  background: transparent;
  border: 1px solid black;
  color: var(--primary-text-color);
  font-size: 1rem;
}

.tabs button.active {
  background: var(--secondary-team-color);
  color: var(--secondary-text-color);
}

.user-bar {
  padding: 0.7em 1em;
  color: #000;
  background-color: #FFC62F;
  text-align: center;
  border: 1px solid #000;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#logout-button {
  background: #fff;
  color: black;
  border: 2px solid black;
  border-radius: 5px;
  padding: 0.4em 1.1em;
  font-weight: bold;
  cursor: pointer;
  margin-left: 1em;
  transition: background 0.2s, color 0.2s;
}
#logout-button:hover {
  background: var(--secondary-team-color);
  color: #fff;
}


.tournament-bar {
  background-color: #000;
  color: #fff;
  padding: 0.3rem;
  text-align: center;
  font-weight: bold;
  box-sizing: border-box;

}

.round-bar {
  background-color: var(--primary-team-color, #4F2185);
  color: #fff;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.round-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  z-index: 100;
}

.round-dropdown-item {
  padding: 0.75rem 1rem;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.round-dropdown-item:last-child {
  border-bottom: none;
}

.round-dropdown-item:hover {
  background-color: #f5f5f5;
}

.round-dropdown-item.active {
  background-color: var(--primary-team-color, #4F2185);
  color: white;
}


main {
  flex: 1;
  overflow: auto;

}



.corner-dot {
  position: absolute;
  top: 3px;
  right: 9px;
  width: 6px;
  height: 6px;
  background: black; /* or any color you want */
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
}

.second-dot {
  left: auto;
  right: 2px;
}

.penalty-dot {
  background: #e53935;
}

/* for circle and square around scores */
.score-birdie {
  background-color: #d0e8ff !important; /* light blue */
}
.score-bogey {
  background-color: #ffe0e0 !important; /* light red/pink for bogey */
}
.score-par {
  background-color: #f7f7f7 !important; /* light gray for par, optional */
}

/* Guys Trip best ball cells */
.best-ball-cell {
  font-weight: bold;
  text-align: center;
}

.winning-score {
  border: 2px solid #FFD700 !important; /* Gold border for winning score */
  font-weight: bold;
}

#score-entry-content {
  overflow-y: auto;
  max-height: 800px;
}

.no-match-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
}

.no-match-img {
  width: 80vw;
  max-width: 320px;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.2));
}

.no-match-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #4F2185;
  margin: 0 0 0.6rem;
  letter-spacing: 0.02em;
}

.no-match-msg {
  font-size: 1rem;
  color: #666;
  max-width: 280px;
  line-height: 1.5;
  margin: 0;
}

.score-table td {
  position: relative;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  margin-top: 10px;
}

.score-table th,
.score-table td {
  border: 1px solid #ccc;
  padding: 0.5rem;
  text-align: center;
}

.score-table th {
  background-color: #f0f0f0;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 3;
}

.score-table td select {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #aaa;
}

.score-table tr:nth-child(even) {
  background-color: #fafafa;
}

.score-table tr:hover {
  background-color: #f5f5f5;
}

.subtotal-row {
  background-color: #f8f9fa !important;
  border-top: 1px solid #dee2e6;
  border-bottom: 1px solid #dee2e6;
}

.subtotal-row td {
  font-weight: normal;
  padding: 8px 4px !important;
  color: #6c757d;
  font-style: italic;
}

#finalize-results-btn {
  display: block;
  width: 100vw;
  max-width: 100%;
  margin: 24px 0 0 0;
  padding: 1rem 0;
  font-size: 1.3rem;
  font-weight: bold;
  background: linear-gradient(90deg, #1976d2 0%, #42a5f5 100%);
  color: #fff;
  border: none;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.2s, box-shadow 0.2s;

}

#finalize-results-btn:hover, #finalize-results-btn:focus {
  background: linear-gradient(90deg, #1565c0 0%, #1976d2 100%);
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.25);
  outline: none;
}

@media (max-width: 600px) {
  .score-table {
    font-size: 0.9rem;
  }

  .score-table td select {
    font-size: 1rem;
    padding: 0.6rem;
  }
}





/* ── PIN Screen ───────────────────────────────────── */
#pin-container {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top) + 3rem) 1.25rem 3rem;
  background: linear-gradient(160deg, #2e0d55 0%, #4F2185 55%, #3a1060 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

#pin-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0;
}

#pin-form h2 {
  margin: 0 0 1.75rem;
  color: #fff;
  text-align: center;
  width: 100%;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

#pin-form .pin-prompt {
  margin: 0;
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  text-align: center;
}

#pin-form #pin-input {
  text-align: center;
  letter-spacing: 0.3rem;
  font-size: 1.2rem;
}

#pin-form #pin-error {
  color: #ffcdd2;
  text-align: center;
  font-size: 0.9rem;
  margin: 0;
}

/* ── Login / Register / Signup / Join / Reset forms inside pin-container ─── */
#login-form, #register-form, #signup-chooser, #join-form, #reset-form, #org-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  gap: 0;
}

#login-form h2, #register-form h2, #signup-chooser h2, #join-form h2, #reset-form h2, #org-picker h2 {
  margin: 0 0 1.75rem;
  color: #fff;
  text-align: center;
  width: 100%;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ── Login Screen ─────────────────────────────────── */
#auth-container {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  padding: 3rem 1.25rem 3rem;
  background: linear-gradient(160deg, #2e0d55 0%, #4F2185 55%, #3a1060 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

#auth-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0;
}

/* Title */
#auth-form h2 {
  margin: 0 0 1.75rem;
  color: #fff;
  text-align: center;
  width: 100%;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* Logo image */
.form-logo {
  display: block;
  width: 92vw;
  max-width: 92vw;
  margin: 0 auto 2rem;
  border-radius: 16px;
  filter: drop-shadow(0 8px 28px rgba(0,0,0,0.45));
}

/* Frosted glass card */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 1.75rem 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Select + inputs */
.auth-card select,
.auth-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
  outline: none;
  appearance: auto;
  -webkit-appearance: auto;
  transition: background 0.2s;
}

.auth-card select:focus,
.auth-card input:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 198, 47, 0.5);
}

/* New golfer sub-inputs */
#new-golfer-form {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
}

/* Continue button */
.auth-card button[type="submit"] {
  width: 100%;
  padding: 0.95rem 1rem;
  margin-top: 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: #FFC62F;
  color: #1a1a1a;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 16px rgba(255, 198, 47, 0.35);
}

.auth-card button[type="submit"]:hover {
  background: #f5b800;
}

.auth-card button[type="submit"]:active {
  transform: scale(0.98);
}

/* Auth message */
#auth-message {
  margin-top: 1rem;
  color: #ffe0e0;
  text-align: center;
  font-size: 0.95rem;
}

/* Labels */
#auth-form label {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.2rem;
}

/* Round History back button */
.history-back-btn {
  background-color: lightgray;
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.history-back-btn:hover {
  background-color: #d3d3d3;
}

/* User Dashboard buttons */
#user-dashboard button[type="button"] {
  background-color: lightgray;
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}

#user-dashboard button[type="button"]:hover {
  background-color: #d3d3d3;
}

#change-user-btn {
  width: auto !important;
  padding: 0.4rem 1rem !important;
  font-size: 0.9rem !important;
  background-color: #fff !important;
  border: 2px solid #4F2185 !important;
  color: #4F2185 !important;
}

#change-user-btn:hover {
  background-color: #f0f0f0 !important;
}

/* The message below the form for errors or feedback */
#auth-message {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: red;
  text-align: center;
}

#auth-form select,
#auth-form input[type="password"],
#auth-form button[type="submit"] {
  width: 100%;
  box-sizing: border-box; /* Ensures padding doesn't expand total width */
}



.handicap-cell {
  background-color: gray; 
}





.match-summary {
  border: 1px solid #ccc;
  margin-bottom: 12px;
  border-radius: 8px;
  padding: 8px;

  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.teams-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.team-box {
  flex: 1;
  padding: 6px 10px;
  border-radius: 5px;
  color: #fff;
  font-weight: bold;
  text-align: center;
}

.team-box.primary-team {
  background-color: var(--primary-team-color);
  color: var(--primary-text-color);
}

.team-box.secondary-team {
  background-color: var(--secondary-team-color);
  color: var(--secondary-text-color);

}

.vs {
  margin: 0 8px;
  font-weight: bold;
  font-size: 1.2rem;
}

.match-status {
  text-align: center;
  font-weight: bold;
  font-size: 0.95rem;
  margin-top: 4px;
}

.match-status.primary-team-status {
  background-color: var(--primary-team-color);
  color: var(--primary-text-color);
  border-radius: 4px;
  padding: 4px 8px;
}

.match-status.secondary-team-status {
  background-color: var(--secondary-team-color);
  color: var(--secondary-text-color);
  border-radius: 4px;
  padding: 4px 8px;
}

.tied-status,
.halved-status {
  background-color: #333;
  color: #fff;
  border-radius: 4px;
  padding: 4px 8px;
}



.skins-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.skins-table th, .skins-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  text-align: center;
}

.skins-table th {
  background-color: #f2f2f2;
}


.gross-leaderboard {
  margin-top: 10px;
  border-top: 2px solid #ccc;
  padding-top: 0px;
}

.net-leaderboard {
  margin-top: 10px;
  border-top: 2px solid #ccc;
  padding-top: 0px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.leaderboard-table th, .leaderboard-table td {
  padding: 8px;
  border: 1px solid #ccc;
}

.leaderboard-table th {
  background-color: #f2f2f2;
}

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

.matchup-table th, .matchup-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matchup-table th:nth-child(1),
.matchup-table td:nth-child(1) {
  width: 14%;
}

.matchup-table th:nth-child(2),
.matchup-table td:nth-child(2) {
  width: 39%;
}

.matchup-table th:nth-child(3),
.matchup-table td:nth-child(3) {
  width: 39%;
}

.matchup-table th:nth-child(4),
.matchup-table td:nth-child(4) {
  width: 8%;
}


.form-logo {
  display: block;
  margin: 0 auto 1.5rem;
  width: 92vw;
  max-width: 92vw;
}


.handicap-explanation {
  margin-top: 1em;
  padding: 10px;
  background: #f8f8e0;
  border: 1px solid #e0e0b0;
  border-radius: 6px;
  font-size: 1em;
}

/* Add to your styles.css */
.handicap-table-container {
  margin-top: 10px;
  border-top: 2px solid #ccc;
}
.handicap-table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}
.handicap-table th, .handicap-table td {
  border: 1px solid #ccc;
  padding: 0.4em 0.7em;
  text-align: center;
}
.handicap-table th {
  background: #f2f2f2;
}

.scorecard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.scorecard-table th, .scorecard-table td {
  padding: 8px;
  border: 1px solid #ccc;
}

.scorecard-table th {
  background-color: #f2f2f2;
}

.tournament-rounds-table-container {
  margin-top: .2em;
  border-top: 2px solid #ccc;

}

.tournament-rounds-table-container h4 {
  padding: 0.1em 0 0.1em 0; /* or just padding: 0; */
  margin: 0.1em 0 0.1em 0;   /* optional: adjust margin as needed */
}

div:empty {
  display: none;
}

h3 {
  margin-top: 1em;
  margin-bottom: 0.5em;
}
