/* 基礎樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif TC', 'Microsoft JhengHei', Arial, sans-serif;
    font-weight: 400; /* 粗體 */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

.main-body {
    background-image: url('../images/main3.jpg');
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.game-body {
    background-image: url('../images/gamebg.jpg');
    background-size: 100% auto;M
    background-position: top center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.result-body {
    background-image: url('../images/game.jpg');
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
    /*background-attachment: fixed;*/
}

.container {
    max-width: 414px;
    margin: 0 auto;
    min-height: 90vh;
    padding: 20px;
    position: relative;
}

/* 標題區域已移除，因為未被使用 */

/* 主要內容區域和獎品預覽已移除，因為未被使用 */

/* 開始按鈕區域 */
.startup{
    position: fixed;
    bottom: 4rem;
    left: 0;
    right: 0;
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}


.startup:hover {
    transform: scale(1.05); /* 懸停時放大效果 */
}
.start-section {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 100px;
}

.start-btn {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    border: none;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255,107,107,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255,107,107,0.4);
}

.start-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* 遊戲頁面樣式 */
.game-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.instruction {
    text-align: center;
    margin-bottom: 40px;
}

.instruction p {
    font-size: 18px;
    color: #ffd700;
    margin-bottom: 15px;
}

.shake-indicator {
    font-size: 16px;
    color: #e0e0e0;
    animation: shake 2s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 籤筒相關樣式 */
.game-area {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.game-controls {
    text-align: center;
    margin: 0;
}

#drawingStatus {
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

#drawingStatus p {
    font-size: 16px;
    color: #fff;
}

/* 抽出的籤樣式 */
.drawn-stick {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 200px;
    background-color: #f5f5dc;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.drawn-stick.show {
    display: block;
    animation: drawStick 1s ease-out forwards;
}

.stick-text {
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: #8b4513;
    font-weight: bold;
}

/* 搖動動畫 */
.shake-animation {
    animation: shakeDevice 0.5s ease-in-out;
}

@keyframes shakeDevice {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
}

@keyframes drawStick {
    0% { height: 0; top: 100%; }
    100% { height: 200px; top: 50%; }
}

/* 遊戲控制按鈕 */
.game-controls {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.draw-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(76,175,80,0.3);
}

.draw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76,175,80,0.4);
}

.draw-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* iOS權限請求按鈕樣式已移除，因為未被使用 */

/* 結果頁面樣式已移除，因為未被使用 */

/* 操作按鈕樣式已移除，因為未被使用 */

/* 頁腳 */
.footer {
    position: fixed;
    bottom: -4px;
    left: 0;
    right: 0;
}

.footer img {
    width: 100%;
    height: auto;
}

/* 動畫效果 */
.shake-animation {
    animation: shakeDevice 0.5s ease-in-out;
}

@keyframes shakeDevice {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 響應式設計 */
@media (max-width: 375px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .activity-banner h2 {
        font-size: 20px;
    }
    
    .start-btn {
        padding: 18px 35px;
        font-size: 18px;
    }
    
    .fortune-tube .tube-body {
        width: 100px;
        height: 180px;
    }
    
    .tube-top, .tube-middle, .tube-bottom {
        width: 100px;
    }
}

/* 中文直書格式 */
.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: auto;
    margin: 0 auto;
    padding:10px 2px;
    line-height: 2;
    letter-spacing: 3px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    /*max-height: 300px;*/
    overflow-x: visible;
    font-size: 1.1em;
    text-align: start;
    white-space: pre-line;
    direction: ltr;
    column-gap: 10px;
    text-combine-upright: none;
    letter-spacing: 2px;
}

/* 載入動畫 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 彈窗樣式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(209 197 197 / 70%);
    z-index: 100;
    overflow: auto;
    animation: fadeIn 0.3s ease-in-out;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(to bottom, #ffd700, #FFFFFF);
    margin: 15% auto;
    padding: 20px;
    border: 5px solid #ffd700;
    /*border-radius: 15px;*/
    width: 80%;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.4s ease-in-out;
    position: relative;
}

.modal-header {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    text-align: center;
}

.modal-header h2 {
    margin: 0;
    color: #ffd700;
    font-size: 24px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.modal-body {
    padding: 20px 0;
    text-align: left;
}

.modal-body p {
    font-size: 16px;
    line-height: 1.6;
    color: black;
}

.modal-footer {
    padding: 15px 0 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.modal-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-family: 'Noto Serif TC', 'Microsoft JhengHei', Arial, sans-serif;
    font-weight: 700; /* 粗體 */
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 250px;
}

.primary-btn {
    background-color: gray;
    color: #ffffff;
}

.primary-btn:hover {
    background-color: #ffcc00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.secondary-btn {
    background-color: rgba(255, 255, 255, 0.8);
    color: #f60c0c;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}