/* ==========================================================================
   赛博极光紫金/抽奖系统样式表 (Cyber Aurora Purple & Gold Edition)
   ========================================================================== */

:root {
    --bg-dark: #09071a;
    
    /* 赛博极光紫金配色 */
    --aurora-purple: #a855f7;
    --aurora-cyan: #00f0ff;
    --aurora-pink: #ec4899;
    --aurora-gold: #ffd700;
    
    --gold-bright: #fef08a;
    --gold-primary: #00f0ff;
    --gold-dark: #7e22ce;
    --gold-gradient: linear-gradient(135deg, #00f0ff 0%, #a855f7 35%, #ec4899 70%, #ffd700 100%);
    --gold-glow: rgba(168, 85, 247, 0.5);
    
    --card-bg: rgba(17, 13, 38, 0.88);
    --card-border: rgba(168, 85, 247, 0.42);
    --glass-blur: blur(25px);
    
    --text-white: #ffffff;
    --text-gold: #00f0ff;
    --text-muted: rgba(230, 220, 255, 0.72);
    --accent-green: #00ffaa;
    --accent-blue: #00f0ff;
}

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

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 20%, #1a103c 0%, #09071a 65%, #04030a 100%),
        linear-gradient(rgba(168, 85, 247, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 36px 36px, 36px 36px;
    font-family: 'Noto Sans SC', system-ui, sans-serif;
    color: var(--text-white);
}

#threeCanvasContainer, #confettiCanvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

.ambient-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 950px; height: 580px;
    background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.22) 0%, rgba(0, 240, 255, 0.1) 45%, transparent 70%);
    z-index: 2;
    pointer-events: none;
    filter: blur(55px);
}

.app-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 20px 36px;
    justify-content: space-between;
}

/* 顶部 Header */
header.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand-title h1 {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 3px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 35px rgba(168, 85, 247, 0.6);
    outline: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-badge {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    padding: 8px 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6), 0 0 15px rgba(168, 85, 247, 0.25);
}

.stat-badge .label, .stat-badge .unit {
    color: var(--text-muted);
}

.stat-badge .num {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 20px;
    color: var(--aurora-cyan);
    text-shadow: 0 0 12px var(--aurora-cyan);
}

.action-btn-group {
    display: flex;
    gap: 8px;
}

.glass-icon-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-white);
    padding: 8px 16px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: var(--glass-blur);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.glass-icon-btn:hover {
    border-color: var(--aurora-cyan);
    background: rgba(0, 240, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

/* 扫码卡片 */
.qr-widget {
    background: rgba(17, 13, 38, 0.92);
    border: 1.5px solid var(--card-border);
    border-radius: 14px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(168, 85, 247, 0.3);
    transition: all 0.25s ease;
}

.qr-widget:hover {
    border-color: var(--aurora-cyan);
    box-shadow: 0 0 30px var(--aurora-cyan);
}

.qr-code-box {
    width: 54px;
    height: 54px;
    background: #ffffff;
    border-radius: 8px;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qr-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--aurora-cyan);
    display: flex;
    align-items: center;
    gap: 6px;
}

.qr-title .dot {
    width: 6px; height: 6px;
    background: var(--aurora-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--aurora-cyan);
}

.qr-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* 顶部最新扫码入池条 (Live Joined Bar) */
.live-joined-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(17, 13, 38, 0.88);
    border: 1.5px solid rgba(0, 240, 255, 0.35);
    border-radius: 18px;
    padding: 7px 18px;
    backdrop-filter: var(--glass-blur);
    margin-top: 12px;
    margin-bottom: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 240, 255, 0.2);
    width: 100%;
}

.live-tag {
    font-size: 13px;
    font-weight: 800;
    color: var(--aurora-cyan);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot-cyan {
    width: 8px;
    height: 8px;
    background-color: var(--aurora-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--aurora-cyan);
    animation: pulse 1.5s infinite;
}

.live-joined-stream {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
}

.live-joined-stream::-webkit-scrollbar {
    height: 3px;
}

.live-joined-stream::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 2px;
}

.joined-pill {
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.38);
    padding: 4px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
    animation: joinedPillPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.joined-pill .pill-code {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: var(--aurora-gold);
    background: rgba(255, 215, 0, 0.15);
    padding: 2px 8px;
    border-radius: 8px;
}

.empty-live-tip {
    font-size: 12px;
    color: var(--text-muted);
}

