@font-face {
    font-family: 'ChiayiFont';
    src: url('../fonts/ChiayiCity.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'ChiayiFont', sans-serif;
    background: #050505;
    color: white;
    overflow-x: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: #666;
}

/* ===== Scanline ===== */
.scanline {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,.03),
        rgba(255,255,255,.03) 1px,
        transparent 1px,
        transparent 4px
    );
    opacity: .08;
    z-index: 999;
}

/* ===== Header ===== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 60px;
    z-index: 100;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo img {
    width: 58px;
}

nav {
    display: flex;
    gap: 40px;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: .9rem;
    letter-spacing: 2px;
    transition: .3s;
}

nav a:hover {
    color: #00A3FF;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle, .mobile-nav-panel {
    display: none;
}

/* ===== Button ===== */

.login-btn,
.member-btn {
    border-radius: 999px;
    text-decoration: none;
    transition: .3s;
    padding: 10px 20px;
    font-size: .8rem;
}

.primary-btn,
.secondary-btn {
    padding: 14px 32px;
    border-radius: 999px;
    text-decoration: none;
    transition: .3s;
}

.secondary-btn:hover,
.login-btn:hover {
    background: white;
    color: black;
}

/* 藍色主按鈕群 */
.primary-btn,
.member-btn {
    background: #0084FF;
    color: white;
}

.primary-btn:hover,
.member-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(0,132,255,.5);
}

/* 白框次按鈕群 */
.secondary-btn,
.login-btn {
    border: 1px solid rgba(255,255,255,.3);
    color: white;
}

/* ===== Hero 共用結構 ===== */
.hero {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hero video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    inset: 0;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    text-align: center;
    z-index: 2;
}

/* ===== Section 共用標籤 ===== */
.section-tag {
    color: #00A3FF;
    letter-spacing: 4px;
    font-size: .8rem;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 40px 20px;
    background: #0A0A0A;
    border-top: 1px solid rgba(255,255,255,.05);
}

footer p {
    color: #777;
    margin: 10px 0;
}

/* ===== Global RWD ===== */
@media(max-width: 768px) {
    
    /* 隱藏桌機版的組件，防止撐開 Header */
    .desktop-nav, .desktop-only {
        display: none !important;
    }

    header {
        padding: 0 20px;
        height: 70px;
    }

    /* 顯示漢堡按鈕 */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 18px;
        cursor: pointer;
        z-index: 102;
    }

    .menu-toggle .bar {
        height: 2px;
        width: 100%;
        background-color: white;
        transition: 0.3s;
    }
    
    /* 霓虹發光效果 */
    .menu-toggle:hover .bar {
        background-color: #00A3FF;
        box-shadow: 0 0 8px #00A3FF;
    }

    /* 手機版側邊面板主體 */
    .mobile-nav-panel {
        display: flex;
        position: fixed;
        top: 0;
        left: 0; /* 改從左邊滑出，與右側的購物車做視覺平衡 */
        width: 280px;
        height: 100vh;
        background: #09090e;
        border-right: 1px solid rgba(0, 163, 255, 0.2);
        z-index: 1005;
        flex-direction: column;
        padding: 30px;
        transform: translateX(-100%); /* 預設隱藏在左側螢幕外 */
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-nav-panel.active {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 163, 255, 0.08);
    }

    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 15px;
        margin-bottom: 30px;
    }

    .close-menu {
        background: transparent;
        border: none;
        color: #888;
        font-size: 2rem;
        cursor: pointer;
        line-height: 1;
    }
    .close-menu:hover { color: #FF4646; }

    /* 手機版連結直向排列 */
    .mobile-links {
        display: flex;
        flex-direction: column;
        gap: 25px;
        flex-grow: 1;
    }

    .mobile-links a {
        color: white;
        text-decoration: none;
        font-size: 1.1rem;
        letter-spacing: 2px;
        transition: 0.3s;
    }
    .mobile-links a:hover { color: #00A3FF; padding-left: 5px; }

    /* 🌟 手機版玩家名字獨立特區：直向安全排列，絕對不破版 */
    .mobile-user-zone {
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 20px;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .mobile-user-zone span {
        font-size: 0.95rem;
        color: #00A3FF;
        word-break: break-all; /* 即使名字帶有超長英文或特殊符號，也會自動換行不爆框 */
        text-shadow: 0 0 10px rgba(0, 163, 255, 0.3);
    }

    .mobile-user-zone .login-btn,
    .mobile-user-zone .member-btn {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
}