
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  min-height: 100vh;
  font-family: 'Rubik', sans-serif;

  /* 🎾 Green gradient background */
  background: linear-gradient(to bottom, #2E7D32, #81C784, #2E7D32);
  color: #f0f0f0;

  padding-top: 48px;   /* 👈 half-inch gap at the top of the page */
}

section {
  width: 100%;
  max-width: 680px;        
  text-align: center;
  margin-bottom: 15px;
}

.container {
  background: #81C794;
  border-radius: 12px;
   border: 2px solid #9575CD; 
  max-width: 750px;     /* ⬅️ already narrower */
  width: 100%;
  padding: 10px 8px;
  margin: 20px auto 40px auto;  /* ⬅️ adds space from bottom */
  display: flex;
  flex-direction: column;
  align-items: center;
}
.admin-toggle {
    background: #4CAF50;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    margin-left: auto; /* pushes it all the way right */
    /* Remove any float: right if present */
    float: none !important;
}
.welcome-section {
  text-align: center;
  padding-top: 30px;   /* half inch breathing room */
  margin-bottom: 20px;
  color: #fff;
}

.contact-block {
  display: flex;
  gap: 20px;             /* bigger gap */
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;   /* extra space underneath */
}





/* subheadings should not push themselves down further */
.subheading {
  text-align: center;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 0 15px 0;   /* ⬅️ remove top margin */
  color: #FFD700;       /* Wimbledon yellow */
  text-shadow: 0 0 3px rgba(0,0,0,0.6);
}
    .court-line {
  border: none;
  height: 4px;
  background: #fff;
  width: 80%;
  max-width: 680px;
  margin: 20px auto;
}

.header-flex {
  display: flex;
  justify-content: space-between; /* club left, coach right */
  align-items: center;
  max-width: 800px;
  margin: 0 auto;                 /* keep it centered */
  width: 100%;
}

.club-name {
  flex: 1;                        /* allow it to center */
  text-align: center;             /* force text centered */
  font-size: 2.6rem;
  font-weight: 600;
  color: #DFFF00;
}

    #currentDate {
        font-size: 1.5rem;
        margin-top: 8px;
        font-weight: 600;
    }
    /* QR codes side-by-side, but as a block under the date */
.qr-placeholder {
  display: flex;
  flex-direction: column;    /* stack box + label vertically */
  align-items: center;       /* center both */
  flex: 0 0 auto;            /* don't stretch */
}

.qr-box {
  width: 70px;
  height: 70px;
  border: 2px dashed #ccc;
  border-radius: 6px;
  margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.05);
}

.qr-label {
  font-size: 0.8rem;
  color: #fff;
  margin-top: 2px;
}
.Appbox {
  width: 150px;
  height: auto;          /* was 1000px */
  padding: 0;
  background: transparent;
  display: inline-block; /* keeps it tidy around the image */
}

/* Make sure the QR image is exactly 100×100 */
.qr-img {
  width: 100px;
  height: 100px;
  display: block;
  object-fit: cover;     /* or 'contain' if you want full image without crop */
}

/* Optional: give the QR row some breathing room */
.instructions-with-qr {
  max-width: 680px;      /* you had two max-widths, the later 200px was cramping it */
  gap: 20px;
}

#dayNote {
  width: 90%;
  max-width: 600px;        /* keeps it same width as instructions */
  padding: 12px;
  font-size: 1rem;
  border-radius: 12px;     /* slightly softer radius */
  border: 2px solid #ccc;  /* 👈 2px border */
  resize: vertical;
  color: #333;
  display: block;
  margin: 0 auto 25px auto; /* 👈 centers horizontally */
}

.unavailable-name {
  opacity: 0.4;
  font-style: italic;
  color: #777;
  pointer-events: none;
}

.unavailable-name::after {
  content: ' - unavailalble';
}


.day-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 5;              /* 👈 tighter than before */
}
    
    .day-date {
        font-size: 0.65rem;
        color: #eee;
        margin-top: 4px;
    }
    
.day-tab {
  padding: 10px 14px 14px;
  min-width: 220px;                 /* slightly narrower */
  border: 3px solid #9575CD;           /* neutral gray border */
  border-radius: 10px;
  cursor: pointer;
  color: #D1C4E9;                   /* light gray text */
  font-weight: 700;
  text-shadow: 0 0 2px #000;
  text-align: center;
  background: rgba(0,0,0,0.25);     /* subtle dark background */
  transition: background 0.2s, transform 0.2s;
}

.day-tab:hover {
 background: rgba(123, 31, 162, 0.3); /* slightly brighter hover */
  transform: translateY(-2px);
}

