/* =========================================================
   Rewards – Ultra Premium (Sparkys Theme)
   :root --brand (#841a78)  |  --accent (#E0C5DD)
   Prefix: rw-*
   ========================================================= */

/* ─── Page Shell ─── */
.rw-page { background: #fdfbfc; overflow-x: hidden; }

.rw-container {
    width: 100%; max-width: 56rem; margin: 0 auto; padding: 0 1.25rem;
}
@media (min-width:768px) { .rw-container { padding: 0 2rem; } }

/* =========================================================
   1. HERO
   ========================================================= */
.rw-hero {
    position: relative; margin: 1rem .75rem 0; border-radius: 28px;
    min-height: auto; display: flex; align-items: center; justify-content: center;
    text-align: center; overflow: hidden;
    box-shadow: 0 30px 80px rgba(132,26,120,.20), 0 8px 24px rgba(0,0,0,.10);
}
@media (min-width:768px) {
    .rw-hero { margin: 1.25rem 1.5rem 0; border-radius: 36px; min-height: 32vh; }
}
.rw-hero__bg {
    position: absolute; inset: 0; border-radius: inherit; z-index: 0;
    background: radial-gradient(ellipse 130% 90% at 50% 15%,
        color-mix(in srgb, var(--accent) 30%, var(--brand)),
        var(--brand) 65%, color-mix(in srgb, var(--brand) 85%, #1a0520) 100%);
}
.rw-hero__orb { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(60px); will-change: transform; }
.rw-hero__orb--1 { width: 280px; height: 280px; top: -60px; left: -40px;
    background: color-mix(in srgb, var(--accent) 22%, transparent); animation: rwOrb1 8s ease-in-out infinite; }
.rw-hero__orb--2 { width: 200px; height: 200px; bottom: -30px; right: -30px;
    background: rgba(255,255,255,.06); animation: rwOrb2 10s ease-in-out infinite; }
@keyframes rwOrb1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(25px,18px) scale(1.08); } }
@keyframes rwOrb2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-20px,-15px) scale(1.1); } }

.rw-hero__particles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.rw-particle { position: absolute; border-radius: 50%; background: rgba(255,255,255,.5); animation: rwFloat linear infinite; will-change: transform; }
@keyframes rwFloat { 0% { transform: translateY(0) scale(1); } 50% { transform: translateY(-35px) scale(1.3); } 100% { transform: translateY(0) scale(1); } }

.rw-hero__content { position: relative; z-index: 2; padding: 2rem 1.25rem 1.5rem; max-width: 42rem; }
@media (min-width:768px) { .rw-hero__content { padding: 4rem 2rem 3rem; } }

.rw-hero__badge {
    display: inline-flex; align-items: center; gap: .45rem;
    background: rgba(255,255,255,.12); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
    padding: .4rem 1rem; font-size: .78rem; font-weight: 700;
    color: var(--accent); letter-spacing: .04em; margin-bottom: .75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.10); animation: rwBadgeIn .8s ease .3s both;
}
@keyframes rwBadgeIn { from { opacity:0; transform:translateY(14px) scale(.95); } to { opacity:1; transform:translateY(0) scale(1); } }

.rw-hero__title {
    font-size: clamp(1.45rem,5vw,3rem); font-weight: 900; color: #fff;
    line-height: 1.12; letter-spacing: -.03em; margin: 0 0 .5rem;
    text-shadow: 0 4px 40px rgba(0,0,0,.28); animation: rwTitleIn 1s cubic-bezier(.16,1,.3,1) .5s both;
}
@keyframes rwTitleIn { from { opacity:0; transform:translateY(32px) scale(.95); filter:blur(6px); } to { opacity:1; transform:translateY(0) scale(1); filter:blur(0); } }

.rw-hero__tagline {
    margin: 0 auto; font-size: clamp(.88rem,1.8vw,1.05rem);
    color: rgba(255,255,255,.84); line-height: 1.8; animation: rwTagIn .8s ease .9s both;
}
@keyframes rwTagIn { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }

