/* ==========================================================================
   YU-GI-OH! NEXUS - 完整全域樣式表 (ygo-style.css)
   設計風格：暗黑、耀眼金、高質感科幻網格
   ========================================================================== */

/* 🎨 1. 全域變數定義 */
:root {
    --bg-dark: #0a0a0c;          /* Header/Footer 極黑背景 */
    --body-bg: #050507;          /* 網頁底色 */
    --panel-bg: #111115;         /* 面板半透明基底 */
    --search-bg: #141416;        /* 搜尋框暗灰色 */
    --border-dark: #1c1c24;      /* 統一暗色邊框 */
    --gold-primary: #ffb830;     /* 遊戲王耀眼金 */
    --gold-dim: #cca050;         /* 沉穩暗金 */
    --text-muted: #8a8a93;       /* 未選中灰字 */
    --text-light: #f4f4f6;       /* 明亮白字 */
    --gold-glow: rgba(255, 184, 48, 0.2); /* 統一金色發光 */
}

/* 📐 2. 基礎重設 (Reset) */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-light);
    min-height: 100vh;
}

/* ==========================================================================
   🧱 3. 共用排版與組件 (Shared Layouts & Components)
   ========================================================================== */

/* 共用 1000px 置中容器 */
.header-container, 
.welcome-container, 
.packs-page-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

/* 共用內容層定位 (確保疊在背景卡背上方) */
.welcome-container, 
.packs-page-container {
    position: relative;
    z-index: 2;
}

/* 共用發光金字標題 */
.welcome-container h1, 
.page-title,
.card-main-name {
    color: var(--gold-primary);
    text-shadow: 0 0 10px rgba(255, 184, 48, 0.15);
    margin: 0 0 15px 0;
}

/* 共用副標題/說明文字 */
.welcome-container p, 
.page-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}
.page-subtitle { margin-bottom: 40px; font-size: 0.95rem; }

/* 🃏 共用卡片本體與 Hover 浮動特效 (整合 Pack Card & Gallery Card) */
.pack-card, .gallery-card-item {
    /* 🟢 核心改動：消滅原本死黑底，改用帶有高質感的半透明微光澤 */
    background: rgba(255, 255, 255, 0.03); 
    
    /* 配合全域毛玻璃濾鏡，令卡片後方的金色旋渦背景隱約透出，質感拉滿 */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    
    /* 邊框微調：改用半透明的暗灰色線條，令邊緣更柔和 */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    
    /* 核心轉場：使用貝氏曲線 (cubic-bezier) 確保卡片放大同變色時極度流暢、毫不生硬 */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s ease, 
                box-shadow 0.4s ease,
                background-color 0.4s ease;
}

.pack-card:hover, 
/* 🟢 滑鼠指進去（Hover）時的炫酷電競特效 */
.gallery-card-item:hover {
    /* 🎯 核心效果 1：張卡向前突起平滑放大 (原本 1.02 -> 升級為 1.06 放大感更明顯) */
    transform: translateY(-8px) scale(1.06);
    
    /* 🎯 核心效果 2：底色微微增亮，營造光線照射在表面的虛擬光澤感 */
    background: rgba(255, 255, 255, 0.08);
    
    /* 🎯 核心效果 3：邊框點亮為經典的遊戲王耀眼金 */
    border-color: #ffb830;
    
    /* 🎯 核心效果 4：後方加上一層柔和的外發光金色霓虹陰影 */
    box-shadow: 0 15px 35px rgba(255, 184, 48, 0.25);
}


/* ==========================================================================
   💻 4. 頂部導航與頁尾 (Header & Footer)
   ========================================================================== */

.ygo-nexus-header {
    background-color: var(--bg-dark);
    border-bottom: 1px solid var(--border-dark);
    padding: 15px 20px;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 900;
}
.ygo-nexus-footer {
    background-color: var(--bg-dark);
    border-top: 1px solid var(--border-dark);
    padding: 15px 20px;
    width: 100%;
    text-align: center;
}
.ygo-nexus-footer div { color: #52525b; font-size: 0.85rem; }

.header-container {
    display: flex;
    justify-content: space-between; 
    align-items: center;    
    gap: 20px;
}

.header-logo {
    color: var(--gold-dim);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-shadow: 0 0 12px var(--gold-glow);
    cursor: pointer;
    white-space: nowrap;
}

.header-search-box {
    display: flex;
    align-items: center;
    background-color: var(--search-bg);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: 6px 12px;
    width: 260px; 
    transition: all 0.3s ease;
}

.header-search-box:focus-within {
    border-color: var(--gold-primary);
    box-shadow: 0 0 8px var(--gold-glow);
}

.search-icon { width: 16px; height: 16px; color: #52525b; margin-right: 8px; flex-shrink: 0; }
.search-input { background: none; border: none; outline: none; color: var(--text-light); font-size: 0.9rem; width: 100%; }

.mobile-menu-btn { display: none; }

.header-nav { display: flex; gap: 28px; align-items: center; }
.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 0;
    position: relative;
    transition: color 0.2s;
    white-space: nowrap;
}
.nav-item:hover { color: var(--text-light); }
.nav-item.active { color: var(--gold-primary); font-weight: 600; }

.nav-item.active::after {
    content: ""; position: absolute; bottom: -17px; left: 0;
    width: 100%; height: 2px;
    background-color: var(--gold-primary);
    box-shadow: 0 0 8px rgba(255, 184, 48, 0.6);
    border-radius: 2px;
}

.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

/* ==========================================================================
   🌌 5. 核心中央背景舞台與歡迎面板
   ========================================================================== */

.main-container {
    position: relative;
    box-sizing: border-box;
    min-height: calc(100vh - 134px);
    padding: 60px 20px; 
    overflow: hidden; 
    width: 100%;
}

.main-container::before,
.db-container::before{
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, var(--bg-dark) 0%, transparent 15%, transparent 85%, var(--body-bg) 100%),
                url('/images/ygo-card-back.jpg') no-repeat center center;
    background-size: cover; opacity: 0.3; z-index: -1;
    pointer-events: none;
}

