/* ============ 拉霸遊戲外掛樣式表 ============ */
/* 版本: 1.1.0 */

/* ============ 基本樣式 ============ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.laba-game-container body {
    font-family: 'Noto Sans TC', sans-serif;
    overflow-x: hidden;
    background-color: #F9F9F9;
    color: #333333;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

/* ============ 標題金色光暈效果 ============ */
.game-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #e63946;
    text-align: center;
    margin: 20px 0;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.2),
        2px 2px 4px rgba(0,0,0,0.1);
    animation: titleGlow 2s ease-in-out infinite alternate;
    position: relative;
    z-index: 10;
}

@keyframes titleGlow {
    0% {
        text-shadow: 
            0 0 10px rgba(255, 215, 0, 0.4),
            0 0 20px rgba(255, 215, 0, 0.3),
            0 0 30px rgba(255, 215, 0, 0.2),
            2px 2px 4px rgba(0,0,0,0.1);
    }
    100% {
        text-shadow: 
            0 0 15px rgba(255, 215, 0, 0.6),
            0 0 25px rgba(255, 215, 0, 0.5),
            0 0 35px rgba(255, 215, 0, 0.4),
            2px 2px 4px rgba(0,0,0,0.1);
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 1.8rem;
        margin: 15px 0;
    }
}

/* ============ 遊戲容器 ============ */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ============ 拉霸機器樣式 - 新增雙層金色外框 ============ */
.slot-machine-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    /* 新增雙層金色外框 */
    border: 8px solid #FFD700;
    position: relative;
}

/* 添加第二層金色外框效果 */
.slot-machine-container::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 4px solid #FFD700;
    border-radius: 35px;
    pointer-events: none;
}

.slot-reel {
    width: 180px;
    height: 180px;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border: 6px solid #3498db;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.1),
        0 10px 25px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 手機端：遊戲圖樣改成正方形 */
@media (max-width: 768px) {
    .slot-machine-container {
        gap: 10px;
        padding: 15px;
    }
    
    .slot-reel {
        width: 80px;
        height: 80px; /* 確保正方形 */
        font-size: 40px;
        border-radius: 10px; /* 稍小的圓角保持正方形感 */
        border-width: 4px;
    }
    
    /* 調整雙層外框在手機端 */
    .slot-machine-container::before {
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
        border-width: 3px;
        border-radius: 25px;
    }
}

.slot-reel.spinning {
    background: linear-gradient(145deg, #e8f4fc, #d4e7f7);
}

.slot-reel.stopped {
    border-color: #2ecc71;
    box-shadow: 
        inset 0 0 20px rgba(46, 204, 113, 0.3),
        0 10px 25px rgba(46, 204, 113, 0.3);
}

.slot-item {
    display: block;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1);
    transition: transform 0.3s;
}

/* ============ 遊戲結果訊息 - 新增緊張訊息樣式 ============ */
#gameResult {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    border-radius: 12px;
    background: #FFFACD; /* 淺黃色背景 */
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #FFD700; /* 金色邊框 */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    position: relative;
    transition: all 0.3s ease;
    display: none; /* 初始隱藏 */
}

/* 新增：顯示遊戲結果欄位 */
#gameResult.visible {
    display: flex;
}

/* 新增：緊張訊息脈衝動畫效果 */
.tension-message {
    animation: pulseTension 1.5s ease-in-out infinite alternate;
}

@keyframes pulseTension {
    0% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
        border-color: #FFD700;
    }
    100% {
        transform: scale(1.02);
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
        border-color: #FFC107;
    }
}

