:root {
    --primary: #00f2ff;
    --primary-glow: rgba(0, 242, 255, 0.5);
    --secondary: #7000ff;
    --accent: #ff007f;
    --bg-dark: #020205;
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.5);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}

h1, h2, .event-tag, .module-name, .congrats-title, #flash-name, .btn-text {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    perspective: 1500px;
}

/* --- 背景层 --- */
#nebula {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(112, 0, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(0, 242, 255, 0.1) 0%, transparent 40%);
    filter: blur(80px);
    z-index: 0;
    animation: nebulaPulse 10s infinite alternate ease-in-out;
}

@keyframes nebulaPulse {
    from { opacity: 0.5; transform: scale(1); }
    to { opacity: 0.8; transform: scale(1.1); }
}

#stars-container {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 5px white;
}

#scanlines {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    z-index: 20;
    pointer-events: none;
    opacity: 0.3;
}

/* --- 头部 --- */
.main-header {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 2rem 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}

.logo-ticker a {
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-ticker a:hover {
    transform: scale(1.02);
}

.ticker-track {
    display: flex;
    align-items: center;
    gap: 4rem;
    padding: 0 2rem;
}

.logo-outline {
    height: 30px;
    opacity: 0.2;
    filter: brightness(2);
}

.logo-focus {
    position: relative;
    padding: 0 2rem;
}

.logo-focus::before, .logo-focus::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40px;
    height: 1px;
    background: var(--primary);
    opacity: 0.5;
}

.logo-focus::before { left: -20px; }
.logo-focus::after { right: -20px; }

.logo-laser {
    height: 45px;
    filter: drop-shadow(0 0 15px var(--primary-glow));
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
}

.event-tag { color: #fff; }
.divider { width: 1px; height: 10px; background: var(--text-dim); }
.module-name { color: var(--primary); }

/* --- 3D 空间 --- */
#space {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    z-index: 5;
}

/* --- 泡泡 --- */
.mask-item {
    position: absolute;
    cursor: pointer;
    pointer-events: auto;
    transform-style: preserve-3d;
    border-radius: 50%;
    z-index: 1;
}

.bubble {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.6));
    border-radius: 50%;
    border: 1px solid rgba(0, 242, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.bubble::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 45%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 55%
    );
    animation: shine 4s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

.mask-item:hover {
    z-index: 10000 !important; /* 悬停时强制提到最最最前面，解决点不到的问题 */
}

.mask-item:hover .bubble {
    border-color: var(--primary);
    box-shadow: inset 0 0 20px rgba(0, 242, 255, 0.3), 0 0 40px var(--primary-glow);
    transform: scale(1.3) translateZ(200px); /* 悬停时向镜头凸起 */
}

.mask-svg {
    width: 50%;
    height: 50%;
    fill: var(--text-dim);
    transition: all 0.3s;
}

.mask-item:hover .mask-svg {
    fill: #fff;
    filter: drop-shadow(0 0 10px var(--primary));
    transform: scale(1.2);
}

.mask-item::before {
    content: "";
    position: absolute;
    inset: -5px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: pulseCircle 3s infinite;
}

@keyframes pulseCircle {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* --- 抽奖层 --- */
#flash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 500;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flash-content {
    position: relative;
    height: 300px; /* 固定高度，防止随姓名长短跳动 */
    width: 80vw;
    max-width: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.flash-scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary);
    animation: scan 1.5s infinite;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

#flash-name {
    font-size: 5rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 30px var(--primary-glow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 中奖模态框 --- */
#prize-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    padding: 10px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
}

