.spin-to-win,
.spin-to-win * {
    box-sizing: border-box;
}

.spin-to-win {
    --stw-bg: #101713;
    --stw-surface: #17231d;
    --stw-surface-soft: #213126;
    --stw-primary: #2f8f5b;
    --stw-primary-dark: #236b47;
    --stw-accent: #d5a642;
    --stw-accent-dark: #b9852f;
    --stw-wheel-light: #f4f7ef;
    --stw-wheel-green: #2f8f5b;
    --stw-wheel-dark: #18251f;
    --stw-ink: #f7faf7;
    --stw-muted: rgba(247,250,247,.72);
    --stw-border: rgba(247,250,247,.14);
    --stw-error: #ffb8a8;
    display: none;
    font-family: var(--ds-main-font, inherit);
}

.spin-to-win.is-ready {
    display: block;
}

.spin-to-win [hidden] {
    display: none !important;
}

.stw-trigger {
    position: fixed;
    left: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 1035;
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;
    max-width: calc(100vw - 36px);
    border: 1px solid var(--stw-border);
    border-radius: 8px;
    background: var(--stw-bg);
    box-shadow: 0 10px 28px rgba(0,0,0,.24);
    opacity: 0;
    transform: translateY(10px);
    animation: stw-trigger-in .32s ease forwards;
}

.stw-trigger__button,
.stw-trigger__close,
.stw-modal__close,
.stw-submit {
    border: 0;
    font: inherit;
    cursor: pointer;
}

.stw-trigger__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 13px 10px 12px;
    color: var(--stw-ink);
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.stw-trigger__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    color: var(--stw-bg);
    background: var(--stw-accent);
    font-size: 13px;
    font-weight: 800;
}

.stw-trigger__close {
    width: 34px;
    min-height: 44px;
    color: var(--stw-bg);
    background: var(--stw-accent);
    font-size: 22px;
    line-height: 1;
}

.stw-trigger__button:hover,
.stw-trigger__button:focus,
.stw-trigger__close:hover,
.stw-trigger__close:focus {
    outline: none;
}

.stw-trigger__button:hover,
.stw-trigger__button:focus {
    background: var(--stw-surface-soft);
}

.stw-trigger__close:hover,
.stw-trigger__close:focus {
    color: var(--stw-bg);
    background: #e2b857;
}

.stw-modal {
    position: fixed;
    inset: 0;
    z-index: 21000;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.stw-modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(6,12,9,.74);
}

.stw-modal__dialog {
    position: relative;
    width: min(920px, 100%);
    max-height: min(720px, calc(100vh - 36px));
    overflow: auto;
    border: 1px solid var(--stw-border);
    border-radius: 8px;
    background: var(--stw-surface);
    color: var(--stw-ink);
    box-shadow: 0 24px 80px rgba(0,0,0,.46);
}

.stw-modal__content {
    display: grid;
    grid-template-columns: minmax(270px, 1fr) minmax(280px, 360px);
    gap: 28px;
    align-items: center;
    padding: 34px;
}

.stw-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--stw-ink);
    background: rgba(247,250,247,.1);
    font-size: 28px;
    line-height: 1;
}

.stw-modal__close:hover,
.stw-modal__close:focus {
    outline: none;
    background: rgba(247,250,247,.18);
}

