/* Overlay */
#spin-wheel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* Container */
#spin-wheel-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #E8677C;
    border: none;
    border-radius: 20px;
    padding: 0;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    width: 800px;
    max-width: 90vw;
    max-height: 90vh;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Inner content wrapper */
#spin-wheel-container .wheel-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    padding: 35% 20px 20px;
    box-sizing: border-box;
}

/* Title — hidden when background image provides branding */
#spin-wheel-container h2 {
    color: #FFD700;
    font-family: 'Georgia', serif;
    text-transform: uppercase;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
    height: 0;
    overflow: hidden;
}

/* Subtitle — hidden when background image provides branding */
#spin-wheel-container .wheel-subtitle {
    color: #fff;
    font-family: 'Georgia', serif;
    text-transform: uppercase;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
    height: 0;
    overflow: hidden;
}

/* Canvas */
#spin-wheel-canvas {
    width: 55%;
    max-width: 55%;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 10;
    display: block;
    margin: 0 auto;
    flex-shrink: 1;
}

/* Input & Button wrapper */
#spin-wheel-container .spin-form {
    display: flex;
    gap: 0;
    margin-top: auto;
    padding-top: 15px;
    justify-content: center;
    align-items: stretch;
    width: 100%;
}

#spin-btn {
    padding: 12px 25px;
    background: #FFD700;
    color: #a90000;
    border: 2px solid #FFD700;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s;
    white-space: nowrap;
    width: 100%;
}

#spin-btn:hover {
    background: #ffeb3b;
}

#spin-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* Custom image button */
img#spin-btn.spin-btn-img {
    height: 48px;
    width: 100%;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    border-radius: 5px;
    object-fit: contain;
    transition: opacity 0.3s;
}

img#spin-btn.spin-btn-img:hover {
    opacity: 0.85;
}

img#spin-btn.spin-btn-img.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Close Button — hidden, click-away dismisses instead */
#spin-wheel-close {
    display: none;
}

/* Result Modal */
#spin-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 200000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spin-result-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    border: 2px solid #FFD700;
    position: relative;
    animation: popIn 0.3s ease-out;
}

.spin-reward-image {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
    display: block;
}

.spin-result-content.image-only {
    padding: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: 90vw;
    width: 800px;
}

.spin-result-content.image-only .close-result-btn {
    display: none;
}

.spin-result-content h3 {
    color: #E8677C;
    margin-top: 0;
    font-size: 24px;
}

.spin-result-content p {
    font-size: 1.2em;
    margin: 15px 0;
    color: #333;
}

.coupon-box {
    margin: 20px 0;
    padding: 10px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
}

.coupon-box input {
    width: 120px;
    text-align: center;
    border: 1px solid #ddd;
    padding: 5px;
    font-family: monospace;
    font-weight: bold;
    color: #E8677C;
}

.coupon-box button {
    cursor: pointer;
    background: #FFD700;
    border: none;
    padding: 5px 10px;
    color: #E8677C;
    font-weight: bold;
    border-radius: 3px;
}

.close-result-btn {
    margin-top: 10px;
    background: #E8677C;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.close-result-btn:hover {
    background: #D94F6B;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile */
@media (max-width: 600px) {
    #spin-wheel-container {
        width: 95vw;
        max-height: 95vh;
    }

    #spin-wheel-container .wheel-content {
        padding: 45% 12px 12px;
    }

    #spin-wheel-canvas {
        width: 70%;
        max-width: 70%;
    }

    #spin-email {
        font-size: 14px;
        padding: 10px 10px;
    }

    #spin-btn {
        font-size: 14px;
        padding: 10px 15px;
    }
}