.scratch-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.scratch-card-container {
  position: relative;
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1 / 1.2;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.prize-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 1;
}

.prize-content {
  text-align: center;
  padding: 30px 20px;
  color: white;
  animation: fadeIn 0.5s ease-in, celebrateContent 0.8s ease-out 0.3s;
}

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

.prize-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: bounce 0.6s ease, celebrate 1s ease-out 0.3s;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

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

@keyframes prizeReveal {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
  }
  50% {
    transform: scale(1.1) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 165, 0, 0.4), 0 0 60px rgba(255, 99, 71, 0.2);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.9), 0 0 60px rgba(255, 165, 0, 0.7), 0 0 90px rgba(255, 99, 71, 0.5);
  }
}

@keyframes codeGlow {
  0%, 100% {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 165, 0, 0.4);
  }
  50% {
    text-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 40px rgba(255, 165, 0, 0.8), 0 0 60px rgba(255, 99, 71, 0.6);
  }
}

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

@keyframes celebrateContent {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.05);
  }
  50% {
    transform: scale(0.98);
  }
  75% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.prize-title {
  font-size: 42px;
  font-weight: bold;
  margin: 20px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.prize-code {
  background: rgba(255, 255, 255, 0.2);
  padding: 15px 25px;
  border-radius: 10px;
  margin: 25px auto;
  max-width: 300px;
  backdrop-filter: blur(10px);
  animation: prizeReveal 0.8s ease-out;
  position: relative;
}

.prize-code::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347, #FFD700);
  border-radius: 12px;
  z-index: -1;
  opacity: 0;
  animation: glowPulse 2s ease-in-out infinite;
}

.prize-code.revealed {
  animation: prizeReveal 0.8s ease-out, glowPulse 2s ease-in-out infinite;
}

.prize-code.revealed::before {
  opacity: 1;
}

.code-label {
  display: block;
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.code-value {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 3px;
  font-family: 'Courier New', monospace;
  transition: all 0.3s ease;
  user-select: all;
  -webkit-user-select: all;
  -moz-user-select: all;
  -ms-user-select: all;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
  position: relative;
  animation: codeGlow 2s ease-in-out infinite;
  padding: 10px;
  margin: 5px 0;
  min-height: 44px;
  touch-action: manipulation;
}

.code-value:hover {
  transform: scale(1.05);
  opacity: 0.9;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 165, 0, 0.6);
}

.code-value:active {
  transform: scale(0.98);
}

/* Mobile-specific improvements */

@media (max-width: 768px) {
  .code-value {
    font-size: 20px;
    padding: 12px;
    min-height: 48px;
  }
  
  .copy-code-btn {
    min-height: 48px;
    padding: 14px 35px;
    font-size: 18px;
  }
}

.prize-code.revealed .code-value {
  animation: codeGlow 2s ease-in-out infinite, bounceIn 0.6s ease-out;
  text-shadow: 0 0 15px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 165, 0, 0.8);
}

.prize-description {
  font-size: 18px;
  margin: 20px 0;
  opacity: 0.95;
  line-height: 1.6;
}

.copy-code-btn {
  background: white;
  color: #667eea;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.5);
  touch-action: manipulation;
  min-height: 44px; /* Minimum touch target size for mobile */
}

.copy-code-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.copy-code-btn:active {
  transform: translateY(0);
}

.prize-loading {
  color: white;
  font-size: 18px;
}

.scratch-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  touch-action: none;
}

.scratch-layer.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.progress-indicator {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 3;
  pointer-events: none;
}

.reset-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 30px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-in;
}

.reset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.reset-btn:active {
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
  .scratch-card-container {
    max-width: 90%;
  }

  .prize-title {
    font-size: 36px;
  }

  .prize-icon {
    font-size: 56px;
  }

  .code-value {
    font-size: 20px;
  }

  .prize-description {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .scratch-card-container {
    max-width: 95%;
  }

  .prize-content {
    padding: 20px 15px;
  }

  .prize-title {
    font-size: 32px;
  }

  .prize-icon {
    font-size: 48px;
  }

  .code-value {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .copy-code-btn {
    padding: 10px 25px;
    font-size: 14px;
  }

  .reset-btn {
    padding: 12px 30px;
    font-size: 16px;
  }
}