/* ── Redeem inside hero ── */
.rw-hero__redeem {
    display: flex; align-items: center; gap: 1rem; margin-top: 1rem;
    background: rgba(255,255,255,.1); backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.12); border-radius: 18px;
    padding: .75rem 1.2rem; animation: rwTagIn .8s ease 1.1s both;
}
.rw-hero__ring { position: relative; flex-shrink: 0; width: 68px; height: 68px; }
.rw-hero__ring-svg { width: 100%; height: 100%; display: block; }
.rw-hero__ring-inner {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.rw-hero__ring-val { font-size: 1.2rem; font-weight: 900; color: #fff; line-height: 1; letter-spacing: -.02em; }
.rw-hero__ring-lbl { font-size: .55rem; font-weight: 700; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .06em; }

.rw-hero__redeem-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.rw-hero__redeem-status {
    font-size: .78rem; font-weight: 700; color: rgba(255,255,255,.8); margin: 0;
    display: flex; align-items: center; gap: .3rem;
}
.rw-hero__redeem-status i { font-size: .7rem; }

.rw-hero__redeem-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    border: none; cursor: pointer; white-space: nowrap;
    padding: .5rem 1.15rem; border-radius: 10px;
    font-size: .8rem; font-weight: 800; color: var(--brand);
    background: rgba(255,255,255,.92);
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    transition: transform .2s ease, box-shadow .2s ease;
}
.rw-hero__redeem-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.rw-hero__redeem-btn:active { transform: scale(.97); }
.rw-hero__redeem-btn--locked {
    opacity: .4; cursor: not-allowed; pointer-events: none; filter: grayscale(.2);
}

/* =========================================================
   2. SECTION HEADER
   ========================================================= */
.rw-section-head {
    display: flex; align-items: center; gap: .75rem; margin: 2rem 0 1.25rem;
}
.rw-section-head__icon {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1rem; color: #fff;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 65%, var(--accent)));
    box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 20%, transparent);
}
.rw-section-head__title {
    font-size: 1.15rem; font-weight: 800; color: var(--brand);
    margin: 0; letter-spacing: -.01em; flex: 1;
}

/* History button in section head */
.rw-history-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    border: 1.5px solid color-mix(in srgb, var(--brand) 18%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, #fff);
    color: var(--brand); cursor: pointer;
    padding: .35rem .75rem; border-radius: 10px;
    font-size: .72rem; font-weight: 700; white-space: nowrap;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.rw-history-btn i { font-size: .65rem; }
.rw-history-btn:hover {
    background: color-mix(in srgb, var(--accent) 22%, #fff);
    border-color: color-mix(in srgb, var(--brand) 30%, transparent);
    transform: translateY(-1px);
}
.rw-history-btn:active { transform: scale(.97); }

/* =========================================================
   3. EARN POINTS – Task Cards
   ========================================================= */
.rw-tasks { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }

.rw-task {
    position: relative; display: flex; align-items: center; gap: 1rem;
    padding: 1.25rem 1.25rem; border-radius: 20px;
    background: rgba(255,255,255,.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(132,26,120,.06);
    box-shadow: 0 12px 32px rgba(132,26,120,.05), 0 3px 10px rgba(0,0,0,.02), 0 1px 0 rgba(255,255,255,.85) inset;
    overflow: hidden;
    transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, border-color .3s ease;
}
.rw-task::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, var(--brand), var(--accent)); opacity: 0; transition: opacity .3s ease;
}
.rw-task:hover { transform: translateY(-4px); border-color: rgba(132,26,120,.12);
    box-shadow: 0 20px 48px rgba(132,26,120,.09), 0 6px 16px rgba(0,0,0,.04), 0 1px 0 rgba(255,255,255,.85) inset;
}
.rw-task:hover::before { opacity: 1; }

/* Shimmer */
.rw-task__shimmer {
    position: absolute; inset: 0; border-radius: 20px; z-index: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,.3) 42%, transparent 58%);
    transform: translateX(-140%); transition: transform .75s cubic-bezier(.2,.8,.2,1);
}
.rw-task:hover .rw-task__shimmer { transform: translateX(140%); }

/* Completed state */
.rw-task--done { opacity: .7; }
.rw-task--done::after {
    content: ""; position: absolute; inset: 0; border-radius: 20px;
    background: rgba(255,255,255,.45); pointer-events: none; z-index: 2;
}