.day-tab.active {
  background: linear-gradient(145deg, #7E57C2, #5E35B1); /* brighter purple gradient */
  border: 5px solid chartreuse;        /* 🎾 contrast highlight */
  color: #fff;
  text-shadow: none;
}


    
    .day-date {
        font-size: 0.90rem;
        font-weight: 600;
        margin-top: 4px;
        color: #fff;
        text-shadow: 0 0 1px #000;
    }

.instructions-with-qr {
  min-width: 280px;
  max-width: 420px;
  display: flex;
  flex-direction: row;       /* force horizontal layout */
  align-items: center;       /* vertically center QR + text */
  justify-content: center;
  gap: 35px;
  max-width: 200px;
  margin: 0 auto 20px auto;
}

.checkin-instructions {
  flex: 1;
  min-width: 280px;
  max-width: 420px;          /* compact width */
  font-size: 1rem;
  color: black;
  background: rgba(211, 221, 211, 1);
  padding: 8px 12px;
  border-radius: 22px;
  text-align: center;
  font-weight: 500;
  border: 2px solid gold;
  box-shadow: 0 0 8px gold;
  animation: glowPulse 2s ease-in-out infinite;
  margin: 0;
}


.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}



    .player-box.checked-in {
        border: 2px solid #4CAF50;
        background: #e0f2f1;
    }
    .ball-container {
        position: relative;
        width: 24px;
        height: 24px;
        margin-right: 0px;
        flex-shrink: 0;
    }
    .grey-ball {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: linear-gradient(145deg, #888888, #555555);
        box-shadow:
        inset 2px 2px 5px rgba(255,255,255,0.8),
        inset -2px -2px 5px rgba(0,0,0,0.7);
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    .tennis-ball-overlay {
        font-size: 22px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -55%);
        pointer-events: none;
        user-select: none;
        filter: drop-shadow(0 0 1px rgba(0,0,0,0.4));
    }
    .tennis-ball-overlay.hidden {
        display: none;
    }
  /*  .mobile-input {
        position: absolute;
        bottom: 60%;
        left: calc(100% - 40px);
        margin-bottom: 6px;
        background: white;
        color: #000;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 0.75rem;
        display: none;
        z-index: 10;
        box-shadow: 0 0 4px rgba(0,0,0,0.2);
    }
    .player-box:hover .mobile-input {
        display: inline-block;
    }*/
    
#playerGrid, #reserveGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;          /* full width of container */
  max-width: none;      /* ⬅️ remove the 800px limiter */
  margin: 0 auto;
  
}
@media (max-width: 500px) {
  .player-box {
    font-size: 1.1rem;
    padding: 12px 16px;
  }
}

.player-box {
  width: 100%;              /* fill each grid cell */
  box-sizing: border-box;
  padding: 8px 16px;        /* more padding for name + tick */
  background: #f5f5f5;
  border: 2px dashed #ccc;
  border-radius: 12px;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  position: relative;
  min-height: 40px;
  user-select: none;
}


    .name-label {
        flex-grow: 1;
        font-weight: bold;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
.player-box:hover .note-popup.above {
    opacity: 1;
    pointer-events: auto;
}
.note-popup.above {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);  /* ⬆️ shift popup up */
    
    background-color: #fffacd;       /* pale yellow */
    color: #222;
    padding: 10px 12px 8px 12px;     /* top-heavy padding = lifts text */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    
    white-space: normal;             /* ✅ allows wrapping */
    max-width: 160px;                /* ⛔ prevent too-wide boxes */
    
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}



@media (max-width: 500px) {
  #playerGrid, #reserveGrid {
    grid-template-columns: repeat(1, 1fr); /* stack vertically on narrow screens */
  }
}
   /* .note-popup {
        position: absolute;
        top: 0;
        left: auto;
        right: 100%;
        margin-right: 10px;
        width: 180px;
        background: #ffffcc;
        color: #333;
        padding: 6px;
        border: 1px solid #aaa;
        border-radius: 5px;
        font-size: 0.85rem;
        box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
        white-space: normal;
        word-wrap: break-word;
        display: none;
        z-index: 100;
    } */
    
    .note-popup.right {
        left: auto;
        right: -200px; /* Adjust as needed for how far right you want it */
    }
