/**************************/
/* モーダル共通 */
/**************************/

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(45, 35, 25, 0.58);
    z-index: 9999;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(900px, 90vw);
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(255, 252, 245, 0.97);
    border: 1px solid rgba(190, 160, 110, 0.45);
    border-radius: 12px;
    padding: 24px;
    box-shadow:
            0 12px 35px rgba(80, 55, 25, 0.25);
}

/*タイトル*/
#resonanceTitle,
#skillEffectTitle,
#linkSkillTitle,
#columnSettingsTitle {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;

    border-bottom: 2px solid rgba(190, 160, 110, 0.45);

    color: #55442d;
}

/*閉じるボタン*/
#closeResonanceModal,
#closeSkillEffectModal,
#closeLinkSkillModal,
#closeColumnSettingsModal {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 28px;
    font-weight: bold;
    color: #8a7658;
    transition:
            color 0.2s ease,
            transform 0.2s ease;
}

#closeResonanceModal:hover,
#closeSkillEffectModal:hover,
#closeLinkSkillModal:hover,
#closeColumnSettingsModal:hover {
    color: #5c4a32;
    transform: scale(1.1);
}


/* 詳細グループ */
.modal-detail-group {
    background-color: rgba(250, 246, 237, 0.85);
    border: 1px solid rgba(190, 160, 110, 0.30);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(100, 70, 30, 0.07);
}

.modal-detail-row {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-start;
}

.modal-detail-group .modal-detail-row:first-child {
    border-bottom: 1px solid var(--color-gold-light);
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-weight: bold;
    color: var(--color-brown);
}

.modal-detail-label {
    width: 80px;
    font-weight: bold;
    color: var(--color-brown-light);
    flex-shrink: 0;
}

.modal-detail-value {
    flex: 1;
}

.modal-effect-value {
    padding: 7px 10px;
    margin-bottom: 6px;
    background-color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(190, 160, 110, 0.20);
    border-radius: 5px;
    font-size: 15px;
}

.modal-effect-value:last-child {
    margin-bottom: 0;
}

/*効果タイトル*/
.modal-detail-effect {
    margin-top: 20px;
}

/* 効果同士の区切り */
.modal-detail-divider {
    display: none;
}

/**************************/
/* モーダル（領域共鳴） */
/**************************/

.resonance-popup-btn {
    cursor: pointer;
}

.resonance-popup-btn:hover {
    background-color: rgba(232, 213, 174, 0.55);
    border-radius: 8px;
}

.modal-value-highlight {
    color: #16A34A;
    font-weight: bold;
}

/**************************/
/* モーダル（状態） */
/**************************/

.skill-effect-popup-btn {
    cursor: pointer;
    font-weight: bold;
}

.skill-effect-popup-btn:hover {
    background-color: rgba(232, 213, 174, 0.55);
    border-radius: 8px;
}

.modal-detail-row.category-row {
    align-items: center;
}

.category-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
    border: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 1px 2px rgba(0,0,0,.12);
}

/* 特殊（灰色） */
.category-tag.special {
    background: #e5dfd3;
    color: #5c5347;
}

/* 災厄（紫） */
.category-tag.disaster {
    background: #dfcce3;
    color: #65436e;
}

/* 聖護（青） */
.category-tag.holy {
    background: #cdddea;
    color: #3d6282;
}

/* 罪悪（黄色） */
.category-tag.sin {
    background: #eee0a6;
    color: #806713;
}

/* 有益（緑） */
.category-tag.benefit {
    background: #d2e3d0;
    color: #4b7048;
}

/* デバフ（赤） */
.category-tag.debuff {
    background: #e8cccc;
    color: #8a4444;
}

.text-danger {
    color: #dc3545;
    font-weight: bold;
}

/**************************/
/* モーダル（連携スキル） */
/**************************/

.link-skill-popup-btn {
    cursor: pointer;
    font-weight: bold;

    transition:
            color 0.2s ease,
            text-shadow 0.2s ease;
}

.link-skill-popup-btn:hover {
    color: #8a6a3d;

    text-shadow:
            0 0 6px rgba(190, 160, 110, 0.45);
}

#linkSkillText {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 15px;
    font-family: inherit;
}

/**************************/
/* モーダル（表示項目） */
/**************************/

.column-settings-group {
    margin-bottom: 20px;
}

.column-settings-group-title {
    margin-bottom: 8px;

    font-weight: bold;
    color: var(--color-brown);
}

.column-settings-list {
    display: flex;
    flex-wrap: wrap;

    gap: 8px 20px;
}

.column-settings-list label {
    cursor: pointer;
}

/**************************/
/* モーダル ローディング */
/**************************/

.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 10px;

    padding: 30px 0;

    color: var(--color-brown-light);
    font-size: 15px;
}

.modal-spinner {
    width: 36px;
    height: 36px;

    border: 4px solid var(--color-gold-light);
    border-top-color: var(--color-gold);

    border-radius: 50%;

    animation: modal-spin 0.8s linear infinite;
}

@keyframes modal-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}