.rw-task__icon {
    position: relative; z-index: 1; flex-shrink: 0;
    width: 50px; height: 50px; border-radius: 14px;
    display: grid; place-items: center; font-size: 1.2rem; color: #fff;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 65%, var(--accent)));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 22%, transparent);
    transition: transform .3s ease;
}
.rw-task:hover .rw-task__icon { transform: translateY(-2px) scale(1.05); }

.rw-task--done .rw-task__icon {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 8px 22px rgba(34,197,94,.25);
}

.rw-task__body { position: relative; z-index: 1; flex: 1; min-width: 0; }
.rw-task__title { font-size: .95rem; font-weight: 800; color: #1e293b; margin: 0 0 .2rem; }
.rw-task__desc { font-size: .8rem; color: rgba(30,41,59,.6); margin: 0; line-height: 1.5; }

.rw-task__points {
    position: relative; z-index: 1; flex-shrink: 0; display: flex; flex-direction: column;
    align-items: center; gap: .1rem;
    padding: .5rem .85rem; border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.rw-task__points-val { font-size: 1.1rem; font-weight: 900; color: var(--brand); letter-spacing: -.02em; }
.rw-task__points-lbl { font-size: .6rem; font-weight: 700; color: rgba(30,41,59,.5); text-transform: uppercase; letter-spacing: .06em; }

.rw-task--done .rw-task__points {
    background: color-mix(in srgb, #22c55e 10%, #fff);
    border-color: color-mix(in srgb, #22c55e 22%, transparent);
}
.rw-task--done .rw-task__points-val { color: #16a34a; }

.rw-task__check {
    position: relative; z-index: 3; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; font-size: .7rem; color: #fff;
    background: #22c55e; box-shadow: 0 4px 12px rgba(34,197,94,.3);
}

/* Action button inside task */
.rw-task__btn {
    position: relative; z-index: 1; flex-shrink: 0;
    border: none; cursor: pointer;
    padding: .55rem 1.1rem; border-radius: 12px;
    font-size: .8rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 65%, var(--accent)));
    box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 20%, transparent);
    transition: transform .2s ease, box-shadow .2s ease;
    white-space: nowrap;
}
.rw-task__btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 28%, transparent); }
.rw-task__btn:active { transform: translateY(0) scale(.98); }

/* =========================================================
   4. PROGRESS BAR – Total Points Toward Spin
   ========================================================= */
.rw-progress-card {
    position: relative; padding: 1.5rem 1.5rem; border-radius: 22px;
    background: rgba(255,255,255,.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(132,26,120,.06);
    box-shadow: 0 16px 44px rgba(132,26,120,.06), 0 4px 12px rgba(0,0,0,.03), 0 1px 0 rgba(255,255,255,.85) inset;
    margin-bottom: 2rem; overflow: hidden;
}
.rw-progress-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.rw-progress__header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 1rem; flex-wrap: wrap; gap: .25rem .75rem;
}
.rw-progress__title { font-size: 1rem; font-weight: 800; color: var(--brand); margin: 0; }
.rw-progress__fraction { font-size: .85rem; font-weight: 700; color: rgba(30,41,59,.6); }
.rw-progress__fraction strong { color: var(--brand); font-size: 1rem; }

.rw-progress__track {
    width: 100%; height: 14px; border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 18%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
    overflow: hidden; position: relative;
}
.rw-progress__fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 60%, var(--accent)));
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 25%, transparent);
    transition: width .8s cubic-bezier(.16,1,.3,1);
    position: relative;
}
.rw-progress__fill::after {
    content: ""; position: absolute; top: 2px; left: 4px; right: 4px; height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,.35), transparent);
}

.rw-progress__hint {
    margin-top: .75rem; font-size: .8rem; color: rgba(30,41,59,.55); line-height: 1.6; text-align: center;
}
.rw-progress__hint i { color: var(--brand); }

/* =========================================================
   5. SPIN WHEEL SECTION (canvas-based, always visible)
   ========================================================= */
.rw-spin-section {
    padding-top: 2rem; padding-bottom: 1rem; margin-bottom: 1.5rem;
}

