/*--------------------------------------------------------------
# Badge Overlay System
--------------------------------------------------------------*/

.badge-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1000;
  display: none;
}

/* Buy-in Badge Area */
.buyin-badge-area {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
}

.buyin-badge {
  width: 80px;
  height: 80px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.buyin-badge img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

/* Crown of Chaos */
.buyin-badge.crown-of-chaos {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.2));
  border: 3px solid #ffd700;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  animation: crownPulse 2s ease-in-out infinite alternate;
}

.crown-glow {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4), transparent);
  border-radius: 50%;
  animation: crownGlow 3s ease-in-out infinite;
}

/* Gold Prompt */
.buyin-badge.gold-prompt {
  border: 3px solid #ffd700;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.1));
  animation: goldPromptPulse 1.5s ease-in-out infinite;
}

.gold-glow {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent);
  border-radius: 50%;
  animation: goldGlow 2s ease-in-out infinite alternate;
}

/* Animations */
@keyframes crownPulse {
  0% { transform: translateX(-50%) scale(1); }
  100% { transform: translateX(-50%) scale(1.1); }
}

@keyframes crownGlow {
  0% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.5; transform: scale(1); }
}

@keyframes goldPromptPulse {
  0% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
  50% { box-shadow: 0 0 40px rgba(255, 215, 0, 1); }
  100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
}

@keyframes goldGlow {
  0% { opacity: 0.3; }
  100% { opacity: 0.7; }
}

/* Mascot Area */
.mascot-area {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
}

.mascot {
  width: 96px;
  height: 96px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(4, 170, 109, 0.3));
}

.mascot:hover {
  transform: scale(1.1) rotate(5deg);
}

@keyframes mascotCelebrate {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.2) rotate(-10deg); }
  50% { transform: scale(1.3) rotate(10deg); }
  75% { transform: scale(1.2) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@media (max-width: 480px) {
  .mascot {
    width: 80px;
    height: 80px;
  }
  
  .mascot-area {
    bottom: 15px;
    right: 15px;
  }
}

.badge-grid {
  position: absolute;
  display: grid;
  gap: 8px;
  padding: 20px;
}

/* Portrait Layout (5x5 grid) */
.badge-overlay.portrait .badge-grid {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 300px;
  aspect-ratio: 1;
}

/* Landscape Layout (horizontal strip) */
.badge-overlay.landscape .badge-grid {
  grid-template-columns: repeat(25, 1fr);
  grid-template-rows: 1fr;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  height: 60px;
}

/* Badge Items */
.badge-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.badge-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.3s ease;
}

/* Badge States */
.badge-item.locked {
  opacity: 0.3;
  filter: grayscale(100%);
}

.badge-item.silhouette {
  opacity: 0.8;
  filter: grayscale(100%) brightness(0) invert(1);
}

.badge-item.vibrant {
  opacity: 1;
  filter: none;
  transform: scale(1.05);
}

.badge-item.gold {
  opacity: 1;
  filter: none;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  border: 2px solid #ffd700;
}

/* Smoldering Effect */
.badge-item.smoldering {
  transform: scale(1.2);
  z-index: 1001;
}

.badge-smoke {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(ellipse at center, 
    rgba(255, 255, 255, 0.3) 0%,
    rgba(200, 200, 200, 0.2) 30%,
    rgba(100, 100, 100, 0.1) 60%,
    transparent 100%);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.badge-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, 
    rgba(4, 170, 109, 0.4) 0%,
    rgba(4, 170, 109, 0.2) 50%,
    transparent 100%);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

/* Smoldering Animations */
.badge-item.smoldering .badge-smoke {
  animation: smoke 3s ease-out infinite;
}

.badge-item.smoldering .badge-glow {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes smoke {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0.8);
  }
  20% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
    transform: translateX(-50%) translateY(-30px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-60px) scale(1.5);
  }
}

@keyframes glow {
  0% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1.3);
  }
}

/* Completion Flash Effect */
.badge-item.completion-flash {
  animation: completionFlash 1s ease-out;
}

@keyframes completionFlash {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(4, 170, 109, 0);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 0 30px rgba(4, 170, 109, 1);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(4, 170, 109, 0);
  }
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .badge-overlay.portrait .badge-grid {
    width: 90%;
    max-width: 250px;
    gap: 6px;
  }
  
  .badge-overlay.landscape .badge-grid {
    height: 50px;
    gap: 4px;
  }
}

@media (max-height: 600px) {
  .badge-overlay.landscape .badge-grid {
    bottom: 10px;
    height: 40px;
  }
}

/* Camera Integration Styles */
.camera-container {
  position: relative;
  width: 100%;
  height: 100vh;
  background: #000;
}

.camera-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 1002;
}

.camera-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #04aa6d;
  background: rgba(0, 0, 0, 0.7);
  color: #04aa6d;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-btn:hover {
  background: #04aa6d;
  color: #000;
  transform: scale(1.1);
}

.camera-btn.recording {
  background: #ff4444;
  border-color: #ff4444;
  color: #fff;
  animation: recordingPulse 1s ease-in-out infinite alternate;
}

@keyframes recordingPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}