.win-result {
    color: #2a9d8f;
    background: linear-gradient(145deg, #d4edda, #c3e6cb) !important;
    border: 3px solid #2a9d8f;
    animation: none; /* 移除緊張訊息的動畫 */
    transform: none;
}

.lose-result {
    color: #e63946;
    background: linear-gradient(145deg, #f8d7da, #f5c6cb) !important;
    border: 3px solid #e63946;
    animation: none; /* 移除緊張訊息的動畫 */
    transform: none;
}

/* ============ 遊戲控制按鈕容器 ============ */
.game-controls-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

/* ============ 主要遊戲按鈕 ============ */
.main-game-btn {
    padding: 15px 40px;
    font-size: 1.5rem !important; /* 與遊戲結果字體大小一致 */
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(145deg, #e63946, #d62828);
    color: white;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    min-width: 250px;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.main-game-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(230, 57, 70, 0.6);
}

.main-game-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* ============ 生成海報按鈕 - 新增 ============ */
#generatePosterBtn {
    padding: 15px 30px;
    font-size: 1.5rem !important;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    background: linear-gradient(145deg, #FFD700, #FFC107) !important;
    color: white;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.3),
        0 6px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    min-width: 250px;
    margin: 15px 0;
    display: none; /* 初始隱藏 */
    -webkit-appearance: none;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
    animation: posterPulse 2s ease-in-out infinite alternate;
}

@keyframes posterPulse {
    0% {
        transform: scale(1);
        box-shadow: 
            0 0 20px rgba(255, 215, 0, 0.5),
            0 0 40px rgba(255, 215, 0, 0.3),
            0 6px 15px rgba(0,0,0,0.2);
    }
    100% {
        transform: scale(1.02);
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 0.7),
            0 0 50px rgba(255, 215, 0, 0.5),
            0 8px 20px rgba(0,0,0,0.3);
    }
}

#generatePosterBtn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 
        0 0 35px rgba(255, 215, 0, 0.8),
        0 0 60px rgba(255, 215, 0, 0.6),
        0 10px 25px rgba(0,0,0,0.3);
}

#generatePosterBtn:disabled {
    background: #95a5a6 !important;
    cursor: not-allowed;
    animation: none;
}

/* ============ 遊戲控制按鈕組 ============ */
.game-controls {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 500px;
    justify-content: center;
}

/* 手機端：遊戲規則、獎項說明和歸零計算要並排置中 */
@media (max-width: 768px) {
    .game-controls {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        max-width: 350px;
        gap: 8px;
    }
    
    .game-controls .game-btn {
        font-size: 0.9rem !important;
        padding: 10px 12px;
        min-width: auto;
        flex: 1;
        white-space: nowrap;
    }
    
    #generatePosterBtn {
        min-width: 200px;
        padding: 12px 25px;
        font-size: 1.3rem !important;
    }
}

.game-btn {
    padding: 12px 25px;
    font-size: 1.5rem !important; /* 與遊戲結果字體大小一致 */
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    touch-action: manipulation;
    flex: 1;
    max-width: 200px;
}

/* 遊戲規則按鈕 - 亮色系 */
.rules-btn {
    background: linear-gradient(145deg, #FFB74D, #FF9800) !important;
}

.rules-btn:hover:not(:disabled) {
    box-shadow: 0 6px 15px rgba(255, 167, 38, 0.5);
}

#prizeBtn {
    background: linear-gradient(145deg, #457b9d, #1d3557);
}

#resetBtn {
    background: linear-gradient(145deg, #FF7A00, #FF5722);
}

.game-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

#prizeBtn:hover:not(:disabled) {
    box-shadow: 0 6px 15px rgba(69, 123, 157, 0.5);
}

#resetBtn:hover:not(:disabled) {
    box-shadow: 0 6px 15px rgba(255, 122, 0, 0.5);
}

.game-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* ============ 店家設定和獎項設定按鈕組 ============ */
.store-prize-buttons {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 500px;
    justify-content: center;
    margin: 20px auto;
}

/* 手機端：店家設定和獎項設定要並排置中 */
@media (max-width: 768px) {
    .store-prize-buttons {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        max-width: 350px;
    }
}

.store-prize-buttons .game-btn {
    flex: 1;
    max-width: 200px;
    font-size: 1.5rem !important; /* 與遊戲結果字體大小一致 */
}

/* 店家設定按鈕顏色 */
#storeInfoBtn {
    background: linear-gradient(145deg, #9d4edd, #7b2cbf);
}

#storeInfoBtn:hover:not(:disabled) {
    box-shadow: 0 6px 15px rgba(157, 78, 221, 0.5);
}

/* 獎項設定按鈕顏色（橙色） */
#prizeSettingBtn {
    background: linear-gradient(145deg, #FF7A00, #FF5722);
}

