/* Spin Wheel Overlay */
.spin-wheel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Spin Wheel Container */
.spin-wheel-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 25px 20px;
    max-width: 420px;
    width: 90%;
    max-height: 95vh;
    overflow-y: hidden;
    /* Prevent scroll */
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.spin-wheel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.spin-wheel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Step Management */
.spin-wheel-step {
    display: none;
    text-align: center;
}

.spin-wheel-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Typography */
.spin-wheel-title {
    color: white;
    font-size: 20px;
    /* Reduced from 28px */
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.spin-wheel-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    /* Reduced from 15px */
    margin-bottom: 15px;
    line-height: 1.4;
    text-align: center;
}

/* Input Group */
.spin-wheel-input-group {
    margin-bottom: 10px;
    /* Reduced from 20px */
    width: 100%;
}

.spin-wheel-input {
    width: 100%;
    padding: 10px 15px;
    /* Reduced padding */
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 15px;
    transition: all 0.3s;
    outline: none;
    text-align: center;
}

.spin-wheel-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.spin-wheel-input:focus {
    border-color: white;
    background: rgba(255, 255, 255, 0.15);
}

.spin-wheel-error {
    display: block;
    color: #ffeb3b;
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
}

/* Buttons */
.spin-wheel-btn {
    width: 100%;
    padding: 12px 20px;
    /* Reduced padding */
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 5px;
}

.spin-wheel-btn-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.spin-wheel-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.spin-wheel-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spin-wheel-btn-spin {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    font-size: 18px;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.spin-wheel-btn-text {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
    padding: 10px;
    font-size: 14px;
}

/* Wheel Wrapper */
.wheel-wrapper {
    position: relative;
    margin: 0 auto;
    /* Removed top/bottom margin for tighter layout */
    width: 280px;
    /* Reduced from 350px */
    height: 280px;
    /* Reduced from 350px */
}

.wheel-container-wrapper {
    display: none;
    /* Hidden by default, shown via JS when offers load */
    animation: fadeIn 0.5s ease;
}

#wheelCanvas {
    transition: transform 0.1s ease-out;
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 30px solid #FFD700;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    z-index: 10;
}

/* Result Content */
.result-content {
    text-align: center;
}

.result-icon {
    font-size: 80px;
    color: #FFD700;
    margin-bottom: 20px;
    animation: bounce 1s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.result-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
}

.result-offer {
    color: #FFD700;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

.result-coupon {
    background: rgba(255, 255, 255, 0.15);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.result-coupon code {
    color: white;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.result-validity {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Confetti Animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 100000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s linear infinite;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Already Spun */
.already-spun-icon {
    font-size: 80px;
    color: #FFD700;
    margin-bottom: 20px;
}

.previous-offer {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .spin-wheel-container {
        padding: 30px 20px;
        max-width: 95%;
    }

    .spin-wheel-title {
        font-size: 24px;
    }

    .wheel-wrapper {
        width: 300px;
        height: 300px;
    }

    #wheelCanvas {
        width: 300px !important;
        height: 300px !important;
    }

    .result-coupon code {
        font-size: 18px;
    }
}