@keyframes joinedPillPop {
    0% { opacity: 0; transform: scale(0.8) translateY(-6px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 核心舞台分栏布局 (Main Stage Split Wrapper) */
.main-stage-wrapper {
    flex: 1;
    display: flex;
    gap: 32px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 14px 0;
    height: calc(100vh - 150px);
}

.main-stage-left {
    flex: 1.25;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rolling-cards-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.rolling-card {
    position: relative;
    width: 100%;
    max-width: 560px;
    height: 240px;
    background: linear-gradient(145deg, rgba(24, 18, 52, 0.94) 0%, rgba(10, 8, 25, 0.98) 100%);
    border: 2px solid var(--aurora-purple);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 45px rgba(168, 85, 247, 0.35), inset 0 0 35px rgba(168, 85, 247, 0.18);
    backdrop-filter: blur(28px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rolling-card::before, .rolling-card::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: var(--aurora-cyan);
    border-style: solid;
}

.rolling-card::before {
    top: 14px; left: 14px;
    border-width: 2px 0 0 2px;
}

.rolling-card::after {
    bottom: 14px; right: 14px;
    border-width: 0 2px 2px 0;
}

.rolling-card .winner-status-badge {
    font-size: 16px;
    font-weight: 800;
    color: var(--aurora-cyan);
    letter-spacing: 3px;
    text-shadow: 0 0 12px var(--aurora-cyan);
}

.rolling-card.glow-winner {
    border-color: var(--aurora-gold);
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.7), inset 0 0 45px rgba(255, 215, 0, 0.35);
    transform: scale(1.03);
}

.rolling-card.glow-winner .winner-status-badge {
    font-size: 17px;
    font-weight: 900;
    color: var(--aurora-gold);
    text-shadow: 0 0 16px var(--aurora-gold);
}

.rolling-card .ticket-badge {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    font-weight: 900;
    color: var(--aurora-cyan);
    background: rgba(0, 240, 255, 0.12);
    padding: 8px 36px;
    border-radius: 16px;
    border: 1.5px solid rgba(0, 240, 255, 0.45);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.rolling-card .phone-num {
    font-family: 'Orbitron', sans-serif;
    font-size: 64px;
    font-weight: 900;
    color: var(--text-white);
    letter-spacing: 4px;
    text-shadow: 0 0 35px rgba(255, 255, 255, 0.8), 0 0 18px var(--aurora-purple);
}

/* 控制按钮 */
.controls-area {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.main-action-btn {
    position: relative;
    width: 280px;
    height: 70px;
    background: var(--gold-gradient);
    border: none;
    border-radius: 35px;
    cursor: pointer;
    box-shadow: 0 0 55px var(--gold-glow), 0 10px 25px rgba(0,0,0,0.6);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.main-action-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 0 80px var(--gold-glow), 0 15px 35px rgba(0,0,0,0.7);
}

.main-action-btn:active {
    transform: translateY(1px) scale(0.98);
}

.main-action-btn .btn-text {
    font-size: 25px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 4px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.main-action-btn.running {
    background: linear-gradient(135deg, #ec4899 0%, #ff0055 100%);
    box-shadow: 0 0 55px rgba(236, 72, 153, 0.8);
}

.shortcut-tip {
    font-size: 13px;
    color: var(--text-muted);
}

.kbd-badge {
    background: rgba(168, 85, 247, 0.18);
    border: 1px solid rgba(168, 85, 247, 0.4);
    padding: 3px 10px;
    border-radius: 6px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: var(--aurora-cyan);
}

/* 右侧醒目中奖英雄榜 (Prominent Winner Wall Panel) */
.winner-wall-panel {
    flex: 0.75;
    max-width: 460px;
    height: 100%;
    max-height: 480px;
    background: linear-gradient(160deg, rgba(24, 18, 52, 0.94) 0%, rgba(10, 8, 25, 0.98) 100%);
    border: 2px solid var(--aurora-purple);
    border-radius: 32px;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 45px rgba(168, 85, 247, 0.35);
    backdrop-filter: blur(28px);
}

.winner-wall-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1.5px solid rgba(168, 85, 247, 0.35);
    margin-bottom: 16px;
}

.winner-wall-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.winner-wall-title h2 {
    font-size: 20px;
    font-weight: 900;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.winner-wall-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 6px;
}

.winner-wall-list::-webkit-scrollbar {
    width: 6px;
}
.winner-wall-list::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.4);
    border-radius: 3px;
}

.winner-wall-card {
    background: rgba(168, 85, 247, 0.12);
    border: 1.5px solid rgba(168, 85, 247, 0.4);
    border-radius: 18px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s ease, border-color 0.25s ease;
    animation: winnerCardPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winner-wall-card:hover {
    border-color: var(--aurora-cyan);
    transform: translateX(4px);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.35);
}

.winner-wall-card .winner-rank {
    font-size: 13px;
    font-weight: 800;
    color: var(--aurora-gold);
    background: rgba(255, 215, 0, 0.15);
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.35);
}

.winner-wall-card .winner-phone {
    font-family: 'Orbitron', monospace;
    font-size: 17px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1px;
}

.winner-wall-card .winner-ticket {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 800;
    color: var(--aurora-cyan);
    background: rgba(0, 240, 255, 0.12);
    padding: 3px 8px;
    border-radius: 8px;
}

.empty-tip {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 40px;
}

@keyframes winnerCardPop {
    0% { opacity: 0; transform: scale(0.85) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 弹窗 Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 5, 18, 0.88);
    backdrop-filter: blur(16px);
}

.modal-card {
    position: relative;
    background: linear-gradient(160deg, rgba(24, 18, 52, 0.96), rgba(10, 8, 25, 0.98));
    border: 2px solid var(--aurora-purple);
    border-radius: 28px;
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 90px var(--gold-glow);
    max-width: 620px;
    width: 90%;
    text-align: center;
}

.modal-title {
    font-size: 34px;
    font-weight: 900;
    color: var(--aurora-cyan);
    text-shadow: 0 0 20px var(--aurora-cyan);
    margin-bottom: 24px;
}

.modal-confirm-btn {
    background: var(--gold-gradient);
    border: none;
    padding: 14px 48px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 35px var(--gold-glow);
    transition: transform 0.2s ease;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.modal-confirm-btn:hover {
    transform: scale(1.05);
}

/* 移动端 (mobile.html) 样式 */
.mobile-body {
    background-color: #09071a;
    background-image: 
        radial-gradient(circle at 50% 20%, #1a103c 0%, #09071a 70%, #04030a 100%),
        linear-gradient(rgba(168, 85, 247, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 28px 28px, 28px 28px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.mobile-card {
    width: 100%;
    max-width: 390px;
    background: linear-gradient(160deg, rgba(24, 18, 52, 0.94) 0%, rgba(10, 8, 25, 0.98) 100%);
    border: 1.5px solid var(--aurora-purple);
    border-radius: 26px;
    padding: 38px 26px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.7), 0 0 35px rgba(168, 85, 247, 0.35);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    text-align: center;
}

.mobile-input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.mobile-input-group label {
    font-size: 13px;
    color: var(--text-muted);
}

.mobile-input {
    width: 100%;
    height: 54px;
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(168, 85, 247, 0.4);
    border-radius: 14px;
    padding: 0 18px;
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    color: #fff;
    outline: none;
    transition: all 0.25s ease;
}

.mobile-input:focus {
    border-color: var(--aurora-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.08);
}

.mobile-submit-btn {
    width: 100%;
    height: 54px;
    background: var(--gold-gradient);
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 30px var(--gold-glow);
    transition: transform 0.2s ease;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.mobile-submit-btn:active {
    transform: scale(0.98);
}

.ticket-result-box {
    width: 100%;
    background: rgba(168, 85, 247, 0.1);
    border: 1.5px dashed var(--aurora-cyan);
    border-radius: 18px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ticket-number-display {
    font-family: 'Orbitron', monospace;
    font-size: 36px;
    font-weight: 900;
    color: var(--aurora-cyan);
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

/* 自定义 UI 提示/确认弹窗 */
.dialog-card {
    max-width: 440px !important;
    padding: 32px 36px !important;
    border-radius: 26px !important;
    border: 1.5px solid rgba(168, 85, 247, 0.5) !important;
    box-shadow: 0 0 60px rgba(168, 85, 247, 0.35), 0 20px 40px rgba(0, 0, 0, 0.8) !important;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .dialog-card {
    transform: scale(1);
}

.dialog-icon {
    margin-bottom: 12px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 0 15px var(--gold-glow));
}

.dialog-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--aurora-cyan);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.dialog-message {
    font-size: 15px;
    color: var(--text-white);
    line-height: 1.6;
    margin-bottom: 28px;
    opacity: 0.92;
    word-break: break-word;
}

.dialog-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    width: 100%;
}

.dialog-cancel-btn {
    padding: 10px 32px !important;
    font-size: 15px !important;
    border-radius: 24px !important;
}

.dialog-card .modal-confirm-btn {
    padding: 10px 36px !important;
    font-size: 15px !important;
    border-radius: 24px !important;
}

/* 实时扫码入池全屏提示 Toast */
.realtime-toast {
    position: fixed;
    top: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(17, 13, 38, 0.94);
    border: 1.5px solid var(--aurora-cyan);
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.45);
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 150;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.realtime-toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pulse-dot-green {
    width: 10px;
    height: 10px;
    background-color: var(--aurora-cyan);
    border-radius: 50%;
    box-shadow: 0 0 14px var(--aurora-cyan);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(0, 240, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}
