/* --- General & Typography --- */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  background-color: #ffc0cb; /* Pink background */
  color: #333;
  margin: 0;
  padding: 20px;
}

h1 {
  font-size: 2.5em; /* Larger title */
  margin-bottom: 5px;
  color: #444;
}

button {
  cursor: pointer;
}

/* --- Wheel & Main Page Layout --- */
.wheel-container {
  position: relative;
  width: 900px; /* Match canvas width */
  height: 900px; /* Match canvas height */
}

.wheel-pointer {
  position: absolute;
  top: 50%;
  right: -18px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-right: 30px solid #222;
  z-index: 10;
}

.wheel-pointer::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -15px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-right: 24px solid #fff;
}

#picker-wheel {
  cursor: pointer; /* Change cursor to a hand when hovering over the wheel */
}

/* --- Winner Display (Below Wheel) --- */
#winner-display {
  margin-top: 20px;
  font-size: 1.8em; /* Larger text */
  font-weight: bold;
  color: #333;
  min-height: 60px; /* Reserve space */
  text-align: center;
}

/* --- Modal Styles --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(200, 210, 230, 0.6);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 30px 50px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#modal-winner-text {
  font-size: 2.2em; /* Larger modal text */
  font-weight: bold;
  color: #333;
  margin: 20px 0;
}

/* --- Animation & Effects --- */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: #f00;
  top: -20px; /* Start off-screen */
  opacity: 0;
  animation: fall 3s linear forwards;
  z-index: 1001; /* Ensure confetti is on top of the modal */
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 1;
  }
}

/* --- UI Controls --- */
#mute-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: 20px;
  padding: 0;
}

/* --- Bottom Controls --- */
.bottom-controls {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.bottom-controls button {
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #888;
  background-color: #f0f0f0;
  font-weight: bold;
  color: #333;
}

.bottom-controls button:hover {
  background-color: #e0e0e0;
}

/* --- Admin Page Styles --- */
/* --- Admin Page Layout --- */
.admin-page {
  background-color: #f4f7f7;
}

.admin-container {
  display: flex;
  gap: 30px;
  width: 90%;
  max-width: 1200px;
  margin: 20px 0;
}

/* The left-hand panel with instructions on the admin page. */
.instructions {
  flex-basis: 30%;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.instructions h2 {
  margin-top: 0;
}

.instructions ul {
  padding-left: 20px;
}

.instructions li {
  margin-bottom: 10px;
}

/* The main container for the participant list on the admin page. */
#participant-list {
  flex-basis: 70%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  align-content: start;
}

#participant-list > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

#participant-list input[type='number'] {
  width: 60px;
}

#participant-list input[type='text'] {
  flex-grow: 1;
}

/* --- Admin Page Forms & Actions --- */
.add-participant-form,
.admin-actions {
  margin-top: 40px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.add-participant-form input[type='number'] {
  width: 60px;
  height: 20px;
  font-size: 12px;
}

.add-participant-form input[type='text'] {
  flex-grow: 1;
  height: 20px;
  font-size: 14px;
}

.admin-actions a,
.admin-actions button {
  text-decoration: none;
  padding: 10px 20px;
  border: 1px solid #888;
  border-radius: 8px;
  background-color: #f0f0f0;
  color: #333;
  font-weight: bold;
}

.admin-actions a:hover {
  background-color: #e0e0e0;
}

.logout-container {
  display: flex;
  width: 90%;
  justify-content: end;
}

.logout-container .logout-button {
  background-color: #f44336;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: right;
}

.logout-button:hover {
  background-color: #d32f2f;
}

/* --- Login Page Styles --- */

.login-container {
  max-width: 400px;
  margin: 50px auto;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 5px;
  text-align: center;
}
.login-container input {
  display: block;
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.login-container button {
  background-color: #4caf50;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.login-container button:hover {
  background-color: #45a049;
}

.error-message {
  color: red;
  margin-top: 10px;
  display: none;
}