.welcome-container {
    background: rgba(17, 17, 21, 0.85); 
    backdrop-filter: blur(5px);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 184, 48, 0.1); 
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.welcome-container h1 { font-size: 2.2rem; }
.page-title { font-size: 2rem; }

/* ==========================================================================
   📂 6. 卡包專區與圖鑑網格 (New Packs & Gallery)
   ========================================================================== */

.packs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;
    justify-content: center; 
    justify-items: center; 
}

/* 前台新版的自適應網格 */
.new-packs-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    justify-items: stretch;
}

.pack-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 250px; 
}

.pack-cover-wrapper {
    width: 100%;
    aspect-ratio: 3 / 4.2; 
    background-color: #0d0d11; 
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-dark);
}

.pack-cover-wrapper img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.5s ease; }
.pack-card:hover .pack-cover-wrapper img { transform: scale(1.03); }

.pack-info { padding: 16px; display: flex; flex-direction: column; flex-grow: 1; }
.pack-code { color: var(--gold-dim); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.pack-name { color: var(--text-light); font-size: 0.8rem; margin: 0 0 12px 0; font-weight: 600; line-height: 1.4; }
.pack-meta { margin-top: auto; display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.7rem; border-top: 1px solid var(--border-dark); padding-top: 10px; }

/* 圖鑑畫廊特有屬性 */
.gallery-wrapper { max-width: 1300px; margin: 0 auto; padding: 0px 10px; }
.ygo-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 30px; }
.gallery-card-item { padding: 10px; } /* Hover特效已與pack-card合併在第3節 */

/* ==========================================================================
   ⚡ YU-GI-OH! NEXUS - 彈窗 (Modal) 三指標平排、防滑動完美終極版 CSS
   ========================================================================== */

.ygo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 4, 6, 0.96) !important;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 🎯 限制最高 85vh，內部完全不觸發 Scroll */
.ygo-modal-box {
    background: #111115;
    border: 1px solid #33333f;
    border-radius: 20px;
    width: 95%;
    max-width: 1100px;
    height: auto;
    max-height: 85vh; 
    display: grid;
    grid-template-columns: 360px 1fr;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.modal-left {
    background: #000;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #222;
}

.modal-big-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

.modal-right { 
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden; 
}

.modal-body-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 頂部卡號與稀有度平排區 */
.modal-top-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    line-height: 1.2;
}

.card-id-badge {
    color: #ffb830;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 1.1rem;
}

.modal-top-meta .rare-solid-badge {
    font-size: 0.85rem;
    padding: 3px 6px;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
}

.card-main-name {
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 1px;
}

/* 屬性/種族/類型小藥丸列 */
.card-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.info-pill {
    background: #1c1c24;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #a1a1aa;
    border: 1px solid #2a2a35;
}

.info-pill strong {
    color: #fff;
    margin-left: 5px;
}

/* 🟢 🎯 全新優化：Level、ATK、DEF 三軌橫向平排網格 */
.stats-horizontal-grid {
    display: grid;
    grid-template-columns: 120px 1fr 1fr; /* 固定星數寬度，ATK/DEF均分剩餘空間 */
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid #1f1f27;
    padding: 8px 12px;
    border-radius: 12px;
    margin-top: 4px;
}

/* Level 內聯樣式 */
.level-inline-box {
    font-size: 0.9rem;
    color: #ffb830;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

/* ATK / DEF 圓角橫條 */
.stat-bar-inline {
    display: flex;
    align-items: center;
    background: #16161e;
    border: 1px solid #272733;
    border-radius: 20px; /* 精美圓角橫條 */
    overflow: hidden;
    height: 32px; /* 緊湊高度 */
    width: 100%;
}

/* 左側標籤：改用仿稀有度 Badge 嘅 High Light 實色款 */
.stat-bar-label-badge {
    height: 100%;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.5px;
}

/* ATK 實色高亮標籤 (烈焰暗紅) */
.badge-atk {
    background: #7f1d1d;
    text-shadow: 0 0 4px rgba(255, 71, 87, 0.5);
}

/* DEF 實色高亮標籤 (翡翠暗綠) */
.badge-def {
    background: #064e3b;
    text-shadow: 0 0 4px rgba(46, 213, 115, 0.5);
}

/* 右側數值顯示：靠右對齊 */
.stat-bar-value-text {
    flex: 1;
    padding-right: 12px;
    text-align: right;
    font-size: 1.15rem;
    font-weight: 900;
    font-family: 'Arial Black', sans-serif;
}

.atk-text-glow {
    color: #ff4757;
}

.def-text-glow {
    color: #2ed573;
}

/* 效果內文框（嚴格限制高度，杜絕彈窗大滾動） */
.effect-text-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #222;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #d4d4d8;
    white-space: pre-line;
    margin: 0;
    max-height: 170px; /* 超過此高度才在框內微捲動 */
    overflow-y: auto;
}

