/* Lucky Spin Wheel — Modern Frontend v3.0 */

*, *::before, *::after { box-sizing: border-box; }

/* ── Container ───────────────────────────────────────────────────── */
.lsw-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    position: relative;
}

/* ── Test-mode banner ────────────────────────────────────────────── */
.lsw-test-banner {
    background: #fef3c7;
    color: #92400e;
    border: 1.5px solid #fcd34d;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

/* ── Two-column layout ───────────────────────────────────────────── */
.lsw-layout {
    display: flex;
    flex-direction: column;       /* mobile: stacked */
    gap: 24px;
    align-items: stretch;
}

@media (min-width: 768px) {
    .lsw-layout {
        flex-direction: row;      /* tablet+: side by side */
        align-items: center;
        gap: 32px;
    }
    .lsw-wheel-col  { flex: 1 1 50%; }
    .lsw-form-col   { flex: 1 1 50%; }
}

/* ── Wheel column ────────────────────────────────────────────────── */
.lsw-wheel-col {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 24px;
    padding: 36px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.35);
}

.lsw-wheel-col::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 36px 36px;
    animation: drift 25s linear infinite;
    pointer-events: none;
}
@keyframes drift { to { background-position: 100px 100px; } }

.lsw-title {
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 24px;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

/* ── Wheel wrapper ───────────────────────────────────────────────── */
.lsw-wheel-wrapper {
    position: relative;
    width: 340px;
    height: 340px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .lsw-wheel-wrapper { width: 280px; height: 280px; }
}

.lsw-wheel-canvas {
    width: 100%; height: 100%;
    display: block;
    filter: drop-shadow(0 8px 30px rgba(0,0,0,0.28));
}
.lsw-spinning .lsw-wheel-canvas {
    filter: drop-shadow(0 12px 40px rgba(245,158,11,0.55));
}

.lsw-wheel-pointer {
    position: absolute;
    top: -26px; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left:  26px solid transparent;
    border-right: 26px solid transparent;
    border-top:   52px solid #fbbf24;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
    z-index: 10;
    animation: ptrBounce 2.5s ease-in-out infinite;
}
@keyframes ptrBounce {
    0%,100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-7px); }
}

/* ── Form column / card ──────────────────────────────────────────── */
.lsw-form-col { display: flex; flex-direction: column; }

.lsw-form-card {
    background: #fff;
    border-radius: 22px;
    padding: 32px 28px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.10);
    border: 1px solid #e5e7eb;
}

.lsw-form-card-header {
    margin-bottom: 24px;
}
.lsw-form-card-header h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}
.lsw-form-card-header p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* ── Form inputs ─────────────────────────────────────────────────── */
.lsw-spin-form { display: flex; flex-direction: column; gap: 14px; }

