/* 圣诞节主题背景 */
body {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #8B0000 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 雪花Canvas */
#snowCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* 主标题 */
.main-title {
    font-size: 2.8rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 
        3px 3px 0px #DC143C,
        6px 6px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    margin-top: 2rem;
    position: relative;
    z-index: 10;
    animation: titleGlow 2s ease-in-out infinite alternate;
    line-height: 1.4;
}

/* Logo容器 */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 1rem;
    position: relative;
    z-index: 10;
}

.site-logo {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.05);
}

.title-line {
    display: block;
    margin-bottom: 0.5rem;
}

.title-icon {
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
    margin: 0 15px;
}

@keyframes titleGlow {
    from {
        text-shadow: 
            3px 3px 0px #DC143C,
            6px 6px 10px rgba(0, 0, 0, 0.5);
    }
    to {
        text-shadow: 
            3px 3px 0px #DC143C,
            6px 6px 20px rgba(255, 215, 0, 0.8),
            0 0 30px rgba(255, 215, 0, 0.5);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(10deg);
    }
}

/* 圣诞节卡片样式 */
.christmas-card {
    background: linear-gradient(135deg, #fff 0%, #ffe6e6 100%);
    border: 3px solid #DC143C;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.christmas-card::before {
    content: '❄';
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 2rem;
    animation: rotate 3s linear infinite;
}

.christmas-card::after {
    content: '❄';
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 2rem;
    animation: rotate 3s linear infinite reverse;
}

/* 错误提示样式 */
.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
    font-weight: bold;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    font-weight: bold;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 九宫格抽奖容器 */
.prize-grid-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    z-index: 10;
}

.prize-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 3px solid #FFD700;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(220, 20, 60, 0.4);
    aspect-ratio: 1;
}

.prize-item {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #DC143C, #8B0000);
    border: 3px solid #FFD700;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    cursor: default;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    padding: 8px;
    text-align: center;
    /* 文字处理：确保长文本不溢出 */
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    /* 根据容器大小自动调整字体，确保6个字符也能显示 */
    font-size: clamp(0.85rem, 2.2vw, 1.4rem);
    /* 如果内容太长，允许换行 */
    white-space: normal;
    /* 确保文字在容器内 */
    box-sizing: border-box;
}

/* 中间旋转礼物图标 */
.prize-item.center-icon {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border-color: #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    animation: giftRotate 2s linear infinite;
    pointer-events: none;
}

@keyframes giftRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.prize-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
}

.prize-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.prize-item.highlight {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #DC143C;
    border-color: #DC143C;
    transform: scale(1.1);
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.8),
        0 0 60px rgba(255, 215, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    animation: prizePulse 0.5s ease-in-out infinite;
    z-index: 5;
}

.prize-item.highlight::before {
    animation: shine 1s linear infinite;
}

@keyframes prizePulse {
    0%, 100% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.15);
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.prize-item.scanning {
    border: 5px solid #FFD700 !important;
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    color: #DC143C !important;
    transform: scale(1.15);
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 1),
        0 0 80px rgba(255, 215, 0, 0.8),
        0 0 120px rgba(255, 215, 0, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.4);
    z-index: 10;
    animation: scanning 0.3s ease-in-out infinite;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

@keyframes scanning {
    0%, 100% {
        border-color: #FFD700;
        box-shadow: 
            0 0 40px rgba(255, 215, 0, 1),
            0 0 80px rgba(255, 215, 0, 0.8),
            0 0 120px rgba(255, 215, 0, 0.6),
            inset 0 0 30px rgba(255, 255, 255, 0.4);
    }
    50% {
        border-color: #FFA500;
        box-shadow: 
            0 0 60px rgba(255, 215, 0, 1.2),
            0 0 100px rgba(255, 215, 0, 1),
            0 0 150px rgba(255, 215, 0, 0.8),
            inset 0 0 40px rgba(255, 255, 255, 0.6);
    }
}

/* 抽奖按钮（已移到九宫格中间，此样式保留用于其他按钮） */
.christmas-btn {
    font-size: 1.8rem;
    padding: 18px 50px;
    border-radius: 50px;
    background: linear-gradient(135deg, #DC143C, #8B0000);
    border: 3px solid #FFD700;
    color: #FFD700;
    font-weight: bold;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 215, 0, 0.3);
    transition: all 0.3s;
    position: relative;
    z-index: 10;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.christmas-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, #FF1744, #DC143C);
}

.christmas-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    display: inline-block;
    margin: 0 10px;
    animation: bounce 1.5s ease-in-out infinite;
}

/* 结果弹窗 */
.christmas-modal {
    border: 3px solid #DC143C;
    border-radius: 15px;
    background: linear-gradient(135deg, #fff 0%, #ffe6e6 100%);
}

.result-icon {
    font-size: 4rem;
    animation: bounce 1s ease-in-out infinite;
    margin-bottom: 10px;
}

.prize-result {
    color: #DC143C;
    font-weight: bold;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    padding: 15px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 10px;
    border: 3px solid #DC143C;
    display: inline-block;
    margin-top: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
        margin-top: 1rem;
    }
    
    .title-line {
        margin-bottom: 0.3rem;
    }
    
    .logo-container {
        margin-bottom: 2rem;
    }
    
    .site-logo {
        max-width: 150px;
    }
    
    .prize-grid {
        gap: 15px;
        padding: 20px;
        min-height: 400px;
    }
    
    .prize-item {
        font-size: clamp(0.8rem, 2vw, 1.2rem);
        min-height: 120px;
        padding: 6px;
    }
    
    .christmas-btn {
        font-size: 1.4rem;
        padding: 15px 35px;
    }
    
    .title-icon {
        margin: 0 8px;
    }
    
    .center-spinner {
        width: 80px;
        height: 80px;
    }
    
    .spinner-icon {
        font-size: 3rem;
    }
}

/* 容器内容层级 */
.container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
}

/* Modal 弹窗样式 - 不使用遮罩 */
.modal {
    z-index: 1050 !important;
    background: transparent !important;
}

.modal-backdrop {
    display: none !important;
    opacity: 0 !important;
}

.modal-dialog {
    z-index: 1055 !important;
    pointer-events: auto !important;
}

.modal-content {
    z-index: 1060 !important;
    position: relative;
    pointer-events: auto !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header,
.modal-body,
.modal-footer {
    position: relative;
    z-index: 1061;
    pointer-events: auto !important;
}

.modal-header .btn-close {
    z-index: 1062 !important;
    position: relative;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.modal-footer .btn {
    z-index: 1062 !important;
    position: relative;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* 确保modal在所有元素之上 */
.modal.show {
    display: block !important;
    z-index: 1050 !important;
}

.modal.show .modal-dialog {
    z-index: 1055 !important;
}

.modal.show .modal-content {
    z-index: 1060 !important;
    pointer-events: auto !important;
}

