/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial Rounded MT Bold', 'Segoe UI', Arial, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(to bottom, #60a5fa, #3b82f6);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Decorative elements */
.decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    color: rgba(250, 240, 137, 0.7);
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(250, 240, 137, 0.3);
}

.star-1 {
    top: 12%;
    right: 10%;
    font-size: 2.5rem;
}

.star-2 {
    bottom: 24%;
    left: 6%;
    font-size: 1.5rem;
}

.star-3 {
    top: 33%;
    left: 4%;
    font-size: 1rem;
}

.star-4 {
    bottom: 50%;
    right: 8%;
    font-size: 2rem;
}

.butterfly {
    position: absolute;
    font-size: 1.5rem;
    animation: float 6s ease-in-out infinite;
}

.butterfly-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.butterfly-2 {
    bottom: 20%;
    right: 10%;
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* Logo and Title */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-image {
    width: 6rem;
    height: 6rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    animation: slow-bounce 3s ease-in-out infinite;
}

@keyframes slow-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.03);
    }
}

h2 {
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.3);
    margin: 0;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 24px;
}

/* Expiry notice outside spinner */
.expiry-notice {
    background-color: #f9a8d4;
    color: #831843;
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    width: 100%;
    transform: rotate(-1deg);
    font-style: italic;
}

/* Main container */
.game-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Scratch card container */
.scratch-card-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    height: 400px;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    cursor: pointer;
}

/* Prize background - appears underneath the scratch layer */
.prize-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f9ff, #e6f1fe);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
}

/* Prize content */
.prize-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.prize-icon {
    width: 180px;  /* Increased from 150px */
    height: 180px; /* Increased from 150px */
    background-color: #8b5cf6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 4px solid #fef3c7;
    box-shadow: 0 0 15px rgba(252, 211, 77, 0.7);
    overflow: hidden;
}

.prize-icon img {
    max-width: 90%;  /* Increased from 85% */
    max-height: 90%; /* Increased from 85% */
    object-fit: contain;
}


.prize-amount {
    font-size: 42px;
    font-weight: bold;
    color: #ec4899;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.prize-label {
    font-size: 20px;
    font-weight: bold;
    color: #6d28d9;
    letter-spacing: 1px;
}

/* Scratch canvas - covers the prize */
.scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="white"><circle cx="12" cy="12" r="10" stroke="black" stroke-width="2"/></svg>') 12 12, auto;
    border-radius: 16px;
}

/* Confetti canvas */
.confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Controls area */
.controls-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Winner message */
.winner-message {
    font-size: 28px;
    font-weight: bold;
    color: #fcd34d;
    margin-bottom: 24px;
    text-align: center;
    display: none;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: popIn 0.5s ease-out forwards;
}

