/* =======================================================
   SPIN-THE-WHEEL GAMIFICATION STYLES
   ======================================================= */

/* 1. Floating Launcher Button */
#spinWheelLauncher {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99990;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    font-weight: 700;
    font-size: 13.5px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: swPulseGlow 2.5s infinite;
}
#spinWheelLauncher:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 14px 30px rgba(99, 102, 241, 0.55);
}
#spinWheelLauncher .launcher-icon {
    font-size: 18px;
    animation: swWobble 2s infinite ease-in-out;
}
@keyframes swPulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6); }
    70% { box-shadow: 0 0 0 14px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
@keyframes swWobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-12deg); }
    75% { transform: rotate(12deg); }
}

/* 2. Modal Overlay & Container */
#spinWheelOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.35s ease;
}
#spinWheelOverlay.show {
    display: flex;
    opacity: 1;
}
.spin-wheel-card {
    background: #ffffff;
    border-radius: 24px;
    max-width: 820px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
#spinWheelOverlay.show .spin-wheel-card {
    transform: scale(1) translateY(0);
}
.spin-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    z-index: 50;
    transition: all 0.2s;
}
.spin-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

/* 3. Wheel Visual Section */
.spin-wheel-visual-col {
    background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 100%);
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.wheel-stage-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
}
#spinWheelCanvas {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.4));
}
.wheel-pointer-arrow {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 26px solid #ef4444;
    z-index: 20;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}
.wheel-center-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: #ffffff;
    border-radius: 50%;
    border: 4px solid #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
    color: #4f46e5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 25;
    transition: transform 0.2s;
    user-select: none;
}
.wheel-center-button:hover {
    transform: translate(-50%, -50%) scale(1.08);
}

/* 4. Form & Content Section */
.spin-wheel-content-col {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.spin-header-tag {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    font-weight: 800;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 10px;
}
.spin-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 8px;
}
.spin-subtitle {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 22px;
}
.spin-input-group {
    position: relative;
    margin-bottom: 14px;
}
.spin-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
}
.spin-input {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    padding-left: 42px;
    padding-right: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.spin-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.spin-action-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.spin-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.45);
}
.spin-action-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}
.spin-terms-note {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    margin-top: 12px;
}

/* 5. Winner Screen */
.spin-winner-view {
    display: none;
    text-align: center;
    animation: swFadeIn 0.4s ease;
}
.winner-trophy-badge {
    width: 64px;
    height: 64px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 12px;
    animation: swBounce 1.5s infinite;
}
.winner-prize-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}
.winner-prize-desc {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 16px;
}
.coupon-code-box {
    background: #f8fafc;
    border: 2px dashed #6366f1;
    border-radius: 14px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.coupon-code-text {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 800;
    color: #4f46e5;
    letter-spacing: 1px;
}
.copy-coupon-btn {
    background: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.copy-coupon-btn:hover {
    background: #4338ca;
}
.urgency-badge {
    font-size: 12px;
    font-weight: 700;
    color: #ef4444;
    background: #fee2e2;
    padding: 4px 10px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 18px;
}

@keyframes swFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes swBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 6. Responsive Rules */
@media (max-width: 768px) {
    #spinWheelLauncher {
        bottom: 18px;
        left: 18px;
        padding: 8px 14px;
        font-size: 12px;
    }
    .spin-wheel-card {
        max-width: 420px;
    }
    .spin-wheel-visual-col {
        padding: 24px 10px;
    }
    .wheel-stage-wrapper, #spinWheelCanvas {
        width: 250px;
        height: 250px;
    }
    .spin-wheel-content-col {
        padding: 24px 20px;
    }
    .spin-title {
        font-size: 20px;
    }
}
