/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

/* Header */
.header {
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
}

.header h1 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.5;
}

/* Wheel Container */
.wheel-container {
    position: relative;
    margin: 30px auto;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
    color: #FFD700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 10;
    animation: bounce 2s infinite;
}

#roulette {
    display: block;
    margin: 0 auto;
    border-radius: 50%;
    box-shadow: 
        0 0 0 8px rgba(255, 255, 255, 0.2),
        0 0 0 12px rgba(255, 255, 255, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.4);
    background: white;
    transition: transform 0.1s;
}

#roulette.spinning {
    box-shadow: 
        0 0 0 8px rgba(255, 215, 0, 0.4),
        0 0 0 12px rgba(255, 215, 0, 0.2),
        0 15px 60px rgba(0, 0, 0, 0.5);
}

/* Spin Button */
.spin-button {
    background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    border: none;
    border-radius: 50px;
    padding: 18px 45px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    animation: fadeIn 1s ease-out 0.4s both;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.5);
}

.spin-button:active:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-icon {
    font-size: 24px;
    animation: rotate 2s linear infinite;
}

.spin-button:disabled .button-icon {
    animation: none;
}

/* Result */
.result {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(5px);
}

.result.hidden {
    display: none;
}

.result-content {
    background: white;
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 320px;
    width: 90%;
    animation: scaleIn 0.5s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.result-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: bounce 1s ease-out;
}

.result-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.result-prize {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    animation: pulse 1.5s ease-in-out infinite;
}

.result-message {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

/* Already Spun */
.already-spun {
    animation: fadeIn 0.5s ease-out;
}

.already-spun.hidden {
    display: none;
}

.already-spun-content {
    background: white;
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 320px;
    margin: 20px auto;
    animation: scaleIn 0.5s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.already-spun-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.already-spun-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.already-spun-prize {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(45deg, #4ECDC4, #45B7D1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.already-spun-message {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(3px);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive */
@media (max-width: 380px) {
    .header h1 {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    #roulette {
        width: 280px;
        height: 280px;
    }
    
    .spin-button {
        padding: 15px 35px;
        font-size: 16px;
    }
}
