/* گردونه شانس — frontend styles */

.plw-root {
        direction: rtl;
        font-family: Vazirmatn, Vazir, IRANSansX, IRANSans, Tahoma, sans-serif;
        --plw-panel: #1b1b1b;
        --plw-text: #ffffff;
        --plw-accent: #d4af37;
        --plw-accent2: #a31515;
        --plw-btn: #d4af37;
        --plw-btn-text: #111111;
        --plw-border: #d4af37;
}

/* ---------- Overlay & modal ---------- */
.plw-overlay {
        position: fixed;
        inset: 0;
        z-index: 999999;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 16px;
        background: rgba(0, 0, 0, 0.78);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
}
.plw-overlay.plw-open { display: flex; }
body.plw-lock { overflow: hidden !important; }

/* The hidden attribute must always win over display rules. */
.plw-root [hidden],
.plw-float [hidden] { display: none !important; }

.plw-modal {
        position: relative;
        background:
                radial-gradient(130% 80% at 50% 0%, rgba(212, 175, 55, 0.10), transparent 55%),
                var(--plw-panel);
        color: var(--plw-text);
        border: 1px solid var(--plw-border);
        border-radius: 20px;
        max-width: 410px;
        width: 100%;
        max-height: 94dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 16px 16px 14px;
        text-align: center;
        box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
        box-sizing: border-box;
        line-height: 1.6;
}

/* Thin, themed scrollbar — never a fat bar in the corner. */
.plw-modal { scrollbar-width: thin; scrollbar-color: var(--plw-accent) transparent; }
.plw-modal::-webkit-scrollbar { width: 5px; height: 5px; }
.plw-modal::-webkit-scrollbar-track { background: transparent; }
.plw-modal::-webkit-scrollbar-thumb { background: var(--plw-accent); border-radius: 4px; }
.plw-modal::-webkit-scrollbar-corner { background: transparent; }
.plw-inline .plw-modal {
        max-width: 430px;
        margin: 0 auto;
        box-shadow: none;
}

.plw-close {
        position: absolute;
        top: 10px;
        left: 12px;
        background: transparent;
        border: 0;
        color: var(--plw-text);
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
        opacity: 0.7;
        padding: 4px;
}
.plw-close:hover { opacity: 1; }

.plw-sound {
        position: absolute;
        top: 10px;
        right: 12px;
        background: transparent;
        border: 1px solid var(--plw-border);
        color: var(--plw-accent);
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
}
.plw-sound[data-on="0"] .plw-sound-on { display: none; }
.plw-sound[data-on="0"] { opacity: 0.45; }

/* ---------- Head ---------- */
.plw-head-icon { color: var(--plw-accent); margin-bottom: 0; }
.plw-head-icon svg { width: 26px; height: 26px; }
.plw-title {
        margin: 2px 0 0;
        font-size: 22px;
        font-weight: 800;
        color: var(--plw-accent);
        line-height: 1.5;
}
.plw-subtitle {
        margin: 0;
        font-size: 13px;
        opacity: 0.85;
}

/* ---------- Wheel ---------- */
.plw-stage { min-height: 0; }
.plw-wheelbox {
        position: relative;
        width: min(292px, 76vw);
        margin: 22px auto 8px;
}

