/* ── Spin to Win Plugin Styles ── */

/* Tab */
#stw-tab {
    position: fixed;
    right: -44px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    background: var(--stw-tab-color, #C0392B);
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    z-index: 99998;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    box-shadow: -3px 0 16px rgba(0,0,0,.25);
    transition: right .3s ease, background .2s;
    user-select: none;
    white-space: nowrap;
}
#stw-tab:hover { right: -38px; background: #a93226; }

/* Overlay */
#stw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99998;
    animation: stw-fade-in .25s ease;
}

/* Popup */
#stw-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) scale(.92);
    opacity: 0;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0,0,0,.32);
    z-index: 99999;
    width: min(660px, 96vw);
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, sans-serif;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
}
#stw-popup.stw-open {
    display: flex !important;
    flex-direction: column;
    transform: translate(-50%,-50%) scale(1);
    opacity: 1;
}

/* Close */
#stw-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none; border: none;
    font-size: 20px; cursor: pointer;
    color: #888; z-index: 2;
    transition: color .2s;
}
#stw-close:hover { color: #333; }

/* Step rows */
#stw-step-form, #stw-step-result {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Wheel column */
#stw-wheel-col, #stw-wheel-col-2 {
    position: relative;
    flex: 0 0 300px;
    height: 340px;
    background: linear-gradient(135deg,#fff5f5 0%,#ffe8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px 0 0 18px;
}
#stw-canvas, #stw-canvas-2 {
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(192,57,43,.35);
}
#stw-needle, #stw-needle-2 {
    position: absolute;
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
    font-size: 26px;
    color: #7f1d1d;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
    z-index: 2;
}

/* Form column */
#stw-form-col, #stw-result-col {
    flex: 1;
    padding: 36px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#stw-emoji, #stw-result-emoji {
    font-size: 32px;
    margin-bottom: 2px;
}
#stw-headline, #stw-result-title {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.3;
}
#stw-subheadline, #stw-result-msg {
    font-size: 14px;
    color: #555;
    margin: 0 0 12px;
    line-height: 1.5;
}

/* Fields */
.stw-field {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #fafafa;
    transition: border-color .2s;
}
.stw-field:focus-within { border-color: #C0392B; background:#fff; }
.stw-flag {
    padding: 0 10px;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    border-right: 1px solid #eee;
    height: 44px;
    display: flex;
    align-items: center;
    background: #f5f5f5;
}
.stw-field input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    flex: 1;
    color: #222;
    box-shadow: none !important;
}

/* Spin button */
#stw-spin-btn {
    width: 100%;
    padding: 13px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .3px;
    transition: background .2s, transform .15s;
    margin-top: 4px;
}
#stw-spin-btn:hover { background: #333; }
#stw-spin-btn:active { transform: scale(.98); }
#stw-spin-btn:disabled { opacity:.6; cursor:default; }

/* No thanks / disclaimer */
#stw-no-thanks {
    display: block;
    text-align: center;
    color: #C0392B;
    font-size: 13px;
    margin-top: 6px;
    text-decoration: none;
    font-weight: 600;
}
#stw-no-thanks:hover { text-decoration: underline; }
#stw-disclaimer {
    font-size: 11px;
    color: #999;
    text-align: center;
    line-height: 1.5;
    margin-top: 6px;
}

/* Coupon box */
#stw-coupon-box {
    margin: 12px 0;
}
#stw-coupon-wrap {
    display: flex;
    align-items: center;
    border: 2px dashed #C0392B;
    border-radius: 8px;
    overflow: hidden;
    background: #fff5f5;
}
#stw-coupon-code {
    flex: 1;
    padding: 12px 16px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #C0392B;
    font-family: monospace;
}
#stw-copy-btn {
    padding: 0 16px;
    height: 48px;
    background: #f5d5d5;
    border: none;
    border-left: 1px dashed #C0392B;
    font-size: 18px;
    cursor: pointer;
    color: #C0392B;
    transition: background .2s;
}
#stw-copy-btn:hover { background: #e8c0c0; }

/* Shop btn */
#stw-shop-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 13px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .3px;
    transition: background .2s;
    margin-top: 8px;
}
#stw-shop-btn:hover { background: #333; color: #fff; }

/* Animations */
@keyframes stw-fade-in {
    from { opacity:0; } to { opacity:1; }
}
@keyframes stw-pulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}
.stw-pulse { animation: stw-pulse .6s ease 3; }

/* Mobile */
@media (max-width: 540px) {
    #stw-step-form, #stw-step-result { flex-direction: column; }
    #stw-wheel-col, #stw-wheel-col-2 {
        flex: none; width: 100%; height: 260px;
        border-radius: 18px 18px 0 0;
    }
    #stw-canvas, #stw-canvas-2 { width: 220px !important; height: 220px !important; }
    #stw-form-col, #stw-result-col { padding: 24px 20px 20px; }
    #stw-popup { width: 96vw; }
    #stw-tab { font-size: 12px; padding: 8px 16px; right: -40px; }
}
