* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gold: #ffd76a;
    --gold-dark: #c99a2e;
    --bg1: #1a0b2e;
    --bg2: #3b1a5e;
    --panel: rgba(255, 255, 255, 0.07);
    --panel-border: rgba(255, 215, 106, 0.25);
    --text: #f5f0ff;
    --text-dim: #b7a8d6;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg1), var(--bg2), #201238);
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-decor {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 215, 106, 0.12), transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(255, 120, 200, 0.12), transparent 40%),
        radial-gradient(circle at 70% 15%, rgba(90, 200, 255, 0.10), transparent 35%);
}

.topbar {
    position: relative; z-index: 1;
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.25);
}
.brand { font-size: 22px; font-weight: 700; letter-spacing: 2px; color: var(--gold); }
.admin-link a {
    color: var(--text-dim); text-decoration: none; font-size: 13px;
    padding: 6px 14px; border: 1px solid var(--panel-border); border-radius: 20px;
}
.admin-link a:hover { color: var(--gold); border-color: var(--gold); }

.layout {
    position: relative; z-index: 1;
    display: flex; justify-content: center;
    padding: 24px 32px; max-width: 1200px; margin: 0 auto;
}

/* 舞台 */
.stage {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 860px;
    padding: 32px 24px 28px; border-radius: 20px;
    background: var(--panel); border: 1px solid var(--panel-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    min-height: 560px;
}
.stage-title { font-size: 24px; color: var(--gold); letter-spacing: 6px; margin-bottom: 24px; }

/* 转盘 */
.wheel-wrap { position: relative; width: min(520px, 82vw); height: min(520px, 82vw); margin: 0 auto; }
#wheelCanvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
.wheel-pointer {
    position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 30px solid var(--gold);
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45));
    z-index: 5;
}
.wheel-center {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 118px; height: 118px; border-radius: 50%;
    border: 5px solid #fff;
    background: radial-gradient(circle at 30% 30%, #ffe9a8, #f2b32c);
    color: #4a2c00; font-size: 28px; font-weight: 800; letter-spacing: 2px;
    cursor: pointer; z-index: 6;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s;
}
.wheel-center:hover { transform: translate(-50%, -50%) scale(1.07); }
.wheel-center:disabled { cursor: not-allowed; opacity: 0.65; transform: translate(-50%, -50%); }

.error-msg {
    color: #ff8a8a; font-size: 16px; margin-top: 16px;
    padding: 8px 22px; background: rgba(255, 80, 80, 0.12); border-radius: 10px;
}

/* 中奖弹层 */
.winner-overlay {
    position: fixed; inset: 0; z-index: 80;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.62);
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.wo-box {
    background: linear-gradient(160deg, #2a1148, #4a1f7a);
    border: 2px solid var(--gold); border-radius: 24px;
    padding: 40px 56px; text-align: center;
    box-shadow: 0 0 90px rgba(255, 215, 106, 0.35);
    animation: pop 0.5s ease; max-width: 90vw;
}
@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.wo-icon { font-size: 52px; }
.wo-text { font-size: 26px; color: var(--gold); letter-spacing: 6px; margin-top: 10px; }
.wo-prize { font-size: 20px; color: var(--text-dim); }
.wo-actions { margin-top: 22px; min-height: 42px; }
.wo-btn {
    display: inline-block; cursor: pointer;
    padding: 12px 34px; border-radius: 30px;
    font-size: 16px; font-weight: 700; letter-spacing: 2px;
    color: #3a2300; border: none;
    background: linear-gradient(135deg, #ffe9a8, var(--gold), #e6b03c);
    box-shadow: 0 6px 22px rgba(255, 215, 106, 0.4);
    transition: transform 0.15s;
}
.wo-btn:hover { transform: translateY(-2px) scale(1.04); }
.wo-close {
    display: inline-block; cursor: pointer;
    font-size: 13px; color: var(--text-dim);
    border: 1px solid var(--panel-border); padding: 8px 26px; border-radius: 20px;
}
.wo-close:hover { color: var(--gold); border-color: var(--gold); }

/* 彩纸 */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 99; overflow: hidden; }
.confetti {
    position: absolute; top: -12px; width: 10px; height: 14px; opacity: 0.95;
    animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

.hidden { display: none !important; }

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; padding: 16px; }
}
