/* 全域字型設定 */
@font-face {
    font-family: 'JF Open Huninn';
    src: url('./fonts/jf-openhuninn-2.1.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Comic Neue';
    src: url('./fonts/ComicNeue-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* 全域樣式 */
* {
    font-family: 'JF Open Huninn', 'Microsoft JhengHei', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background: #FAF3E0;
    color: #333333;
    min-height: 100vh;
    font-family: 'JF Open Huninn', 'Microsoft JhengHei', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #FAF3E0;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #FFF9C4 0%, #FFFDE7 100%);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(255, 249, 196, 0.3);
}

.cloud {
    position: absolute;
    opacity: 0.7;
    z-index: 1;
    font-size: 40px;
    animation: float 3s ease-in-out infinite;
}

.cloud1 {
    left: 20px;
    top: 20px;
    animation-delay: 0s;
}

.cloud2 {
    right: 30px;
    top: 10px;
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.title-container {
    text-align: center;
    z-index: 2;
}

.main-title {
    font-size: 28px;
    font-weight: bold;
    color: white;
    text-shadow: 3px 3px 6px #239ba7;
    letter-spacing: 0.1em;
    margin-bottom: 3px;
}

.sub-title {
    font-size: 16px;
    color: white;
    font-weight: bold;
    opacity: 0.95;
}

.mascot {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    z-index: 3;
    font-size: 60px;
    cursor: pointer;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.mascot:hover {
    transform: translateX(-50%) scale(1.1);
}

.content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    color: #333333;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: bold;
}

.section-icon {
    font-size: 25px;
    margin-right: 8px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.game-card {
    background: #FFFFFF;
    border: 2px solid #E1BEE7;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #B3E5FC;
}

.game-card.learning {
    border-color: #C8E6C9;
}

.game-card.puzzle {
    border-color: #E1BEE7;
}

.game-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    object-fit: contain;
}

.game-title {
    color: #333333;
    font-size: 1.2em;
    margin: 0;
    font-weight: 600;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #666666;
    background: #FFFFFF;
    border-radius: 15px;
    border: 1px solid #E1BEE7;
}

.footer-text {
    font-size: 16px;
    font-weight: bold;
    color: #FF7A30;
    margin-bottom: 8px;
}

.footer-sub-text {
    font-size: 14px;
    color: #FF7A30;
    margin: 0;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .main-title {
        font-size: 24px;
    }
    
    .content {
        padding: 15px;
    }
}

/* 觸控優化 */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 允許文字選擇 */
p, span, div, h1, h2, h3, h4, h5, h6 {
    -webkit-user-select: text;
    user-select: text;
}

/* 動畫優化 */
* {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Google 廣告樣式 */
.ad-container {
    margin-top: 40px;
    padding: 20px;
    background: #FFFFFF;
    border-radius: 15px;
    border: 2px solid #B3E5FC;
    text-align: center;
    box-shadow: 0 4px 15px rgba(179, 229, 252, 0.2);
}

.ad-label {
    color: #666666;
    font-size: 12px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.adsbygoogle {
    min-height: 200px;
    display: block;
}

/* 按鈕樣式 */
.btn-primary {
    background: #FFF9C4;
    color: #333333;
    border: 2px solid #FFF9C4;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary:hover {
    background: #FFF59D;
    border-color: #FFF59D;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 249, 196, 0.4);
}

.btn-secondary {
    background: #B3E5FC;
    color: #333333;
    border: 2px solid #B3E5FC;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #81D4FA;
    border-color: #81D4FA;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(179, 229, 252, 0.4);
}

.btn-success {
    background: #C8E6C9;
    color: #333333;
    border: 2px solid #C8E6C9;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-success:hover {
    background: #A5D6A7;
    border-color: #A5D6A7;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(200, 230, 201, 0.4);
}

/* 返回按鈕 */
.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #FFF9C4;
    color: #333333;
    border: 2px solid #FFF9C4;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.back-button:hover {
    background: #FFF59D;
    border-color: #FFF59D;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 249, 196, 0.4);
}