.lsw-form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.lsw-form-group input[type="text"],
.lsw-form-group input[type="email"],
.lsw-form-group input[type="tel"] {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    color: #111827;
    background: #f9fafb;
    transition: all 0.25s ease;
}
.lsw-form-group input:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.lsw-form-group input::placeholder { color: #9ca3af; }

.lsw-terms {
    background: #f3f4f6;
    padding: 12px 14px;
    border-radius: 10px;
}
.lsw-terms label {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #374151; cursor: pointer;
}
.lsw-terms input[type="checkbox"] {
    width: 16px; height: 16px; flex-shrink: 0;
    accent-color: #6366f1;
}

/* ── Spin button ─────────────────────────────────────────────────── */
.lsw-spin-button {
    width: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    padding: 15px 24px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 24px rgba(99,102,241,0.35);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    position: relative;
    overflow: hidden;
}
.lsw-spin-button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,rgba(255,255,255,0.18),transparent);
    opacity: 0;
    transition: opacity 0.25s;
}
.lsw-spin-button:hover::after { opacity: 1; }
.lsw-spin-button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(99,102,241,0.45); }
.lsw-spin-button:active { transform: translateY(0); }
.lsw-spin-button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ── Spinning state ──────────────────────────────────────────────── */
.lsw-spinning-wrapper {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 20px; padding: 40px 0;
}
.lsw-spinner-ring {
    width: 54px; height: 54px;
    border: 5px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spinRing 0.8s linear infinite;
}
@keyframes spinRing { to { transform: rotate(360deg); } }
.lsw-spinning-text { font-size: 17px; font-weight: 600; color: #374151; margin: 0; }

/* ── Already-spun state ──────────────────────────────────────────── */
.lsw-result-wrapper {
    text-align: center; padding: 40px 0;
}
.lsw-result-icon { font-size: 52px; margin-bottom: 14px; }
.lsw-result-text { font-size: 20px; font-weight: 700; color: #111827; margin: 0 0 8px; }
.lsw-result-sub  { font-size: 14px; color: #6b7280; margin: 0; }

/* ── Winner toast — FIXED position, never touches layout ─────────── */
.lsw-toast-area {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 99990;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
    max-width: 320px;
}

.lsw-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.16);
    border-left: 4px solid #6366f1;
    font-size: 13px;
    color: #1f2937;
    opacity: 0;
    transform: translateX(-24px) scale(0.96);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34,1.36,0.64,1);
    pointer-events: none;
}
.lsw-toast.lsw-toast-enter {
    opacity: 1;
    transform: translateX(0) scale(1);
}
.lsw-toast.lsw-toast-leave {
    opacity: 0;
    transform: translateX(-16px) scale(0.93);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.lsw-toast-icon { font-size: 22px; flex-shrink: 0; }
.lsw-toast-body strong { display: block; font-weight: 700; color: #111827; }
.lsw-toast-body span   { color: #6366f1; font-weight: 600; }

/* ── Modal ───────────────────────────────────────────────────────── */
.lsw-modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(5px);
    z-index: 99999;
    align-items: center; justify-content: center;
}
.lsw-modal.active { display: flex; }

.lsw-modal-content {
    background: #fff;
    border-radius: 26px;
    max-width: 480px; width: 92%;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0,0,0,0.28);
    animation: modalUp 0.4s cubic-bezier(0.34,1.46,0.64,1);
}
@keyframes modalUp {
    from { transform: translateY(80px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.lsw-modal-header {
    background: linear-gradient(135deg,#6366f1,#8b5cf6);
    padding: 36px 28px 28px;
    text-align: center;
    border-radius: 26px 26px 0 0;
    color: #fff;
}
.lsw-modal-emoji { font-size: 52px; margin-bottom: 8px; }
.lsw-modal-header h3 { margin: 0 0 6px; font-size: 30px; font-weight: 800; }
.lsw-modal-header p  { margin: 0; opacity: 0.85; font-size: 14px; }

.lsw-modal-body { padding: 32px 28px; text-align: center; }

.lsw-prize-image img {
    max-width: 180px; max-height: 180px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(99,102,241,0.2);
    border: 3px solid #f3f4f6;
    margin-bottom: 20px;
}
.lsw-prize-name {
    font-size: 30px; font-weight: 800; color: #111827;
    margin: 0 0 10px; letter-spacing: -0.5px;
}
.lsw-prize-description { color: #6b7280; font-size: 15px; line-height: 1.7; margin: 0 0 20px; }

.lsw-coupon-code {
    background: linear-gradient(135deg,#eef2ff,#f5f3ff);
    border: 2px dashed #6366f1;
    border-radius: 14px;
    padding: 20px;
    margin: 0 0 20px;
}
.lsw-coupon-code strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #374151; margin-bottom: 10px; }
.lsw-coupon-code span {
    display: inline-block;
    background: linear-gradient(135deg,#6366f1,#8b5cf6);
    color: #fff; padding: 12px 24px;
    border-radius: 8px; font-size: 20px; font-weight: 800;
    letter-spacing: 2px; font-family: 'Monaco','Courier New',monospace;
    margin-bottom: 8px;
}
.lsw-coupon-code small { display: block; font-size: 12px; color: #6b7280; }

.lsw-modal-email-note { font-size: 13px; color: #6b7280; margin: 0; }

.lsw-modal-footer { padding: 0 28px 32px; text-align: center; }
.lsw-modal-close {
    background: linear-gradient(135deg,#6366f1,#8b5cf6);
    color: #fff; border: none;
    padding: 14px 44px; font-size: 16px; font-weight: 700;
    border-radius: 12px; cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.lsw-modal-close:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(99,102,241,0.35); }

/* ── Confetti canvas ─────────────────────────────────────────────── */
.lsw-confetti-canvas {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none; z-index: 99998;
}
