* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif;
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #FF6347 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 頁面頭部 */
.header {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    margin-bottom: 30px;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, transparent 70%);
    pointer-events: none;
}

.title {
    font-size: 56px;  /* 原来 48px */
    color: #FFD700;
    text-shadow: 
        3px 3px 0 #8B0000,
        -1px -1px 0 #8B0000,
        1px -1px 0 #8B0000,
        -1px 1px 0 #8B0000,
        0 0 20px rgba(255, 215, 0, 0.8);
    margin-bottom: 15px;
    position: relative;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 3px 3px 0 #8B0000, 0 0 20px rgba(255, 215, 0, 0.8); }
    50% { text-shadow: 3px 3px 0 #8B0000, 0 0 30px rgba(255, 215, 0, 1); }
}

.subtitle {
    font-size: 28px;  /* 原来 24px */
    color: #FFF;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* 統計區域 */
.stats-section {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-item {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    padding: 25px 45px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    border: 3px solid #8B0000;
}

.stat-number {
    font-size: 48px;  /* 原来 42px */
    font-weight: bold;
    color: #8B0000;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 20px;  /* 原来 18px */
    color: #5D0000;
    font-weight: bold;
}

/* 轉盤區域 */
.lottery-section {
    text-align: center;
    margin-bottom: 50px;
}

.wheel-container {
    position: relative;
    width: 650px;  /* 稍微增大一點，給燈泡留空間 */
    height: 650px;
    margin: 0 auto 20px;
    /* 移動端性能優化 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* 完全移除drop-shadow，避免陰影透明度影響 */
    /* 裁剪成圓形 */
    border-radius: 50%;
    overflow: hidden;
    /* 居中Canvas */
    display: flex;
    align-items: center;
    justify-content: center;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    /* 移除drop-shadow，避免陰影渗透到間隙 */
    /* 移動端性能優化 */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-transform: translateZ(0);
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #FFD700;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    z-index: 10;
}

.spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    border: 5px solid #8B0000;
    color: #8B0000;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    transition: all 0.3s;
    z-index: 20;
}

.spin-button:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lottery-hint {
    font-size: 22px;  /* 原来 18px */
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-top: 15px;
}

/* 得獎名單 */
.winners-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 3px solid #FFD700;
}

.section-title {
    font-size: 28px;
    color: #8B0000;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.winners-list {
    max-height: 400px;
    overflow-y: auto;
}

.winner-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, #FFF5E1 0%, #FFFAF0 100%);
    border-radius: 12px;
    border-left: 5px solid #FFD700;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.winner-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.winner-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 3px solid #8B0000;
}

.winner-details {
    text-align: left;
}

.winner-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.winner-location {
    font-size: 14px;
    color: #666;
}

.winner-prize {
    background: linear-gradient(145deg, #DC143C, #8B0000);
    color: #FFD700;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.winner-time {
    font-size: 13px;
    color: #999;
    margin-top: 5px;
}

/* LINE 引導區 */
.line-section {
    text-align: center;
    margin: 40px 0;
}

.line-card {
    background: #FFF;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 3px solid #00B900;
    max-width: 500px;
    margin: 0 auto;
}

.line-card h3 {
    font-size: 28px;
    color: #8B0000;
    margin-bottom: 15px;
}

.line-card p {
    font-size: 18px;
    color: #666;
    margin-bottom: 25px;
}

.line-button {
    background: #00B900;
    color: #FFF;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,185,0,0.3);
}

.line-button:hover {
    background: #009900;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,185,0,0.4);
}

/* 彈窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #FFF 0%, #FFF5E1 100%);
    margin: 2% auto;
    padding: 0;
    border: 5px solid #FFD700;
    border-radius: 25px;
    width: 90%;
    max-width: 600px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideDown 0.4s;
    position: relative;
}

@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-button {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #8B0000;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
}

.close-button:hover {
    color: #DC143C;
}

.modal-header {
    background: linear-gradient(145deg, #DC143C, #8B0000);
    padding: 30px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.modal-header h2 {
    color: #FFD700;
    font-size: 36px;  /* 原来 32px */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.modal-body {
    padding: 40px 30px;
    text-align: center;
}

.prize-image {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 15px;
    margin: 0 auto 20px;
    display: block;
    border: 4px solid #FFD700;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    cursor: pointer; /* 添加鼠标指针 */
    transition: transform 0.3s ease;
}

.prize-image:hover {
    transform: scale(1.05);
}

/* 商品詳情框 */
.prize-details {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFBF0 100%);
    border: 2px solid #FFD700;
    border-radius: 12px;
    padding: 15px 20px;
    margin: 15px 0;
    text-align: left;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.prize-details h4 {
    font-size: 18px;
    color: #8B0000;
    margin: 0 0 12px 0;
    font-weight: bold;
    text-align: center;
    border-bottom: 2px solid #FFD700;
    padding-bottom: 8px;
}

.prize-details-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 16px;
    line-height: 1.6;
}

