/* Badge unlock modal — badge image size is set in JS (badge-celebration.js) */

.badge-celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 18, 40, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: auto;
}

.badge-celebration-overlay.show {
  display: flex !important;
}

body.badge-celebration-open {
  overflow: hidden;
}

.badge-celebration-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.badge-celebration-spark {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: badgeSparkFly 1.6s ease-out forwards;
}

@keyframes badgeSparkFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.15); }
}

.badge-celebration-star {
  position: absolute;
  opacity: 0;
  color: #ffd54f;
  text-shadow: 0 0 8px rgba(255, 213, 79, 0.8);
  animation: badgeStarTwinkle 2.2s ease-in-out infinite;
}

@keyframes badgeStarTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

.badge-celebration-confetti {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 14px;
  opacity: 0;
  animation: badgeConfettiFall var(--dur, 3.2s) linear forwards;
}

@keyframes badgeConfettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(110vh) rotate(720deg); }
}

.badge-celebration-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  z-index: 10070;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(27, 94, 32, 0.45);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.35s ease;
  pointer-events: none;
  white-space: nowrap;
}

.badge-celebration-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.badge-celebration-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.32);
  animation: badgeModalPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.dark .badge-celebration-modal {
  background: #2d2d2d;
  color: #e0e0e0;
}

@keyframes badgeModalPop {
  0% { opacity: 0; transform: scale(0.78) translateY(24px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.badge-celebration-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 36px 24px 32px;
  background: linear-gradient(135deg, #1565c0 0%, #42a5f5 50%, #ffd54f 100%);
  position: relative;
}

.badge-celebration-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 55%);
  pointer-events: none;
}

.badge-celebration-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  font-size: 1.2rem;
  cursor: pointer;
  color: #fff;
  border-radius: 50%;
  z-index: 3;
  line-height: 1;
}

.badge-celebration-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Transparent badge — PNG with alpha, size set in JS */
.badge-celebration-badge-wrap {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  line-height: 0;
  background: transparent;
}

#badgeCelebrationImg {
  display: block;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.28));
}

.badge-celebration-hero-name {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.badge-celebration-body {
  padding: 14px 22px 20px;
  text-align: center;
}

.badge-celebration-body h2,
.badge-celebration-body p {
  margin: 0;
}

.badge-celebration-title {
  font-size: 1rem;
  font-weight: 800;
  color: #1b5e20;
  margin-bottom: 4px;
}

body.dark .badge-celebration-title {
  color: #81c784;
}

.badge-celebration-msg {
  font-size: 0.8125rem;
  color: #555;
  line-height: 1.4;
  margin-bottom: 12px;
}

body.dark .badge-celebration-msg {
  color: #bbb;
}

.badge-celebration-email {
  display: none;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  font-size: 0.75rem;
  color: #2e7d32;
}

.badge-celebration-btn {
  padding: 9px 24px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #1976d2, #1565c0);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(25, 118, 210, 0.35);
}

.badge-celebration-btn:hover {
  transform: translateY(-1px);
}