.prize-text {
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Buttons */
.action-button {
    padding: 16px 32px;
    border-radius: 9999px;
    font-weight: bold;
    font-size: 20px;
    transition: all 0.3s;
    background-color: #8b5cf6;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 300px;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
}

.action-button:hover {
    background-color: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.action-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.action-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: all 0.3s;
    opacity: 0;
}

.action-button:hover::after {
    opacity: 1;
    transform: rotate(45deg) translateX(100%);
}

.reset-button {
    display: none;
    background-color: #6d28d9;
}

.reset-button:hover {
    background-color: #5b21b6;
}

/* Attempts counter */
.attempts-counter {
    color: white;
    margin: 1rem 0;
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
    padding: 0.7rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(139, 92, 246, 0.4);
    border: 2px solid rgba(139, 92, 246, 0.6);
    max-width: 300px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}

.attempts-counter.highlight {
    background-color: rgba(139, 92, 246, 0.7);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(252, 211, 77, 0.5);
    animation: pulse-attempts 1s ease-in-out;
}

@keyframes pulse-attempts {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.attempts-label {
    margin-right: 0.5rem;
}

.attempts-remaining {
    color: #fcd34d;
    font-size: 1.4rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* For smaller screens */
@media (max-width: 768px) {
    .scratch-card-container {
        max-width: 280px;
        height: 350px;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .prize-icon {
        width: 140px;  /* Increased from 90px */
        height: 140px;
    }
    
    .prize-amount {
        font-size: 34px;
    }
    
    .prize-label {
        font-size: 18px;
    }
    
    .winner-message {
        font-size: 24px;
    }
    
    .attempts-counter {
        font-size: 1rem;
    }
    
    .attempts-remaining {
        font-size: 1.2rem;
    }
}


/* Style for special prizes */
.prize-amount.special-prize {
    font-size: 28px;
    color: #ec4899;
    line-height: 1.2;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 4px 0;
    font-weight: bold;
    text-shadow: none;
}

/* Style for the prize-label when it's a membership */
.prize-content:has(.special-prize) .prize-label {
    color: #ec4899;
    font-size: 18px;
}

/* Change icon background for Star Rider prizes */
.prize-content:has(.special-prize) .prize-icon {
    background-color: #ec4899;
    border: 4px solid #fef3c7;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.7);
}

.continue-button {
    display: none; /* Hidden by default */
    background-color: #059669; /* Green background */
}

.continue-button:hover {
    background-color: #047857; /* Darker green on hover */
}

/* Continue button styles */
.continue-button {
    display: none; /* Hidden by default */
    background-color: #059669; /* Green background */
}

.continue-button:hover {
    background-color: #047857; /* Darker green on hover */
}

/* Claim Prize Section Styles - Part 2 */
.claim-section {
    display: none; /* Hidden by default */
    position: fixed; /* Changed from absolute to fixed to cover entire viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #60a5fa, #3b82f6);
    z-index: 100;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.5s ease-in-out;
}

.claim-decorations {
    position: absolute; /* Use absolute within the fixed claim-section */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 101; /* Just above the background, below the content */
}

.claim-section .logo-container,
.prize-info-container {
    position: relative;
    z-index: 102; /* Above the decorations */
}

/* Logo styling in Part 2 */
.claim-section .logo-container {
    margin-top: 20px;
    margin-bottom: 20px;
}

.claim-section .logo-container h2 {
    color: white;
    margin-bottom: 10px;
}

.prize-info-container {
    max-width: 600px;
    margin: 40px auto;
    background-color: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.prize-info-container h2 {
    color: #8b5cf6;
    margin-bottom: 5px;
    font-size: 32px;
}

.prize-details {
    margin-bottom: 5px;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.prize-icon-large {
    width: 200px;  
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    animation: gentle-pulse 3s ease-in-out infinite;
}

.prize-icon-large::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 70%
    );
    animation: shine-sweep 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gentle-pulse {
    0%, 100% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(1.15) translateY(-10px);
    }
}

@keyframes shine-sweep {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
        opacity: 0;
    }
}

.prize-icon-large img {
    max-width: 100%;  /* Increased from 90% */
    max-height: 100%; /* Increased from 90% */
    object-fit: contain;
}


.prize-name {
    font-size: 28px;
    font-weight: bold;
    color: #ec4899;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.prize-description {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 20px;
}

/* Special prize styling */
.special-prize-name {
    font-size: 24px;
    color: #ec4899;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 4px 0;
    font-weight: bold;
}

.special-prize-icon {
    background-color: #ec4899;
    border: 4px solid #fef3c7;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.7);
}

/* Username Form */
.username-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.username-form label {
    font-size: 18px;
    color: #4b5563;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Username Input - Enhanced Visibility */
#usernameInput {
    width: 100%;
    max-width: 350px; /* Increased from 300px */
    padding: 16px 20px; /* Increased from 12px 16px */
    border-radius: 12px; /* Increased from 8px */
    border: 3px solid #8b5cf6; /* Changed from 2px solid #d1d5db */
    font-size: 18px; /* Increased from 16px */
    margin-bottom: 4px;
    transition: all 0.3s;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.2); /* Added shadow */
    font-weight: 500; /* Added weight */
}

#usernameInput:focus {
    outline: none;
    border-color: #ec4899; /* Changed from #8b5cf6 */
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.3), 0 4px 12px rgba(139, 92, 246, 0.3); /* Enhanced shadow */
    transform: translateY(-2px); /* Added lift effect */
}