.modal-content {
    background: linear-gradient(145deg, #0a0a15, #05050a);
    border: 1px solid var(--primary);
    box-shadow: 
        0 0 100px rgba(0, 242, 255, 0.3),
        inset 0 0 30px rgba(0, 242, 255, 0.1);
    border-radius: 2px;
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    max-width: 600px;
    width: 95%;
    max-height: 98vh;
    overflow-y: auto;
    animation: modalAppear 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes modalAppear {
    0% { opacity: 0; transform: scale(0.9) translateY(30px); filter: brightness(3); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: brightness(1); }
}

.modal-decoration {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid var(--primary);
    opacity: 0.4;
    pointer-events: none;
}
.top-left { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.bottom-right { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

.congrats-title {
    font-size: 1.4rem;
    color: #f7ff00; /* 改为亮黄色 */
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-align: center;
    width: 100%;
    font-weight: 900;
    text-shadow: 
        0 0 10px rgba(247, 255, 0, 0.5),
        0 0 20px rgba(247, 255, 0, 0.3),
        0 0 40px rgba(247, 255, 0, 0.2); 
    animation: titleGlow 2s infinite alternate;
}

@keyframes titleGlow {
    from { 
        text-shadow: 0 0 10px rgba(247, 255, 0, 0.5); 
        filter: brightness(1);
    }
    to { 
        text-shadow: 0 0 30px #f7ff00, 0 0 10px #fff; 
        filter: brightness(1.2);
    }
}

.prize-display {
    margin-bottom: 1.5rem;
    position: relative;
    padding: 0rem;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border: 1px dashed rgba(0, 242, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.gift-image {
    width: 320px;
    height: auto;
    filter: drop-shadow(0 0 40px rgba(0, 242, 255, 0.5));
    animation: giftFloat 4s infinite ease-in-out;
}

@keyframes giftFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.prize-label {
    font-size: 0.7rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 900;
    background: rgba(0, 242, 255, 0.15);
    padding: 4px 16px;
    letter-spacing: 2px;
    border-radius: 20px;
}

.prize-label .highlight {
    color: #fff;
    text-shadow: 0 0 10px var(--primary);
}

.winner-card {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.15), rgba(0, 0, 0, 0.6));
    padding: 1.5rem 3rem;
    border-left: 4px solid var(--primary);
    border-right: 1px solid rgba(0, 242, 255, 0.1);
    margin-bottom: 1.5rem;
    width: 100%;
    min-height: 130px;
    box-shadow: inset 0 0 20px rgba(0, 242, 255, 0.05);
}

.avatar-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--primary);
    filter: blur(40px);
    opacity: 0.2;
    z-index: -1;
}

.winner-avatar {
    width: 85px;
    height: 85px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #000;
    box-shadow: 0 0 30px var(--primary-glow);
    position: relative;
}

.winner-avatar svg {
    width: 65% !important;
    height: 65% !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
}

.winner-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
}

#winner-name {
    font-size: 2.4rem;
    font-weight: 900;
    margin: 0 0 0.2rem 0;
    line-height: 1;
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255,255,255,0.2);
}

.info-group label {
    display: block;
    font-size: 0.6rem;
    color: var(--primary);
    margin-bottom: 0.1rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.info-group p {
    font-size: 1.25rem;
    color: #ffffff;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.sponsor-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0 1rem 0;
    width: 100%;
}

.footer-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
}

.sponsor-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: all 0.3s;
}

.sponsor-link:hover {
    transform: translateY(-2px);
}

.sponsor-text {
    font-size: 0.5rem;
    color: var(--text-dim);
    letter-spacing: 2px;
}

.prize-logo {
    height: 28px;
    opacity: 0.8;
    transition: filter 0.3s;
}

.sponsor-link:hover .prize-logo {
    filter: drop-shadow(0 0 10px var(--primary));
    opacity: 1;
}

#reset-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s;
    text-decoration: underline;
    text-underline-offset: 5px;
    margin-top: auto;
    pointer-events: auto;
}

#reset-btn:hover {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
    transform: translateY(-1px);
}

.instructions {
    position: absolute;
    bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    background: var(--glass);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.instructions .icon { font-size: 1.2rem; }

/* --- 音乐控制 --- */
#music-control {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

#music-toggle {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: all 0.3s;
    pointer-events: auto;
}

#music-toggle:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
    transform: scale(1.1);
}

#music-toggle.playing {
    animation: rotate 4s linear infinite;
    box-shadow: 0 0 20px var(--primary-glow);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes floatAround {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); }
    33% { transform: translate3d(80px, -50px, 200px) rotate(10deg); }
    66% { transform: translate3d(-60px, 70px, -150px) rotate(-10deg); }
    100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

.hidden { display: none !important; }
