/* Reset 基本樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: url('');
    font-family: Arial, sans-serif;
    background-color: #1e1e1e;
    color: #fff;
    line-height: 1.6;
    background-repeat: no-repeat; /* 禁止重複 */
    background-size: cover; /* 覆蓋整個背景區域 */
    background-position: center; /* 置中顯示背景 */
    background-size: 120%; /* 將圖片縮放為容器的 80% */
}
@media screen and (max-width: 768px) {
    body {
        background-size: contain; /* 手機或平板縮小圖片顯示 */
    }
}
/* 頂部導航列 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    padding: 10px 20px;
    width: 100%;
}

    .navbar .logo {
        font-size: 24px;
        font-weight: bold;
        color: #ffcc00;
    }

    .navbar .nav-links a {
        color: #fff;
        text-decoration: none;
        margin-left: 15px;
        font-size: 16px;
    }

        .navbar .nav-links a:hover {
            color: #ffcc00;
        }

    .navbar .nav-links .login {
        font-weight: bold;
    }

/* 背景圖片區域 */
.background-banner {
    height: 200px;
    background: url('https://via.placeholder.com/1280x200') no-repeat center center;
    margin: 0 auto;
}

/* 主容器區域 */
.main-container {
    display: flex;
    justify-content: center;
    margin: 20px auto;
    max-width: 1280px;
}

/* 廣告區域 */
.ad-banner {
    width: 160px;
    background-color: #2a2a2a;
    padding: 10px;
    margin: 0 10px;
    color: #aaa;
    text-align: center;
    flex-shrink: 0;
}

    .ad-banner img {
        width: 100%;
        margin-bottom: 10px;
    }

/* 👇展示區 <---------------------------------------------------------*/
.featured-games, .featured-tools, .featured-music, .featured-art {
    flex-grow: 1;
    padding: 20px;
    background-color: #1e1e1e;
    max-width: 960px;
    margin: 20px auto 0; /* 上方增加 20px，其他保持置中 */
    animation: fadeIn 1s ease-in-out;
}


    .featured-games h2, .featured-tools h2, .featured-music h2, .featured-art h2 {
        font-size: 28px;
        margin-bottom: 20px;
        text-align: center; /* 讓標題也置中 */
    }

    .featured-games .filter-options, .featured-tools .filter-options, .featured-music .filter-options, .featured-art .filter-options {
        margin-bottom: 20px;
        display: flex;
        gap: 15px;
        font-size: 14px;
        justify-content: center; /* 置中过濾選項 */
    }

    .featured-games select, .featured-music select, .featured-art select {
        padding: 5px;
        background-color: #333;
        color: #fff;
        border: 1px solid #555;
        border-radius: 4px;
    }
/* 預設隱藏所有section，除了 game-player 和 featured-games */
.featured-games {
    display: block; /* 預設顯示 featured-games */
}

.featured-tools {
    display: none; /* 預設隱藏 featured-tools */
}

.featured-music {
    display: none; /* 預設隱藏 featured-music */
}
.featured-art {
    display: none; /* 預設隱藏 featured-art */
}
/*👆 展示區 --------------------------------------------------------->*/

/* 展示格子區域 */
.exhibit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    justify-content: center; /* 展示格子置中 */
}

/* 展示格子區域 */
#music-container, #game-container{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    justify-content: center; /* 展示格子置中 */
}

.exhibit-item{
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .exhibit-item a {
        text-decoration: none; /* 去除底線 */
    }

    .exhibit-item img {
        width: 100%;
        border-radius: 5px;
        margin-bottom: 10px;
    }

    .exhibit-item h3 {
        font-size: 18px;
        margin: 10px 0;
        color: #ffcc00;
    }

    .exhibit-item p {
        font-size: 14px;
        color: #aaa;
    }

    .exhibit-item:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background-color: #000; /* Optional: Set background color */
}

    .video-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: none;
    }

/* 遊戲播放器區域 */
.game-player {
    background: url('../images/background6.webp');
    font-family: Arial, sans-serif;
    color: #fff;
    line-height: 1.6;
    background-repeat: no-repeat; /* 禁止重複 */
    background-size: cover; /* 覆蓋整個背景區域 */
    background-position: center; /* 置中顯示背景 */
    background-size: 100%; /* 將圖片縮放為容器的 80% */
    background-position: center -150px; /* 往上移動 50px */
    animation: fadeIn 1s ease-in-out;
    background-color: #2a2a2a; /* Dark background for the player */
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Subtle shadow for depth */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 20px 0; /* Add margin for spacing */
}

/* 按鈕容器 */
.game-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 1080px;
    max-width: 1200px;
    margin: 10px 0;
}

    /* 左右按鈕 */
    .game-navigation button {
        background-color: #333;
        color: #fff;
        border: none;
        padding: 10px 15px;
        font-size: 20px;
        border-radius: 50%;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.3s ease;
    }

        /* 按鈕的 hover 效果 */
        .game-navigation button:hover {
            background-color: #ffcc00;
            transform: scale(1.1);
        }

/* iFrame 外觀 */
#game-frame {
    margin: 20px auto 0; /* 上方增加 20px，其他保持置中 */
    border-radius: 8px;
    border: 2px solid #444;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Add shadow to the iframe */
    transition: transform 0.3s ease;
}

    #game-frame:hover {
        transform: scale(1.02); /* Slight zoom effect on hover */
    }
/* 美化頁尾 */
footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
    border-top: 2px solid #444;
}

    footer .footer-content {
        max-width: 1200px;
        margin: 0 auto;
    }

    footer p {
        margin: 10px 0;
    }

    footer a {
        color: #ffcc00;
        text-decoration: none;
        margin: 0 10px;
    }

        footer a:hover {
            text-decoration: underline;
        }

    footer .social-links a {
        margin: 0 15px;
        font-size: 18px;
    }

        footer .social-links a:hover {
            color: #ffcc00;
        }

        /* 設置按鈕的基本樣式 */
/* 按鈕容器樣式 */
.button-container {
    display: flex; /* 使用 Flexbox */
    justify-content: center; /* 水平置中 */
    align-items: center; /* 垂直置中 */
    gap: 15px; /* 按鈕之間的間距 */
    height: 10vh; /* 容器高度，讓按鈕置於頁面正中 */
    background-color: #222; /* 可選：設置背景顏色以與整體風格一致 */
    animation: fadeIn 1s ease-in-out;
}

/* 按鈕樣式 */
button {
    font-family: 'Courier Prime', monospace;
    background-color: #444; /* 深灰色背景 */
    color: #ddd; /* 字體顏色 */
    padding: 10px 20px;
    border: none;
    border-radius: 8px; /* 圓角邊框 */
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease; /* 過渡效果 */
}

    button:hover {
        background-color: #666; /* 懸停時的背景色 */
        color: white; /* 懸停時的字體顏色 */
        transform: scale(1.05); /* 懸停時稍微放大 */
    }

    button:active {
        transform: scale(0.95); /* 按下時縮小 */
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}



/* 破碎小塊樣式（不規則形狀） */
.piece {
    position: absolute;
    width: 30px; /* 基本大小 */
    height: 30px;
    background-color: #444;
    opacity: 1;
    animation: shatter 1s ease forwards;
    /* 動態設置 clip-path */
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}


/* 破碎效果動畫 */
@keyframes shatter {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(calc(var(--dx) * 150px), calc(var(--dy) * 150px)) rotate(calc(var(--r) * 360deg));
        opacity: 0;
    }
}