.rw-spin-wrap {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
    padding: 2rem 1.5rem; border-radius: 24px;
    background: rgba(255,255,255,.78); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(132,26,120,.06);
    box-shadow: 0 20px 52px rgba(132,26,120,.08), 0 6px 16px rgba(0,0,0,.03), 0 1px 0 rgba(255,255,255,.85) inset;
}

/* ── Wheel Stage ── */
.rw-wheel-stage {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 80vw; max-width: 380px; aspect-ratio: 1;
}
@media (min-width:768px) {
    .rw-wheel-stage { width: 100%; max-width: 420px; }
}

/* Locked: dim the wheel slightly but keep values readable */
.rw-wheel-stage--locked .rw-wheel-canvas {
    filter: grayscale(0.08);
    opacity: .92;
}
.rw-wheel-stage--locked .rw-wheel-pointer { opacity: .65; }
.rw-wheel-stage--locked .rw-wheel-cap { opacity: .7; }

/* ── Canvas ── */
.rw-wheel-canvas {
    display: block; width: 100%; height: 100%; border-radius: 50%;
    box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 0 0 5px color-mix(in srgb, var(--brand) 35%, transparent);
    transition: transform 4.5s cubic-bezier(.21, 1.02, .73, 1), filter .4s ease, opacity .4s ease;
}

/* ── Pointer ── */
.rw-wheel-pointer {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    z-index: 10; transition: opacity .4s ease;
    animation: rwPointerBounce 1.3s infinite cubic-bezier(.68,-.55,.27,1.55);
}
.rw-wheel-pointer__tri {
    width: 0; height: 0;
    border-left: 14px solid transparent; border-right: 14px solid transparent;
    border-top: 28px solid var(--accent);
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.2));
}
@media (min-width:768px) {
    .rw-wheel-pointer__tri {
        border-left-width: 16px; border-right-width: 16px; border-top-width: 32px;
    }
}
@keyframes rwPointerBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* ── Center Cap ── */
.rw-wheel-cap {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,.95); border: 4px solid color-mix(in srgb, var(--brand) 35%, transparent);
    display: grid; place-items: center; z-index: 5;
    box-shadow: inset 0 2px 6px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.1);
    transition: opacity .4s ease;
}
.rw-wheel-cap i { font-size: 1.2rem; color: var(--brand); }
@media (min-width:768px) {
    .rw-wheel-cap { width: 56px; height: 56px; }
    .rw-wheel-cap i { font-size: 1.4rem; }
}

/* ── Lock Overlay (sits on top of the visible wheel) ── */
.rw-wheel-lock-overlay {
    position: absolute; inset: 0; border-radius: 50%; z-index: 15;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle, rgba(255,255,255,.15) 0%, rgba(255,255,255,.3) 70%);
}
.rw-wheel-lock-overlay__inner {
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    text-align: center; padding: 1rem;
}
.rw-wheel-lock-overlay__icon {
    width: 56px; height: 56px; border-radius: 50%;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--accent) 18%, #fff);
    border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
    box-shadow: 0 8px 24px rgba(132,26,120,.12);
}
.rw-wheel-lock-overlay__icon i {
    font-size: 1.5rem; color: var(--brand); opacity: .7;
}
.rw-wheel-lock-overlay__title {
    font-size: .95rem; font-weight: 800; color: var(--brand); margin: 0;
}
.rw-wheel-lock-overlay__text {
    font-size: .75rem; color: rgba(30,41,59,.6); margin: 0; max-width: 200px; line-height: 1.5;
}

