body {
  background: #121212;
  color: white;
  font-family: sans-serif;
  text-align: center;
  margin: 0;
  padding: 0;
}

#logo {
  margin-top: 30px;
  width: 200px;
  animation: bounceIn 0.6s ease;
}

#subtitle {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: white;
}

#menu input {
  padding: 10px;
  font-size: 1rem;
  margin-bottom: 10px;
  width: 180px;
  border-radius: 5px;
  border: none;
  text-transform: uppercase;
  text-align: center;
}

#menu button {
  margin: 10px 5px;
  padding: 10px 20px;
  font-size: 1rem;
  border-radius: 5px;
  border: none;
  background: white;
  color: black;
  cursor: pointer;
  transition: 0.3s;
}
#menu button:hover {
  background: #ddd;
}

#codeSection {
  animation: fadeIn 0.7s ease forwards;
  margin-top: 10px;
}

#codeDisplay {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  border: 2px solid white;
  padding: 10px;
  display: inline-block;
  border-radius: 10px;
  margin-bottom: 8px;
  animation: bounceIn 0.6s ease;
}

#backArrow {
  cursor: pointer;
  font-size: 1.2rem;
  color: #999;
  transition: color 0.3s;
  margin-bottom: 10px;
}
#backArrow:hover {
  color: white;
}

#status {
  font-size: 1.2rem;
  margin: 10px 0;
}

#countdownBar {
  width: 100%;
  height: 8px;
  background: #333;
  margin: 8px auto 16px;
  max-width: 400px;
  border-radius: 4px;
}
#countdown {
  height: 100%;
  background: white;
  transition: width 1s linear;
  border-radius: 4px;
}

#board {
  display: grid;
  grid-template-columns: repeat(5, 50px);
  gap: 6px;
  justify-content: center;
  margin: 0 auto 20px;
}

.tile {
  width: 50px;
  height: 50px;
  background: #1e1e1e;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.correct {
  background: #538d4e;
}
.present {
  background: #b59f3b;
}
.absent {
  background: #3a3a3c;
}

.flip {
  animation: flip 0.5s ease;
}

@keyframes flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

.key-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 4px 0;
  flex-wrap: wrap;
}

#keyboard button {
  padding: 10px;
  min-width: 30px;
  font-size: 1rem;
  border: none;
  background: #333;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}
#keyboard button:hover {
  background: #555;
}

/* Popup */
#popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #222;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
  z-index: 10;
  width: 80%;
  max-width: 300px;
  text-align: center;
}

#popupMsg {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

#popup button {
  margin: 6px;
  padding: 10px 16px;
  background: #444;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
#popup button:hover {
  background: #666;
}

.popup-bounce {
  animation: popupBounce 0.6s ease;
}

@keyframes popupBounce {
  0% { transform: scale(0.9) translate(-50%, -50%); opacity: 0.5; }
  50% { transform: scale(1.05) translate(-50%, -50%); }
  100% { transform: scale(1) translate(-50%, -50%); opacity: 1; }
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

/* Mobile tweaks */
@media (max-width: 600px) {
  #board {
    grid-template-columns: repeat(5, 40px);
    gap: 4px;
  }
  .tile {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  #keyboard button {
    padding: 10px;
    min-width: 26px;
    font-size: 1rem;
  }