/* Golden rim with bulb lights around the wheel. */
.plw-rim {
        position: absolute;
        inset: -14px;
        border-radius: 50%;
        background: linear-gradient(145deg, var(--plw-accent), var(--plw-accent2));
        box-shadow:
                0 10px 30px rgba(0, 0, 0, 0.5),
                inset 0 2px 5px rgba(255, 255, 255, 0.45),
                inset 0 -4px 9px rgba(0, 0, 0, 0.4);
}
/* Bulb dots — only where masks are supported, so old browsers just get the ring. */
@supports ((-webkit-mask-image: radial-gradient(#000, transparent)) or (mask-image: radial-gradient(#000, transparent))) {
        .plw-rim::before {
                content: "";
                position: absolute;
                inset: 0;
                border-radius: 50%;
                background: repeating-conic-gradient(from -4deg,
                                var(--plw-btn, #d4af37) 0deg 6deg,
                                transparent 6deg 30deg);
                -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
                mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
                filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
        }
}

.plw-canvas {
        position: relative;
        z-index: 1; /* paint above the rim */
        display: block;
        width: 100%;
        height: auto;
        border-radius: 50%;
        box-shadow:
                0 0 0 3px rgba(0, 0, 0, 0.35),
                0 8px 26px rgba(0, 0, 0, 0.45);
}
.plw-pointer {
        position: absolute;
        top: -19px;
        left: 50%;
        width: 18px;
        height: 18px;
        background: linear-gradient(135deg, var(--plw-accent), var(--plw-accent2));
        transform: translateX(-50%) rotate(45deg);
        border-radius: 3px;
        z-index: 3;
        box-shadow: 0 3px 7px rgba(0, 0, 0, 0.55), inset 0 1px 2px rgba(255, 255, 255, 0.45);
}
.plw-hub {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 82px;
        height: 82px;
        border-radius: 50%;
        background: var(--plw-btn);
        color: var(--plw-btn-text);
        font-family: inherit;
        font-size: 16px;
        font-weight: 800;
        border: 4px solid rgba(255, 255, 255, 0.25);
        cursor: pointer;
        z-index: 4;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
        transition: transform 0.15s ease;
}
.plw-hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.06); }
.plw-hub:disabled { opacity: 0.75; cursor: default; }

/* ---------- Form ---------- */
.plw-form { margin-top: 10px; }
.plw-in {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 11px 12px;
        margin: 0 auto 8px;
        border-radius: 10px;
        border: 1px solid var(--plw-border);
        background: rgba(255, 255, 255, 0.08);
        color: var(--plw-text);
        font-size: 14px;
        text-align: center;
        font-family: inherit;
}
.plw-in::placeholder { color: rgba(255, 255, 255, 0.45); }
.plw-in:focus { outline: 2px solid var(--plw-accent); outline-offset: 1px; }
.plw-hp {
        position: absolute;
        left: -9999px;
        width: 1px;
        height: 1px;
        opacity: 0;
}
.plw-note {
        font-size: 12px;
        margin: 4px 0 0;
        opacity: 0.7;
}
.plw-error {
        font-size: 13px;
        margin: 8px 0 0;
        color: #ff8a8a;
        font-weight: 600;
}
.plw-shake { animation: plwShake 0.4s ease; }
@keyframes plwShake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(6px); }
        50% { transform: translateX(-6px); }
        75% { transform: translateX(4px); }
}

/* ---------- Login gate (members only) ---------- */
.plw-lockicon { color: var(--plw-accent); margin: 10px 0 4px; }
.plw-login-text { font-size: 14px; line-height: 2; margin: 4px 0 12px; }
.plw-loginbtn {
        display: inline-block;
        background: var(--plw-btn);
        color: var(--plw-btn-text);
        text-decoration: none;
        border-radius: 10px;
        padding: 11px 26px;
        font-weight: 800;
        font-size: 14px;
}
.plw-loginbtn:hover { filter: brightness(1.08); }

/* ---------- Result ---------- */
.plw-result-icon { color: var(--plw-accent); margin: 8px 0 2px; }
.plw-result-title {
        font-size: 22px;
        margin: 6px 0;
        color: var(--plw-accent);
        line-height: 1.7;
}
.plw-code-label { display: block; font-size: 13px; opacity: 0.8; margin-bottom: 6px; }
.plw-code-row {
        display: flex;
        gap: 8px;
        justify-content: center;
        align-items: center;
        margin: 6px 0 10px;
        flex-wrap: wrap;
}
.plw-code {
        background: rgba(0, 0, 0, 0.4);
        border: 1px dashed var(--plw-accent);
        color: var(--plw-accent);
        padding: 9px 16px;
        border-radius: 9px;
        font-size: 17px;
        font-weight: 700;
        letter-spacing: 1.5px;
        direction: ltr;
        user-select: all;
}
.plw-copy {
        background: var(--plw-btn);
        color: var(--plw-btn-text);
        border: 0;
        border-radius: 9px;
        padding: 10px 16px;
        font-family: inherit;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
}
.plw-result-note { font-size: 13px; opacity: 0.85; line-height: 1.9; }
.plw-shop {
        display: inline-block;
        margin: 10px auto 4px;
        background: var(--plw-btn);
        color: var(--plw-btn-text);
        text-decoration: none;
        border-radius: 10px;
        padding: 10px 22px;
        font-weight: 700;
        font-size: 14px;
}
.plw-shop:hover { filter: brightness(1.08); }

