/* ================
   GLOBAL LAYOUT
=================== */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  background: radial-gradient(circle at top left, #9be15d, #00e3ae);
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* ================
   HEADER
=================== */
header {
  text-align: center;
  color: #fff;
  background: #2e7d32;
  width: 100%;
  padding: 1.5rem 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

header p {
  font-size: 1rem;
  margin: 0.3rem 0 0;
  opacity: 0.9;
}
.button {
    display: inline-block;
    background-color: #ffcc00;      /* Change to your theme colour */
    color: #000;                    /* Text colour */
    padding: 14px 22px;             /* Comfortable tap area */
    border-radius: 8px;             /* Rounded corners */
    text-decoration: none;          /* Remove underline */
    font-size: 18px;                /* Larger for mobile */
    font-weight: 600;
    text-align: center;
    width: 100%;                    /* Full-width on mobile */
    max-width: 320px;               /* Optional limit */
    margin: 12px auto;              /* Center spacing */
    display: block;                 /* Makes full width work */
    transition: background 0.2s ease, transform 0.1s ease;
}

.button:active {
    transform: scale(0.97);        /* Mobile tap feedback */
    background-color: #e6b800;     /* Slightly darker */
}

/* ================
   MAIN CARD
=================== */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 1100px;
  margin: 1.5rem auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* ================
   COURSE SELECTOR
=================== */
.course-select {
  text-align: center;
  margin-bottom: 1rem;
}

.course-select label {
  font-weight: 600;
  margin-right: 0.5rem;
  color: #2e7d32;
}

select {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

/* ================
   ADD PLAYERS
=================== */
.add-player {
  text-align: center;
  margin-top: 1rem;
}

.input-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

input[type="text"] {
  flex: 1;
  max-width: 300px;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

button {
  background: #43a047;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s ease;
}

button:hover {
  background: #2e7d32;
  transform: scale(1.05);
}

/* ================
   SCORECARD TABLE
=================== */
.scorecard {
  margin-top: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}

table {
  width: 1200px;
  border-collapse: collapse;
  margin: auto;
  background: #fff;
}

th, td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 0.8rem 0.6rem;
  font-size: 1rem;
  line-height: 1.4;
}

thead th {
  background: #2e7d32;
  color: #fff;
  font-weight: 600;
}

.hole-nums th {
  background: #81c784;
  color: #000;
  font-weight: 500;
}

.player-name {
  text-align: left;
  font-weight: 600;
  background: #e8f5e9;
  padding-left: 0.5rem;
}

input[type="number"] {
  width: 3.5rem;
  height: 2.2rem;
  font-size: 1rem;
  text-align: center;
  border-radius: 8px;
  border: 1px solid #aaa;
  background-color: #f7f7f7;
  transition: border 0.2s ease;
}

input[type="number"]:focus {
  outline: none;
  border: 1px solid #43a047;
}

.total-cell {
  font-weight: 700;
  background: #c8e6c9;
  color: #1b5e20;
}

/* ================
   SAVE BUTTON
=================== */
.save-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  width: 100%;
}

.primary-btn {
  background-color: #2e7d32;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.4rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.primary-btn:hover {
  background-color: #1b5e20;
  transform: scale(1.05);
}

/* ================
   LEADERBOARD
=================== */
.leaderboard {
  margin-top: 2rem;
}

.leaderboard h2 {
  color: #2e7d32;
  border-bottom: 2px solid #c8e6c9;
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
  text-align: left;
}

.leaderboard ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.leaderboard {
  margin-top: 2rem;
  text-align: center;
}

.leaderboard-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.tab-btn {
  background: #c8e6c9;
  color: #1b5e20;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.tab-btn.active {
  background: #2e7d32;
  color: white;
  transform: scale(1.05);
}

.leaderboard-list {
  display: none;
  list-style: none;
  padding: 0;
}

.leaderboard-list.active {
  display: block;
}

.leaderboard-list li {
  background: #e8f5e9;
  margin: 0.3rem auto;
  padding: 0.6rem 1rem;
  width: 80%;
  border-radius: 8px;
  color: #2e7d32;
  text-align: left;
}


/* ================
   FOOTER
=================== */
footer {
  text-align: center;
  width: 100%;
  padding: 1rem;
  color: #fff;
  background: #2e7d32;
  margin-top: auto;
  font-size: 0.9rem;
}

/* ================
   MOBILE STYLING
=================== */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }

  header p {
    font-size: 0.9rem;
  }

  table {
    width: 900px; /* scrollable on smaller screens */
  }

  th, td {
    font-size: 0.85rem;
    padding: 0.4rem;
  }

  input[type="number"] {
    width: 2.6rem;
    height: 2rem;
    font-size: 0.9rem;
  }

  .save-container {
    justify-content: center; /* center on mobile */
  }

  .primary-btn {
    font-size: 0.95rem;
  }
}

/* ================
   SMALL SCREENS
=================== */
@media (max-width: 480px) {
  header h1 {
    font-size: 1.3rem;
  }

  .card {
    padding: 1rem;
  }

  input[type="number"] {
    width: 2.3rem;
    height: 1.8rem;
  }

  .leaderboard h2 {
    text-align: center;
  }
}

/* 🪄 Popup Overlay */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

/* Popup Card */
.popup-card {
  background: #ffffff;
  padding: 1.8rem;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.popup-card h2 {
  color: #2e7d32;
  margin-bottom: 0.5rem;
}

.popup-card p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: #555;
}

.popup-card input {
  display: block;
  width: 100%;
  margin: 0.4rem 0;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

.popup-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 0.5rem;
}

.save-btn,
.cancel-btn {
  flex: 1;
  padding: 0.6rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.save-btn {
  background: #2e7d32;
  color: #fff;
}

.save-btn:hover {
  background: #1b5e20;
}

.cancel-btn {
  background: #ddd;
}

.cancel-btn:hover {
  background: #bbb;
}

