/* 主頁樣式 */
:root {
    --color-primary: #E63946;
    --color-secondary: #FFC107;
    --color-accent: #4CAF50;
    --color-dark: #1D3557;
    --color-light: #F1FAEE;
    --color-gold: #FFD700;
    --color-silver: #C0C0C0;
    --color-bronze: #CD7F32;
    --transition-speed: 0.3s;
    --border-radius: 0.5rem;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 通用樣式 */
body {
    background-color: var(--color-dark);
    color: var(--color-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
}

/* CTA 按鈕樣式 */
.cta-button-hero {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #ff1744 100%);
    color: white !important;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none !important;
    box-shadow: 0 8px 25px rgba(230, 57, 70, 0.4), 0 0 0 0 rgba(230, 57, 70, 0.7);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    transform: translateY(0) scale(1);
    border: 2px solid transparent;
    white-space: nowrap;
    min-width: 140px;
    z-index: 10;
    animation: pulse-glow 2s ease-in-out infinite;
}

/* 添加火焰效果 */
.cta-button-hero::after {
    content: '🔥';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 18px;
    animation: flame-dance 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 165, 0, 0.8));
}

.cta-button-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.cta-button-hero:hover::before {
    left: 100%;
}

.cta-button-hero:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(230, 57, 70, 0.6), 0 0 30px rgba(255, 215, 0, 0.8);
    background: linear-gradient(135deg, #ff1744 0%, var(--color-primary) 100%);
    border-color: var(--color-gold);
    animation: hover-shine 0.6s ease-in-out infinite alternate;
}

.cta-button-hero:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 8px 25px rgba(230, 57, 70, 0.4);
    animation: click-pulse 0.3s ease-out;
}

.cta-text {
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 脈搏發光動畫 */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(230, 57, 70, 0.4), 0 0 0 0 rgba(230, 57, 70, 0.7);
    }
    50% {
        box-shadow: 0 8px 25px rgba(230, 57, 70, 0.4), 0 0 20px 10px rgba(230, 57, 70, 0.3);
    }
}

/* 懸停閃爍動畫 */
@keyframes hover-shine {
    0% {
        filter: brightness(1) saturate(1);
    }
    100% {
        filter: brightness(1.2) saturate(1.3);
    }
}

/* 點擊脈沖動畫 */
@keyframes click-pulse {
    0% {
        transform: translateY(-1px) scale(1.02);
    }
    50% {
        transform: translateY(-2px) scale(1.08);
    }
    100% {
        transform: translateY(-1px) scale(1.02);
    }
}

/* 火焰跳動動畫 */
@keyframes flame-dance {
    0%, 100% {
        transform: rotate(-5deg) scale(1);
    }
    25% {
        transform: rotate(5deg) scale(1.1);
    }
    50% {
        transform: rotate(-3deg) scale(0.95);
    }
    75% {
        transform: rotate(3deg) scale(1.05);
    }
}

main {
    flex-grow: 1;
}

/* 容器樣式 */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-spacing {
    margin-top: 4rem;
}

/* 遊戲展示區域 */
.games-section {
    padding: 2rem 0;
    background-color: white;
}

.games-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.section-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.section-title h2 {
    font-size: clamp(1.2rem, 2vw, 2rem);
    font-family: 'Bangers', cursive;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-title h2 i {
    font-size: 1.2em;
}

/* 遊戲卡片網格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
}

@media (max-width: 1280px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}

/* 遊戲卡片樣式 */
.slot-item {
    position: relative;
    overflow: hidden;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease-out;
    box-shadow: var(--box-shadow);
}

.slot-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(230, 57, 70, 0.3);
}

.slot-item img {
    height: 150px;
    width: 100%;
    object-fit: cover;
    transition: filter var(--transition-speed) ease;
}

.slot-item:hover img {
    filter: brightness(0.7);
}

.slot-item .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 10;
    transition: all var(--transition-speed) ease;
    background-color: rgba(230, 57, 70, 0.9);
    padding: 8px 16px;
    border-radius: 9999px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--box-shadow);
    white-space: nowrap;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.slot-item:hover .play-button {
    opacity: 1;
}

.slot-item .p-3 {
    padding: 0.75rem;
}

.slot-item h3 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--color-dark);
    font-weight: 600;
}

/* 熱門標籤 */
.hot-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--color-primary);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 5;
    box-shadow: var(--box-shadow);
}

/* 查看更多按鈕 */
a.view-more-button {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.5rem; /* Combined px and py */
    border-radius: 9999px;
    background-color: white;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

a.view-more-button:hover {
    background-color: var(--color-primary);
    color: white;
}

a.view-more-button i {
    margin-left: 0.5rem;
}

/* 優惠活動區塊 */
.promotions-section {
    padding: 2rem 0;
    background-color: #e0f2f7; /* blue-50 */
}

.promotions-container {
     max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.promotions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 1024px) { /* lg */
    .promotions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.promotions-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 1rem;
}

.promotions-content p {
    color: #4b5563; /* gray-700 */
    margin-bottom: 1rem;
}

.promotions-content ul {
    list-style: disc;
    list-style-position: inside;
    color: #4b5563; /* gray-700 */
    margin-bottom: 1rem;
}

.promotions-content ul li span {
    font-weight: 700;
}

.promotions-content a.button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem; /* Combined px and py */
    border-radius: 9999px;
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    border: 2px solid var(--color-primary);
}

