

body.light { background: #f0f0f5; color: #111; }

.btn {
  background: #1f3b63;
  color: #8bd3ff;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  cursor: pointer;
}

/* Overlay + popup */
.puzzle-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease forwards;
}

.puzzle-overlay.fade-out { animation: fadeOut 0.35s ease forwards; }

.puzzle-popup {
  background: #12213d;
  color: #8bd3ff;
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  transform: scale(0.8);
  animation: popupIn 0.8s ease forwards;
  position: relative;
}

.puzzle-popup.fade-out { animation: popupOut 0.35s ease forwards; }

body.light .puzzle-popup { background: #fff; color: #1f3b63; }

.puzzle-popup h2 {
  font-size: 1.6rem;
  margin-top: 12px;
}

/* Trophy */
.puzzle-popup img {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: block;
  animation: orangePulse 2.2s infinite ease-in-out;
  filter: drop-shadow(0 0 8px rgb(238,103,35));
}

/* Buttons */
.puzzle-popup .buttons {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.puzzle-popup button {
  background: #1f3b63;
  color: #8bd3ff;
  border: 1px solid #2b4a75;
  border-radius: 8px;
  padding: 10px 22px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.puzzle-popup button:hover {
  background: #2b4a75;
  color: #ffffff;
}

/* Animations */
@keyframes popupIn {
  0% {transform: scale(0.8) translateY(20px); opacity: 0;}
  60% {transform: scale(1.05) translateY(0); opacity: 1;}
  100% {transform: scale(1);}
}

@keyframes popupOut {
  0% {transform: scale(1); opacity: 1;}
  100% {transform: scale(0.92); opacity: 0;}
}

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

@keyframes orangePulse {
  0%,100% {filter: drop-shadow(0 0 0px rgb(238,103,35));}
  50% {filter: drop-shadow(0 0 10px rgb(238,103,35));}
}
