/* =========================================
   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: 40px;
}

.rule-box h3 {
    margin-top: 0;
    color: var(--primary-gold, #fbb750);
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.rule-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.rule-item {
    display: flex;
    gap: 15px;
}

.rule-item i {
    font-size: 1.5rem;
    color: #888;
    margin-top: 3px;
}

.rule-item.full-width {
    grid-column: 1 / -1;
    background: rgba(255, 87, 34, 0.1);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #ff5722;
}

.rule-item strong { display: block; color: #fff; margin-bottom: 5px; }
.rule-item p { margin: 0; color: #ccc; font-size: 0.95rem; line-height: 1.5; }

.attr-list { list-style: none; padding: 0; margin: 0; }
.attr-list li { margin-bottom: 4px; font-size: 0.9rem; color: #bbb; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 0.8rem; margin-right: 5px; color: #000; font-weight: bold; }
.tag.str { background: #ef5350; }
.tag.dex { background: #66bb6a; }
.tag.int { background: #42a5f5; }

/* =========================================
   2. 階級卡片 (Tier Cards)
   ========================================= */
.tier-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 600px; /* 限制寬度，讓卡片不要太寬 */
    margin: 0 auto;
}

.tier-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.tier-card:hover { transform: translateY(-3px); }

/* 不同階級的配色 */
.tier-1 { border-top: 4px solid #90a4ae; } /* 灰/銀 */
.tier-1 .tier-header { background: linear-gradient(90deg, rgba(144,164,174,0.2), transparent); }

.tier-2 { border-top: 4px solid #66bb6a; } /* 綠 */
.tier-2 .tier-header { background: linear-gradient(90deg, rgba(102,187,106,0.2), transparent); }

.tier-3 { border-top: 4px solid #42a5f5; } /* 藍 */
.tier-3 .tier-header { background: linear-gradient(90deg, rgba(66,165,245,0.2), transparent); }

.tier-4 { border-top: 4px solid #ab47bc; } /* 紫 */
.tier-4 .tier-header { background: linear-gradient(90deg, rgba(171,71,188,0.2), transparent); }

.tier-5 { border-top: 4px solid #ef5350; } /* 紅 */
.tier-5 .tier-header { background: linear-gradient(90deg, rgba(239,83,80,0.2), transparent); }

.tier-6 { border-top: 4px solid #ffd700; box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); } /* 金 */
.tier-6 .tier-header { background: linear-gradient(90deg, rgba(255,215,0,0.2), transparent); }

/* 卡片頭部 */
.tier-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tier-badge {
    background: rgba(0,0,0,0.5);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.tier-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* 等級列表 */
.level-list {
    padding: 15px 20px;
}

.level-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
}
.level-row:last-child { border-bottom: none; }

.lv-badge {
    background: #333;
    color: #aaa;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 15px;
    min-width: 50px;
    text-align: center;
}

.lv-detail {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.cost { color: #888; }
.bonus { color: #ccc; }
.bonus .val { color: #ffeb3b; font-weight: bold; }

/* 升階區塊 */
.evolve-box {
    background: rgba(0,0,0,0.4);
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.evolve-icon {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 1px;
}

.evolve-content {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.03);
    padding: 10px;
    border-radius: 8px;
}

.evolve-content img {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
}

.evolve-text strong { display: block; color: #81c784; margin-bottom: 3px; }
.evolve-text p { margin: 0; font-size: 0.85rem; color: #888; }

/* 終階樣式 */
.final-tier {
    text-align: center;
    padding: 20px;
    color: #ffd700;
    font-weight: bold;
    letter-spacing: 2px;
    background: rgba(0,0,0,0.4);
}

/* 連接箭頭 */
.tier-arrow {
    font-size: 1.5rem;
    color: #555;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* RWD */
@media (max-width: 768px) {
    .rule-grid { grid-template-columns: 1fr; }
    .lv-detail { flex-direction: column; gap: 2px; }
    .cost { font-size: 0.85rem; }
}