/* =========================================
   1. 規則說明區
   ========================================= */
.rule-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.rule-box h3 {
    margin-top: 0;
    color: var(--primary-gold, #fbb750);
    margin-bottom: 10px;
    font-size: 1.2rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.intro-text { color: #ccc; line-height: 1.6; font-size: 0.95rem; margin: 0; }

/* 顏色變數 */
.text-gold { color: #ffd700; }
.tier-1 { --tier-color: #90a4ae; } /* 灰/銀 */
.tier-2 { --tier-color: #66bb6a; } /* 綠 */
.tier-3 { --tier-color: #42a5f5; } /* 藍 */
.tier-4 { --tier-color: #ab47bc; } /* 紫 */
.tier-5 { --tier-color: #ef5350; } /* 紅 */

/* =========================================
   2. Boss 掉落卡片 (Grid Gallery)
   ========================================= */
.boss-grid {
    display: grid;
    /* 電腦版：自動適應，最小寬度 200px */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.boss-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--tier-color, #ccc); /* 頂部顏色條 */
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s;
}

.boss-card:hover { transform: translateY(-5px); border-color: var(--tier-color, #ccc); }

.boss-img {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    padding: 10px;
}

.boss-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

.boss-info {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tier-badge {
    background: var(--tier-color, #ccc);
    color: #fff;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.boss-info h4 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #fff;
    min-height: 2.4em; /* 預留兩行高度，避免標題長短不一導致卡片高度不同 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.rate-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.rate-box span { color: #aaa; }
.rate-box strong { color: var(--tier-color, #ccc); font-size: 1.1rem; }

/* =========================================
   3. 星級能力展示 (Responsive Grid)
   ========================================= */
.star-grid {
    display: grid;
    /* 電腦版：一排 5 個 */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.star-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s;
    border-bottom: 3px solid var(--tier-color, #ccc); /* 底部顏色條 */
}

.star-card:hover { transform: translateY(-5px); border-color: var(--tier-color, #ccc); }

.star-header {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.star-header h4 { margin: 0; color: var(--tier-color, #ccc); font-size: 1.1rem; }
.stars { color: #ffd700; font-size: 0.9rem; margin-top: 2px; letter-spacing: 1px; }

.star-img {
    height: 180px; /* 圖片高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
}

.star-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.star-stats {
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #ccc;
    padding: 3px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
}
.stat-row:last-child { border-bottom: none; }
.stat-row strong { color: #fff; }

/* =========================================
   4. RWD 手機版優化
   ========================================= */
@media (max-width: 768px) {
    /* Boss 卡片改為雙欄 */
    .boss-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .boss-img { height: 100px; }
    .boss-info h4 { font-size: 0.9rem; min-height: auto; margin-bottom: 5px; } /* 手機版取消高度限制 */
    .rate-box { flex-direction: column; gap: 2px; } /* 機率上下排 */

    /* 星級卡片改為雙欄 */
    .star-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .star-img { height: 150px; }
}