.prize-details-label {
    font-weight: bold;
    color: #8B0000;
    min-width: 70px;
    margin-right: 8px;
}

.prize-details-value {
    color: #333;
    flex: 1;
}

.prize-name {
    font-size: 32px;  /* 原来 28px */
    color: #8B0000;
    margin-bottom: 15px;
}

.prize-desc {
    font-size: 20px;  /* 原来 16px */
    color: #666;
    line-height: 1.8;
    white-space: pre-line;  /* 支持换行显示 */
    text-align: left;  /* 左对齐 */
    padding: 10px 20px;
    background: #f9f9f9;
    border-radius: 10px;
    border-left: 4px solid #FFD700;
}

.modal-footer {
    padding: 20px 30px 30px;
    text-align: center;
}

.claim-button {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #8B0000;
    border: 3px solid #8B0000;
    padding: 18px 60px;  /* 原来 15px 50px */
    font-size: 24px;  /* 原来 20px */
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.claim-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* 彩带动画 */
.confetti {
    position: fixed;
    width: 10px;
    height: 30px;
    background: #FFD700;
    animation: confetti-fall 3s linear forwards;
    z-index: 99999;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* 中奖弹窗动画增强 */
.prize-modal-show {
    animation: prize-bounce 0.6s ease-out;
}

@keyframes prize-bounce {
    0% {
        transform: scale(0.3) translateY(-100px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* 移動端性能優化 */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .title {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .wheel-container {
        width: 280px;  /* 移動端略微減小提升性能 */
        height: 280px;
    }
    
    .spin-button {
        width: 80px;
        height: 80px;
        font-size: 16px;
    }
    
    .stats-section {
        gap: 20px;
    }
    
    .stat-item {
        padding: 20px 30px;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .modal-content {
        width: 95%;
        margin: 3% auto;
        max-height: 92vh;
        border-radius: 20px;
    }
    
    .modal-header {
        padding: 20px 15px;
    }
    
    .modal-header h2 {
        font-size: 24px;
    }
    
    .modal-body {
        padding: 25px 15px;
    }
    
    .prize-image {
        width: 180px;
        height: 180px;
    }
    
    .prize-name {
        font-size: 22px;
    }
    
    .prize-desc {
        font-size: 16px;  /* 移动端略小 */
        padding: 8px 15px;
    }
    
    .prize-details {
        padding: 12px 15px;
        margin: 12px 0;
    }
    
    .prize-details h4 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .prize-details-item {
        font-size: 14px;
        margin: 6px 0;
    }
    
    .prize-details-label {
        min-width: 60px;
    }
    
    .claim-button {
        padding: 14px 35px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;  /* 原来 15px */
    }
    
    .header {
        padding: 20px 10px;  /* 原来 25px 15px */
    }
    
    .title {
        font-size: 28px;  /* 原来 32px，减小一点 */
    }
    
    .subtitle {
        font-size: 18px;  /* 原来 20px */
    }
    
    .wheel-container {
        width: 300px;  /* 小屏手機再略微減小 */
        height: 300px;
    }
    
    .spin-button {
        width: 75px;  /* 原来 80px */
        height: 75px;
        font-size: 15px;  /* 原来 16px */
    }
    
    .stat-number {
        font-size: 32px;  /* 原来 36px */
    }
    
    .stat-label {
        font-size: 15px;  /* 原来 16px */
    }
    
    /* 弹窗移动端优化 */
    .modal-content {
        width: 90%;  /* 原来 95% */
        margin: 5% auto;  /* 靠近顶部 */
        max-height: 90vh;  /* 限制高度 */
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 20px 15px;  /* 减小内边距 */
    }
    
    .modal-header h2 {
        font-size: 24px;  /* 原来 28px */
    }
    
    .modal-body {
        padding: 25px 15px;  /* 减小内边距 */
    }
    
    .prize-image {
        width: 160px;  /* 原来 180px，再减小一点 */
        height: 160px;
        margin-bottom: 15px;
    }
    
    .prize-name {
        font-size: 22px;  /* 适中大小 */
        margin-bottom: 10px;
    }
    
    .prize-desc {
        font-size: 15px;
        line-height: 1.6;
        padding: 8px 12px;
    }
    
    .modal-footer {
        padding: 15px;
    }
    
    .claim-button {
        padding: 14px 35px;
        font-size: 18px;
        width: 100%;  /* 按钮占满宽度 */
        max-width: 250px;
    }
}
