/* ─── Lucky Wheel page ─── */

.sw-page {
    position: relative;
    overflow-x: hidden;
    overflow-x: clip;
    min-height: 70vh;
    background: #f5f5f5;
}

.sw-page__inner {
    position: relative;
    z-index: 1;
}

/* Alerts */
.sw-alert {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.9rem;
    font-size: 0.8rem;
    text-align: right;
}

.sw-alert--warn {
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: #fffbeb;
    color: #92400e;
}

.sw-alert--info {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #fff;
    color: #475569;
}

/* Main 2-column layout (RTL: first = right panel, second = left wheel) */
.sw-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .sw-layout {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
        gap: 2rem;
        align-items: center;
    }
}

.sw-side {
    order: 2;
    text-align: right;
}

.sw-stage {
    order: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (min-width: 1024px) {
    .sw-side {
        order: 0;
    }

    .sw-stage {
        order: 0;
    }
}

.sw-side__header {
    margin-bottom: 1.15rem;
}

.sw-side__title {
    font-size: clamp(1.35rem, 3.2vw, 1.85rem);
    font-weight: 900;
    line-height: 1.35;
    color: #1a1a1a;
}

.sw-side__sub {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #6b7280;
}

/* Stats cards */
.sw-stats {
    margin-bottom: 1rem;
}

.sw-stats__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.sw-stats__item {
    padding: 0.85rem 0.5rem;
    border-radius: 0.9rem;
    background: #fff;
    border: 1px solid #ebebeb;
    box-shadow: 0 4px 14px -10px rgba(15, 23, 42, 0.18);
    text-align: center;
}

.sw-stats__label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #6b7280;
}

.sw-stats__value {
    margin-top: 0.3rem;
    font-size: 1rem;
    font-weight: 800;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
}

.sw-stats__paid {
    margin-top: 0.65rem;
    font-size: 0.72rem;
    color: #6b7280;
    text-align: center;
}

/* Panel CTA */
.sw-cta {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    min-height: 3.15rem;
    padding: 0.85rem 1.25rem;
    border: none;
    border-radius: 0.95rem;
    background: linear-gradient(145deg, #ff7a2f, #f2701d 55%, #e35f12);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 12px 28px -12px rgba(242, 112, 29, 0.65);
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.sw-cta:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px -12px rgba(242, 112, 29, 0.7);
}

.sw-cta:disabled,
.sw-cta.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.sw-cta__hint {
    margin-top: 0.55rem;
    font-size: 0.72rem;
    line-height: 1.6;
    color: #6b7280;
    text-align: center;
}

/* How-to */
.sw-howto {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e8e8e8;
}

.sw-howto__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.sw-howto__summary::-webkit-details-marker {
    display: none;
}

.sw-howto__title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1a1a1a;
}

.sw-howto__chevron {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: #fff4ec;
    color: #f2701d;
    transition: transform 0.2s ease;
}

.sw-howto[open] > .sw-howto__summary .sw-howto__chevron {
    transform: rotate(180deg);
}

.sw-howto__list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0.85rem 0 0;
    padding: 0;
    list-style: none;
}

.sw-howto__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.sw-howto__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    background: #fff4ec;
    color: #f2701d;
}

.sw-howto__step {
    font-size: 0.85rem;
    font-weight: 800;
    color: #1a1a1a;
}

.sw-howto__desc {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    line-height: 1.6;
    color: #6b7280;
}

/* Arena + wheel */
.sw-arena {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: min(100%, 32rem);
    margin-inline: auto;
    padding: 1.75rem 0.75rem 1.15rem;
    overflow: visible;
}

.sw-arena__pulp {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: visible;
}

.sw-pulp {
    --x: 50%;
    --y: 50%;
    --s: 8px;
    --r: 0deg;
    --o: 0.75;
    --d: 0s;
    position: absolute;
    top: var(--y);
    left: var(--x);
    width: var(--s);
    height: var(--s);
    color: #f2701d;
    opacity: var(--o);
    transform: translate(-50%, -50%) rotate(var(--r));
    animation: sw-pulp-float 4.8s ease-in-out var(--d) infinite;
}

.sw-pulp--soft {
    color: #f5a46a;
}

.sw-pulp--square {
    border-radius: 1.5px;
    background: currentColor;
}

.sw-pulp--diamond {
    border-radius: 1px;
    background: currentColor;
    transform: translate(-50%, -50%) rotate(calc(var(--r) + 45deg));
}

.sw-pulp--plus {
    background: transparent;
}

.sw-pulp--plus::before,
.sw-pulp--plus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: currentColor;
    border-radius: 1px;
}

.sw-pulp--plus::before {
    width: 100%;
    height: 2px;
    transform: translate(-50%, -50%);
}

