/* --- 全局與色彩設定 --- */
:root {
    --bg-color: #FDF8F0;
    --text-color: #4A4441;
    --primary-color: #7A828A;
    --accent-color: #C04848;
    --hover-color: #F7B54A;
    --card-bg: #FFFFFF;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --nav-height: 100px;
    --pixel-border-color: #4A4441;
    --pixel-shadow-color: #E3B44B;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", "Roboto", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    padding-top: var(--nav-height);
    font-size: 18px;
}

h1, h2, h3 { text-align: center; margin-bottom: 25px; }
h2 { font-size: 2.2rem; font-weight: 700; color: var(--accent-color); }
h3 { font-weight: 700; font-size: 1.4rem; }
p { font-size: 1.1rem; }

/* --- 頂部導覽 Banner --- */
nav { position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height); background-color: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 10px var(--shadow-color); z-index: 1000; transition: all 0.3s ease-in-out; }
.nav-container { max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo-container { display: flex; align-items: center; text-decoration: none; color: var(--text-color); font-size: 1.4rem; font-weight: 700; }
.logo-container img { height: 50px; margin-right: 12px; transition: height 0.3s ease-in-out; }
.nav-links { display: flex; list-style: none; margin: 0; padding: 0; gap: 35px; }
.nav-links a { text-decoration: none; color: var(--text-color); font-weight: 600; font-size: 1.1rem; position: relative; padding: 5px 0; }
.nav-links a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--accent-color); transition: width 0.3s; }
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 20px; }
.social-icon img { height: 38px; opacity: 0.7; transition: opacity 0.3s; vertical-align: middle; }
.social-icon:hover img { opacity: 1; }
nav.nav-scrolled { height: 75px; background-color: rgba(255, 255, 255, 0.85); backdrop-filter: blur(5px); }
nav.nav-scrolled .logo-container img { height: 45px; }

/* --- 漢堡選單 --- */
.hamburger-menu { display: none; cursor: pointer; }
.hamburger-menu .bar { width: 28px; height: 3px; background-color: var(--text-color); margin: 5px 0; transition: all 0.3s ease; }
.mobile-nav-links { position: fixed; top: var(--nav-height); left: 0; width: 100%; height: calc(100vh - var(--nav-height)); background-color: rgba(253, 248, 240, 0.98); backdrop-filter: blur(5px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; transform: translateY(-110%); transition: transform 0.4s ease-in-out; z-index: 999; }
.mobile-nav-links.active { transform: translateY(0); }
.mobile-nav-links a { text-decoration: none; color: var(--text-color); font-size: 1.8rem; font-weight: 600; }
.hamburger-menu.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
.hamburger-menu.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --- 頁面主視覺橫幅 --- */
header {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/主視覺圖.png');
    background-size: cover;
    background-position: center;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    padding: 50px 0;
    min-height: 60vh;
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 100px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    flex-wrap: wrap;
}
.header-video {
    flex: 1 1 500px;
    min-width: 320px;
}
.header-text {
    flex: 1 1 400px;
}
.header-text h1, .header-text h2 {
    text-align: left;
}
.header-text h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}
.header-text h2 {
    font-size: 1.4rem;
    font-weight: normal;
    color: #EFEFEF;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* --- YouTube 影片與像素外框樣式 --- */
.pixel-frame-container {
    background-color: white;
    border: 10px solid var(--pixel-border-color);
    padding: 15px;
    width: 100%;
    box-shadow: 8px 8px 0 0 var(--pixel-shadow-color);
}
.video-aspect-ratio-box {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}
.video-aspect-ratio-box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- 發光按鈕 --- */
.btn-primary { background-color: var(--accent-color); color: white; padding: 10px 20px; border-radius: 25px; text-decoration: none; font-weight: 700; font-size: 0.95rem; border: none; position: relative; animation: glow 2.5s infinite ease-in-out; transition: background-color 0.3s, box-shadow 0.3s; }
.btn-primary:hover { animation: none; background-color: var(--hover-color); color: var(--text-color); box-shadow: 0 0 25px var(--hover-color); }

main { padding: 20px; }
section { max-width: 1100px; margin: 0 auto 80px auto; padding: 60px 20px 0; }
.container { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.container img { flex: 1.22; min-width: 300px; border-radius: 10px; max-width: 100%; }
.text-content { flex: 1; min-width: 300px; }

/* --- 圖片輪播 --- */
.carousel-container { position: relative; max-width: 900px; margin: auto; overflow: hidden; border-radius: 10px; box-shadow: 0 4px 15px var(--shadow-color); aspect-ratio: 16 / 9; }
.carousel-slide { display: flex; height: 100%; transition: transform 0.5s ease-in-out; }
.carousel-slide img { width: 100%; height: 100%; flex-shrink: 0; object-fit: cover; }
.prev-btn, .next-btn { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(0, 0, 0, 0.4); color: white; border: none; padding: 10px 15px; cursor: pointer; border-radius: 50%; font-size: 1.5rem; }
.prev-btn { left: 15px; }
.next-btn { right: 15px; }
.dots-container { position: absolute; bottom: 15px; width: 100%; text-align: center; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background-color: rgba(255, 255, 255, 0.6); margin: 0 6px; cursor: pointer; transition: background-color 0.3s; }
.dot.active { background-color: var(--accent-color); }

/* ---【已更新】遊戲音樂區塊 --- */
#music {
    padding-bottom: 50px;
    max-width: 100%;
}
.music-header {
    display: grid; /* 使用 Grid 佈局 */
    justify-items: center; /* 關鍵！讓所有網格項目水平置中 */
    gap: 15px;
    margin-bottom: -10px;
}
.music-header h2 {
    margin-bottom: 0;
}
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}
.volume-icon { font-size: 1.5rem; }
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 150px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}
input[type="range"]:hover {
    opacity: 1;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
}