/* ── Spin Button ── */
.rw-spin-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    border: none; cursor: pointer; white-space: nowrap;
    padding: .85rem 2.2rem; border-radius: 999px;
    font-size: 1.05rem; font-weight: 800; color: #fff; letter-spacing: .02em;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, var(--accent)));
    box-shadow: 0 12px 32px color-mix(in srgb, var(--brand) 25%, transparent),
                0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
    transition: transform .25s ease, box-shadow .25s ease;
    animation: rwSpinBtnPulse 2.5s ease-in-out infinite;
}
.rw-spin-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 16px 40px color-mix(in srgb, var(--brand) 30%, transparent),
                0 0 0 4px color-mix(in srgb, var(--accent) 40%, transparent);
}
.rw-spin-btn:active { transform: translateY(0) scale(.98); }
.rw-spin-btn:disabled { opacity: .65; cursor: not-allowed; animation: none; }
.rw-spin-btn i { font-size: .95rem; }
.rw-spin-btn__count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 24px; border-radius: 999px; padding: 0 .4rem;
    font-size: .72rem; font-weight: 900; color: var(--brand);
    background: rgba(255,255,255,.92);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* ── Spin Available Badge (in section head) ── */
.rw-spin-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .7rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 65%, var(--accent)));
    box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 25%, transparent);
    white-space: nowrap;
    animation: rwSpinBadgePulse 2s ease-in-out infinite;
}
.rw-spin-badge i { font-size: .65rem; }
.rw-spin-badge span {
    font-weight: 900; font-size: .85rem;
}
@keyframes rwSpinBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