#courtView {
  padding-top: 20px;        /* courts get a little breathing room */
  overflow-y: auto;
  max-height: 80vh;
  padding-bottom: 20px;
}
    .court-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 45px;
      justify-content: center;
      max-width: 450px; /* ✅ Limits to 2 courts per row */
        margin: 0 auto;
    }

    
    .court {
        position: relative;
        width: 180px;
        height: 350px;
        background-color: #b7410e; /* Red clay */
        overflow: hidden;
    }
    
    .court::before {
        content: "";
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        border: 2px solid white; /* Outer doubles boundary */
        box-sizing: border-box;
    }
    
    /* Lines inside each court */
    .line {
        position: absolute;
        background: white;
    }
    
    .sideline-singles-left {
        top: 0;
        bottom: 0;
        left: 20px;
        width: 2px;
    }
    
    .sideline-singles-right {
        top: 0;
        bottom: 0;
        right: 20px;
        width: 2px;
    }
    
    .baseline-top,
    .baseline-bottom {
        left: 0;
        right: 0;
        height: 2px;
    }
    
    .baseline-top { top: 0; }
    .baseline-bottom { bottom: 0; }
    
    .service-line-top,
    .service-line-bottom {
        left: 20px;
        right: 20px;
        height: 2px;
    }
    
    .service-line-top { top: 90px; }
    .service-line-bottom { bottom: 90px; }
    
    .center-service-line {
        top: 90px;
        bottom: 90px;
        left: 50%;
        width: 2px;
        transform: translateX(-50%);
    }
    
    .net-line {
        top: 50%;
        left: 0;
        right: 0;
        height: 2px;
        transform: translateY(-50%);
    }
    
    .court-label {
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        color: white;
        font-weight: bold;
        background: rgba(0,0,0,0.5);
        padding: 1px 5px;
        border-radius: 3px;
        font-size: 0.8rem;
    }
    .ball-bench {
        display: flex;
        flex-wrap: wrap;
        width: 150px;  /* Adjust as needed for 4 across */
        margin: 10px;
        gap: 8px;
    }
    
#courtOuter {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

#courtContainer {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  max-width: 1000px; /* You can adjust this */
  width: 100%;
  padding: 0 20px;
}

#courtView .subheading {
  margin-top: 0;        /* extra insurance: no extra gap for courts title */
}
    
#playerReserveSection {
  max-width: 1200px;  /* Or none */
  width: 100%;
  padding: 0 20px;
  margin: 0 auto;
  box-sizing: border-box;
}

#ballBench {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 140px;   /* 3 × 40px balls + 2 × 8px gaps = 136px, round to 140 */
  max-height: 400px;
  overflow-y: auto;
  align-self: flex-start;
  position: sticky;
  top: 100px;
  justify-content: center; /* keeps them centred nicely */
}

    .big-ball {
        width: 40px;
        height: 40px;
        background: radial-gradient(circle at 30% 30%, #a3d977, #60a82f);
        border: 2px solid black;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: bold;
        color: black;
        font-size: 0.9rem;
        cursor: grab;
        box-shadow:
        inset 2px 2px 5px rgba(255, 255, 255, 0.7),
        0 4px 6px rgba(0, 0, 0, 0.3);
        transition: box-shadow 0.2s ease;
    }
    
    .big-ball:hover {
        box-shadow:
        inset 2px 2px 8px rgba(255, 255, 255, 0.9),
        0 6px 10px rgba(0, 0, 0, 0.4);
    }
    
    .reserve-ball {
        border-color: blue;
        background: radial-gradient(circle at 30% 30%, #a0c8ff, #4a70ff);
        color: black;
    }
 
    
  .court-ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #a3d977, #60a82f);
  border: 2px solid black;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: black;
  font-size: 0.9rem;
  position: absolute; /* ✅ valid CSS */
  /* Because you're positioning them inside the court */
}

    .court-ball.reserve {
      border-color: blue;
      background: radial-gradient(circle at 30% 30%, #a0c8ff, #4a70ff);
    }
    /* ranking tabs */
 
.button-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 4px;            /* 👈 minimal gap from tabs */
    margin-bottom: 4px;         /* 👈 just enough breathing room */
}

@media (max-width: 600px) {
  .styled-button {
    padding: 16px;
    font-size: 1.2rem;
  }
}

 .styled-button {
 background: rgba(0,0,0,0.25);     /* subtle dark background */
  transition: background 0.2s, transform 0.2s;
   border: 2px solid #9575CD;  
   border-radius: 8px;
   box-shadow: 0 5px 10px rgba(46, 125, 50, 0.5);
   color: black;
   padding: 10px 20px;
   cursor: pointer;
   transition: all 0.2s ease;
   font-size: 1rem;
   user-select: none;
 }

 .styled-button:hover {
  background: Chartreuse;
   box-shadow: 0 8px 15px rgba(46, 125, 50, 0.7);
   transform: translateY(-2px);
 }
 .styled-button.active {
      background: linear-gradient(145deg, #7E57C2, #5E35B1);
      transition: background 0.2s, transform 0.2s;
      color: white;
      font-weight: bold;
      border: 4px solid chartreuse;
    }
    
.tab-buttons {
  display: flex;
  gap: 16px;              /* Space between buttons */
  justify-content: center; /* Optional: center the button group */
  flex-wrap: wrap;         /* Allow wrapping on smaller screens */
}

.tab-buttons button {
  flex: 1;                 /* 💥 this makes all buttons equal width */
  min-width: 240px;        /* ✅ maintains reasonable size on smaller screens */
  padding: 10px 16px;
  font-weight: 680;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: #2E7D32;
  color: white;
  box-shadow:
    0 3px 5px rgba(0,0,0,0.2),
    inset 0 2px 0 rgba(255,255,255,0.3);
  transition: background 0.3s ease;
  text-align: center;
}


   
.tab-content {
  background: #2E7D32;
  border-radius: 12px;
  padding: 12px 20px 20px 20px;  /* ⬅️ balanced top padding (was 8 or 20) */
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}


 /* Clean these up */
 #mainNavButtons button {
   padding: 10px 16px;
   font-size: 16px;
   background-color: #1e90ff;
   color: white;
   border: none;
   border-radius: 8px;
   cursor: pointer;
 }
  .score-input {
  width: 5ch;            /* snug for 3 digits */
  flex: 0 0 4ch;         /* don't let the flex row stretch it */
  box-sizing: content-box;
  padding: 2px 4px;
  text-align: center;
}

    .form-row {
      display: flex;
      gap: 0.20rem;
      margin: 1rem 0;
      flex-wrap: wrap;
    }

    .form-row input,
    .form-row button {
      padding: 3px 6px;
      font-size: 1rem;
    }

 #rankingTabs .styled-button {
   padding: 8px 14px;
   font-size: 14px;
   background-color: #eee;
   border: 1px solid #999;
   border-radius: 6px;
   cursor: pointer;
   color: black;
 }

 #rankingTabs button:hover {
   background-color: #ddd;
 }
    #rankingTabs .styled-button.active {
      background-color: chartreuse !important;
      color: white !important;
      font-weight: bold;
      border: 4px solid chartreuse;
    }

    #rankingTabs {
      display: flex;
      justify-content: center;
      gap: 16px;
      margin-top: 20px;
      margin-bottom: 10px;
    }


    #rankingData {
      margin-top: 20px;
      text-align: center;
      color: #fff;
    }
    .ranking-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 10px;
    }

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

    .ranking-table th {
      background-color: #222;
      color: #ffcc00;
      font-weight: bold;
    }

    .ranking-table tr:nth-child(even) {
      background-color: #2c2c2c;
    }