.promotions-content a.button:hover {
    background-color: var(--color-gold);
    color: var(--color-dark);
    border-color: var(--color-gold);
}

.promotions-content a.button i {
     margin-left: 0.5rem;
}

.promotions-image img {
    width: 100%;
    height: auto;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* shadow-2xl */
    object-fit: cover;
}

/* 遊戲特色區塊 */
.features-section {
    padding: 2rem 0;
    background-color: #e0f2f7; /* blue-50 */
}

.features-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) { /* md */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) { /* lg */
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-item {
    background-color: white;
    border: 1px solid #bfdbfe; /* blue-100 */
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed) ease;
}

.feature-item:hover {
    box-shadow: 0 8px 12px rgba(230, 57, 70, 0.2);
    transform: translateY(-8px); /* hover:-translate-y-2 */
}

.feature-item img {
    width: 100%;
    aspect-ratio: 1 / 1; /* aspect-square */
    object-fit: cover;
}

.feature-item .p-4 {
     padding: 1rem;
}

.feature-item h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

.feature-item p {
    color: #4b5563;
    font-size: 0.875rem;
}

/* 下載應用區塊 */
.download-section {
    padding: 2rem 0;
    background-color: #44679c; /* custom blue */
}

.download-container {
    max-width: 1024px; /* max-w-4xl */
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.download-section h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-family: 'Bangers', cursive;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    color: white;
}

.download-section p {
    margin-bottom: 2.5rem;
    font-size: 1.125rem;
    color: white;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

@media (min-width: 640px) { /* sm */
    .download-buttons {
        flex-direction: row;
    }
}

.download-button {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: black;
    border-radius: 0.75rem;
    transition: all var(--transition-speed) ease;
    color: white;
    width: 100%;
}

@media (min-width: 640px) { /* sm */
    .download-button {
        width: 200px;
    }
}

.download-button:hover {
    background-color: #374151; /* gray-800 */
}

.download-button i {
    font-size: 1.875rem; /* text-3xl */
    margin-right: 0.75rem;
}

.download-button .text-xs {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7); /* white/70 */
}

.download-button .text-lg {
     font-size: 1.125rem;
     font-weight: 600;
}

.download-social-links {
    display: flex;
    justify-content: center;
    gap: 1rem; /* space-x-4 */
}

.download-social-link {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-speed) ease;
}

.download-social-link:hover {
     color: var(--color-dark);
     background-color: var(--color-gold);
}

/* 滾動到頂部按鈕 */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow);
    transform: translateY(20px); /* Initially hidden below the screen */
    opacity: 0; /* Initially invisible */
    transition: all var(--transition-speed) ease;
    z-index: 1000;
    cursor: pointer; /* Add cursor pointer */
}

#back-to-top.show {
    transform: translateY(0);
    opacity: 1;
}

#back-to-top:hover {
    background-color: var(--color-dark);
}

/* 遊戲 iframe 彈出視窗 - 由game-iframe.js控制 */
#game-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    /* display由JS控制 */
}
#game-modal > div {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
}
#game-modal iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
@media (max-width: 1024px) {
  #game-modal > div {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* 廣告彈窗 */
#ad-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
}

#ad-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background-color: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#ad-modal .modal-header {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#ad-modal #ad-countdown {
    color: black;
    font-weight: 700;
    font-size: 1.125rem;
}

#ad-modal #close-ad {
    width: 1.5rem;
    height: 1.5rem;
    color: #9ca3af; /* gray-400 */
    transition: all var(--transition-speed) ease;
    opacity: 0.5;
    display: none; /* hidden */
    cursor: pointer; /* Add cursor pointer */
}

#ad-modal #close-ad:hover {
    color: #4b5563; /* gray-600 */
    opacity: 1;
}

#ad-modal #close-ad i {
    font-size: 0.875rem;
}

#ad-modal .modal-body {
    padding: 1.5rem;
}

#ad-modal h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    text-align: center;
}

#ad-modal p {
    color: #4b5563;
    margin-bottom: 1rem;
    text-align: center;
}

#ad-modal p.font-bold {
    font-weight: 700;
}

#ad-modal .button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#ad-modal a.button {
    width: 100%;
    padding: 0.75rem 1.5rem; /* Combined px and py */
    background-color: var(--color-primary);
    color: white;
    text-align: center;
    border-radius: 0.5rem;
    transition: all var(--transition-speed) ease;
    font-weight: 700;
}

#ad-modal a.button:hover {
    background-color: rgba(230, 57, 70, 0.9);
}

/* 頁面載入動畫 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-speed) ease;
}

.page-loader .loading {
    display: inline-block;
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 其他工具類和動畫 */
.content-auto { content-visibility: auto; }

.text-shadow { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); }
.text-shadow-lg { text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7); }

.bg-gradient-slot { background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-primary) 100%); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.btn-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* 文字顏色 */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-dark { color: #333333; }
.text-light { color: var(--color-light); }
.text-muted { color: #666666; }
.text-link { color: #007BFF; }
.text-link:hover { color: #0056b3; }

/* 背景顏色 */
.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-dark { background-color: var(--color-dark); }
.bg-light { background-color: var(--color-light); }

/* 動畫效果 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* 錯誤提示 */
.error-message {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 成功提示 */
.success-message {
    background-color: #dcfce7;
    color: #16a34a;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
} 