/* index.php 獨立CSS樣式 - 遵循開發規則：每個頁面CSS獨立 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 上方空間：輪播展示 - 佔滿整個寬度 */
.hero-section {
    width: 100%;
    margin-bottom: 40px;
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    height: 500px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    cursor: pointer;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 10;
}

.prev-btn, .next-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-btn:hover, .next-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

/* 下方空間：卡片展示 - 直接在背景上放置 */
.cards-section {
    width: 100%;
    padding: 40px 20px;
}

/* 移除標題區域 */

.cards-container {
    max-width: 1200px;
    margin: 0 auto;
}

.cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    margin-bottom: 40px;
}

.app-card, .game-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    width: 300px;
    flex-shrink: 0;
}


.app-card:hover, .game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.card-icon {
    text-align: center;
    margin-bottom: 15px;
}

.card-icon img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

.game-preview {
    border-radius: 8px;
    background: linear-gradient(45deg, #ffd89b 0%, #19547b 100%);
}

.card-content h4 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

.card-content p {
    color: #666;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 20px;
}

.card-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.download-btn {
    display: inline-block;
    transition: transform 0.3s ease;
}

.download-btn img {
    width: 120px;
    height: auto;
}

.download-btn:hover {
    transform: scale(1.05);
}

.play-btn {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 後台管理入口 */
.admin-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.admin-link a {
    display: block;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-decoration: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.admin-link a:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .carousel-wrapper {
        height: 300px;
    }
    
    .cards-section {
        padding: 20px 10px;
    }
    
    .app-card, .game-card {
        width: 280px;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .download-btn img {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .carousel-wrapper {
        height: 250px;
    }
    
    .app-card, .game-card {
        width: 260px;
    }
}

/* 遊戲彈框樣式 */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.game-modal-content {
    background: white;
    border-radius: 20px;
    padding: 20px;
    max-width: 520px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.game-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.game-modal-header h2 {
    color: #667eea;
    margin: 0;
    font-size: 1.5em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* 刮刮樂遊戲區域 */
.scratch-game-area {
    text-align: center;
    margin-bottom: 20px;
}

#scratchGameCanvas {
    border: 3px solid #667eea;
    border-radius: 15px;
    cursor: crosshair;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
    background: #fff;
}

.scratch-hint {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    color: #667eea;
    font-weight: bold;
    text-align: center;
}

.scratch-hint p {
    margin: 0;
    font-size: 0.9em;
}


/* 遊戲按鈕 */
.game-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.game-btn {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 120px;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 動畫效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .game-modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    #scratchGameCanvas {
        width: 100%;
        max-width: 280px;
        height: auto;
    }
    
    .symbol {
        font-size: 2em;
        min-width: 60px;
        padding: 8px;
    }
    
    .game-modal-actions {
        flex-direction: column;
    }
    
    .game-btn {
        width: 100%;
    }
}

/* 刮刮樂結果彈框 */
.scratch-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scratch-result-modal.show {
    opacity: 1;
}

.scratch-result-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    position: relative;
}

/* 中獎時的紅包樣式 */
.scratch-result-modal.win .scratch-result-content {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #ff6b6b 100%);
    color: white;
    border: 3px solid #FFD700;
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.4), 0 0 30px rgba(255, 215, 0, 0.3);
}

.scratch-result-modal.win .result-header h2 {
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.scratch-result-modal.win .result-message p {
    color: white;
    font-weight: bold;
}

.scratch-result-modal.show .scratch-result-content {
    transform: translateY(0);
}

.result-header h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #667eea;
}

.result-symbols-display {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
}

.symbol-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.result-symbol {
    font-size: 3.5em;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 15px;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.result-message {
    margin: 20px 0;
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

.result-btn {
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 120px;
}

.result-btn.primary {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-btn.secondary {
    background: linear-gradient(45deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 右上角關閉按鈕 */
.result-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.result-close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
    transform: scale(1.1);
}

.scratch-result-modal.win .result-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.scratch-result-modal.win .result-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #FFD700;
}

/* 領紅包優惠按鈕 */
.result-btn.redpacket {
    background: linear-gradient(45deg, #FFD700 0%, #FFA500 100%);
    color: #8B0000;
    font-weight: bold;
    font-size: 1.1em;
    padding: 15px 30px;
    border: 2px solid #FFD700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    animation: redpacketGlow 2s infinite;
}

.result-btn.redpacket:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

@keyframes redpacketGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 215, 0, 0.6);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .scratch-result-content {
        padding: 25px;
        margin: 20px;
    }
    
    .result-symbol {
        font-size: 2.5em;
        min-width: 60px;
        padding: 10px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-btn {
        width: 100%;
    }
}

/* 老虎機特定樣式 */
.game-modal-body {
    text-align: center;
}

#slotCanvas {
    border: 3px solid #333;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    height: auto;
}

.slot-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spin-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.2em;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.slot-status {
    font-size: 1.1em;
    font-weight: bold;
    color: #667eea;
}

/* 老虎機結果彈窗樣式 - 統一使用刮刮樂樣式 */
#slotResultModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

#slotResultModal .modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

#slotResultTitle {
    font-size: 2em;
    margin-bottom: 20px;
    color: #667eea;
}

#slotResultSymbols {
    font-size: 3em;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#slotResultText {
    font-size: 1.3em;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 10px;
    font-weight: bold;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.redpacket-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e) !important;
    color: white !important;
    border: 2px solid #ff4757 !important;
    font-weight: bold;
    animation: redpacketPulse 2s infinite;
}

.redpacket-btn:hover {
    background: linear-gradient(135deg, #ff5252, #ff7979) !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

@keyframes redpacketPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
    }
}

/* 老虎機響應式設計 */
@media (max-width: 768px) {
    .game-modal-content {
        padding: 15px;
        max-width: 95%;
        max-height: 90vh;
    }
    
    #slotCanvas {
        width: 100%;
        max-width: 350px;
        height: auto;
    }
    
    .spin-btn {
        padding: 12px 25px;
        font-size: 1.1em;
    }
    
    #slotResultModal .modal-content {
        padding: 25px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .game-modal-content {
        padding: 10px;
        margin: 10px;
    }
    
    #slotCanvas {
        max-width: 300px;
    }
    
    .game-modal-header h2 {
        font-size: 1.3em;
    }
    
    .spin-btn {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    #slotResultModal .modal-content {
        padding: 20px;
        margin: 15px;
    }
    
    #slotResultSymbols {
        font-size: 2.5em;
        padding: 15px;
    }
    
    #slotResultText {
        font-size: 1.1em;
        padding: 15px;
    }
}