.stw-wheel-area {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.stw-wheel-shell {
    position: relative;
    width: min(380px, 100%);
    aspect-ratio: 1;
    padding: 12px;
}

.stw-wheel {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    border: 10px solid var(--stw-wheel-light);
    border-radius: 50%;
    overflow: hidden;
    background:
        conic-gradient(from 75deg,
            var(--stw-wheel-light) 0deg 30deg,
            var(--stw-wheel-green) 30deg 60deg,
            var(--stw-wheel-dark) 60deg 90deg,
            var(--stw-wheel-light) 90deg 120deg,
            var(--stw-wheel-green) 120deg 150deg,
            var(--stw-wheel-dark) 150deg 180deg,
            var(--stw-wheel-light) 180deg 210deg,
            var(--stw-wheel-green) 210deg 240deg,
            var(--stw-wheel-dark) 240deg 270deg,
            var(--stw-wheel-light) 270deg 300deg,
            var(--stw-wheel-green) 300deg 330deg,
            var(--stw-wheel-dark) 330deg 360deg);
    box-shadow: inset 0 0 0 2px rgba(0,0,0,.18), 0 14px 36px rgba(0,0,0,.34);
    transform: rotate(0deg);
    will-change: transform;
}

.stw-wheel.is-spinning {
    transition: transform 5.4s cubic-bezier(.12,.78,.12,1);
}

.stw-wheel__hub {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58px;
    height: 58px;
    border: 7px solid var(--stw-wheel-light);
    border-radius: 50%;
    background: var(--stw-accent);
    box-shadow: 0 4px 16px rgba(0,0,0,.28);
    transform: translate(-50%, -50%);
}

.stw-sector-label {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 86px;
    min-height: 34px;
    margin: -17px 0 0 -43px;
    padding: 0 4px;
    color: var(--stw-bg);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(calc(var(--i) * 30deg)) translateX(112px) rotate(calc(var(--i) * -30deg));
    transform-origin: center;
    pointer-events: none;
}

.stw-sector-label--dark {
    color: var(--stw-ink);
}

.stw-sector-label--red {
    color: var(--stw-ink);
}

.stw-pointer {
    position: absolute;
    top: 50%;
    right: -6px;
    width: 0;
    height: 0;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-right: 28px solid var(--stw-wheel-light);
    filter: drop-shadow(0 3px 6px rgba(0,0,0,.35));
    transform: translateY(-50%);
    z-index: 2;
}

.stw-panel {
    min-width: 0;
    padding-right: 18px;
}

.stw-panel__intro h2 {
    margin: 0 0 10px;
    color: var(--stw-ink);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.12;
}

.stw-panel__intro p {
    margin: 0 0 22px;
    color: var(--stw-muted);
    font-size: 15px;
    line-height: 1.45;
}

.stw-form {
    display: grid;
    gap: 12px;
}

.stw-field {
    display: grid;
    gap: 6px;
    margin: 0;
    color: rgba(247,250,247,.84);
    font-size: 13px;
    font-weight: 600;
}

.stw-field input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--stw-border);
    border-radius: 6px;
    padding: 0 12px;
    color: var(--stw-ink);
    background: rgba(247,250,247,.08);
    font: inherit;
    outline: none;
}

.stw-field input:focus {
    border-color: var(--stw-accent);
    background: rgba(247,250,247,.11);
}

.stw-consent {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 9px;
    align-items: start;
    margin: 4px 0 0;
    color: rgba(247,250,247,.78);
    font-size: 13px;
    line-height: 1.35;
    cursor: pointer;
}

.stw-consent input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--stw-primary);
}

.stw-agreement {
    margin: 0;
    color: rgba(247,250,247,.52);
    font-size: 12px;
    line-height: 1.4;
}

.stw-message {
    min-height: 18px;
    color: var(--stw-error);
    font-size: 13px;
    line-height: 1.35;
}

.stw-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 6px;
    padding: 11px 18px;
    color: #fff;
    background: var(--stw-primary);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.15;
}

.stw-submit:hover,
.stw-submit:focus {
    outline: none;
    background: var(--stw-primary-dark);
}

.stw-submit:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.stw-result {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--stw-border);
    border-radius: 8px;
    background: rgba(247,250,247,.08);
    color: var(--stw-ink);
    font-size: 15px;
    line-height: 1.45;
}

.stw-result p {
    margin: 0 0 8px;
}

.stw-result p:last-child {
    margin-bottom: 0;
}

body.stw-modal-open {
    overflow: hidden;
}

@keyframes stw-trigger-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .stw-trigger {
        left: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        max-width: calc(100vw - 24px);
    }

    .stw-trigger__button {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .stw-trigger__icon {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
    }

    .stw-trigger__close {
        width: 32px;
        min-height: 40px;
    }

    .stw-modal {
        align-items: flex-start;
        justify-content: flex-start;
        padding: calc(10px + env(safe-area-inset-top)) 10px calc(18px + env(safe-area-inset-bottom));
    }

    .stw-modal__dialog {
        width: 100%;
        max-height: none;
        margin: 0;
        overflow: visible;
    }

    .stw-modal__close {
        position: fixed;
        top: calc(18px + env(safe-area-inset-top));
        right: 18px;
        z-index: 4;
    }

    .stw-modal__content {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 48px 16px 18px;
    }

    .stw-wheel-shell {
        width: min(292px, calc(100vw - 56px));
        padding: 8px;
    }

    .stw-wheel {
        border-width: 8px;
    }

    .stw-wheel__hub {
        width: 46px;
        height: 46px;
        border-width: 6px;
    }

    .stw-sector-label {
        width: 64px;
        min-height: 28px;
        margin: -14px 0 0 -32px;
        font-size: 7.7px;
        transform: rotate(calc(var(--i) * 30deg)) translateX(84px) rotate(calc(var(--i) * -30deg));
    }

    .stw-pointer {
        right: -7px;
        border-top-width: 12px;
        border-bottom-width: 12px;
        border-right-width: 22px;
    }

    .stw-panel {
        padding-right: 0;
    }

    .stw-panel__intro h2 {
        font-size: 22px;
    }

    .stw-panel__intro p {
        font-size: 14px;
    }
}