/* ---------- Countdown ---------- */
.plw-cd-title { font-size: 15px; font-weight: 700; margin: 18px 0 12px; }
.plw-countdown {
        display: flex;
        gap: 8px;
        justify-content: center;
        direction: ltr;
}
.plw-cd-box {
        background: rgba(255, 255, 255, 0.07);
        border: 1px solid var(--plw-border);
        border-radius: 10px;
        padding: 9px 8px;
        min-width: 58px;
}
.plw-cd-num {
        display: block;
        font-size: 24px;
        font-weight: 800;
        color: var(--plw-accent);
        line-height: 1.2;
}
.plw-cd-lbl { font-size: 11px; opacity: 0.7; }

/* ---------- Ticker ---------- */
.plw-ticker {
        border-top: 1px solid var(--plw-border);
        margin-top: 14px;
        padding-top: 10px;
        font-size: 12px;
        text-align: right;
}
.plw-ticker-title { color: var(--plw-accent); font-weight: 700; }
.plw-ticker-list {
        list-style: none;
        margin: 6px 0 0;
        padding: 0;
        max-height: 86px;
        overflow: hidden;
}
.plw-ticker-list li {
        padding: 3px 0;
        color: rgba(255, 255, 255, 0.78);
        display: flex;
        justify-content: space-between;
        gap: 8px;
}
.plw-ticker-list .plw-tk-label { color: var(--plw-accent); font-weight: 600; }
.plw-ticker-list .plw-tk-ago { opacity: 0.55; font-size: 11px; white-space: nowrap; }

/* ---------- Floating button ---------- */
.plw-float {
        position: fixed;
        bottom: 22px;
        left: 22px;
        z-index: 99998;
        display: flex;
        align-items: center;
        gap: 8px;
        background: var(--plw-panel, #1b1b1b);
        color: var(--plw-accent, #d4af37);
        border: 1.5px solid var(--plw-border, #d4af37);
        border-radius: 40px;
        padding: 11px 18px;
        font-family: Vazirmatn, Vazir, IRANSansX, IRANSans, Tahoma, sans-serif;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
        transition: transform 0.18s ease;
}
.plw-float:hover { transform: translateY(-3px); }
.plw-float-icon { display: flex; align-items: center; }
.plw-float-badge {
        background: var(--plw-accent2, #a31515);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        border-radius: 20px;
        padding: 3px 9px;
}

/* ---------- Confetti (clipped inside its own layer: no overflow, no scrollbar) ---------- */
.plw-fx {
        position: absolute;
        inset: 0;
        border-radius: inherit;
        overflow: hidden;
        pointer-events: none;
        z-index: 6;
}
.plw-confetti {
        position: absolute;
        top: -14px;
        width: 8px;
        height: 14px;
        border-radius: 2px;
        z-index: 5;
        pointer-events: none;
        animation: plwFall linear forwards;
}
@keyframes plwFall {
        to { transform: translateY(120vh) rotate(720deg); opacity: 0.1; }
}

/* ---------- Inline (shortcode) ---------- */
.plw-inline .plw-modal { border-radius: 16px; }
.plw-msg { padding: 14px; }
.plw-msg .plw-note { font-size: 14px; text-align: center; }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
        .plw-modal { padding: 14px 10px 12px; max-height: 96dvh; }
        .plw-title { font-size: 19px; }
        .plw-wheelbox { width: min(260px, 74vw); }
        .plw-hub { width: 68px; height: 68px; font-size: 14px; }
        .plw-float { bottom: 14px; left: 14px; padding: 9px 14px; font-size: 13px; }
        .plw-cd-box { min-width: 52px; }
        .plw-rim { inset: -11px; }
        .plw-pointer { top: -15px; width: 16px; height: 16px; }
}
