/* 闲鱼客服 · 真实感幸运大转盘 */

.lottery-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-right: 10px;
    padding: 3px 10px 3px 5px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    vertical-align: middle;
    color: #fff;
    background: linear-gradient(135deg, #ff9a3c 0%, #ff5a1f 55%, #e11d0f 100%);
    box-shadow: 0 2px 6px rgba(255, 90, 30, 0.35), inset 0 1px 0 rgba(255,255,255,.35);
    transition: transform .15s ease, box-shadow .15s ease;
    animation: lotteryBtnPulse 2.2s ease-in-out infinite;
    -webkit-tap-highlight-color: transparent;
}
.lottery-tool-btn:active { transform: scale(0.96); }
.lottery-tool-btn .lottery-tool-ico {
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(255,255,255,.22);
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lottery-tool-btn .lottery-tool-ico svg { width: 14px; height: 14px; display: block; }
.lottery-tool-btn .lottery-tool-label {
    display: inline-block; font-size: 12px; font-weight: 700;
    letter-spacing: 0.5px; line-height: 1; color: #fff;
    text-shadow: 0 1px 0 rgba(0,0,0,.12); white-space: nowrap;
}
@keyframes lotteryBtnPulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(255, 90, 30, 0.35), inset 0 1px 0 rgba(255,255,255,.35); }
    50% { box-shadow: 0 3px 12px rgba(255, 90, 30, 0.55), inset 0 1px 0 rgba(255,255,255,.4); }
}

.lottery-mask {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(10, 0, 0, 0.78);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}
.lottery-mask.show { display: flex; }

.lottery-panel {
    position: relative;
    width: 100%;
    max-width: 372px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255,210,80,.28) 0%, transparent 45%),
        linear-gradient(180deg, #ff5a30 0%, #e01410 42%, #b00808 100%);
    border-radius: 22px;
    padding: 16px 12px 18px;
    box-shadow:
        0 0 0 3px rgba(255, 200, 90, .35),
        0 18px 50px rgba(0,0,0,.5),
        inset 0 1px 0 rgba(255,255,255,.25);
    text-align: center;
    overflow: hidden;
}
.lottery-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,230,120,.55) 0 1.2px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,.35) 0 1px, transparent 1.8px);
    background-size: 42px 42px, 28px 28px;
    background-position: 8px 10px, 22px 30px;
    opacity: .55;
    pointer-events: none;
    animation: lotterySpark 3s linear infinite;
}
@keyframes lotterySpark {
    0% { opacity: .4; }
    50% { opacity: .7; }
    100% { opacity: .4; }
}

.lottery-close {
    position: absolute;
    top: 10px; right: 10px;
    width: 30px; height: 30px;
    border: 0; border-radius: 50%;
    background: rgba(0,0,0,.28);
    color: #fff; font-size: 20px; line-height: 30px;
    cursor: pointer; z-index: 3;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}
.lottery-title {
    position: relative; z-index: 1;
    margin: 2px 0 10px;
    color: #fff8dc;
    font-size: 22px; font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 2px 0 #9a0a00, 0 4px 10px rgba(0,0,0,.35);
}

