/* ===========================
   Lato Spin The Wheel – THEME
   =========================== */

:root {
    --lato-blue: #0047c0;
    --lato-blue-deep: #001a66;
    --accent-gold: #ffcf4a;
    --accent-gold-deep: #c58b1d;
    --accent-pink: #ff3ea9;
    --text-light: #f9fafb;
    --card-bg: #ffffff;
}

/* Global reset */

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

body {
    margin: 0;
    min-height: 100vh;
    color: #111827;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    /* Diamond casino-style background */
    background:
        url("spin-back.jpg") repeat center center fixed,
        radial-gradient(circle at top, #0b1c5a 0, #03045e 55%, #020217 100%);
    background-size: auto, cover;
}

/* ===========================
   Top hero / logos
   =========================== */

.theme-header {
    padding-top: 1.25rem;
    padding-bottom: 0.5rem;
}
.theme-header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center; /* ⬅️ this centers LATO + Spin logo vertically */
    gap: 2.5rem;
}

.brand-logo {
    max-height: 100px;
    width: auto;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.45));
}

.spin-logo {
    max-height: 200px;
    width: auto;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.65));
}

/* ===========================
   Main container & cards
   =========================== */

.main-wrap {
    max-width: 1000px;
    margin: 0 auto 2.5rem;
    padding: 0 1rem 2rem;
}

.card {
    background: radial-gradient(
        circle at top,
        #ffffff 0,
        #f4f5ff 60%,
        #e5e7ff 100%
    );
    border-radius: 22px;
    padding: 1.5rem 1.75rem;
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.45),
        0 0 0 3px rgba(255, 255, 255, 0.04);
    margin-bottom: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

/* ---------------------------
   Form card
   --------------------------- */

.form-card {
    margin-top: 0.5rem;
}

.form-title {
    font-family: "Playfair Display", serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2933;
    margin: 0 0 1rem;
}

.form-group {
    margin-bottom: 0.9rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: #374151;
}

/* Inputs */
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"] {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #c4c9e5;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.form-group input:focus {
    border-color: var(--accent-gold);
    background: #ffffff;
    box-shadow:
        0 0 0 1px rgba(255, 207, 74, 0.65),
        0 0 0 7px rgba(17, 24, 39, 0.35);
}

/* Honeypot – hidden from users */
.honeypot {
    display: none !important;
}

/* Terms */

.terms-group {
    margin-top: 0.75rem;
}

.terms-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: #374151;
}

.terms-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
}

.terms-label a {
    color: var(--lato-blue);
    text-decoration: underline;
    font-weight: 500;
}

.terms-note {
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.4;
}

.form-hint {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: #4b5563;
}

/* ===========================
   Wheel card & wheel styling
   =========================== */

.wheel-card {
    text-align: center;
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
}

.wheel-title {
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    color: var(--lato-blue-deep);
    margin: 0 0 0.25rem;
}

.wheel-subtext {
    font-size: 0.85rem;
    color: #374151;
    margin: 0 0 1.2rem;
}

/* Wheel shell mimics the white box in your theme */
.wheel-shell {
    position: relative;
    width: min(100%, 420px);
    margin: 0 auto 1.2rem;
    /* subtle glow around wheel */
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);

    box-shadow:
        0 26px 60px rgba(0, 0, 0, 0.5),
        0 0 0 5px rgba(255, 255, 255, 0.4);
}

/* Canvas – sits on top of gold base, sized as a circle */
#wheelCanvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 50%;
}

.wheel-container {
    position: relative;
}

/* Pointer: small red triangle, perfectly centered above wheel */
.pointer {
    position: absolute;
    left: 46%;
    top: -4px; /* just above the wheel rim */
    transform: translateX(-50%);
    width: 0;
    height: 0;
    z-index: 50;
}

.pointer::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 28px solid #ff3737; /* downwards red arrow */
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4));
}

/* Pointer bounce + glow when wheel stops (used by JS) */
.pointer-hit {
    animation:
        pointer-hit 0.35s ease-out,
        pointer-glow 1.7s ease-in-out infinite 0.35s;
}