.sw-pulp--plus::after {
    width: 2px;
    height: 100%;
    transform: translate(-50%, -50%);
}

@keyframes sw-pulp-float {
    0%,
    100% {
        translate: 0 0;
    }
    50% {
        translate: 0 -4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sw-pulp {
        animation: none;
    }
}

.sw-wheel {
    --sw-brand: #f2701d;
    --sw-brand-dark: #d9541a;
    --sw-empty: #3f3a36;
    --sw-cream: #fbf8f3;
    --sw-surface: #ffffff;
    --sw-border: #ece6d9;
    --sw-peach: #fbd7af;
    --sw-text: #2c2620;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 100%;
    max-width: 480px;
    margin-inline: auto;
    aspect-ratio: 1 / 1;
}

@media (max-width: 640px) {
    .sw-arena {
        padding: 1.35rem 0.35rem 0.75rem;
    }

    .sw-pulp:nth-child(n + 11) {
        display: none;
    }

    /* Cap size so wheel fits parent padding and CTA clears fixed bottom nav */
    .sw-wheel {
        width: min(100%, 21.25rem);
    }
}

.sw-wheel__pin {
    position: absolute;
    top: -14px;
    left: 50%;
    z-index: 6;
    transform: translateX(-50%);
    color: var(--sw-brand);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
    pointer-events: none;
}

.sw-wheel__pin.is-ticking {
    animation: sw-pointer-tick 0.13s ease;
}

@keyframes sw-pointer-tick {
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(5px);
    }
}

.sw-wheel__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--sw-surface);
    box-shadow:
        0 0 0 8px var(--sw-surface),
        0 0 0 9px var(--sw-border),
        0 20px 40px rgba(43, 38, 30, 0.16);
}

.sw-wheel__svg {
    position: absolute;
    inset: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    border-radius: 50%;
    will-change: transform;
    overflow: hidden;
}

.sw-wheel__shade {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 45%),
        radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(43, 38, 30, 0.16) 100%);
}

.sw-wheel__seg-label {
    font-family: Vazirmatn, IRANSansX, Tahoma, sans-serif;
    font-weight: 700;
    fill: var(--sw-text);
}

.sw-wheel__seg-label--on-brand {
    fill: #fff;
}

.sw-wheel__seg-sub-bg {
    fill: #fff;
    stroke: var(--sw-border);
    stroke-width: 1;
}

.sw-wheel__seg-sub-text {
    font-family: Vazirmatn, IRANSansX, Tahoma, sans-serif;
    font-weight: 600;
    fill: var(--sw-text);
}

.sw-segment {
    transition:
        opacity 0.55s cubic-bezier(0.2, 0, 0, 1),
        filter 0.55s cubic-bezier(0.2, 0, 0, 1);
    transform-origin: 250px 250px;
    transform-box: fill-box;
}

.sw-segment.is-dimmed {
    opacity: 0.38;
}