#prizeSettingBtn:hover:not(:disabled) {
    box-shadow: 0 6px 15px rgba(255, 122, 0, 0.5);
}

/* ============ 遊戲統計 ============ */
.game-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
    width: 100%;
}

.stat-item {
    text-align: center;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 120px;
    /* 確保桌面端保持矩形 */
    width: auto;
    height: auto;
    border: 3px solid #FF7A00; /* 橙色邊框 */
}

/* 調整手機端統計區域間距 - 修正：縮小間距和方格大小 */
@media (max-width: 768px) {
    .game-stats {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 8px; /* 修正：縮小一半間距 (從15px到8px) */
        width: auto;
        max-width: 340px; /* 修正：縮小最大寬度 (從380px到340px) */
        margin: 15px auto; /* 修正：縮小外邊距 */
        padding: 8px; /* 修正：縮小內邊距 (從10px到8px) */
        flex-wrap: nowrap;
    }
    
    .game-stats .stat-item {
        width: 75px; /* 修正：縮小方格寬度 (從85px到75px) */
        height: 85px; /* 修正：縮小方格高度 (從95px到85px) */
        aspect-ratio: 1 / 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 8px; /* 修正：縮小內邊距 (從10px到8px) */
        margin: 0;
        min-width: 0;
        flex-shrink: 0;
        border: 2px solid #FF7A00; /* 修正：稍微縮小邊框 (從3px到2px) */
        background: linear-gradient(145deg, #ffffff, #f8f9fa); /* 漸層背景 */
        box-shadow: 0 4px 10px rgba(255, 122, 0, 0.15); /* 修正：縮小陰影 (從5px 15px到4px 10px) */
    }
    
    .game-stats .stat-value {
        font-size: 1.6rem !important; /* 修正：稍微縮小數字字體 (從1.8rem到1.6rem) */
        margin-bottom: 8px; /* 修正：縮小間距 (從10px到8px) */
        line-height: 1;
        font-weight: bold;
        color: #FF7A00;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    }
    
    .game-stats .stat-label {
        font-size: 0.8rem !important; /* 修正：稍微縮小文字字體 (從0.85rem到0.8rem) */
        margin-top: 4px; /* 修正：縮小間距 (從5px到4px) */
        text-align: center;
        line-height: 1.2;
        padding: 0 2px;
        color: #555;
        font-weight: 600;
    }
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #FF7A00;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* ============ 會員登入提示區域 ============ */
.member-login-prompt {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 30px 0;
    text-align: center;
    border: 3px solid #FF7A00;
}

.login-message {
    margin-bottom: 25px;
}

.login-message h3 {
    font-size: 1.8rem;
    color: #e63946;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-message p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.6;
}

.login-message p:last-child {
    font-weight: bold;
    color: #FF7A00;
}

.login-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.login-btn, .register-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.login-btn {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    border: 2px solid #2980b9;
}

.login-btn:hover {
    background: linear-gradient(145deg, #2980b9, #3498db);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(52, 152, 219, 0.4);
}

.register-btn {
    background: linear-gradient(145deg, #FF7A00, #FF5722);
    color: white;
    border: 2px solid #FF5722;
}

.register-btn:hover {
    background: linear-gradient(145deg, #FF5722, #FF7A00);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(255, 122, 0, 0.4);
}

@media (max-width: 768px) {
    .member-login-prompt {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .login-message h3 {
        font-size: 1.5rem;
    }
    
    .login-message p {
        font-size: 1rem;
    }
    
    .login-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .login-btn, .register-btn {
        width: 100%;
        max-width: 250px;
        padding: 12px 20px;
        font-size: 1.1rem;
    }
}

/* ============ 店家資訊展示區域 ============ */
.store-info-display {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    margin: 30px auto;
    max-width: 800px;
    width: 100%;
    border: 3px solid #FF7A00;
}

.store-info-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
    width: 100%;
}

.store-info-label-display {
    font-weight: bold;
    color: #FF7A00;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    flex-shrink: 0;
}

.store-info-value-display {
    flex: 1;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    font-size: 16px;
    line-height: 1.6;
    word-break: break-word;
    transition: all 0.3s;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.store-info-value-display:hover {
    border-color: #FF7A00;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
    background: white;
}

@media (max-width: 768px) {
    .store-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .store-info-label-display {
        min-width: auto;
        width: 100%;
    }
    
    .store-info-value-display {
        width: 100%;
        font-size: 14px;
        padding: 10px;
        min-height: 45px;
    }
}

/* ============ 彈窗樣式 ============ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 勝利彈窗樣式 - 修改後 */
.win-modal-content {
    background: linear-gradient(145deg, #fff9c4, #ffeb3b);
    padding: 30px 20px;
    border-radius: 30px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(255, 235, 59, 0.7);
    animation: winPopup 0.5s ease-out;
    border: 8px solid #ffd600;
    margin: 20px auto;
    box-sizing: border-box;
}

@keyframes winPopup {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.win-emoji {
    font-size: 70px;
    margin-bottom: 15px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.05); }
}

.win-title {
    font-size: 28px;
    color: #e63946;
    margin-bottom: 12px;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}

.win-details {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.4;
}

.win-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 15px 0;
    font-size: 50px;
    font-weight: bold;
}

.win-icon {
    animation: bounce 1s infinite alternate;
    animation-delay: var(--delay);
}

.win-gold {
    font-size: 32px;
    color: #e63946;
    font-weight: bold;
    margin: 12px 0;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}

.win-btn {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.5);
    margin-top: 12px;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.win-btn:hover {
    background: linear-gradient(to right, #3498db, #1abc9c);
    transform: scale(1.05);
    box-shadow: 0 12px 25px rgba(52, 152, 219, 0.6);
}

/* 失敗彈窗樣式 */
.lose-modal-content {
    background: linear-gradient(145deg, #e0e0e0, #b0b0b0);
    padding: 30px 20px;
    border-radius: 30px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    animation: losePopup 0.5s ease-out;
    border: 8px solid #777;
    margin: 20px auto;
    box-sizing: border-box;
}

@keyframes losePopup {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.lose-emoji {
    font-size: 70px;
    margin-bottom: 15px;
    animation: shake 1s infinite alternate;
}

@keyframes shake {
    from { transform: rotate(-10deg); }
    to { transform: rotate(10deg); }
}

.lose-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 12px;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
}

.lose-details {
    font-size: 18px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.4;
}

.lose-gold {
    font-size: 32px;
    color: #333;
    font-weight: bold;
    margin: 12px 0;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
}

/* 遊戲規則彈窗樣式 */
.rules-list-modal {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.rule-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #FF9800;
}

.rule-icon {
    font-size: 24px;
    min-width: 40px;
    text-align: center;
    color: #FF9800;
}

.rule-desc {
    font-size: 18px;
    color: #333;
    font-weight: 500;
    flex: 1;
}

/* 成功訊息彈窗樣式 */
.success-modal-content {
    background: linear-gradient(145deg, #d4edda, #c3e6cb);
    padding: 25px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 15px 40px rgba(42, 157, 143, 0.3);
    animation: popup 0.4s ease-out;
    border: 4px solid #2a9d8f;
}

.success-title {
    font-size: 24px;
    color: #2a9d8f;
    margin-bottom: 15px;
    font-weight: bold;
}

.success-message {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* 確認彈窗樣式 */
.confirm-modal-content {
    background: white;
    padding: 25px 15px;
    border-radius: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    animation: popup 0.4s ease-out;
    border: 4px solid #FF7A00;
    margin: 20px auto;
    box-sizing: border-box;
}

.confirm-title {
    font-size: 24px;
    color: #e63946;
    margin-bottom: 12px;
    font-weight: bold;
}

.confirm-message {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
}

.confirm-yes, .confirm-no {
    padding: 10px 25px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    min-width: 90px;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.confirm-yes {
    background: linear-gradient(145deg, #e63946, #d62828);
    color: white;
}

.confirm-yes:hover {
    background: linear-gradient(145deg, #d62828, #e63946);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(230, 57, 70, 0.4);
}

.confirm-no {
    background: linear-gradient(145deg, #457b9d, #1d3557);
    color: white;
}

.confirm-no:hover {
    background: linear-gradient(145deg, #1d3557, #457b9d);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(69, 123, 157, 0.4);
}

/* 獎項說明彈窗樣式 */
.prize-modal-content {
    background: white;
    padding: 25px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    animation: popup 0.4s ease-out;
    -webkit-overflow-scrolling: touch;
}

.prize-title {
    font-size: 28px;
    font-weight: 900;
    color: #FF7A00;
    text-align: center;
    margin-bottom: 25px;
}

.prize-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.prize-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.prize-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #FF7A00;
}

.prize-icon {
    font-size: 40px;
    min-width: 60px;
    text-align: center;
}

.prize-desc {
    font-size: 18px;
    color: #333;
    font-weight: 500;
    flex: 1;
}

/* 店家資訊和獎項設定彈窗樣式 */
.info-modal-content {
    background: white;
    padding: 25px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    animation: popup 0.4s ease-out;
    -webkit-overflow-scrolling: touch;
}

.info-title {
    font-size: 28px;
    font-weight: 900;
    color: #457b9d;
    text-align: center;
    margin-bottom: 25px;
}

.prize-setting-title {
    color: #FF7A00;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-label {
    font-size: 16px;
    font-weight: bold;
    color: #FF7A00;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s;
    background: #f8f9fa;
    -webkit-appearance: none;
    appearance: none;
}

.info-input:focus {
    border-color: #FF7A00;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.2);
    background: white;
}

.info-char-count {
    font-size: 14px;
    color: #666;
    text-align: right;
}

.info-buttons {
    display: flex;
    gap: 15px;
}

.info-save, .info-cancel {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.info-save {
    background: linear-gradient(145deg, #457b9d, #1d3557);
    color: white;
}

.info-save:hover {
    background: linear-gradient(145deg, #1d3557, #457b9d);
    transform: translateY(-3px);
}

.info-cancel {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    color: white;
}

.info-cancel:hover {
    background: linear-gradient(145deg, #7f8c8d, #95a5a6);
    transform: translateY(-3px);
}

.prize-save {
    background: linear-gradient(145deg, #FF7A00, #FF5722) !important;
}

.prize-save:hover {
    background: linear-gradient(145deg, #FF5722, #FF7A00) !important;
}

/* ============ 海報彈窗樣式 - 修正後 ============ */
.poster-modal-content {
    background: white;
    padding: 0;
    border-radius: 20px;
    max-width: 95%;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: popup 0.5s ease-out;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

@media (min-width: 769px) {
    .poster-modal-content {
        max-width: 800px;
        width: 90%;
    }
}

.poster-content-wrapper {
    padding: 30px;
    position: relative;
}

.poster-container {
    padding: 30px;
    background: linear-gradient(145deg, #fff9e6, #fff0b3);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.poster-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, rgba(255,215,0,0) 70%);
    z-index: 1;
}

.poster-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
}

.poster-title {
    font-size: 2.8rem; /* 店家名稱保持原大小 */
    font-weight: 900;
    color: #e63946;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
}

.poster-subtitle {
    font-size: 2.8rem; /* 修正：放大2倍 (從1.4rem到2.8rem) - 用戶輸入的本次活動名稱 */
    color: #FF7A00;
    font-weight: bold;
}

.poster-winning-section {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
    border: 3px solid #FFD700;
}

.poster-winning-title {
    font-size: 2.2rem; /* 增大字體 */
    color: #e63946;
    margin-bottom: 20px; /* 增加間距 */
    font-weight: bold;
}

.poster-winning-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px; /* 增加間距 */
    margin: 20px 0;
    font-size: 7.5rem; /* 水果圖放大1.5倍 (從5rem到7.5rem) */
}

/* 移除水果圖脈動動畫 */
.poster-winning-icon {
    /* 移除動畫 */
    transform: scale(1.1); /* 稍微放大 */
}

.poster-prize-text {
    font-size: 1.8rem; /* 增大字體 */
    color: #2a9d8f;
    font-weight: bold;
    margin-top: 20px;
}

/* 本次活動欄位樣式 - 修改後 */
.poster-activity-section {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(145deg, #e8f4fc, #d4e7f7);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
    border: 3px solid #3498db;
}

.poster-activity-title {
    font-size: 2.2rem; /* 保持原大小 */
    color: #457b9d;
    margin-bottom: 20px;
    font-weight: bold;
}

.poster-activity-content {
    font-size: 1.44rem; /* 修正：改成跟店家地址一樣大小 (從2.2rem到1.44rem) */
    color: #1d3557;
    font-weight: bold;
    line-height: 1.5;
}

.poster-store-info {
    margin-top: 25px;
    position: relative;
    z-index: 2;
}

.poster-store-title {
    font-size: 2.4rem; /* 增大字體 (從2rem到2.4rem) */
    color: #457b9d;
    text-align: center;
    margin-bottom: 25px;
    font-weight: bold;
    border-bottom: 3px solid #457b9d;
    padding-bottom: 15px;
}

/* 修改店家資訊為一行一列並靠左對齊 */
.poster-store-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.poster-store-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-left: 4px solid #FF7A00;
    text-align: left; /* 靠左對齊 */
    justify-content: flex-start; /* 靠左對齊 */
}

.poster-store-icon {
    font-size: 1.68rem; /* 增大圖標 (從1.4rem到1.68rem) */
    min-width: 40px; /* 增加最小寬度 */
    color: #FF7A00;
    text-align: left; /* 靠左對齊 */
}

.poster-store-text {
    font-size: 1.44rem; /* 店家資訊文字大小 */
    color: #333;
    font-weight: 500;
    flex: 1;
    text-align: left; /* 靠左對齊 */
}

/* 海報操作按鈕（放在海報容器外部） */
.poster-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #FFD700;
    position: relative;
    z-index: 2;
}

.poster-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    position: relative;
    z-index: 2;
}

.poster-download, .poster-close {
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.poster-download {
    background: linear-gradient(145deg, #2a9d8f, #21867a);
    color: white;
}

.poster-download:hover {
    background: linear-gradient(145deg, #21867a, #2a9d8f);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(42, 157, 143, 0.4);
}

.poster-close {
    background: linear-gradient(145deg, #e63946, #d62828);
    color: white;
}

.poster-close:hover {
    background: linear-gradient(145deg, #d62828, #e63946);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(230, 57, 70, 0.4);
}

/* 手機端海報樣式調整 */
@media (max-width: 768px) {
    .poster-content-wrapper {
        padding: 20px 15px;
    }
    
    .poster-container {
        padding: 20px 15px;
        min-height: 300px;
    }
    
    .poster-title {
        font-size: 2.2rem;
    }
    
    .poster-subtitle {
        font-size: 2.2rem; /* 手機端放大2倍 (從1.1rem到2.2rem) */
    }
    
    .poster-winning-title {
        font-size: 1.8rem;
    }
    
    .poster-winning-icons {
        font-size: 5.25rem; /* 手機端水果圖放大1.5倍 (從3.5rem到5.25rem) */
        gap: 20px;
    }
    
    .poster-prize-text {
        font-size: 1.5rem;
    }
    
    .poster-activity-title {
        font-size: 1.8rem; /* 手機端調整 */
    }
    
    .poster-activity-content {
        font-size: 1.32rem; /* 手機端改成跟店家地址一樣大小 (從1.8rem到1.32rem) */
    }
    
    .poster-store-title {
        font-size: 2.0rem; /* 手機端增大 (從1.8rem到2.0rem) */
    }
    
    .poster-store-text {
        font-size: 1.32rem; /* 手機端店家資訊文字大小 */
    }
    
    .poster-store-icon {
        font-size: 1.5rem; /* 手機端增大圖標 */
    }
    
    .poster-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .poster-download, .poster-close {
        width: 100%;
        max-width: 250px;
    }
}

@keyframes popup {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ============ 返回頂部按鈕 - 桌面隱藏，手機顯示 ============ */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, #FF7A00, #FF5722);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(255, 122, 0, 0.5);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    touch-action: manipulation;
    /* 桌面端隱藏 */
    display: none;
}

@media (max-width: 768px) {
    #backToTop {
        display: flex;
    }
    
    #backToTop.show {
        opacity: 1;
        visibility: visible;
    }
    
    #backToTop:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(255, 122, 0, 0.7);
    }
    
    #backToTop {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        bottom: 20px;
        right: 20px;
    }
}