/* =========================================
   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: 15px;
    font-size: 1.2rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.check-list li {
    margin-bottom: 12px;
    color: #ddd;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.check-list i {
    margin-top: 4px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.check-list li div {
    flex: 1;
}

/* 顏色工具 */
.text-gold {
    color: #ffd700;
}

.text-green {
    color: #81c784;
}

.text-blue {
    color: #64b5f6;
}

.text-red {
    color: #ff5252;
}

.text-gray {
    color: #aaa;
}

.highlight {
    color: #ffd700;
    font-weight: bold;
}

.intro-text {
    color: #ccc;
    margin-bottom: 15px;
}

/* =========================================
   2. 升階機率表 (Responsive Table)
   ========================================= */
.wiki-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.wiki-table th {
    background: rgba(0, 0, 0, 0.5);
    padding: 12px;
    color: #aaa;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wiki-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.rank-name {
    font-weight: bold;
    color: #fff;
}

.rate-val {
    color: #81c784;
    font-family: monospace;
    font-weight: bold;
    font-size: 1.1rem;
}

.loss-val {
    color: #ef5350;
    font-size: 0.9rem;
}

/* =========================================
   3. HOME 設定教學
   ========================================= */
.tutorial-box {
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tutorial-box p {
    color: #ddd;
    margin-bottom: 10px;
}

.tutorial-box img {
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid #555;
}

/* =========================================
   4. 精靈階級卡片 (Genius Grid)
   ========================================= */
.genius-grid {
    display: grid;
    /* 電腦版：改為自動適應，一排約 3 個 (卡片變高了，寬度維持) */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    /* 增加間距 */
    margin-bottom: 30px;
}

.genius-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    border-top: 3px solid #ccc;
    display: flex;
    flex-direction: column;
    /* 確保內容垂直排列 */
}

.genius-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 各階級配色 (維持不變) */
.tier-1 {
    border-top-color: #a5d6a7;
}

.tier-2 {
    border-top-color: #64b5f6;
}

.tier-3 {
    border-top-color: #ba68c8;
}

.tier-4 {
    border-top-color: #ffb74d;
}

.tier-5 {
    border-top-color: #ef5350;
}

.card-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h4 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
}

.card-header .cost {
    font-size: 0.85rem;
    color: #aaa;
}

/* ★ 修改重點：讓 Body 內的區塊垂直排列 */
.card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    /* 改為垂直排列 */
    gap: 15px;
    flex: 1;
    /* 撐開高度 */
}

.stats-box {
    width: 100%;
    /* 佔滿寬度 */
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    padding: 5px 0;
    /* 稍微增加行距 */
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    color: #ccc;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row strong {
    color: #fff;
}

/* ★ 修改重點：特效區塊獨立一行，並放大圖片 */
.effect-box {
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    /* 深色背景襯托 GIF */
    padding: 15px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    /* 讓圖片區塊自動推到底部對齊 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.effect-box .label {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
}

.effect-box img {
    /* 移除之前的 60px 限制，改為自適應但限制最大高度，避免圖片太大撐爆版面 */
    max-width: 100%;
    height: auto;
    max-height: 180px;
    /* 設定最大高度為 180px，符合您提到的尺寸 */
    object-fit: contain;
    /* 保持比例 */
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
    /* 加一點光暈讓特效更明顯 */
}

/* =========================================
   5. RWD 手機版優化
   ========================================= */
@media (max-width: 768px) {

    /* 表格轉卡片 */
    .wiki-table thead {
        display: none;
    }

    .wiki-table,
    .wiki-table tbody,
    .wiki-table tr,
    .wiki-table td {
        display: block;
        width: 100%;
    }

    .wiki-table tr {
        margin-bottom: 15px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    .rate-table td {
        display: flex;
        justify-content: space-between;
        text-align: right;
        padding: 10px 15px;
    }

    .rate-table td::before {
        content: attr(data-label);
        color: #aaa;
        font-weight: normal;
    }

    .rank-name {
        background: rgba(0, 0, 0, 0.3);
        text-align: center !important;
        color: var(--primary-gold, #fbb750);
        display: block !important;
    }

    .rank-name::before {
        display: none;
    }

    /* 精靈卡片維持單欄 */
    .genius-grid {
        grid-template-columns: 1fr;
    }
}