/* ===== 转盘主体 ===== */
.lottery-wheel-wrap {
    position: relative;
    z-index: 1;
    width: 318px;
    height: 318px;
    margin: 0 auto 14px;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,.35));
}
.lottery-wheel-outer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffe9a0 0%, #ffb020 35%, #ff8a00 70%, #e07000 100%);
    box-shadow:
        0 0 0 4px #ffe8b0,
        0 0 24px rgba(255,180,40,.55),
        inset 0 2px 4px rgba(255,255,255,.55),
        inset 0 -4px 8px rgba(160,60,0,.35);
}
.lottery-lamps {
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}
.lottery-lamp {
    position: absolute;
    left: 50%; top: 50%;
    width: 9px; height: 9px;
    margin: -4.5px 0 0 -4.5px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0%, #ffe566 40%, #ffb300 100%);
    box-shadow: 0 0 6px 2px rgba(255, 230, 100, .85);
    transform: rotate(var(--a)) translateY(-151px);
}
.lottery-lamp.dim {
    background: radial-gradient(circle at 35% 30%, #fff8d0 0%, #e0a020 70%);
    box-shadow: 0 0 2px 1px rgba(255, 180, 40, .35);
    opacity: .55;
}
.lottery-lamps.on .lottery-lamp:nth-child(odd) { opacity: 1; }
.lottery-lamps.on .lottery-lamp:nth-child(even) { opacity: .35; }
.lottery-lamps.off .lottery-lamp:nth-child(odd) { opacity: .35; }
.lottery-lamps.off .lottery-lamp:nth-child(even) { opacity: 1; }

.lottery-canvas {
    position: absolute;
    left: 50%; top: 50%;
    width: 268px; height: 268px;
    margin: -134px 0 0 -134px;
    border-radius: 50%;
    background: #d9481a;
    box-shadow:
        inset 0 0 0 3px rgba(255,220,150,.5),
        inset 0 0 28px rgba(120,20,0,.25);
    z-index: 1;
}

.lottery-pointer {
    position: absolute;
    left: 50%; top: 50%;
    z-index: 5;
    width: 26px; height: 34px;
    margin: -62px 0 0 -13px;
    background:
        linear-gradient(180deg, #ffffff 0%, #ffe8a0 55%, #ffc040 100%);
    clip-path: polygon(50% 0%, 100% 70%, 70% 70%, 70% 100%, 30% 100%, 30% 70%, 0% 70%);
    filter: drop-shadow(0 3px 3px rgba(0,0,0,.35));
}

.lottery-center {
    position: absolute;
    left: 50%; top: 50%;
    width: 70px; height: 70px;
    margin: -35px 0 0 -35px;
    border-radius: 50%;
    z-index: 6;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 900; color: #3a1a00;
    cursor: pointer; user-select: none;
    background:
        radial-gradient(circle at 35% 28%, #fff6b0 0%, #ffe14a 38%, #ffb400 78%, #e09000 100%);
    border: 5px solid #fff;
    box-shadow:
        0 6px 14px rgba(0,0,0,.35),
        inset 0 3px 0 rgba(255,255,255,.65),
        inset 0 -4px 6px rgba(180,90,0,.35);
    text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.lottery-center:active { transform: scale(.96); }

.lottery-tip {
    position: relative; z-index: 1;
    color: #ffe566;
    font-size: 14px; font-weight: 600;
    margin: 0 0 10px; min-height: 18px;
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.lottery-spin-wrap {
    position: relative; z-index: 1;
    display: inline-block; width: 88%;
}
.lottery-spin-btn {
    display: block; width: 100%;
    border: 0; border-radius: 999px;
    padding: 13px 16px;
    font-size: 18px; font-weight: 900;
    color: #4a2200;
    background: linear-gradient(180deg, #fff0a0 0%, #ffd84a 45%, #ffb400 100%);
    box-shadow:
        0 5px 0 #c47e00,
        0 10px 22px rgba(0,0,0,.28),
        inset 0 2px 0 rgba(255,255,255,.65);
    cursor: pointer;
    letter-spacing: 1px;
}
.lottery-spin-btn:disabled { opacity: .65; cursor: not-allowed; }
.lottery-spin-btn:not(:disabled):active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 #c47e00, 0 6px 12px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.5);
}
.lottery-hand {
    position: absolute;
    right: -6px; bottom: -8px;
    width: 42px; height: 42px;
    pointer-events: none;
    animation: lotteryHand 1.1s ease-in-out infinite;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.3));
}
@keyframes lotteryHand {
    0%, 100% { transform: translate(0, 0) rotate(-8deg); }
    50% { transform: translate(-4px, -5px) rotate(-18deg); }
}
.lottery-remain {
    position: relative; z-index: 1;
    margin-top: 10px;
    color: rgba(255,255,255,.88);
    font-size: 12px;
}

.lottery-result {
    display: none;
    position: absolute; inset: 0; z-index: 8;
    background: rgba(0,0,0,.58);
    align-items: center; justify-content: center;
    padding: 20px;
}
.lottery-result.show { display: flex; }
.lottery-result-box {
    background: linear-gradient(180deg, #fff 0%, #fff8f0 100%);
    border-radius: 16px;
    padding: 22px 18px;
    width: 100%; max-width: 280px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.lottery-result-box h4 { margin: 0 0 8px; font-size: 20px; color: #e11d0f; }
.lottery-result-box p { margin: 0 0 14px; color: #456; font-size: 14px; line-height: 1.5; }
.lottery-result-box img {
    width: 72px; height: 72px; object-fit: contain; margin-bottom: 8px;
}
.lottery-result-box .btn-ok {
    border: 0; border-radius: 999px; padding: 9px 32px;
    background: linear-gradient(180deg, #ff8a3d, #ff5a1f);
    color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
    box-shadow: 0 3px 0 #c43a00;
}

.lottery-history-btn {
    position: relative; z-index: 1;
    display: inline-block;
    margin-top: 10px;
    border: 0;
    background: rgba(255,255,255,.16);
    color: #fffce8;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}
.lottery-history-btn:active { transform: scale(.97); }

.lottery-history {
    display: none;
    position: absolute;
    left: 10px; right: 10px; bottom: 10px;
    z-index: 9;
    max-height: 58%;
    background: linear-gradient(180deg, #fffdf8 0%, #fff4e8 100%);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0,0,0,.35);
    overflow: hidden;
}
.lottery-history.show { display: flex; flex-direction: column; }
.lottery-history-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px 8px;
    border-bottom: 1px solid rgba(220,120,40,.18);
}
.lottery-history-hd strong { font-size: 15px; color: #c43a00; }
.lottery-history-close {
    border: 0; background: #ffe8d4; color: #a04000;
    border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.lottery-history-list {
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 8px 10px 12px; max-height: 260px;
}
.lottery-history-empty {
    text-align: center; color: #9aa; padding: 28px 10px; font-size: 14px; line-height: 1.7;
}
.lottery-history-empty span { font-size: 12px; color: #bcb; }
.lottery-history-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 8px; margin-bottom: 6px;
    background: #fff; border-radius: 10px;
    box-shadow: 0 1px 3px rgba(180,80,0,.08);
}
.lottery-history-left img,
.lottery-history-ico {
    width: 42px; height: 42px; border-radius: 8px;
    object-fit: contain; background: #fff3e0; flex-shrink: 0;
}
.lottery-history-ico {
    display: flex; align-items: center; justify-content: center;
    color: #e11d0f; font-weight: 800; font-size: 14px;
}
.lottery-history-main { flex: 1; min-width: 0; text-align: left; }
.lottery-history-name {
    font-size: 14px; font-weight: 700; color: #333;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lottery-history-meta {
    margin-top: 3px; font-size: 11px; color: #99a;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lottery-history-status {
    flex-shrink: 0; font-size: 11px; font-weight: 700;
    padding: 3px 8px; border-radius: 999px;
}
.lottery-history-status.pending { background: #fff1db; color: #d48806; }
.lottery-history-status.done { background: #e8f8ef; color: #2da05a; }
.lottery-history-status.void { background: #f0f0f0; color: #888; }
