.th-discount-wheel {
    margin: 1rem auto;
    text-align: center;
}

.th-discount-wheel [hidden] {
    display: none !important;
}

.th-discount-wheel__dialog {
    position: fixed;
    inset: 0;
    width: min(94vw, 790px);
    max-width: none;
    max-height: 94vh;
    margin: auto;
    padding: 28px;
    overflow: auto;
    border: 1px solid #dbeafe;
    border-radius: 24px;
    background: #fff;
    color: #0f172a;
    text-align: left;
    box-shadow: 0 24px 70px rgb(15 23 42 / 28%);
}

.th-discount-wheel__dialog::backdrop {
    background: rgb(15 23 42 / 72%);
}

.th-discount-wheel__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
}

.th-discount-wheel__preview {
    min-width: 0;
}

.th-discount-wheel__preview[hidden] + .th-discount-wheel__details {
    grid-column: 1 / -1;
}

.th-discount-wheel__board {
    position: relative;
    width: min(100%, 360px);
    margin: 0 auto;
    isolation: isolate;
}

.th-discount-wheel__viewport {
    overflow: hidden;
}

.th-discount-wheel__disc {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    transform-origin: 50% 50%;
}

.th-discount-wheel__slice {
    stroke: #fff;
    stroke-width: 2px;
    stroke-linejoin: round;
}

.th-discount-wheel__slice--blue { fill: #1d4ed8; }
.th-discount-wheel__slice--purple { fill: #6d28d9; }
.th-discount-wheel__slice--pink { fill: #be123c; }
.th-discount-wheel__slice--orange { fill: #b45309; }
.th-discount-wheel__slice--teal { fill: #0f766e; }
.th-discount-wheel__slice--empty { fill: #f1f5f9; }

.th-discount-wheel__label {
    fill: #fff;
    font-family: system-ui, sans-serif;
    font-size: 24px;
    font-weight: 800;
    text-anchor: middle;
}

.th-discount-wheel__label--empty {
    fill: #334155;
    font-size: 21px;
}

.th-discount-wheel__label-detail {
    font-size: 20px;
    font-weight: 700;
}

.th-discount-wheel__pointer,
.th-discount-wheel__hub {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.th-discount-wheel__pointer {
    top: -2px;
    left: 50%;
    width: 32px;
    height: 31px;
    transform: translateX(-50%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    background: #0f172a;
}

.th-discount-wheel__hub {
    inset: 50% auto auto 50%;
    display: grid;
    width: 16%;
    aspect-ratio: 1;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 3px solid #dbeafe;
    border-radius: 50%;
    background: #fff;
    color: #1d4ed8;
    font-size: clamp(15px, 4vw, 25px);
}

.th-discount-wheel__status {
    display: grid;
    min-height: 64px;
    margin: 0;
    padding: 8px 12px;
    place-items: center;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-align: center;
}

.th-discount-wheel__details {
    min-width: 0;
    padding: 18px 0 0;
}

.th-discount-wheel__coupon {
    width: 100%;
    gap: 4px;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    user-select: text;
}

.th-discount-wheel__coupon:hover {
    background: #dbeafe;
}

.th-discount-wheel__coupon [data-wheel-code] {
    font-size: 20px;
    font-weight: 750;
}

.th-discount-wheel__copy-feedback,
.th-discount-wheel__coupon-detail {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
}

.th-discount-wheel__coupon-detail {
    color: #64748b;
}

.th-discount-wheel__details h2 {
    margin: 0 0 8px;
    font-size: clamp(23px, 4vw, 34px);
    font-weight: 800;
    line-height: 1.15;
}

.th-discount-wheel__details p:not(.th-discount-wheel__status) {
    margin: 0 0 18px;
    color: #334155;
    font-size: 15px;
    line-height: 1.45;
}

.th-discount-wheel__details form {
    display: grid;
    gap: 10px;
}

.th-discount-wheel__details form > label {
    margin: 0;
    font-size: 14px;
}

.th-discount-wheel__details input[type="tel"] {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 8px 12px;
    border: 1px solid #94a3b8;
    border-radius: 10px;
    font-size: 16px;
}

.th-discount-wheel__consent {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    margin: 4px 0;
}

.th-discount-wheel__consent input[type="checkbox"] {
    -webkit-appearance: auto;
    appearance: auto;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    accent-color: #1d4ed8;
    cursor: pointer;
}

.th-discount-wheel__consent label {
    margin: 0;
    padding: 1px 0 3px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
}

.th-discount-wheel__action {
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid #1d4ed8;
    border-radius: 11px;
    background: #1d4ed8;
    color: #fff;
    font-size: 16px;
    font-weight: 750;
    cursor: pointer;
}

.th-discount-wheel a[data-wheel-login] {
    color: #fff;
    text-decoration: none;
}

.th-discount-wheel__action:hover:enabled,
.th-discount-wheel a[data-wheel-login]:hover {
    background: #1e40af;
}

.th-discount-wheel__action:disabled {
    border-color: #64748b;
    background: #64748b;
    cursor: default;
}

.th-discount-wheel__close {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #0f172a;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.th-discount-wheel :focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 3px;
}

.th-discount-wheel a[data-wheel-login]:focus-visible {
    /* The site's link reset disables outlines with !important. */
    outline: 3px solid #1d4ed8 !important;
}

@media (max-width: 639px) {
    .th-discount-wheel__dialog {
        padding: 20px 14px 14px;
        border-radius: 18px;
    }

    .th-discount-wheel__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .th-discount-wheel__board {
        width: min(100%, 80vw, 310px);
    }

    .th-discount-wheel__status {
        min-height: 58px;
        font-size: 13px;
    }

    .th-discount-wheel__details {
        padding: 0;
    }

    .th-discount-wheel__details form {
        gap: 8px;
    }

    .th-discount-wheel__details p:not(.th-discount-wheel__status) {
        margin-bottom: 12px;
    }
}
