/* (既存のスタイル...省略なしで必要な部分だけ上書き) */
.koto-icon {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    flex-shrink: 0;
}

.koto-icon-normal {
    width: 24px;
    height: 24px;
}

.koto-icon-small {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

.attr-icon-img,
.species-icon-img {
    width: 29px;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}

.icon-prefix {
    font-size: 0.8em;
    color: #666;
    margin-right: 2px;
    vertical-align: middle;
}

.attr-box-row {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.char-font {
    font-weight: bold;
    font-family: "Hiragino Kaku Gothic ProN", sans-serif;
    padding: 0;
    -webkit-text-stroke: 0.4px #555;
    paint-order: stroke;
    font-size: 1.25em;
}

.char-link-item {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
    color: #333;
}

.char-suffix {
    font-size: 0.8em;
    color: #555;
    margin-left: 1px;
    font-weight: normal;
}

.attr-fire {
    color: #ff3333;
}

.attr-water {
    color: #1e90ff;
}

.attr-wood {
    color: #32cd32;
}

.attr-light {
    color: #ffd427;
}

.attr-dark {
    color: #8d23b8;
}

.attr-heaven {
    color: #ffdcfb;
}

.attr-underworld {
    color: #460046;
}

.attr-none {
    color: #333333;
}

.term-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.sort-link:hover {
    text-decoration: underline;
}

.sort-link.is-active {
    font-weight: bold;
    border-bottom: 2px solid #333;
}

.td-buff,
.td-debuff {
    font-size: 0.9em;
    text-align: center;
    font-family: monospace;
    min-width: 40px;
}

.th-buff {
    color: #c62828;
}

.th-debuff {
    color: #1565c0;
}

.buff-cell .bd-val {
    color: #d32f2f;
    font-weight: bold;
}

.debuff-cell .bd-val {
    color: #1976d2;
    font-weight: bold;
}

.arrow {
    color: #999;
    font-size: 0.8em;
    margin: 0 2px;
}

.koto-archive-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: sans-serif;
}

.koto-table-wrapper {
    overflow-x: auto;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

.koto-chara-table {
    width: auto;
    min-width: auto;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.koto-chara-table th,
.koto-chara-table td {
    padding: 5px 5px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.koto-chara-table thead th {
    background: #f1f3f5;
    font-weight: bold;
    text-align: left;
    border-bottom: 2px solid #ddd;
}

/* アイコン固定 */
.td-icon {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #fff;
    border-right: 1px solid #eee;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    width: 70px;
    text-align: center;
    vertical-align: middle;
    padding: 5px !important;
}

.th-icon {
    position: sticky;
    left: 0;
    z-index: 3;
    background-color: #f1f3f5;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.td-icon a {
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    background: #f0f0f0;
}

.chara-thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.3);
    width: auto !important;
    height: auto !important;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    border: none !important;
    border-radius: 0 !important;
}

.no-img {
    width: 100%;
    height: 100%;
    background: #e0e0e0;
}

.chara-link {
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.char-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 1px;
    align-items: center;
}

.col-moji {
    width: 120px !important;
}

/* gap詰めました */

.gimmick-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 200px;
}

.td-power {
    font-weight: bold;
    text-align: center;
}

.text-muted {
    color: #888;
    font-weight: normal;
    font-size: 0.9em;
}

.loading-dots {
    font-size: 1.2em;
    color: #666;
    font-weight: bold;
    display: inline-block;
    min-width: 8em;
    text-align: left;
}

.loading-dots::after {
    content: '・';
    animation: dot-cycle 1.5s infinite steps(1);
}

@keyframes dot-cycle {
    0% {
        content: '・';
    }

    33% {
        content: '・・';
    }

    66% {
        content: '・・・';
    }
}

.sort-arrow {
    font-size: 0.8em;
    line-height: 1;
    margin-left: 2px;
}

.sort-arrow.faint {
    color: #e0e0e0;
}

.sort-arrow.active {
    color: #333;
}

.td-cv,
.td-acq {
    font-size: 0.85em;
    color: #555;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.th-cv,
.th-acq {
    width: 80px;
}

.ls-val {
    font-size: 0.95em;
    color: #444;
}

/* 設定ボックス */
.column-config-box {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.config-summary {
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    list-style: none;
}

.config-summary::-webkit-details-marker {
    display: none;
}

.config-summary::after {
    content: '+';
    float: right;
    font-weight: bold;
}

.column-config-box[open] .config-summary::after {
    content: '-';
}

.config-content {
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid #eee;
}

.config-content label {
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.col-hidden {
    display: none !important;
}

/* --- 列幅調整 --- */
.td-moji {
    min-width: 142px !important;
    width: 142px !important;
    max-width: 142px !important;
    white-space: normal;
}

.koto-chara-table .char-font {
    font-weight: bold;
    font-family: "Hiragino Kaku Gothic ProN", sans-serif;
    padding: 0;
    -webkit-text-stroke: 0.4px #555;
    paint-order: stroke;
    font-size: 1.25em;
}

.td-attr,
.td-species {
    text-align: center;
    min-width: 55px !important;
    width: 55px !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
    box-sizing: border-box;
}

.th-attr,
.th-species {
    text-align: center;
}

.koto-chara-table .attr-icon-img,
.koto-chara-table .species-icon-img {
    width: 22px;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.koto-chara-table .attr-icon-img.koto-icon-small {
    width: 15px;
    margin-left: 2px;
    flex-shrink: 0;
}

/* ▼▼▼ 追加: 新しいステータス列のデザイン ▼▼▼ */
.td-stat {
    font-family: monospace;
    font-size: 1.1em;
    text-align: right;
    min-width: 60px;
}

/* Lv99系 */
.hp-val {
    color: #2e7d32;
}

/* 緑 */
.atk-val {
    color: #c62828;
}

/* 赤 */

/* Lv120系 (少し濃くして強調) */
.hp-val-120 {
    color: #1b5e20;
    font-weight: bold;
    background-color: #f1f8e9;
}

/* 濃い緑 + 薄い背景 */
.atk-val-120 {
    color: #b71c1c;
    font-weight: bold;
    background-color: #ffebee;
}

/* 濃い赤 + 薄い背景 */

.th-sub {
    font-size: 0.75em;
    font-weight: normal;
    margin-left: 2px;
    color: #555;
}

.th-120 {
    background-color: #e8ecef !important;
}

/* Lv120のヘッダーを少し区別 */


/* --- スマホ表示時の余白極小化 --- */
.scroll-hint-text {
    display: none;
    font-size: 0.85em;
    color: #888;
    text-align: right;
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .scroll-hint-text {
        display: block;
    }

    .koto-table-wrapper {
        box-shadow: inset -12px 0 10px -10px rgba(0, 0, 0, 0.25);
        position: relative;
        z-index: 1;
        border-radius: 0;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        border-left: none;
        border-right: none;
    }

    .koto-archive-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow-x: hidden;
        width: 95%;
    }

    .archive-header,
    .column-config-box,
    .scroll-hint-text {
        margin-left: 10px;
        margin-right: 10px;
    }

    .th-icon,
    .td-icon {
        border-right: 1px solid #ddd;
    }

    .td-name,
    .th-name {
        min-width: 85px !important;
        max-width: 85px !important;
        width: 85px !important;
        white-space: normal !important;
        font-size: 11px !important;
        line-height: 1.3;
        padding-left: 2px !important;
        padding-right: 2px !important;
        text-align: left;
    }

    .chara-link {
        display: inline-block;
        word-break: break-all;
    }
}


/* --- 2. キャラクター一覧テーブル --- */
.character-list-container {
    width: 100%;
    margin-top: 20px;
}

.koto-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.koto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 800px;
}

.koto-table th,
.koto-table td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: middle;
}

.koto-table th {
    background: #f0f0f0;
    white-space: nowrap;
    font-weight: bold;
    color: #555;
}

.td-icon img.chara-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.koto-icon-small {
    width: 16px;
    height: 16px;
}

/* 文字列 */
.char-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.char-link-item {
    text-decoration: none;
    color: #333;
}

.char-font {
    font-weight: bold;
    margin-right: 1px;
}

/* ページネーション */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    background: #fff;
}

.pagination .current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}