@keyframes pointer-hit {
    0% {
        transform: translateX(-50%) translateY(0);
    }
    20% {
        transform: translateX(-50%) translateY(-6px);
    }
    60% {
        transform: translateX(-50%) translateY(3px);
    }
    100% {
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes pointer-glow {
    0% {
        box-shadow:
            0 4px 10px rgba(15, 23, 42, 0.55),
            0 0 0 0 rgba(255, 255, 255, 0);
    }
    50% {
        box-shadow:
            0 6px 14px rgba(15, 23, 42, 0.7),
            0 0 10px 2px rgba(255, 255, 255, 0.55);
    }
    100% {
        box-shadow:
            0 4px 10px rgba(15, 23, 42, 0.55),
            0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Spin button – gradient pill matching theme */
#spinBtn {
    background: linear-gradient(135deg, #7dd3fc, #c084fc, #fca5a5);
    padding: 15px 50px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 1px;
    text-align: center;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(255, 255, 255, 0.45);
    transition: 0.3s ease;
}

#spinBtn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(255, 255, 255, 0.65);
}

#spinBtn:active {
    transform: scale(0.95);
}

#spinBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        0 20px 52px rgba(0, 0, 0, 0.65),
        0 0 0 3px rgba(255, 255, 255, 0.7);
}

#spinBtn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.5),
        0 0 0 3px rgba(255, 255, 255, 0.55);
}

#spinBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.65);
}

/* Result text */

#resultMessage {
    margin-top: 0.7rem;
    font-size: 0.95rem;
    min-height: 1.1em;
    color: #293c8f;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===========================
   Modal (Terms)
   =========================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
}

.modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 26px 50px rgba(0, 0, 0, 0.45);
    border-top: 5px solid var(--accent-gold);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--lato-blue-deep);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #4b5563;
}

.modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    font-size: 0.9rem;
    color: #374151;
}

.modal-body ul {
    padding-left: 1.2rem;
}

.modal-body li {
    margin-bottom: 0.3rem;
}

.modal-footer-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.modal-footer-note a {
    color: var(--lato-blue);
    text-decoration: underline;
}

.modal-footer {
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    padding: 0.5rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #0047c0, #33b1ff);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

/* ===========================
   Confetti (unchanged API)
   =========================== */

.confetti-piece {
    position: fixed;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    opacity: 0.9;
    z-index: 70;
    pointer-events: none;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translate3d(0, -10vh, 0) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translate3d(0, 110vh, 0) rotateZ(360deg);
        opacity: 0;
    }
}

/* ===========================
   Responsive tweaks
   =========================== */

@media (max-width: 768px) {
    .theme-header-inner {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .brand-logo {
        max-width: 150px;
    }

    .spin-logo {
        max-width: 220px;
    }

    .card {
        padding: 1.1rem 1.15rem 1.3rem;
        border-radius: 18px;
    }

    .wheel-shell {
        width: min(100%, 340px);
        padding: 1.2rem 1.2rem 1rem;
    }

    .wheel-title {
        font-size: 1.6rem;
    }

    #spinBtn {
        width: 100%;
    }
}
.intro-text {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 25px;
    color: #0a2240;
    padding: 0 10px;
}

.festive-intro-title {
    font-size: 28px;
    font-weight: 700;
    font-family: "Georgia", serif;
    letter-spacing: 0.5px;
    color: #0a2240;
    margin-bottom: 8px;
    text-shadow: 0px 2px 6px rgba(255, 215, 0, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.festive-intro-subtext {
    font-size: 16px;
    line-height: 1.6;
    color: #334155;
    font-weight: 400;
}

/* Base emoji styling */
.festive-intro-title .icon-tree,
.festive-intro-title .icon-gift,
.festive-intro-subtext .icon-sparkle,
.festive-intro-subtext .icon-confetti {
    display: inline-block;
}

/* 🎄 Glowing Christmas tree */
.icon-tree {
    animation: treeGlow 2s ease-in-out infinite;
}

@keyframes treeGlow {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(34, 197, 94, 0);
    }
    50% {
        transform: scale(1.12);
        text-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* 🎁 Bouncing gift */
.icon-gift {
    animation: giftBounce 1.4s ease-in-out infinite;
}

@keyframes giftBounce {
    0%,
    100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-1px);
    }
}

/* ✨ Pulsing sparkle */
.icon-sparkle {
    animation: sparklePulse 1.8s ease-in-out infinite;
}

@keyframes sparklePulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.25);
        opacity: 1;
        filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.9));
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
        filter: drop-shadow(0 0 0 rgba(251, 191, 36, 0));
    }
}

/* 🎉 Subtle wiggle for confetti */
.icon-confetti {
    animation: confettiWiggle 2.2s ease-in-out infinite;
}

@keyframes confettiWiggle {
    0%,
    100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-8deg);
    }
    50% {
        transform: rotate(6deg);
    }
    75% {
        transform: rotate(-4deg);
    }
}
