body {
  font-family: Arial, sans-serif;
  background: linear-gradient(to bottom, #1e5128, #a8df8e);
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  min-height: 100vh;
}

h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  margin-bottom: 2rem;
}

.form-container {
  background: #ffffffee;
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  width: 90%;
  max-width: 400px;
  margin: 1rem auto 2rem;
  text-align: left;
}

label {
  font-weight: bold;
  margin-bottom: 0.3rem;
  display: block;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: clamp(0.4rem, 1.5vw, 0.6rem);
  margin-bottom: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  box-sizing: border-box;
}

button {
  width: 100%;
  padding: clamp(0.5rem, 1.5vw, 0.7rem);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  background-color: #1e5128;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background-color: #154b22;
}

#welcomeMsg {
  margin-top: 1rem;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: bold;
  color: #003300;
  text-align: center;
}

#predictionsSection {
  background: #ffffffdd;
  padding: clamp(1rem, 3vw, 1.5rem);
  border-radius: 10px;
  max-width: 700px;
  width: 90%;
  margin: 1rem auto 2rem;
  display: none;
  text-align: left;
}

.game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.game-label {
  flex: 1 1 auto;
  font-weight: bold;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  padding-right: 1rem;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prediction-buttons {
  display: flex;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

input[type="radio"] {
  margin: 0;
  width: clamp(14px, 2vw, 18px);
  height: clamp(14px, 2vw, 18px);
  cursor: pointer;
}

#submitPredictionsBtn {
  margin-top: 1rem;
  padding: clamp(0.3rem, 1vw, 0.5rem) clamp(0.5rem, 1.5vw, 1rem);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  width: auto;
  cursor: pointer;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#leaderboardSection {
  background: #ffffffdd;
  padding: clamp(0.5rem, 2vw, 1rem);
  border-radius: 10px;
  max-width: 700px;
  width: 90%;
  margin: 0 auto 2rem;
  display: none;
  text-align: left;
}

#leaderboardSection h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
  text-align: center;
}

table {
  margin: 0 auto;
  border-collapse: collapse;
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  width: 100%;
}

th, td {
  border: 1px solid #000;
  padding: clamp(0.3rem, 1vw, 0.75rem) clamp(0.5rem, 1.5vw, 1rem);
}

th {
  background-color: #fff;
}

td {
  background-color: #fff;
}

#playerRankDisplay {
  margin-top: 1rem;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: bold;
  color: #222;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
}

#calcResultsBtn {
  margin: 2rem auto;
  display: block;
  padding: clamp(0.5rem, 1.5vw, 0.8rem) clamp(0.8rem, 2vw, 1.5rem);
  background: darkred;
  color: white;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

/* Media query for smaller screens (e.g., smartphones) */
@media (max-width: 600px) {
  body {
    padding: 1rem 0.5rem;
  }

  .form-container {
    width: 95%;
    max-width: 350px;
  }

  .game-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-label {
    padding-right: 0;
    margin-bottom: 0.5rem;
  }

  .prediction-buttons {
    width: 100%;
    justify-content: space-between;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.3rem 0.5rem;
  }
}

/* Media query for larger screens (e.g., desktops) */
@media (min-width: 1024px) {
  .form-container {
    max-width: 450px;
  }

  #predictionsSection, #leaderboardSection {
    max-width: 800px;
  }
}

/* Modal Styles (Added for feedback modal) */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.close-btn {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-btn:hover {
  color: black;
}

.match-entry {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
}

.match-entry h4 {
  margin-top: 0;
  color: #1e5128;
}

.match-entry input[type="text"],
.match-entry input[type="number"],
.match-entry select {
  width: 100%;
  padding: clamp(0.4rem, 1.5vw, 0.6rem);
  margin-bottom: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  box-sizing: border-box;
}

#updateBtn {
  background-color: #1e5128;
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  width: auto;
  margin: 1rem auto;
  display: block;
}

#updateBtn:hover {
  background-color: #154b22;
}

#adminMsg {
  margin-top: 1rem;
  font-weight: bold;
  text-align: center;
}

/* Chat Sidebar Styles */
.chat-sidebar {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 900;
  font-family: Arial, sans-serif;
}

.chat-toggle {
  background-color: #1e5128;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  text-align: center;
  font-weight: bold;
}

.chat-content {
  background: #ffffffdd;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
  width: 300px;
  height: 400px;
  display: flex;
  flex-direction: column;
}

.chat-content h3 {
  margin: 0.5rem;
  text-align: center;
  color: #1e5128;
  font-size: 1.2rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  border-bottom: 1px solid #ccc;
}

.chat-message {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  word-wrap: break-word;
}

.chat-input-container {
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

#chatInput {
  flex: 1;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}

#sendChatBtn {
  background-color: #1e5128;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
  width: auto;
}

#sendChatBtn:hover {
  background-color: #154b22;
}