/* =========================================
   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;
}
/* 顏色工具 */
.text-green {
    color: #81c784;
}

.text-red {
    color: #ff5252;
}

.text-gold {
    color: #ffd700;
}

.highlight {
    color: #ffd700;
    font-weight: bold;
}

/* =========================================
   2. 元素屬性卡片 (Grid System)
   ========================================= */
.element-grid {
    display: grid;
    /* 電腦版：雙欄排列 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.element-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

.element-card:hover {
    transform: translateY(-3px);
}

/* 左側圖示 */
.elm-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.elm-content h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: #fff;
}

.elm-content p {
    margin: 0;
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.5;
}

.elm-note {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #aaa;
    font-style: italic;
}

/* 各屬性配色 */
.wind {
    border-left: 4px solid #81c784;
}

.wind .elm-icon {
    color: #81c784;
    border-color: #81c784;
}

.wind h4 {
    color: #a5d6a7;
}

.water {
    border-left: 4px solid #64b5f6;
}

.water .elm-icon {
    color: #64b5f6;
    border-color: #64b5f6;
}

.water h4 {
    color: #90caf9;
}

.fire {
    border-left: 4px solid #ef5350;
}

.fire .elm-icon {
    color: #ef5350;
    border-color: #ef5350;
}

.fire h4 {
    color: #ef9a9a;
}

.earth {
    border-left: 4px solid #ffa726;
}

.earth .elm-icon {
    color: #ffa726;
    border-color: #ffa726;
}

.earth h4 {
    color: #ffcc80;
}

/* =========================================
   3. 階級機率列表 (Tier List)
   ========================================= */
.tier-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tier-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tier-lv {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tier-lv .badge {
    background: #444;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.tier-lv .rate {
    color: #ffd700;
    font-weight: bold;
    font-family: monospace;
    font-size: 1.1rem;
}

.tier-names {
    display: flex;
    gap: 8px;
}

.name-tag {
    font-size: 0.9rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ddd;
}

/* 對應屬性顏色微調 */
.t-0 {
    color: #a5d6a7;
}

/* 風 */
.t-1 {
    color: #90caf9;
}

/* 水 */
.t-2 {
    color: #ef9a9a;
}

/* 火 */
.t-3 {
    color: #ffcc80;
}

/* 地 */

/* =========================================
   4. RWD 手機版優化
   ========================================= */
@media (max-width: 768px) {
    /* 元素卡片維持單欄 (預設 grid auto-fill 在手機上會自動變單欄) */

    /* 階級列表轉為垂直堆疊 */
    .tier-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tier-names {
        width: 100%;
        justify-content: space-between;
        /* 讓名字平均分散 */
    }

    .name-tag {
        font-size: 0.85rem;
        padding: 2px 4px;
    }
}