@keyframes rwSpinBtnPulse {
    0%, 100% { box-shadow: 0 12px 32px color-mix(in srgb, var(--brand) 25%, transparent), 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
    50% { box-shadow: 0 12px 32px color-mix(in srgb, var(--brand) 35%, transparent), 0 0 0 8px color-mix(in srgb, var(--accent) 18%, transparent); }
}

/* ── Rules Card ── */
.rw-rules-card {
    position: relative; padding: 1.25rem 1.5rem; border-radius: 20px;
    background: rgba(255,255,255,.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(132,26,120,.06);
    box-shadow: 0 12px 32px rgba(132,26,120,.05), 0 3px 10px rgba(0,0,0,.02), 0 1px 0 rgba(255,255,255,.85) inset;
    margin-top: 1.25rem; margin-bottom: 2rem;
}
.rw-rules__title {
    display: flex; align-items: center; gap: .45rem;
    font-size: 1rem; font-weight: 800; color: var(--brand); margin: 0 0 1rem;
}
.rw-rules__title i { font-size: .85rem; opacity: .7; }
.rw-rules__list { display: flex; flex-direction: column; gap: .65rem; }

.rw-rules__item {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem 1rem; border-radius: 14px;
    background: rgba(132,26,120,.02); border: 1px solid rgba(132,26,120,.04);
    transition: background .2s ease, border-color .2s ease;
}
.rw-rules__item--hit {
    background: color-mix(in srgb, #22c55e 6%, #fff);
    border-color: color-mix(in srgb, #22c55e 15%, transparent);
}
.rw-rules__icon { flex-shrink: 0; font-size: 1rem; }
.rw-rules__icon i { color: color-mix(in srgb, var(--brand) 40%, transparent); }
.rw-rules__item--hit .rw-rules__icon i { color: #22c55e; }

.rw-rules__body { flex: 1; min-width: 0; }
.rw-rules__spend {
    display: block; font-size: .85rem; font-weight: 800; color: var(--brand);
}
.rw-rules__desc {
    font-size: .78rem; color: rgba(30,41,59,.55); line-height: 1.5;
}
.rw-rules__prize {
    flex-shrink: 0; font-size: .9rem; font-weight: 900; color: var(--brand);
    padding: .35rem .7rem; border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 14%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.rw-rules__item--hit .rw-rules__prize {
    background: color-mix(in srgb, #22c55e 10%, #fff);
    border-color: color-mix(in srgb, #22c55e 22%, transparent);
    color: #16a34a;
}

/* =========================================================
   5b. HISTORY BOTTOM-SHEET / MODAL
   ========================================================= */

/* Desktop: centered like other modals */
.rw-modal--sheet .rw-sheet__card {
    position: relative; width: min(90%, 480px); max-height: 70vh;
    padding: 0; border-radius: 24px; overflow: hidden;
    background: rgba(255,255,255,.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(132,26,120,.08);
    box-shadow: 0 40px 100px rgba(132,26,120,.18), 0 12px 32px rgba(0,0,0,.08), 0 1px 0 rgba(255,255,255,.9) inset;
    display: flex; flex-direction: column;
    transform: translateY(20px) scale(.96); transition: transform .4s cubic-bezier(.16,1,.3,1);
}
.rw-modal--visible .rw-sheet__card { transform: translateY(0) scale(1); }

.rw-sheet__handle { display: none; }

.rw-sheet__title {
    display: flex; align-items: center; gap: .5rem;
    padding: 1.25rem 1.5rem .75rem; margin: 0;
    font-size: 1.1rem; font-weight: 900; color: var(--brand);
}
.rw-sheet__title i { font-size: .9rem; opacity: .7; }

.rw-sheet__close {
    position: absolute; top: .85rem; right: 1rem; z-index: 2;
    border: none; background: none; cursor: pointer;
    font-size: 1.6rem; color: rgba(30,41,59,.35); line-height: 1;
    transition: color .2s ease;
}
.rw-sheet__close:hover { color: var(--brand); }

.rw-sheet__body {
    flex: 1; overflow-y: auto; padding: 0 1.25rem 1.5rem;
    display: flex; flex-direction: column-reverse;
    scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 40%, transparent) transparent;
}

/* History items (reused in modal) */
.rw-history-list {
    display: flex; flex-direction: column; gap: .5rem;
}

.rw-history-item {
    display: flex; align-items: center; gap: .85rem;
    padding: .8rem .9rem; border-radius: 14px;
    background: rgba(132,26,120,.02);
    border: 1px solid rgba(132,26,120,.04);
    transition: background .2s ease;
}
.rw-history-item:hover { background: rgba(132,26,120,.05); }

.rw-history-item__icon {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center; font-size: .8rem; color: #fff;
}
.rw-history-item__icon--earn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 4px 12px rgba(34,197,94,.25);
}
.rw-history-item__icon--redeem {
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 65%, var(--accent)));
    box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 22%, transparent);
}

.rw-history-item__body { flex: 1; min-width: 0; }
.rw-history-item__title {
    font-size: .88rem; font-weight: 700; color: #1e293b; margin: 0 0 .15rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rw-history-item__date {
    font-size: .7rem; color: rgba(30,41,59,.45); margin: 0; font-weight: 600;
}

.rw-history-item__pts {
    flex-shrink: 0; font-size: .95rem; font-weight: 900; letter-spacing: -.01em;
}
.rw-history-item__pts--earn { color: #16a34a; }
.rw-history-item__pts--redeem { color: var(--brand); }

/* Empty state */
.rw-history-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .5rem; padding: 2.5rem 1rem; text-align: center;
    margin: auto 0; /* vertically center in column-reverse body */
}
.rw-history-empty i {
    font-size: 2.5rem; color: color-mix(in srgb, var(--brand) 20%, transparent);
}
.rw-history-empty p {
    font-size: .88rem; color: rgba(30,41,59,.5); margin: 0; line-height: 1.6; font-weight: 600;
}

/* ── Mobile bottom-sheet (app-style, half screen, flush to bottom) ── */
@media (max-width:767px) {
    .rw-modal--sheet {
        align-items: flex-end;
        z-index: 99999;
    }
    .rw-modal--sheet .rw-sheet__card {
        width: 100%;
        /* 50vh content + 4rem navbar so card covers bottom fully */
        height: calc(50vh + 4rem + env(safe-area-inset-bottom, 0px));
        max-height: calc(50vh + 4rem + env(safe-area-inset-bottom, 0px));
        border-radius: 24px 24px 0 0;
        /* push bottom padding so content stays above navbar */
        padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        transition: transform .4s cubic-bezier(.32,1,.23,1);
    }
    .rw-modal--sheet.rw-modal--visible .rw-sheet__card {
        transform: translateY(0);
    }
    .rw-sheet__handle {
        display: block; width: 36px; height: 4px; border-radius: 2px;
        background: rgba(30,41,59,.12); margin: .65rem auto .25rem;
        flex-shrink: 0;
    }
    .rw-sheet__close { display: none; }
    .rw-sheet__title {
        padding: .75rem 1.25rem .5rem; font-size: 1rem;
        flex-shrink: 0;
        border-bottom: 1px solid color-mix(in srgb, var(--brand) 10%, transparent);
        background: rgba(255,255,255,.7); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    }
    .rw-sheet__body {
        flex: 1; min-height: 0;
        padding: 0 1rem 0;
        overflow-y: auto;
        flex-direction: column;       /* reset desktop column-reverse */
        -webkit-overflow-scrolling: touch;
    }
    .rw-history-item { padding: .7rem .75rem; gap: .65rem; }
    .rw-history-item__icon { width: 32px; height: 32px; font-size: .7rem; }
    .rw-history-item__title { font-size: .82rem; }
}

/* =========================================================
   6. FOOTER NOTE
   ========================================================= */
.rw-foot {
    display: flex; align-items: center; gap: 1rem; margin: 0 auto 2rem;
    padding: 1.25rem 1.5rem; border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, #fff);
    box-shadow: 0 8px 24px rgba(132,26,120,.04);
}
.rw-foot__icon { flex-shrink: 0; font-size: 1.25rem; color: var(--brand); opacity: .7; }
.rw-foot__text { margin: 0; font-size: .85rem; line-height: 1.7; color: rgba(30,41,59,.72); font-weight: 600; }

/* =========================================================
   7. INPUT MODAL (name / email / dob)
   ========================================================= */
.rw-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.rw-modal--visible { opacity: 1; pointer-events: auto; }

.rw-modal__overlay {
    position: absolute; inset: 0; background: rgba(132,26,120,.18);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.rw-modal__card {
    position: relative; width: min(90%,440px); padding: 2rem 1.75rem; border-radius: 24px;
    background: rgba(255,255,255,.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(132,26,120,.08);
    box-shadow: 0 40px 100px rgba(132,26,120,.18), 0 12px 32px rgba(0,0,0,.08), 0 1px 0 rgba(255,255,255,.9) inset;
    text-align: center;
    transform: translateY(20px) scale(.96); transition: transform .4s cubic-bezier(.16,1,.3,1);
}
.rw-modal--visible .rw-modal__card { transform: translateY(0) scale(1); }
.rw-modal__card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.rw-modal__title { font-size: 1.25rem; font-weight: 900; color: var(--brand); margin: 0 0 .4rem; }
.rw-modal__desc { font-size: .85rem; color: rgba(30,41,59,.6); margin: 0 0 1.5rem; line-height: 1.6; }

.rw-modal__input {
    width: 100%; border-radius: 14px; padding: .85rem 1rem; font-size: .9rem; font-weight: 600; color: #1e293b;
    border: 2px solid color-mix(in srgb, var(--accent) 50%, #fff); background: rgba(255,255,255,.96);
    outline: none; transition: border-color .25s ease, box-shadow .25s ease;
}
.rw-modal__input:focus {
    border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 40%, transparent);
}

.rw-modal__row { display: flex; gap: .75rem; margin-top: 1.25rem; }

.rw-modal__btn {
    flex: 1; border: none; cursor: pointer; padding: .8rem 1rem; border-radius: 14px;
    font-size: .9rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 65%, var(--accent)));
    box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 22%, transparent);
    transition: transform .2s ease, box-shadow .2s ease;
}
.rw-modal__btn:hover { transform: translateY(-2px); }
.rw-modal__btn:active { transform: translateY(0) scale(.98); }

.rw-modal__btn--ghost {
    background: transparent; color: rgba(30,41,59,.6); box-shadow: none;
    border: 2px solid rgba(30,41,59,.12);
}
.rw-modal__btn--ghost:hover { background: rgba(30,41,59,.04); transform: none; }

.rw-modal__otp-row { display: flex; gap: .5rem; justify-content: center; margin-bottom: 1rem; }
.rw-modal__otp-input {
    width: 48px; height: 52px; border-radius: 12px; text-align: center; font-size: 1.25rem; font-weight: 800;
    border: 2px solid color-mix(in srgb, var(--accent) 50%, #fff); background: rgba(255,255,255,.96);
    color: var(--brand); outline: none; transition: border-color .25s ease, box-shadow .25s ease;
}
.rw-modal__otp-input:focus {
    border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 40%, transparent);
}

.rw-modal__msg {
    font-size: .8rem; min-height: 1.2em; margin: .75rem 0 0; font-weight: 600;
}
.rw-modal__msg--ok { color: #16a34a; }
.rw-modal__msg--err { color: #dc2626; }

/* =========================================================
   8. SCROLL REVEAL
   ========================================================= */
.rw-reveal {
    opacity: 0; transform: translateY(30px) scale(.98);
    transition: opacity .65s cubic-bezier(.16,1,.3,1), transform .65s cubic-bezier(.16,1,.3,1);
    transition-delay: var(--reveal-delay, 0ms);
}
.rw-reveal.rw-revealed { opacity: 1; transform: translateY(0) scale(1); }

/* =========================================================
   9. RESPONSIVE
   ========================================================= */
@media (max-width:767px) {
    .rw-hero { min-height: 26vh; margin: .5rem .5rem 0; border-radius: 22px; }
    .rw-hero__content { padding: 3rem 1rem 2rem; }
    .rw-task { padding: 1rem; gap: .75rem; }
    .rw-task__icon { width: 42px; height: 42px; font-size: 1rem; }
    .rw-task__points { padding: .4rem .65rem; }
    .rw-task__points-val { font-size: .95rem; }
    .rw-progress-card { padding: 1.25rem; }
    .rw-spin-wrap { padding: 1.25rem .75rem; }
    .rw-wheel-stage { width: 78vw; max-width: 320px; }
    .rw-wheel-pointer__tri { border-left-width: 12px; border-right-width: 12px; border-top-width: 24px; }
    .rw-wheel-pointer { top: -12px; }
    .rw-wheel-cap { width: 40px; height: 40px; }
    .rw-wheel-cap i { font-size: 1rem; }
    .rw-wheel-lock-overlay__icon { width: 44px; height: 44px; }
    .rw-wheel-lock-overlay__icon i { font-size: 1.2rem; }
    .rw-wheel-lock-overlay__title { font-size: .85rem; }
    .rw-wheel-lock-overlay__text { font-size: .7rem; max-width: 170px; }
    .rw-spin-btn { padding: .75rem 1.8rem; font-size: .95rem; }
    .rw-rules-card { padding: 1rem 1.15rem; }
    .rw-rules__item { padding: .6rem .75rem; gap: .6rem; }
    .rw-foot { flex-direction: column; text-align: center; gap: .5rem; padding: 1rem 1.25rem; }
    .rw-modal__card { padding: 1.75rem 1.25rem; }

    /* Hero redeem */
    .rw-hero__redeem { gap: .75rem; padding: .6rem 1rem; border-radius: 14px; }
    .rw-hero__ring { width: 56px; height: 56px; }
    .rw-hero__ring-val { font-size: 1rem; }
    .rw-hero__redeem-status { font-size: .72rem; }
    .rw-hero__redeem-btn { padding: .42rem .9rem; font-size: .74rem; border-radius: 8px; }
}

/* =========================================================
   10. RTL
   ========================================================= */
[dir="rtl"] .rw-task { text-align: right; }
[dir="rtl"] .rw-section-head { text-align: right; }
[dir="rtl"] .rw-foot { text-align: right; }
[dir="rtl"] .rw-modal__card { text-align: center; }
[dir="rtl"] .rw-hero__redeem-meta { text-align: right; }
[dir="rtl"] .rw-hero__redeem-status i { margin-right: 0; margin-left: .3rem; }
[dir="rtl"] .rw-history-item__body { text-align: right; }
[dir="rtl"] .rw-sheet__close { right: auto; left: 1rem; }
[dir="rtl"] .rw-sheet__title { direction: rtl; }
[dir="rtl"] .rw-rules__body { text-align: right; }
[dir="rtl"] .rw-rules__title { direction: rtl; }

/* =========================================================
   11. REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion:reduce) {
    .rw-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .rw-particle, .rw-hero__orb, .rw-hero__badge, .rw-hero__title, .rw-hero__tagline {
        animation: none !important; opacity: 1 !important; transform: none !important;
    }
    .rw-task__shimmer { display: none !important; }
    .rw-modal__card { transition: none !important; }
    .rw-progress__fill { transition: none !important; }
}