.sw-segment.is-winner {
    opacity: 1;
    filter: drop-shadow(0 0 14px rgba(242, 112, 29, 0.45));
    animation: sw-segment-win 0.6s cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes sw-segment-win {
    to {
        transform: scale(1.04);
    }
}

.sw-wheel__btn {
    position: absolute;
    inset: 34%;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, #ff9448, var(--sw-brand-dark));
    color: #fff;
    font-size: clamp(0.85rem, 2.4vw, 1.05rem);
    font-weight: 900;
    line-height: 1.2;
    cursor: pointer;
    box-shadow:
        0 8px 24px rgba(217, 84, 26, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

.sw-wheel__btn:hover:not(:disabled) {
    transform: scale(1.03);
}

.sw-wheel__btn:disabled,
.sw-wheel__btn.is-disabled,
.sw-wheel__btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sw-wheel__btn-sub {
    font-size: 0.85em;
    font-weight: 600;
    opacity: 0.95;
}

.sw-arena.is-spinning .sw-wheel__btn {
    opacity: 0.7;
    pointer-events: none;
}

/* Result */
.sw-result {
    margin-top: 0.9rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    text-align: right;
    background: #eefbf6;
    border: 1px solid rgba(16, 185, 129, 0.28);
}

.sw-result.is-revealed {
    animation: sw-result-pop 0.55s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes sw-result-pop {
    0% {
        opacity: 0;
        transform: scale(0.94) translateY(0.4rem);
    }
    60% {
        transform: scale(1.02) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.sw-result__title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #047857;
}

.sw-result__value {
    margin-top: 0.2rem;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.4;
    color: #065f46;
}

.sw-result__extra {
    margin-top: 0.3rem;
    font-size: 0.72rem;
    color: #059669;
}

.sw-error {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid rgba(248, 113, 113, 0.4);
}

/* Brands section */
.sw-brands {
    margin-top: 2.5rem;
    padding-top: 0.5rem;
}

.sw-brands__head {
    margin-bottom: 1.1rem;
    text-align: right;
}

.sw-brands__title {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 900;
    color: #1a1a1a;
    border-bottom: 3px solid #f2701d;
    padding-bottom: 0.25rem;
}

.sw-brands__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

@media (min-width: 640px) {
    .sw-brands__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .sw-brands__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.sw-brand-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1rem 0.9rem 0.9rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #ececec;
    box-shadow: 0 8px 24px -16px rgba(15, 23, 42, 0.25);
    text-align: right;
    text-decoration: none;
    color: inherit;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

a.sw-brand-card:hover {
    border-color: #f7c9a8;
    box-shadow: 0 12px 28px -14px rgba(242, 112, 29, 0.35);
    transform: translateY(-2px);
}

.sw-brand-card__top {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.sw-brand-card__logo-wrap {
    position: relative;
    flex-shrink: 0;
}

.sw-brand-card__logo {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    object-fit: cover;
    background: #f3f4f6;
    box-shadow: 0 0 0 3px #fff4ec;
}

.sw-brand-card--locked .sw-brand-card__logo {
    opacity: 0.72;
}

.sw-brand-card__lock {
    position: absolute;
    right: -2px;
    bottom: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    background: #1f2937;
    color: #fff;
    box-shadow: 0 0 0 2px #fff;
}

.sw-brand-card__info {
    min-width: 0;
    flex: 1;
}

.sw-brand-card__title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sw-brand-card__discount {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #c2410c;
}

.sw-brand-card__meta {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9a3412;
}

.sw-brand-card__cat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
}

.sw-brand-card__dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.sw-brand-card__cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    min-height: 2.15rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.7rem;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 800;
}

a.sw-brand-card:hover .sw-brand-card__cta {
    background: #fff4ec;
    color: #c2410c;
}

.sw-brand-card__cta--muted {
    background: #f3f4f6;
    color: #6b7280;
}

.sw-brands__foot {
    margin-top: 1.15rem;
    text-align: center;
}

.sw-brands__all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(100%, 22rem);
    min-height: 2.75rem;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        color 0.15s ease;
}

.sw-brands__all:hover {
    border-color: #f2701d;
    color: #c2410c;
}

/* Discount winners */
.sw-board {
    margin-top: 2.25rem;
    padding-top: 0.25rem;
}

.sw-board__head {
    margin-bottom: 1.1rem;
    text-align: right;
}

.sw-board__title {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 900;
    color: #1a1a1a;
    border-bottom: 3px solid #f2701d;
    padding-bottom: 0.25rem;
}

.sw-winners__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

@media (min-width: 640px) {
    .sw-winners__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .sw-winners__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.sw-winner-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1rem 0.9rem 0.9rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #ececec;
    box-shadow: 0 8px 24px -16px rgba(15, 23, 42, 0.25);
    text-decoration: none;
    color: inherit;
    text-align: right;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

a.sw-winner-card:hover {
    border-color: #f7c9a8;
    box-shadow: 0 12px 28px -14px rgba(242, 112, 29, 0.35);
    transform: translateY(-2px);
}

.sw-winner-card__top {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.sw-winner-card__logo {
    width: 3.25rem;
    height: 3.25rem;
    flex-shrink: 0;
    border-radius: 999px;
    object-fit: cover;
    background: #f3f4f6;
    box-shadow: 0 0 0 3px #fff4ec;
}

.sw-winner-card__info {
    min-width: 0;
    flex: 1;
}

.sw-winner-card__company {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sw-winner-card__discount {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #c2410c;
}

.sw-winner-card__user {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.sw-winner-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.65rem;
    font-weight: 800;
}

.sw-winner-card__name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
}

.sw-winner-card__phone {
    margin-inline-start: 0.2rem;
    font-weight: 500;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

.sw-winner-card__cat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
}

.sw-winner-card__dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.sw-winner-card__cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    min-height: 2.15rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.7rem;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 800;
}

a.sw-winner-card:hover .sw-winner-card__cta {
    background: #fff4ec;
    color: #c2410c;
}

.sw-winners__empty {
    padding: 2rem 1rem;
    border-radius: 1rem;
    border: 1px dashed #e5e7eb;
    background: #fff;
    text-align: center;
}

.sw-winners__empty-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1a1a1a;
}

.sw-winners__empty-sub {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.sw-confetti-canvas {
    border-radius: 50%;
}

.sw-modal__panel {
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 25px 60px -20px rgba(15, 23, 42, 0.25);
}