/* 導航按鈕 */
.modal-nav-wrapper {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.btn-nav-styled {
    flex: 1;
    padding: 12px;
    background: #1c1c24;
    border: 1px solid #33333f;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem;
}

.btn-nav-styled:hover {
    background: #ffb830;
    border-color: #ffb830;
    color: #000;
    transform: translateY(-2px);
}

/* 稀有度通用實色 */
.rare-solid-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 4px;
    color: #fff;
    line-height: 1;
}

.rare-color-N       { background-color: #2d2d34; color: #a1a1aa; }
.rare-color-N-R     { background-color: #3f3f46; color: #e4e4e7; }
.rare-color-R       { background-color: #1e3a8a; color: #93c5fd; }
.rare-color-SR      { background-color: #581c87; color: #e9d5ff; }
.rare-color-UR      { background-color: #78350f; color: #fde68a; }
.rare-color-UTR     { background-color: #7c2d12; color: #ffedd5; }
.rare-color-SER     { background-color: #9d174d; color: #fce7f3; }
.rare-color-HR      { background-color: #065f46; color: #d1fae5; }
.rare-color-GR      { background-color: #854d0e; color: #fef9c3; }
.rare-color-20thSER { background-color: #991b1b; color: #fee2e2; }
.rare-color-PSER    { background-color: #0369a1; color: #e0f2fe; }
.rare-color-25thQCR { background-color: #be185d; color: #fce7f3; border: 1px solid #f472b6; }
.rare-color-OFR     { background-color: #6b21a8; color: #f3e8ff; }
.rare-color-GMR     { background-color: #166534; color: #dcfce7; box-shadow: 0 0 5px rgba(22,101,52,0.5); }

.bg-effect   { background: linear-gradient(135deg, #fdba74, #ea580c); text-shadow: 0 1px 2px rgba(0,0,0,0.4); } /* 效果 - 橙 */
.bg-spell    { background: linear-gradient(135deg, #34d399, #059669); text-shadow: 0 1px 2px rgba(0,0,0,0.4); } /* 魔法 - 綠 */
.bg-trap     { background: linear-gradient(135deg, #f472b6, #be185d); text-shadow: 0 1px 2px rgba(0,0,0,0.4); } /* 陷阱 - 粉紅 */


@media (max-width: 850px) {
    .ygo-modal-box {
        grid-template-columns: 1fr;
        max-height: 95vh;
        overflow-y: auto;
    }
    .stats-horizontal-grid {
        grid-template-columns: 1fr; /* 手機版自動變回垂直 */
        gap: 8px;
    }
    .modal-left {
        border-right: none;
        border-bottom: 1px solid #222;
        padding: 15px;
    }
    .modal-big-img {
        max-width: 160px;
    }
    .modal-right {
        padding: 15px;
    }
}

/* ==========================================================================
   YU-GI-OH! NEXUS - 全新前台綜合首頁排版架構
   ========================================================================== */

/* ========== 🖼️ 大型橫額 Slider ========== */
.hero-slider {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    background: #050507;
}

.slider-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}
.slider-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slide-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
    transition: transform 6s ease-out;
}
.slider-slide.active .slide-bg {
    transform: scale(1); /* 緩慢 Ken Burns 縮放效果 */
}

.slide-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(
        to top,
        rgba(5, 5, 7, 0.95) 0%,
        rgba(5, 5, 7, 0.5) 40%,
        rgba(5, 5, 7, 0.2) 100%
    );
}

.slide-content {
    position: absolute;
    bottom: 50px;
    left: 50px;
    z-index: 2;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slide-badge {
    display: inline-flex;
    width: fit-content;
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 800;
}

.slide-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 2px 20px rgba(0,0,0,0.8);
}

.slide-date {
    color: #a1a1aa;
    font-size: 0.9rem;
    font-family: monospace;
    margin: 0;
}

/* Slider 導航指示點 */
.slider-dots {
    position: absolute;
    bottom: 20px;
    right: 50px;
    display: flex;
    gap: 10px;
    z-index: 3;
}
.slider-dots .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}
.slider-dots .dot.active {
    background: #ffb830;
    box-shadow: 0 0 8px rgba(255, 184, 48, 0.5);
    transform: scale(1.3);
}
.slider-dots .dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* ========== 📰 + 📅 雙欄主體佈局 ========== */
.main-layout-container {
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 7fr 3fr; /* 左側快訊佔 70%，右側行事曆佔 30% */
    gap: 40px;
    position: relative;
}

.gold-text { color: #ffb830; text-shadow: 0 0 15px rgba(255,184,48,0.3); }

/* 區塊通用標頭 */
.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}
.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    margin: 0;
}
.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,184,48,0.3), transparent);
}

/* 🔥 左側新卡快訊卡片網格 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}
.news-card {
    background: #111116;
    border: 1px solid #22222a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.news-card:hover {
    transform: translateY(-5px);
    border-color: #ffb830;
    box-shadow: 0 10px 25px rgba(255, 184, 48, 0.1);
}
.news-thumb-wrap {
    position: relative;
    height: 180px;
    background: #050507;
    overflow: hidden;
}
.news-thumb-wrap img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s;
}
.news-card:hover .news-thumb-wrap img { transform: scale(1.05); }

/* 新聞卡片上的分類標籤 (覆蓋 type-badge 部分定位) */
.news-badge {
    position: absolute; top: 12px; left: 12px;
    font-size: 0.72rem; font-weight: 800;
    padding: 4px 10px; border-radius: 6px;
    z-index: 1;
}
/* 如果沒有 type-badge class，用預設金色 */
.news-badge:not(.type-badge) {
    background: linear-gradient(135deg, #ffb830, #cca050);
    color: #050507;
}

.news-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.news-date { color: #52525b; font-size: 0.8rem; font-family: monospace; }
.news-title { color: #f4f4f5; font-size: 1.1rem; font-weight: 700; margin: 0; }
.news-summary { color: #a1a1aa; font-size: 0.88rem; line-height: 1.5; margin: 0; }
.news-readmore {
    color: #ffb830; text-decoration: none; font-size: 0.85rem; font-weight: 700;
    margin-top: 10px; display: inline-flex; align-items: center; gap: 5px;
    transition: gap 0.2s;
}
.news-readmore:hover { gap: 10px; }

/* 📅 右側官方發售行事曆時間軸 (桌面版) */
.timeline-capsule-scroll.timeline-mobile { display: none; } /* 手機版預設隱藏，用高優先級選擇器防止被覆蓋 */

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.timeline-item {
    background: #111116;
    border: 1px solid #22222a;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: border-color 0.2s;
}
.timeline-item:hover { border-color: #3f3f46; }
/* 本月發售特殊點亮配色 */
.current-month-highlight {
    border-color: rgba(30, 144, 255, 0.4);
    background: linear-gradient(135deg, #111116, rgba(30, 144, 255, 0.03));
}
.timeline-date-badge {
    background: #1e1e24;
    border: 1px solid #33333f;
    min-width: 55px; height: 55px; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.current-month-highlight .timeline-date-badge {
    background: rgba(30, 144, 255, 0.15);
    border-color: #1e90ff;
}
.timeline-date-badge .month { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: #a1a1aa; }
.current-month-highlight .timeline-date-badge .month { color: #1e90ff; }
.timeline-date-badge .day { font-size: 1.2rem; font-weight: 900; color: #fff; font-family: monospace; }

.timeline-content { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.product-type-tag { font-size: 0.72rem; color: #8a8a93; font-weight: 600; }
.product-title { color: #fff; font-size: 0.95rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-code-meta { font-size: 0.8rem; color: #71717a; font-family: monospace; }

.empty-placeholder {
    grid-column: 1 / -1; text-align: center; padding: 50px;
    color: #52525b; border: 1px dashed #22222a; border-radius: 12px;
}

/* ========== 📱 手機版膠囊式行事曆 ========== */
.timeline-capsule-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}
/* 隱藏捲軸但保留功能 */
.timeline-capsule-scroll::-webkit-scrollbar { height: 4px; }
.timeline-capsule-scroll::-webkit-scrollbar-track { background: transparent; }
.timeline-capsule-scroll::-webkit-scrollbar-thumb { background: rgba(255,184,48,0.2); border-radius: 4px; }

.capsule-card {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 150px;
    background: #111116;
    border: 1px solid #22222a;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    transition: border-color 0.2s;
}
.capsule-highlight {
    border-color: rgba(30, 144, 255, 0.4);
    background: linear-gradient(135deg, #111116, rgba(30, 144, 255, 0.05));
}
.capsule-date {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.capsule-month { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; color: #a1a1aa; }
.capsule-highlight .capsule-month { color: #1e90ff; }
.capsule-day { font-size: 1.5rem; font-weight: 900; color: #fff; font-family: monospace; line-height: 1; }
.capsule-info { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.capsule-title { font-size: 0.75rem; color: #d4d4d8; font-weight: 600; line-height: 1.3; }

/* ========== 響應式優化 ========== */
@media (max-width: 992px) {
    .main-layout-container { grid-template-columns: 1fr; }
    .hero-slider { height: 350px; }
    .slide-content { left: 30px; bottom: 35px; }
    .slide-title { font-size: 1.6rem; }
}

@media (max-width: 768px) {
    .hero-slider { height: 280px; }
    .slide-content { left: 20px; right: 20px; bottom: 25px; }
    .slide-title { font-size: 1.3rem; }
    .slider-dots { right: 20px; bottom: 12px; }
    .slider-dots .dot { width: 8px; height: 8px; }

    /* 手機版：隱藏桌面時間軸，顯示膠囊列 */
    .timeline-desktop { display: none; }
    .timeline-capsule-scroll.timeline-mobile { display: flex; }

    .news-grid { grid-template-columns: 1fr; }
}


/* ==========================================================================
   📱 8. 響應式佈局 (Responsive Design - Media Queries)
   ========================================================================== */

@media (max-width: 768px) {
    .ygo-nexus-header { padding: 15px 20px; }
    
    .header-container { display: grid; grid-template-columns: 1fr auto; max-width: none; }
    
    .mobile-menu-btn { 
        display: block; 
        background: none; 
        border: none; 
        cursor: pointer; 
        padding: 4px; 
        z-index: 1001; /* Keep above the overlay */
        outline: none;
    }
    .mobile-menu-btn img { 
        width: 28px; 
        height: 28px; 
        filter: invert(1) sepia(1) saturate(5) hue-rotate(10deg); 
        transition: transform 0.2s ease; 
        border: none;
        outline: none;
    }
    .mobile-menu-btn:focus, .mobile-menu-btn:active {
        outline: none;
    }
    .mobile-menu-btn:active img { transform: scale(0.9); }

    .header-search-box { grid-column: 1 / -1; width: 100%; margin-top: 10px; }

    /* 側邊抽屜式 (Side Drawer) 選單 */
    .header-nav { 
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100vw; 
        height: 100vh; 
        background: rgba(0, 0, 0, 0); /* 初始透明 */
        backdrop-filter: blur(0px); /* 初始無模糊 */
        -webkit-backdrop-filter: blur(0px);
        display: flex; 
        flex-direction: column; 
        justify-content: flex-start; 
        align-items: flex-end; /* 將內容推到右側抽屜區 */
        padding: 80px 30px 30px; 
        gap: 25px; 
        z-index: 1000; 
        opacity: 1; /* 父容器保持 1，用 pointer-events 控管 */
        pointer-events: none; 
        transition: background 0.4s ease, backdrop-filter 0.4s ease; 
        border: none; 
        border-radius: 0; 
        transform: none;
    }
    /* 當展開時，外層變成深色遮罩 */
    .header-nav.show { 
        pointer-events: auto; 
        background: rgba(0, 0, 0, 0.65); 
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    /* 使用 ::after 偽元素作為右側抽屜的背景實體 */
    .header-nav::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 280px;
        max-width: 80vw;
        height: 100%;
        background: #111115;
        border-left: 1px solid rgba(255,255,255,0.05);
        box-shadow: -5px 0 25px rgba(0,0,0,0.6);
        z-index: -1; /* 藏在連結的後面 */
        transform: translateX(100%); /* 初始完全隱藏於右側 */
        transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .header-nav.show::after {
        transform: translateX(0); /* 抽屜滑入 */
    }
    
    /* 抽屜內的連結樣式與交錯滑入動畫 */
    .nav-item, .glass-btn, .profile-dropdown { 
        font-size: 1.25rem; 
        font-weight: 600; 
        color: #fff; 
        width: 220px; /* 剛好對齊抽屜寬度 */
        text-align: left;
        transform: translateX(50px);
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .header-nav.show .nav-item, 
    .header-nav.show .glass-btn, 
    .header-nav.show .profile-dropdown {
        transform: translateX(0);
        opacity: 1;
    }
    
    /* Staggered Delay for a premium feel */
    .header-nav.show .nav-item:nth-child(1) { transition-delay: 0.05s; }
    .header-nav.show .nav-item:nth-child(2) { transition-delay: 0.1s; }
    .header-nav.show .nav-item:nth-child(3) { transition-delay: 0.15s; }
    .header-nav.show .nav-item:nth-child(4) { transition-delay: 0.2s; }
    .header-nav.show .glass-btn, .header-nav.show .profile-dropdown { transition-delay: 0.25s; }

    .nav-item.active::after { display: none; }
    .nav-item.active { border-bottom: none; color: var(--gold-primary); }

    .main-container { padding: 30px 10px; }
    .welcome-container { padding: 30px 20px; }
    .welcome-container h1 { font-size: 1.8rem; }

    .packs-page-container { padding: 16px 12px; }
    .page-title { font-size: 1.5rem; }
    .packs-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; justify-items: stretch; }
    
    .pack-card { max-width: 100%; }
    .pack-info { padding: 10px; }
    .pack-name { font-size: 0.95rem; margin-bottom: 8px; }
    .pack-meta { flex-direction: column; gap: 4px; font-size: 0.78rem; padding-top: 6px; }

    /* 卡包內頁英雄面板手機版 */
    .pack-hero-panel {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 25px 20px !important;
        gap: 20px !important;
    }
    .pack-hero-cover img {
        width: 150px !important;
    }
    .pack-hero-info h1 {
        font-size: 2rem !important;
    }
    .pack-hero-info > a {
        justify-content: center;
    }
    .pack-hero-info > div {
        justify-content: center;
    }

    /* 確保彈窗在手機上顯示正常 */
    .ygo-modal-box { 
        grid-template-columns: 1fr; 
        max-height: 90vh; 
        overflow-y: auto; 
    }
    .modal-left { 
        border-right: none; 
        border-bottom: 1px solid #222; 
        padding: 20px; 
        display: block; /* 移除 flex 避免導致頂部溢出裁切 */
        text-align: center;
    }
    .modal-big-img {
        max-width: 240px; /* 限制手機版卡圖大小，避免佔用太多空間 */
        margin: 0 auto;
    }
    .modal-right { 
        padding: 20px; 
        max-height: none; 
        overflow-y: visible;
    }
}

/* 針對平板 (769px ~ 1024px) 維持雙欄排版，但稍微縮小圖片欄位 */
@media (min-width: 769px) and (max-width: 1024px) {
    .ygo-modal-box {
        grid-template-columns: 280px 1fr; /* 左側縮小為 280px */
    }
    .modal-left {
        padding: 20px;
    }
}

/* ==========================================================================
   🎮 9. 前端玩家認證專區 (Frontend Auth 3D Flip)
   ========================================================================== */

/* 3D 容器與透視 */
.auth-flip-container {
    perspective: 1000px;
}

/* 內層控制器 */
.auth-flip-inner {
    position: relative;
    width: 100%;
    /* 高度由內部撐開 */
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

/* 翻轉觸發 */
.auth-flip-inner.is-flipped {
    transform: rotateY(180deg);
}

/* 正反面共用設定 */
.auth-card-front, .auth-card-back {
    width: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* 背面需預先翻轉 180 度並重疊於正面 */
.auth-card-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg);
}

/* 登入卡片面板高質感玻璃風格 */
.auth-panel-style {
    background: rgba(17, 17, 21, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 184, 48, 0.2);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.auth-logo-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.1);
    font-size: 3rem;
    font-family: 'Arial Black', sans-serif;
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    z-index: -1;
    pointer-events: none;
    letter-spacing: 5px;
}

/* 輸入框 */
.auth-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #33333f;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.auth-input:focus {
    border-color: #ffb830;
    box-shadow: 0 0 12px rgba(255, 184, 48, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

/* 提交按鈕 */
.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ffb830 0%, #d48b1c 100%);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 184, 48, 0.3);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 184, 48, 0.5);
    filter: brightness(1.1);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 提示訊息框 */
.auth-alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
}
.auth-alert.error {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #fca5a5;
}
.auth-alert.success {
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(22, 163, 74, 0.4);
    color: #86efac;
}

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

/* ==========================================================================
   Database Layout Variables & Base
   ========================================================================== */
:root {
    --sidebar-width: 320px;
    --db-bg: #0a0a0c;
    --panel-bg: rgba(20, 20, 25, 0.8);
    --panel-border: 1px solid rgba(255, 255, 255, 0.05);
    --accent-gold: #ffb830;
}

.db-container {
    display: flex;
    min-height: calc(100vh - 80px); /* header height approx */
    background: var(--db-bg);
    position: relative;
}

/* --- Sidebar Filters --- */
.db-sidebar {
    width: var(--sidebar-width);
    background: var(--panel-bg);
    border-right: var(--panel-border);
    padding: 20px;
    overflow-y: auto;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    z-index: 100;
}

.db-sidebar::-webkit-scrollbar {
    width: 6px;
}
.db-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,184,48,0.3);
    border-radius: 3px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-title {
    color: var(--accent-gold);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,184,48,0.2);
    padding-bottom: 5px;
}

.filter-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.filter-input:focus {
    border-color: var(--accent-gold);
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.checkbox-label {
    color: #ddd;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-gold);
    width: 16px;
    height: 16px;
}

/* 屬性按鈕樣式 */
.attr-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.attr-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    color: #fff;
}
.attr-btn:hover {
    background: rgba(255,184,48,0.2);
}
.attr-btn.active {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(255,184,48,0.5);
}

/* --- Main Content Area --- */
.db-main {
    flex: 1;
    padding: 30px;
    position: relative;
}

.db-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.db-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.db-stats {
    color: #aaa;
    font-size: 0.9rem;
}

/* 卡片網格 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.card-item {
    background: var(--panel-bg);
    border-radius: 8px;
    overflow: hidden;
    border: var(--panel-border);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}
.card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border-color: rgba(255,184,48,0.4);
}

.card-image-wrap {
    width: 100%;
    padding-top: 145%; /* 遊戲王卡片比例約 1:1.45 */
    position: relative;
    background: #000;
}
.card-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    padding: 12px;
}
.card-name {
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-type {
    color: #aaa;
    font-size: 0.8rem;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}
.btn-load {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 10px 30px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-load:hover {
    background: var(--accent-gold);
    color: #000;
}

/* --- Mobile Toggle --- */
.mobile-filter-btn {
    display: none;
    background: var(--accent-gold);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(255,184,48,0.4);
    cursor: pointer;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 90;
    backdrop-filter: blur(5px);
}

/* RWD */
@media (max-width: 900px) {
    .db-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: 5px 0 20px rgba(0,0,0,0.5);
    }
    .db-sidebar.show {
        transform: translateX(0);
    }
    .mobile-filter-btn {
        display: block;
    }
    .mobile-overlay.show {
        display: block;
    }
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
/* Banlist Badges */
.ban-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
    box-shadow: 0 3px 6px rgba(0,0,0,0.5);
    z-index: 10;
    border: 2px solid #222;
}
.ban-forbidden { background: #111; color: #e74c3c; border: 1px solid #e74c3c; }
.ban-limited { background: #111; color: #f39c12; border: 1px solid #f39c12; }
.ban-semi { background: #111; color: #f1c40f; border: 1px solid #f1c40f; }

.modal-ban-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 1.1rem;
    margin-right: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* Banlist Full Page UI */
.banlist-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}
.banlist-header {
    text-align: center;
    margin-bottom: 50px;
}
.banlist-title {
    font-size: 2.5rem;
    color: #ffb830;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255,184,48,0.3);
}
.banlist-desc {
    color: #aaa;
    font-size: 1.1rem;
}
.ban-section {
    margin-bottom: 60px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 30px;
}
.ban-section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid;
    display: flex;
    align-items: center;
    gap: 15px;
}
.title-forbidden { color: #e74c3c; border-color: #e74c3c; }
.title-limited { color: #f39c12; border-color: #f39c12; }
.title-semi { color: #f1c40f; border-color: #f1c40f; }
.ban-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
}


/* Database Inline CSS */
.range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}
.range-inputs input {
    width: 100%;
}
.range-separator {
    color: #ffb830;
    font-weight: bold;
}
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}
.checkbox-grid::-webkit-scrollbar { width: 4px; }
.checkbox-grid::-webkit-scrollbar-thumb { background: rgba(255,184,48,0.5); border-radius: 2px; }

/* 圓角按鈕樣式 (Main Type / Race) */
.rounded-btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}
.rounded-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    color: #fff;
    user-select: none;
}
.rounded-btn:hover {
    background: rgba(255,184,48,0.15);
}
.rounded-btn.active {
    background: rgba(255,184,48,0.2);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 0 8px rgba(255,184,48,0.3);
    font-weight: bold;
}

/* Modal Styles */
.db-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #05050a;
    background-image: 
        radial-gradient(circle at center, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.95) 100%),
        linear-gradient(rgba(255, 184, 48, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 184, 48, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    background-position: center center;
    backdrop-filter: blur(10px);
    z-index: 1000;
    overflow-y: auto;
    padding: 40px 20px;
}
.db-modal-content {
    background: rgba(20, 20, 25, 0.95);
    border: 1px solid rgba(255,184,48,0.3);
    border-radius: 12px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    padding: 30px;
}
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 100;
    background: none;
    border: none;
    color: #8a8a93;
    font-size: 30px;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close-btn:hover { color: #ffb830; }

/* Modal Inner Layout (Reused from cards.show) */
.card-detail-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
}
.card-big-image {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,184,48,0.2);
    background: #000;
}
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.card-title {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    margin: 0 0 5px 0;
    font-weight: 900;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(
        90deg, 
        #ffffff 0%, 
        #fef08a 25%, 
        #eab308 50%, 
        #fef08a 75%, 
        #ffffff 100%
    );
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 6s linear infinite;
}
.passcode-badge {
    background: rgba(255,184,48,0.2);
    color: #ffb830;
    font-size: 1rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: monospace;
    border: 1px solid rgba(255,184,48,0.3);
}
.card-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.attr-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ddd;
    font-size: 1.05rem;
}
.attr-value { color: #ffb830; font-weight: bold; }
.card-effect-box {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 5px;
    line-height: 1.8;
    color: #eee;
    font-size: 1.05rem;
    white-space: pre-wrap;
    margin-bottom: 10px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.related-card { text-align: center; cursor: pointer; transition: transform 0.2s; }
.related-card:hover { transform: translateY(-5px); }
.related-card img { width: 100%; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); }
.related-name { color: #aaa; font-size: 0.8rem; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
    .card-detail-container { grid-template-columns: 1fr; gap: 20px; }
    .card-detail-left { max-width: 300px; margin: 0 auto; }
}

/* 隱藏/顯示 Sub Type 的 class */
.sub-type-section { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(255,255,255,0.1); }
.sub-type-section.show { display: block; }


/* Card Detail Show Page Styles */
.card-detail-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
}

.card-detail-left {
    position: relative;
}

.card-big-image {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,184,48,0.2);
    background: #000;
}

.card-detail-right {
    background: rgba(20, 20, 25, 0.8);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.card-title {
    color: #fff;
    font-size: 2.2rem;
    margin: 0 0 5px 0;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 15px;
}

.passcode-badge {
    background: rgba(255,184,48,0.2);
    color: #ffb830;
    font-size: 1rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: monospace;
    border: 1px solid rgba(255,184,48,0.3);
}

.card-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.attr-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ddd;
    font-size: 1.1rem;
}

.attr-value {
    color: #ffb830;
    font-weight: bold;
}

.card-effect-box {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px;
    line-height: 1.8;
    color: #eee;
    font-size: 1.05rem;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

/* 相關卡片區域 */
.related-cards-section {
    margin-top: 40px;
}
.section-title {
    color: #ffb830;
    font-size: 1.2rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}
.related-card {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.related-card:hover {
    transform: translateY(-5px);
}
.related-card img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}
.related-name {
    color: #aaa;
    font-size: 0.85rem;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .card-detail-container {
        grid-template-columns: 1fr;
    }
    .card-detail-left {
        max-width: 400px;
        margin: 0 auto;
    }
}

a.pack-card { text-decoration: none !important; }

/* ==========================================================================
   全新資料庫卡片彈窗 (Bento Modal) 樣式
   ========================================================================== */
.bento-modal {
    max-width: 1100px !important;
    max-height: 90vh !important;
    padding: 0 !important;
    background: rgba(10, 10, 15, 0.9) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 40px 100px rgba(0,0,0,0.9), 0 0 30px rgba(255,184,48,0.15), inset 0 0 0 1px rgba(255,255,255,0.05) !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    animation: modalPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: scale(0.95);
    opacity: 0;
    transition: box-shadow 0.5s ease;
    display: flex;
    flex-direction: column;
}

.bento-modal:hover {
    box-shadow: 0 40px 100px rgba(0,0,0,0.9), 0 0 40px rgba(0,240,255,0.2), inset 0 0 0 1px rgba(255,255,255,0.1) !important;
}

/* Custom scrollbar for modal */
.bento-modal::-webkit-scrollbar {
    width: 6px;
}
.bento-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

@keyframes modalPopIn {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.bento-layout {
    display: grid;
    grid-template-columns: min(350px, 40%) 1fr;
    grid-template-areas: "image info";
    gap: 30px;
    padding: 30px;
    flex-grow: 1;
    overflow: hidden;
}

.bento-layout .image-box {
    grid-area: image;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.bento-info-grid {
    grid-area: info;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Contains children */
    gap: 5px;
    justify-content: center;
}

.bento-layout .packs-box {
    grid-area: packs;
}

.packs-list-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 8px;
}

.bento-layout .bento-info-grid {
    grid-area: info;
}

/* Holographic Foil Effect */
.holographic-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,184,48,0.2);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
    transform-style: preserve-3d;
    display: inline-block; /* Hug the image tightly */
}
.holographic-wrapper:hover {
    transform: perspective(1000px) rotateY(6deg) rotateX(3deg) scale(1.03);
    box-shadow: -10px 20px 40px rgba(0,0,0,0.8), 0 0 50px rgba(255, 184, 48, 0.2);
}
.holo-glare {
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.4) 25%, rgba(255,255,255,0.1) 30%, transparent 35%);
    transform: skewX(-20deg);
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 2;
    pointer-events: none;
}
.holographic-wrapper:hover .holo-glare {
    left: 150%;
}
.card-big-image {
    max-width: 100%;
    width: auto;
    max-height: calc(90vh - 120px); /* Safely fit within modal height minus paddings */
    display: block;
    border-radius: 10px;
    background: #000;
}

/* Sticky Image disabled for 2-column stacked left layout */

@media (max-width: 600px) {
    .bento-layout {
        grid-template-columns: 150px 1fr;
        grid-template-areas: 
            "image packs"
            "info info";
        padding: 15px;
        gap: 15px;
    }
    
    .bento-layout .image-box {
        grid-area: image;
        max-width: 100%;
        margin: 0;
        padding: 10px;
    }
    
    .bento-layout .packs-box {
        grid-area: packs;
        padding: 10px;
    }
    
    .bento-layout .bento-info-grid {
        grid-area: info;
    }
}

.bento-box {
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.6), rgba(10, 10, 15, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.bento-box:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 184, 48, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 184, 48, 0.1);
}



.image-box {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.2) 100%);
}

.image-box img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.badge-type {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
}

.badge-type:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.8);
    filter: brightness(1.1);
}

.badge-ability {
    background: rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.badge-ability:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 184, 48, 0.5);
    box-shadow: 0 5px 15px rgba(255, 184, 48, 0.3);
}

.stat-item {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 50px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 184, 48, 0.5);
    box-shadow: 0 0 15px rgba(255, 184, 48, 0.3);
}

@keyframes neonPulseAtk {
    0% { box-shadow: inset 0 2px 6px rgba(0,0,0,0.3), 0 0 5px rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); }
    50% { box-shadow: inset 0 2px 6px rgba(0,0,0,0.3), 0 0 15px rgba(239, 68, 68, 0.6); border-color: rgba(239, 68, 68, 0.6); }
    100% { box-shadow: inset 0 2px 6px rgba(0,0,0,0.3), 0 0 5px rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); }
}

@keyframes neonPulseDef {
    0% { box-shadow: inset 0 2px 6px rgba(0,0,0,0.3), 0 0 5px rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); }
    50% { box-shadow: inset 0 2px 6px rgba(0,0,0,0.3), 0 0 15px rgba(59, 130, 246, 0.6); border-color: rgba(59, 130, 246, 0.6); }
    100% { box-shadow: inset 0 2px 6px rgba(0,0,0,0.3), 0 0 5px rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); }
}

.neon-atk {
    animation: neonPulseAtk 2s infinite ease-in-out;
}

.neon-def {
    animation: neonPulseDef 2s infinite ease-in-out;
    animation-delay: 1s; /* Offset the breathing */
}

.stat-label {
    font-size: 0.75rem;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: bold;
    color: #fff;
}

.pack-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.glass-scroll::-webkit-scrollbar {
    width: 6px;
}
.glass-scroll::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}
.glass-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

