:root {
  --primary-color: #5b6abf;
  --secondary-color: #9c64a6;
  --accent-color: #6a5acd;
  --light-color: #e6e6fa;
  --success-color: #4caf50;
  --error-color: #f44336;
  --text-color: #2c3e50;
  --white: #ffffff;
}

/* Header styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  padding: 0 10%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-bottom: 2px solid #fff;
  transition: all 0.3s ease;
}

.header:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.logo {
  font-size: 28px;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: var(--white);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
}

.navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.header .navigation ul li {
  float: left;
  position: relative;
}

.header .navigation ul li a {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  padding: 22px 20px;
  display: block;
  transition: all 0.3s ease;
}

.header .navigation ul li a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.header .navigation ul li ul {
  position: absolute;
  right: 0;
  width: 220px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  display: none;
  overflow: hidden;
}

.header .navigation ul li ul li a {
  color: var(--text-color);
  padding: 12px 20px;
  font-size: 14px;
}

.header .navigation ul li ul li a:hover {
  background-color: var(--light-color);
  color: var(--primary-color);
}

.header .navigation ul li:hover > ul {
  display: initial;
  animation: fadeIn 0.3s ease-out;
}

#toggle,
.header label {
  display: none;
  cursor: pointer;
}

.menu {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

@media (max-width: 950px) {
  .header label {
    display: initial;
  }

  .header {
    padding: 15px 10%;
  }

  .header .navigation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    display: none;
    border-radius: 0 0 12px 12px;
  }

  .header .navigation ul li {
    width: 100%;
  }

  .header .navigation ul li a {
    padding: 12px 20px;
  }

  .header .navigation ul li ul {
    position: relative;
    width: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.1);
  }

  .header .navigation ul li ul li a {
    padding-left: 30px;
  }

  #toggle:checked ~ .navigation {
    display: block;
    animation: slideDown 0.4s ease-out;
  }
}

/* Body and background styles */
body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #bdf7ff, #c0abe9, #9cddfc);
  margin: 0;
  padding: 0;
  padding-top: 80px;
  min-height: 100vh;
  color: var(--text-color);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

/* Background animation */
@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-15px);
  }
  60% {
    transform: translateY(-7px);
  }
}

/* Main container */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Title */
h1 {
  text-align: center;
  color: var(--text-color);
  margin-bottom: 30px;
  font-family: "Poppins", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.3);
  position: relative;
  padding-bottom: 15px;
}

h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 4px;
}

/* Game container */
.game-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin: 0 auto;
  justify-items: center;
}

/* Question cards */
.question-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 280px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  animation: fadeIn 0.8s ease-out;
}

.question-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Room images */
.room-img {
  width: 100%;
  height: 200px;
  margin: 0 auto 15px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid var(--primary-color);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.room-img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Answer options */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.options button {
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.options button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.options button:active {
  transform: translateY(1px);
}

.options button:disabled {
  opacity: 0.7;
  transform: none !important;
  box-shadow: none !important;
  animation: none !important;
}

.options button.correct {
  background: linear-gradient(135deg, var(--success-color), #27ae60);
}

.options button.incorrect {
  background: linear-gradient(135deg, var(--error-color), #c0392b);
}

/* Score container */
.score-container {
  text-align: center;
  margin: 30px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.score {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 10px;
}

.score-value {
  font-size: 32px;
  color: var(--secondary-color);
  font-weight: 700;
}

/* Restart button */
.restart-btn {
  padding: 14px 32px;
  background: linear-gradient(
    135deg,
    var(--secondary-color),
    var(--accent-color)
  );
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  display: block;
  margin: 0 auto;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(156, 100, 166, 0.3);
  position: relative;
  overflow: hidden;
}

.restart-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(156, 100, 166, 0.4);
}

.restart-btn:active {
  transform: translateY(1px);
}

/* Confetti effect for correct answers */
@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: var(--primary-color);
  animation: confetti 3s ease-out forwards;
  z-index: 100;
}

/* Congratulations modal */
.congrats-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.5s ease-out;
}

.modal-content {
  background: linear-gradient(135deg, var(--white), var(--light-color));
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  transform: scale(0.9);
  animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  position: relative;
  overflow: hidden;
}

@keyframes scaleUp {
  to {
    transform: scale(1);
  }
}

.modal-content h2 {
  font-family: "Poppins", sans-serif;
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 20px;
}

.modal-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: var(--text-color);
}

.modal-btn {
  padding: 12px 30px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(91, 106, 191, 0.3);
}

.modal-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(91, 106, 191, 0.4);
}

/* Responsive styles */
@media (max-width: 768px) {
  .game-container {
    grid-template-columns: 1fr;
  }

  .question-card {
    width: 100%;
    max-width: 300px;
  }

  .room-img {
    height: 180px;
  }

  h1 {
    font-size: 2rem;
  }

  .modal-content {
    padding: 30px 20px;
  }

  .modal-content h2 {
    font-size: 1.5rem;
  }

  .modal-content p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 22px;
  }

  .header {
    padding: 12px 5%;
  }

  .restart-btn {
    padding: 12px 25px;
  }
}