.music-carousel-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
}
.music-carousel-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 40px;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.music-slide {
    position: relative;
    flex-shrink: 0;
    width: 800px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transform: scale(0.8);
    opacity: 0.6;
    transition: transform 0.5s ease, opacity 0.5s ease;
}
.music-slide.active {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}
.music-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* --- 團隊介紹 --- */
.team-container { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.team-member { background: var(--card-bg); padding: 30px; text-align: center; border-radius: 10px; box-shadow: 0 4px 15px var(--shadow-color); width: 260px; }
.team-member img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 4px solid var(--accent-color); margin-bottom: 20px; }
.team-member p { margin: 8px 0; }

/* --- 頁尾 --- */
footer { text-align: center; padding: 25px; margin-top: 40px; background: var(--primary-color); color: #EFEFEF; font-size: 1rem; }

/* --- 響應式設計 (手機版) --- */
@media (max-width: 992px) {
    .header-container {
        flex-direction: column;
        gap: 40px;
    }
    .header-text h1, .header-text h2 {
        text-align: center;
    }
}

@media (max-width: 768px) {
    body { padding-top: 65px; font-size: 16px; }
    nav, nav.nav-scrolled { height: 65px; }
    .nav-links { display: none; }
    .hamburger-menu { display: block; }
    .nav-container { padding: 0 15px; }
    .logo-container span { font-size: 1.2rem; }
    .btn-primary { padding: 10px 18px; font-size: 0.9rem; }
    .mobile-nav-links { top: 65px; height: calc(100vh - 65px); }
    
    header { padding: 40px 0; min-height: auto; }
    .header-text h1 { font-size: 2.5rem; }
    .header-text h2 { font-size: 1.1rem; }

    .pixel-frame-container { border-width: 8px; padding: 10px; box-shadow: 6px 6px 0 0 var(--pixel-shadow-color); }

    section { padding-top: 40px; margin-bottom: 60px; }
    .carousel-container { aspect-ratio: 16 / 9; }
    .container { flex-direction: column; }
    .container img { flex: none; width: 100%; }
    #introduction .container { flex-direction: column-reverse; }
    p { font-size: 1.05rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.3rem; }
    
    .music-carousel-container {
        height: 400px;
        overflow-x: scroll; /* 【已新增】啟用水平滾動 */
        scroll-snap-type: x mandatory; /* 【已新增】設定為強制水平吸附 */
        -webkit-overflow-scrolling: touch; /* 讓滑動在 iOS 上更流暢 */
        scrollbar-width: none; /* 隱藏 Firefox 的滾動條 */
    }
    .music-carousel-container::-webkit-scrollbar {
        display: none; /* 隱藏 Chrome/Safari 的滾動條 */
    }

    .music-carousel-track {
        position: relative; /* 【已修改】改為相對定位，讓原生滾動生效 */
        /* 【已新增】關鍵的 padding，讓第一張和最後一張可以置中 */
        /* calc(50% - (手機卡片寬度 / 2)) */
        padding: 0 calc(50% - 280px / 2);
    }
    
    .music-slide {
        width: 280px; /* 手機版卡片寬度調整 */
        transform: scale(0.7);
        scroll-snap-align: center; /* 【已新增】讓每張卡片都對齊中心點 */
    }
    .music-slide.active {
        transform: scale(1);
    }
}

/* --- 發光按鈕的動畫定義 --- */
@keyframes glow {
  0% { box-shadow: 0 0 5px var(--accent-color); }
  50% { box-shadow: 0 0 20px var(--accent-color), 0 0 30px var(--accent-color); }
  100% { box-shadow: 0 0 5px var(--accent-color); }
}

/* ---【已更新】自訂像素游標樣式 --- */
html {
    cursor: url('../images/cursor-arrow.png'), auto;
}
html.empty-click-cursor {
    cursor: url('../images/cursor-empty-click.png'), auto !important;
}
/* 將 .music-slide 加入到可點擊元素列表 */
a,
button,
.dot,
.prev-btn,
.next-btn,
.music-slide {
    cursor: url('../images/cursor-pointer.png'), pointer;
}
/* 將 .music-slide 加入到 active 列表 */
a:active,
button:active,
.dot:active,
.prev-btn:active,
.next-btn:active,
.music-slide:active {
    cursor: url('../images/cursor-click.png'), pointer;
}