/*基盤*/
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

.modal.is-open {
    display: block;
}

/*勧誘*/
.clickable {
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
}

.modal-allure .modal-header {
    flex: 0 0 auto;
    min-height: 32px;
    margin-bottom: 8px;
}

.modal-allure .modal-content img {
    flex: 1 1 auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-allure .modal-content {
    position: relative;
    margin: 8vh auto;
    padding: 12px;
    width: fit-content;
    max-width: 90vw;
    max-height: 85vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/*infoアイコン*/
.modal-info .modal-content {
    position: relative;
    margin: 8vh auto;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 8px;
    background: #fff;
}

.modal-info .modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-info .modal-content::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.modal-info .modal-content::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 6px;
}

.modal-info .modal-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 50%;
    background-color: #444;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.info-icon:hover {
    background-color: #222;
}

.info-icon:focus-visible {
    outline: 2px solid #6aa9ff;
    outline-offset: 2px;
}

.modal-info .accordion-item {
    border-bottom: 1px solid #ddd;
}

.modal-info .accordion-header {
    cursor: pointer;
    padding: 12px 0;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.modal-info .accordion-header::after {
    content: "＋";
}

.modal-info .accordion-item.open .accordion-header::after {
    content: "−";
}

.modal-info .accordion-body {
    display: none;
    padding: 8px 0 16px;
    color: #333;
}

.modal-info .accordion-item.open .accordion-body {
    display: block;
}

.modal-info .accordion-image {
    margin-top: 8px;
    max-width: 100%;
}

.modal-info .accordion-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.modal-info .accordion-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/*キャラクター情報*/
.modal-character .modal-content {
    position: relative;
    margin: 8vh auto;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 8px;
    background: #fff;
}

.modal-character .modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-character .modal-content::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.modal-character .modal-content::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 6px;
}

.modal-character .modal-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.character-link {
    cursor: pointer;
}

.character-link:hover .character-name {
    text-decoration: underline;
}

.character-header img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.character-header p {
    font-family: "Yu Mincho", "游明朝", "Hiragino Mincho ProN", "ヒラギノ明朝 ProN W3", "ＭＳ Ｐ明朝", serif;
    font-size: 20px;
    font-weight: bold;
}

.chara-skill-title {
    font-family: "Yu Mincho", "游明朝", "Hiragino Mincho ProN", "ヒラギノ明朝 ProN W3", "ＭＳ Ｐ明朝", serif;
    font-size: 16px;
    font-weight: bold;
    padding-left: 8px;
    margin-bottom: 2px;
    background-color: #dceeff;
    color: #004080;
}

.skill-header {
    font-size: 14px;
}

.skill-effects {
    font-size: 12px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.character-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.character-info {
    font-size: 12px;
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.character-info th {
    text-align: left;
    color: #666;
    white-space: nowrap;
    border-bottom: 1.5px solid #bbb;
    border-right: 2px solid #bbb;
}

.character-info td {
    text-align: left;
}

.character-info th {
    width: 20%;
}

.character-info td {
    width: 30%;
}

.character-info .weapon-icon,
.character-info .armor-icon,
.character-info .ls-icon {
    display: block;
    width: 20px;
    height: 20px;
}

.character-personality {
    margin: 8px 0 12px;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.personality-title {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 8px;
}

.personality-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.personality-item {
    font-size: 12px;
    padding: 4px 8px;
    background: #f3f3f3;
    border-radius: 6px;
    white-space: nowrap;
}

.skill-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.skill-mp,
.skill-mp-table {
    background: #f2f2f2;
    color: #666;
    font-weight: normal;
    font-size: 0.85em;
    padding: 2px 6px;
    border-radius: 3px;
}

.skill-divider {
    border-top: 1px solid #e5e5e5;
    margin: 6px 0;
}

.skill-effects {
    margin: 4px 0 0 0.2em;
}

.effect-main {
    margin-top: 4px;
}

.effect-add {
    margin-left: 0.2em;
}

.skill-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.skill-ver {
    display: inline-block;
    margin-top: 2px;
    font-size: 10px;
    color: #2f5fa8;
    background: #eef4ff;
    padding: 1px 6px;
    border-radius: 3px;
}

.skill-noratk {
    font-size: 10px;
    color: #b3261e;
    background: #fdecea;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.skill-cond {
    font-size: 10px;
    color: #6a4fb3;
    background: #f2edff;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.skill-actcond {
    font-size: 10px;
    color: #1b6626;
    background-color: #e3f8e3;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.skill-icons {
    display: flex;
    flex-wrap: wrap;
    margin: 4px 0 6px;
}

.skill-icons .icon-img {
    width: 20px;
    height: 20px;
}

.skill-stack {
    font-size: 12px;
    margin-top: 8px;
}

.stack-row {
    display: flex;
    gap: 8px;
}

.stack-label {
    min-width: 6em;
}

.stack-cond {
    margin-top: 4px;
}

.stack-cond-body {
    margin-bottom: 4px;
    line-height: 1.4;
}

/*ZONE*/
.modal-zone-help .modal-content {
    position: relative;
    margin: 8vh auto;
    padding: 20px;
    width: 90%;
    max-width: 1500px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 8px;
    background: #fff;
}

.zone-help-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.zone-help-images img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.modal-zone-help .modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-zone-help .modal-content::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.modal-zone-help .modal-content::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 6px;
}

@media (max-width: 600px) {
    .zone-help-images {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .character-info {
        font-size: 10px;
    }

    .character-info th,
    .character-info td {
        padding: 4px;
    }

    .character-info .weapon-icon,
    .character-info .armor-icon,
    .character-info .ls-icon {
        width: 17px;
        height: 17px;
    }

    .character-header p {
        font-size: 20px;
    }

    .chara-skill-title {
        font-size: 14px;
    }

    .skill-header {
        font-size: 12px;
    }

    .skill-effects {
        font-size: 10px;
    }

    .skill-stack {
        font-size: 10px;
    }

    .skill-ver {
        font-size: 9px;
    }

    .skill-noratk {
        font-size: 9px;
    }

    .skill-cond {
        font-size: 9px;
    }

    .skill-icons .icon-img {
        width: 16px;
        height: 16px;
    }

    .personality-title {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .personality-item {
        font-size: 10px;
        padding: 2px 4px;
    }
}