/* ===== General Body & Topbar ===== */
body {
  font-family: 'Comic Sans MS', 'Poppins', cursive;
  background: linear-gradient(135deg, #cce7ff, #fff0f5);
  color: #333;
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

#topbar {
  background: linear-gradient(90deg, #00b4ff, #0099ff);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

/* ===== Layout ===== */
#main {
  display: grid;
  grid-template-columns: 20% 60% 20%;
  height: calc(100vh - 60px);
  gap: 0;
  width: 100vw;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#left, #center, #right {
  padding: 10px;
  box-sizing: border-box;
}

#left, #right {
  background: rgba(255,255,255,0.6);
  border-radius: 20px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

/* ===== Instructions Panel ===== */
#instructions {
  position: absolute;
  bottom: 20px;
  background: rgba(255, 255, 255, 0.97);
  padding: 15px 25px;
  border-radius: 20px;
  border: 3px dashed #4da6ff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  max-width: 600px;
  text-align: left;
  line-height: 1.6;
  color: #004085;
  font-size: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  animation: bounceIn 1s ease;
}

#instructions h3 {
  text-align: center;
  margin-top: 0;
  color: #0073e6;
  font-size: 20px;
}

#instructions li {
  margin-bottom: 6px;
}

/* ===== Cards & Game Elements ===== */
#questionText {
  text-align: center;
  font-size: 26px;
  margin-bottom: 15px;
  color: #ff6600;
  text-shadow: 1px 1px 3px #fff;
}

.cards {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.card {
  width: 120px;
  height: 80px;
  background: #fff9c4;
  border: 3px solid #ffd54f;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  color: #333;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.card:hover {
  transform: scale(1.1);
  background: #fff176;
}

.card.revealed {
  background: #a5d6a7;
  border-color: #66bb6a;
  transform: scale(1.1) rotate(-3deg);
  color: #004d00;
  font-weight: bold;
}

/* ===== Timer ===== */
#timer {
  margin-top: 10px;
  font-weight: bold;
  font-size: 20px;
  color: #ff3d00;
  text-shadow: 1px 1px 2px #fff;
}

/* ===== Guess Area ===== */
#guessArea {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 500px;
  justify-content: center;
}

#guessInput {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid #00b0ff;
  background: #fff;
  color: #333;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ===== Buttons (Cool Kid Style) ===== */
button {
  padding: 10px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #00b0ff, #80d8ff);
  color: white;
  font-weight: bold;
  font-size: 16px;
  border: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all 0.25s ease;
}

button:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #0091ea, #4fc3f7);
}

/* ===== Guess Log ===== */
#messages {
  flex: 1;
  overflow-y: auto;
  max-height: 350px;
  background: #e3f2fd;
  padding: 8px;
  border-radius: 12px;
  border: 2px solid #90caf9;
  color: #0d47a1;
  font-family: 'Courier New', monospace;
  scrollbar-width: thin;
  scrollbar-color: #4da6ff #e3f2fd;
}

#messages::-webkit-scrollbar {
  width: 10px;
}

#messages::-webkit-scrollbar-thumb {
  background-color: #4da6ff;
  border-radius: 10px;
}

/* ===== Player Score List ===== */
.player-score-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a7ffeb, #64ffda);
  color: #004d40;
  font-weight: bold;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

/* ===== Winner Popup ===== */
#winnerPopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.5s ease;
}

#winnerPopup.hidden {
  display: none;
}

.popup-content {
  background: #fff;
  border-radius: 25px;
  padding: 40px 50px;
  text-align: center;
  color: #333;
  box-shadow: 0 0 30px rgba(0,0,0,0.3);
  animation: popIn 0.6s ease;
  position: relative;
}

.popup-content h2 {
  color: #00c853;
  font-size: 32px;
  margin-bottom: 15px;
}

.popup-content::after {
  content: "🎉🎊🎈";
  font-size: 36px;
  position: absolute;
  top: -10px;
  right: 20px;
}

#closePopup {
  margin-top: 20px;
  background: #ff80ab;
  border: none;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 18px;
  color: white;
  font-weight: bold;
  transition: transform 0.2s ease;
}

#closePopup:hover {
  transform: scale(1.1);
  background: #f50057;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

@keyframes popIn {
  from {transform: scale(0.5);}
  to {transform: scale(1);}
}

@keyframes bounceIn {
  0% {transform: translateX(-50%) scale(0.8);}
  50% {transform: translateX(-50%) scale(1.1);}
  100% {transform: translateX(-50%) scale(1);}
}
#name {
  width: 250px;
  padding: 12px 15px;
  border: 3px solid #00b0ff;
  border-radius: 15px;
  background: linear-gradient(135deg, #e1f5fe, #fff);
  font-family: 'Comic Sans MS', 'Poppins', cursive;
  font-size: 18px;
  color: #0073e6;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  outline: none;
  transition: all 0.3s ease;
}

#name::placeholder {
  color: #90caf9;
  font-style: italic;
}

#name:focus {
  background: #ffffff;
  border-color: #4fc3f7;
  box-shadow: 0 0 12px rgba(0,176,255,0.6);
  transform: scale(1.05);
}
#joinBtn, #startBtn {
  font-family: 'Comic Sans MS', 'Poppins', cursive;
  font-size: 18px;
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  margin-left: 8px;
  transition: all 0.3s ease;
}

#joinBtn:hover, #startBtn:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #ffca28, #ff9800);
}