body {
    background-color: #1a1a1a; /* 改成深色背景更有質感 */
    color: #f0f0f0;
    font-family: "Microsoft JhengHei", sans-serif;
    display: flex;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

/* --- 卡包與舞台 --- */
.stage { 
    height: 500px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: #2c2f33; /* 舞台深色背景 */
    border-radius: 15px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    margin-bottom: 30px; 
}
.pack-container { width: 160px; cursor: pointer; transition: transform 0.2s; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5)); }
.pack-container:hover { transform: scale(1.05); }
.pack-cap { width: 100%; transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); transform-origin: bottom left; z-index: 2; position: relative; }
.jagged-top { height: 10px; background: linear-gradient(135deg, transparent 50%, #e74c3c 50%), linear-gradient(-135deg, transparent 50%, #e74c3c 50%); background-size: 20px 10px; }
.cap-body { height: 40px; background: #e74c3c; border-bottom: 2px dashed #ffb8b8; color: white; font-size: 14px; font-weight: bold; display: flex; align-items: center; justify-content: center; }
.pack-base { width: 100%; position: relative; }
.base-body { height: 200px; background: #e74c3c; color: white; font-size: 22px; font-weight: bold; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.jagged-bottom { height: 10px; background: linear-gradient(45deg, transparent 50%, #e74c3c 50%), linear-gradient(-45deg, transparent 50%, #e74c3c 50%); background-size: 20px 10px; }
.pack-container.open .pack-cap { transform: translate(60px, -40px) rotate(35deg); opacity: 0; }

/* --- 疊卡特效區 --- */
.hint-text { color: #888; font-size: 14px; margin-bottom: 20px; }
.carousel-container { display: flex; align-items: center; justify-content: center; gap: 40px; margin-bottom: 30px; }

/* 疊卡容器 */
#deck-container {
    position: relative;
    width: 200px;
    height: 300px;
    perspective: 1000px;
    margin-right: 100px; 
    margin-left: 100px;  /* 🌟 新增這行：把左邊的空間也拉開，保護左邊的按鈕 */
}

/* 單張卡片的基本樣式 */
.deck-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #34495e; /* 卡片底色 */
    border-radius: 12px;
    border: 2px solid #7f8c8d;
    box-shadow: -5px 5px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 15px;
    
    /* 動畫過渡效果：讓位置、縮放、透明度都平滑變換 */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                opacity 0.4s ease, 
                z-index 0s;
}

.deck-card img {
    width: 170px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid #bdc3c7;
}

.rarity-badge { background: #f1c40f; color: #333; padding: 4px 12px; border-radius: 20px; font-weight: bold; font-size: 14px;}
.deck-card h3 { margin: 10px 0 0 0; font-size: 18px; color: white; }

.nav-btn { 
    position: relative;  /* 🌟 新增這行：讓 z-index 產生作用 */
    z-index: 50;         /* 🌟 新增這行：確保按鈕永遠在卡片的最上層 */
    background: transparent; 
    color: #fff; 
    border: 1px solid #777; 
    width: 45px; 
    height: 90px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-size: 20px; 
    transition: 0.2s; 
}
.nav-btn:hover { background: rgba(255,255,255,0.1); border-color: #fff; }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-main { padding: 12px 30px; background: white; color: black; border: none; border-radius: 30px; cursor: pointer; font-size: 16px; font-weight: bold; transition: 0.2s; }
.btn-main:hover { background: #ddd; }
.hidden { display: none !important; }

/* --- 圖鑑系統 --- */
.collection-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 15px; }
.system-buttons { display: flex; gap: 10px; }
.btn-sys { padding: 8px 15px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; color: white; }
.btn-sys.download { background: #9b59b6; } .btn-sys.download:hover { background: #8e44ad; }
.btn-sys.danger { background: #e74c3c; } .btn-sys.danger:hover { background: #c0392b; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); gap: 10px; }
.col-item { background: #444; padding: 5px; border-radius: 5px; font-size: 10px; opacity: 0.3; filter: grayscale(1); transition: 0.3s; text-align: center; color: #fff; }
.col-item.unlocked { opacity: 1; filter: grayscale(0); background: #555; border: 2px solid #f1c40f; box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