/* rankings page shouldn't add extra padding */
#rankingsPage {
  padding-top: 0px !important;   /* reduce top padding */
  padding-right: 20px !important;
  padding-bottom: 20px !important;
  padding-left: 20px !important;
}
    #mainNavButtons .styled-button.active {
      background-color: chartreuse !important;
      color: black !important;
      border: 2px solid black;
    }
    .matches-table {
      width: 100%;
      border-collapse: collapse;
      margin-bottom: 1rem;
      font-family: Arial, sans-serif;
    }

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

    .matches-table th {
      background-color: #2c3e50;
      color: white;
      font-weight: bold;
    }

    .matches-table tr:nth-child(even) {
      background-color: #1e3d1e; /* soft green */
    }

    .matches-table tr:nth-child(odd) {
      background-color: #142914; /* deeper green for contrast */
    }

    .matches-table td,
    .matches-table th {
      color: #fff;
    }


    .matches-table tr:hover {
      background-color: #add8e6;
    }

    .name-cell {
      text-align: left;
      padding-left: 12px;
    }

    .edit-btn, .delete-btn {
      margin: 0 4px;
      padding: 4px 8px;
      background-color: #2980b9;
      color: white;
      border: none;
      border-radius: 3px;
      cursor: pointer;
    }

    .edit-btn:hover {
      background-color: #3498db;
    }

    .delete-btn {
      background-color: #c0392b;
    }

    .delete-btn:hover {
      background-color: #e74c3c;
    }
    .flash-toast {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      background: #00c853;
      color: white;
      padding: 10px 20px;
      border-radius: 20px;
      font-weight: bold;
      box-shadow: 0 2px 6px rgba(0,0,0,0.3);
      z-index: 9999;
    }
    .top-rank {
      background-color: #fff8e1; /* Soft gold */
      font-weight: bold;
      border-left: 4px solid gold;
    }
    .trophy {
      font-size: 1rem;
      margin-left: 5px;
    }
    .trophy.gold { color: #ffb300; }
    .trophy.silver { color: #b0bec5; }
    .trophy.bronze { color: #d2691e; }
    .export-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 20px;
    }

    .export-table th {
      background-color: #d4edc9; /* light green */
      padding: 8px;
      border: 1px solid #ccc;
      text-align: left;
      font-weight: bold;
    }

    .export-table td {
      padding: 8px;
      border: 1px solid #ccc;
      word-wrap: break-word;
      max-width: 200px;
    }