.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-bottom: 15px;
    min-height: 20px;
}

/* Success message after claiming prize */
.success-message {
    padding: 20px;
    background-color: #ecfdf5;
    border-radius: 8px;
    border-left: 4px solid #059669;
    margin-bottom: 20px;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.success-message h3 {
    color: #059669;
    font-size: 24px;
    margin-bottom: 15px;
}

.success-message p {
    color: #065f46;
    margin-bottom: 10px;
    font-size: 16px;
}

.success-message strong {
    font-weight: bold;
}

.submit-button {
    background-color: #059669;
    margin-bottom: 10px;
}

.submit-button:hover {
    background-color: #047857;
}

.back-button {
    background-color: #6b7280;
}

.back-button:hover {
    background-color: #4b5563;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .prize-info-container {
        padding: 20px;
        margin: 20px auto;
    }
    
    .prize-info-container h2 {
        font-size: 24px;
    }
    
    .prize-icon-large {
    width: 180px;  
    height: 180px; 
}
    
    .prize-name {
        font-size: 22px;
    }
    
    .prize-description {
        font-size: 14px;
    }
    
    .special-prize-name {
        font-size: 20px;
    }
    
    .username-form label {
        font-size: 16px;
    }
}

@keyframes prize-pop {
  0% {
    transform: scale(0.5);
    opacity: 0.2;
  }
  60% {
    transform: scale(1.5);  /* Increased from 1.2 to 1.5 for a bigger pop effect */
    opacity: 1;
  }
  80% {
    transform: scale(0.9);  /* Adjusted for a more noticeable bounce-back */
  }
  100% {
    transform: scale(1);
  }
}

.prize-reveal-animation {
  animation: prize-pop 1s ease-out forwards;
}

/* Make the prize amount animation more dramatic as well */
@keyframes prize-amount-reveal {
  0% {
    transform: scale(0.3);  /* Start smaller */
    opacity: 0;
  }
  70% {
    transform: scale(1.3);  /* Grow larger than final size */
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.prize-amount-animation {
  animation: prize-amount-reveal 1.2s ease-out forwards;
  animation-delay: 0.3s; /* Slightly longer delay for better sequence */
}


.verification-container h2 {
    color: #8b5cf6;
    font-size: 32px;
    margin-bottom: 30px;
}

/* Privacy Notice */
.privacy-notice {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 20px;
    font-size: 13px;
    color: #064e3b;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.privacy-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.privacy-notice strong {
    color: #065f46;
    font-weight: 700;
    font-size: 14px;
}

.lock-icon {
    display: inline-block;
    font-size: 18px;
    color: #059669;
    margin-right: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    animation: gentle-pulse-lock 4s ease-in-out infinite;
}

@keyframes gentle-pulse-lock {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}


/* Username Warning */
.username-warning {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #92400e;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    line-height: 1.4;
}

.username-warning strong {
    color: #d97706;
    font-weight: 600;
}

/* Add this CSS to either styles.css or loading.css */

.instant-delivery-notice {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #0ea5e9;
    border-radius: 10px;
    padding: 12px 20px;
    margin: 15px 0 25px 0;
    font-size: 16px;
    font-weight: 600;
    color: #0369a1;
    text-align: center;
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.2);
    animation: gentle-glow-blue 3s ease-in-out infinite;
}

@keyframes gentle-glow-blue {
    0%, 100% {
        box-shadow: 0 4px 8px rgba(14, 165, 233, 0.2);
    }
    50% {
        box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
    }
}