/* Base Layout */
body {
  margin: 0;
  font-family: 'Comic Sans MS', cursive;
  background: #fef5e7;
  overflow-x: hidden;
}

.cpr-container {
  max-width: 550px;
  margin: 2rem auto;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, #ffe, #fff);
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(0,0,0,0.05);
  position: relative;
  z-index: 1;
}

.cpr-title {
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.cpr-subtitle {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #666;
}

/* Gender Buttons */
.cpr-gender-options {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 1.5rem 0;
}

.cpr-gender-btn {
  padding: 0.8rem 1.2rem;
  border-radius: 20px;
  background: #eee;
  cursor: pointer;
  transition: all 0.4s ease;
  font-weight: bold;
  border: 3px solid transparent;
  animation: fadeInUp 0.5s ease;
}

.cpr-gender-btn input {
  display: none;
}

.cpr-gender-btn.active-boy {
  background: #e0f7ff;
  border-color: #2196f3;
  color: #2196f3;
}

.cpr-gender-btn.active-girl {
  background: #ffe0f0;
  border-color: #e91e63;
  color: #e91e63;
}

.cpr-gender-btn.active-twins {
  background: #f3e6ff;
  border-color: #9c27b0;
  color: #9c27b0;
}

/* Link Box */
#cpr-link-box {
  background: #fdfdfd;
  border: 2px dashed #ddd;
  padding: 1rem;
  border-radius: 15px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.05);
  animation: fadeIn 1s ease-in-out;
  margin-top: 1rem;
}

#cpr-generated-link {
  background: #fff;
  padding: 0.75rem;
  border: 2px solid #ccc;
  border-radius: 10px;
  width: 100%;
  font-family: monospace;
  font-size: 0.95rem;
  color: #333;
  transition: box-shadow 0.3s ease;
}

#cpr-generated-link:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.3);
}

.cpr-link-buttons button {
  font-size: 0.9rem;
  background: linear-gradient(45deg, #4caf50, #81c784);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  font-weight: bold;
}

.cpr-link-buttons button:hover {
  background: linear-gradient(45deg, #388e3c, #66bb6a);
  transform: scale(1.05);
}

#cpr-link-box input {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.cpr-link-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* Custom Message */
.cpr-secret-message-box {
  margin: 1.5rem 0;
  text-align: left;
}

.cpr-secret-message-box input {
  font-size: 16px;
}

/* Game screen */
#cpr-balloons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 2rem;
}

.cpr-balloon {
  width: 70px;
  height: 100px;
  border-radius: 50% 50% 45% 45%;
  animation: float 2s ease-in-out infinite;
  position: relative;
}

.cpr-balloon::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 20px;
  background: #555;
}

.cpr-balloon.popped {
  background: transparent !important;
  border: 2px dashed #aaa;
  animation: none;
}

/* Center only the surprise balloons */
.surprise-balloon {
  align-self: center;
  margin-left: auto;
  margin-right: auto;
}

.cpr-scoreboard {
  margin-bottom: 1rem;
  font-weight: bold;
  color: #666;
}

#cpr-end-message {
  padding: 2rem;
  border-radius: 30px;
  text-align: center;
  animation: fadeIn 1s ease;
  transform: scale(0.95);
  transition: all 0.8s ease;
  position: relative;
  margin-top: 2rem;
}

#cpr-end-message.show {
  transform: scale(1);
}

.cpr-result-text {
  font-size: 3.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  animation: popFlash 2s ease-in-out infinite;
  text-shadow:
    0 0 8px rgba(255,255,255,0.8),
    0 0 15px currentColor,
    0 0 30px currentColor,
    0 0 45px currentColor;
}

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

.cpr-share {
  margin-top: 1rem;
  font-size: 1rem;
}

.cpr-share a {
  text-decoration: none;
  color: #fff;
  background: #2196f3;
  padding: 0.7rem 1.1rem;
  margin: 0 0.25rem;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.cpr-share a:hover {
  background: #1976d2;
}

#cpr-play-again {
  display: inline-block;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(45deg, #4caf50, #81c784);
  padding: 0.6rem 1.2rem;
  margin: 0 0.25rem;
  border-radius: 10px;
  font-weight: bold;
  transition: all 0.3s ease-in-out;
  cursor: pointer;
}

#cpr-play-again:hover {
  background: linear-gradient(45deg, #388e3c, #66bb6a);
  transform: scale(1.05);
}

.sparkle-container {
  mix-blend-mode: screen;
}

.sparkle-drop {width: 14px;
  height: 14px;
  position: absolute;
  border-radius: 50%;
  opacity: 0.95;
  animation: sparkle-burst 7s ease-out forwards, shimmer 1.5s infinite;
  pointer-events: none;
}

@keyframes sparkle-burst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  80% {
    transform: translate(var(--dx), var(--dy)) scale(1.2);
    opacity: 0.9;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.5);
    opacity: 0;
  }
}

.animate-glow {
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.8);
  }
}

.share-animate {
  animation: bounceIn 5s ease-out;
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #333;
}

.animate-bounce {
  animation: bounceIn 1s ease;
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

/* Background colors for the reveal container based on gender */
.cpr-boy {
  background: linear-gradient(to right, #bbdefb, #e3f2fd);
  color: #0d47a1;
  border-color: #90caf9 !important;
}

.cpr-girl {
  background: linear-gradient(to right, #fce4ec, #f8bbd0);
  color: #880e4f;
  border-color: #f48fb1 !important;
}

.cpr-twins {
  background: linear-gradient(to right, #ede7f6, #d1c4e9) !important;
  color: #4a148c !important;
  border-color: #b39ddb !important;
}

/* Animations */
@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.hidden {
  display: none !important;
}
