body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  text-align: center;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-top: 70px;
}

#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  z-index: 10000;
}

#splash-screen h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

#game-controls {
  display: flex;
  gap: 20px;
}

#create-game,
#join-game {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 15px 30px;
  border: 2px solid white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.3s ease, transform 0.2s ease;
}

#create-game:hover,
#join-game:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
}

#join-game-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#game-code-input {
  padding: 10px;
  font-size: 1rem;
  border: 2px solid white;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-align: center;
}

#game-code-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.error-message {
  color: #ff6b81;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 5px;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 5px 10px;
  border: 1px solid #ff6b81;
  border-radius: 5px;
  display: none;
}

.error-message.visible {
  display: block;
}

#submit-code,
#cancel-join {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 10px 20px;
  border: 2px solid white;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
}

#submit-code:hover,
#cancel-join:hover {
  background: rgba(255, 255, 255, 0.2);
}

#scrolling-gallery {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

#gallery-images {
  display: flex;
  width: max-content;
  animation: scrollGallery 30s linear infinite;
  transform: translateX(0);
}

#gallery-images img {
  width: 100px;
  height: 180px;
  object-fit: cover;
  margin-right: 10px;
  border-radius: 10px;
  border: 2px solid white;
}

#game-board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 20px;
  gap: 10px;
}

#game-code-display {
  font-size: 1.5rem;
  color: white;
}

#toast {
  position: fixed;
  top: 70px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 10px 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 0;
  transform: translateX(100%);
  max-width: 75%;
}

#toast.visible {
  opacity: 1;
  transform: translateX(0);
}

#toast-message {
  margin: 0;
  font-size: 1rem;
  color: #333;
}

.card {
  border: 4px solid transparent;
  padding: 2px;
  width: 100px;
  height: 100px;
  position: relative;
  perspective: 1000px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.3s ease;
  cursor: pointer;
  transform-style: preserve-3d;
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: -1;
  pointer-events: none;
}

.front,
.back {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  backface-visibility: hidden;
  border-radius: 10px;
  transition: transform 0.5s ease;
  transform-origin: center;
}

.front {
  transform: rotateX(0deg);
  background: linear-gradient(45deg, #667eea, #764ba2) border-box;
  border: 4px solid transparent;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.back {
  transform: rotateX(180deg);
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  border: 4px solid transparent;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card.flipped .front {
  transform: rotateX(180deg);
}

.card.flipped .back {
  transform: rotateX(0deg);
}

#mystery-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
  color: white;
  text-align: center;
  transition: transform 0.3s ease-in-out;
  transform: translateY(100%);
}

#mystery-person {
  padding: 20px;
}

#mystery-img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(45deg, #667eea, #764ba2) border-box;
  border: 4px solid transparent;
  border-radius: 10px;
}

#mystery-toggle {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: black;
  color: white;
  padding: 15px 25px;
  border-radius: 10px 10px 0 0;
  font-size: 2rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

#mystery-toggle:hover {
  background: gray;
}

#mode-bar {
  position: fixed;
  top: 0;
  width: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 10px;
  text-align: center;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  gap: 10px;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mode-btn:hover,
#close-enlarged:hover,
#reset-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  animation: bounce 0.5s ease;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.card:hover {
  transform: translateY(-5px);
}

.front.highlighted {
  box-shadow: 0 0 20px rgba(100, 255, 150, 0.9);
  transform: scale(1.05);
}

#enlarged-view {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  z-index: 1500;
  animation: fadeIn 0.3s ease;
  flex-direction: column;
  align-items: center;
}

#enlarged-img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  margin-bottom: 15px;
}

#enlarged-info {
  margin-top: 15px;
}

#enlarged-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin: 0;
}

#close-enlarged {
  margin-top: 15px;
  background: #ff4757;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
}

#close-enlarged:hover {
  background: #ff6b81;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }

  .card {
    width: 80px;
    height: 80px;
  }

  #enlarged-img {
    width: 200px;
    height: 200px;
  }

  #mode-bar {
    flex-wrap: wrap;
    padding: 10px 5px;
  }

  .mode-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
  }

  #mystery-toggle {
    left: auto;
    right: 20px;
    transform: none;
    border-radius: 10px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes scrollGallery {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}
