/*
 * Rollpix Spin & Win — base styles.
 *
 * Everything is namespaced under .rollpix-saw so it cannot leak into the theme.
 * A visual template is just another class on the overlay (see Model\Template\Pool):
 * .rollpix-saw--dark below is the second shipped template and shows the pattern.
 */

.rollpix-saw__overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .55);
    padding: 16px;
}

.rollpix-saw__overlay.is-open {
    display: flex;
}

.rollpix-saw__modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 28px 24px 24px;
    border-radius: 14px;
    background: #fff;
    color: #1f1f1f;
    text-align: center;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
}

.rollpix-saw__close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: 0;
    background: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}

.rollpix-saw__title {
    margin: 0 0 6px;
    font-size: 22px;
}

.rollpix-saw__description {
    margin: 0 0 14px;
    font-size: 14px;
    opacity: .8;
}

.rollpix-saw__wheel {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.rollpix-saw__canvas {
    display: block;
    max-width: 100%;
    height: auto;
    transform: rotate(0deg);
}

/* Pointer sits at 12 o'clock — spinTo() lands the winning slice right here. */
.rollpix-saw__pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    z-index: 2;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid #1f1f1f;
}

.rollpix-saw__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rollpix-saw__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
}

.rollpix-saw__consent {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    text-align: left;
    opacity: .85;
}

.rollpix-saw__button {
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: #1f1f1f;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.rollpix-saw__button[disabled] {
    opacity: .55;
    cursor: default;
}

.rollpix-saw__status {
    margin: 14px 0 0;
    font-size: 15px;
}

.rollpix-saw__coupon {
    display: none;
    margin-top: 10px;
    padding: 12px;
    border: 2px dashed #999;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    user-select: all;
}

.rollpix-saw__coupon.is-visible {
    display: block;
}

.rollpix-saw__icon {
    position: fixed;
    z-index: 9998;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: #1f1f1f;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}

.rollpix-saw__icon--bottom-right {
    right: 18px;
    bottom: 18px;
}

.rollpix-saw__icon--middle-right {
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
}

.rollpix-saw__icon--middle-left {
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
}

/* ── Template: dark ─────────────────────────────────────────────── */

.rollpix-saw--dark .rollpix-saw__modal {
    background: #16181d;
    color: #f4f4f5;
}

.rollpix-saw--dark .rollpix-saw__pointer {
    border-top-color: #f4f4f5;
}

.rollpix-saw--dark .rollpix-saw__button {
    background: #f4f4f5;
    color: #16181d;
}

.rollpix-saw--dark .rollpix-saw__input {
    border-color: #3a3d45;
    background: #22252c;
    color: #f4f4f5;
}

@media (max-width: 480px) {
    .rollpix-saw__modal {
        padding: 24px 16px 20px;
    }

    .rollpix-saw__title {
        font-size: 19px;
    }
}
