/* ========== 幸运大转盘 前台样式（移动端优先） ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --red: #c04030;
    --red-deep: #8a2a1e;
    --gold: #ffd24c;
    --gold-deep: #c8901a;
    --cream: #fff7e6;
    --text: #5a2a12;
}

html, body {
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 50% -10%, #7a2e2e 0%, #5a1e1e 55%, #3a1212 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.page {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 32px;
}

/* ---------- 顶部标题 ---------- */
.site-header {
    text-align: center;
    color: #fff;
    padding: 8px 0 4px;
}

.site-header h1 {
    font-size: 30px;
    letter-spacing: 2px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.site-header p {
    margin-top: 6px;
    font-size: 14px;
    color: var(--gold);
    letter-spacing: 4px;
}

/* ---------- 老虎机 ---------- */
.slot-machine {
    width: 100%;
    max-width: 360px;
    margin: 22px auto 0;
}

.slot-frame {
    position: relative;
    background: linear-gradient(145deg, #ffe9a8, #f5b93f);
    border: 8px solid #6b3300;
    border-radius: 18px;
    padding: 14px 12px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, .35),
        inset 0 0 0 3px rgba(255, 255, 255, .3);
}

.slot-reels {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid #3a2a0e;
}

.reel {
    flex: 1;
    height: 150px;
    overflow: hidden;
    position: relative;
    background: #2a2a2a;
}

.reel-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform;
}

.reel-item {
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
}

.reel-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 100, .3);
}

.reel-item .reel-emoji {
    font-size: 52px;
    line-height: 1;
}

.reel-item .reel-name {
    font-size: 12px;
    color: #ffd24c;
    font-weight: 600;
    max-width: 90px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reel-divider {
    width: 3px;
    background: linear-gradient(180deg, #6b3300, #3a1e00, #6b3300);
    flex-shrink: 0;
}

/* 中线指示 */
.slot-line {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 50%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 3;
    opacity: .5;
}

.slot-frame::before,
.slot-frame::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    z-index: 4;
}

.slot-frame::before {
    top: 6px;
    border-top: 8px solid var(--gold-deep);
}

.slot-frame::after {
    bottom: 6px;
    border-bottom: 8px solid var(--gold-deep);
}

/* 中奖闪烁 */
.slot-frame.win {
    animation: winFlash .5s ease-in-out 3;
}

@keyframes winFlash {
    0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 0 0 3px rgba(255,255,255,.3); }
    50% { box-shadow: 0 0 40px var(--gold), inset 0 0 0 3px rgba(255,255,255,.6); }
}

/* 抽奖按钮 */
.spin-btn {
    display: block;
    margin: 16px auto 0;
    width: 100%;
    max-width: 280px;
    border: 5px solid #fff;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 30%, #ff7a5c, var(--red) 70%);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 2px;
    padding: 14px 20px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
    transition: transform .1s ease;
}

.spin-btn:active {
    transform: scale(.97);
}

.spin-btn:disabled {
    filter: grayscale(.4) brightness(.85);
    cursor: not-allowed;
}

.spin-btn-text {
    display: inline-block;
}

/* ---------- 次数卡片 ---------- */
.times-card {
    margin: 22px auto 0;
    max-width: 360px;
    background: var(--cream);
    border-radius: 14px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.times-label {
    font-size: 16px;
    font-weight: 600;
}

.times-num {
    font-size: 30px;
    color: var(--red);
    font-weight: 800;
    min-width: 48px;
    text-align: right;
}

.times-num.bump {
    animation: bump .4s ease;
}

@keyframes bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); color: var(--gold-deep); }
    100% { transform: scale(1); }
}

/* ---------- 按钮 ---------- */
.btn {
    display: block;
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 14px 20px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform .1s ease, filter .15s ease;
}

.btn:active {
    transform: scale(.97);
}

.btn-redeem {
    margin: 16px auto 0;
    max-width: 360px;
    background: linear-gradient(145deg, #ffe08a, #f5b93f);
    color: #7a3a06;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
}

.btn-primary {
    background: linear-gradient(145deg, #ff6a5a, var(--red));
    color: #fff;
    box-shadow: 0 6px 16px rgba(217, 48, 37, .35);
}

.btn-block {
    margin-top: 14px;
}

.btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

/* ---------- 活动说明 ---------- */
.rules {
    margin: 22px auto 0;
    max-width: 360px;
    background: rgba(255, 247, 230, .95);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
}

.rules h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--red-deep);
}

.rules ol {
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.9;
    color: #7a4a2a;
}

.site-footer {
    text-align: center;
    margin-top: 26px;
}

.site-footer a {
    color: rgba(255, 255, 255, .75);
    font-size: 13px;
    text-decoration: none;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
    animation: fadeIn .2s ease;
}

.modal-mask[hidden] {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    position: relative;
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: 18px;
    padding: 26px 22px 22px;
    text-align: center;
    animation: popIn .25s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes popIn {
    from { transform: scale(.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    background: none;
    font-size: 26px;
    line-height: 1;
    color: #b0a098;
    cursor: pointer;
}

.modal-title {
    font-size: 20px;
    color: var(--red-deep);
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 13px;
    color: #9a8578;
    line-height: 1.7;
    margin-bottom: 6px;
}

.input {
    width: 100%;
    border: 2px solid #f0dcc8;
    border-radius: 10px;
    padding: 13px 14px;
    font-size: 16px;
    margin-top: 14px;
    outline: none;
    text-align: center;
    letter-spacing: 2px;
    transition: border-color .15s ease;
}

.input:focus {
    border-color: var(--red);
}

/* 结果弹窗 */
.result-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 8px;
}

.result-prize {
    margin: 12px 0 6px;
    font-size: 26px;
    font-weight: 800;
    color: var(--red);
    letter-spacing: 1px;
}

.modal-result .result-prize.is-lose {
    color: #8a7a70;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 12%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, .82);
    color: #fff;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 14px;
    z-index: 200;
    max-width: 86%;
    text-align: center;
    animation: toastIn .25s ease;
}

.toast[hidden] {
    display: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 桌面端微调 ---------- */
@media (min-width: 520px) {
    .page {
        padding-top: 36px;
    }
    .site-header h1 {
        font-size: 36px;
    }
}
