/*-----------------全体------------------*/
body {
    width: 100%;
    margin: 0 auto;
    z-index: 0;
    color: #333333;
    background-image: url("../img/assets/sprites/DIY/background.png");
    background-repeat: repeat;
}

* {
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}



header {
    text-align: center;
    padding: 40px 0;
    font-size: 24px;
    line-height: 30px;
    font-weight: bold;
    background-image: url("../img/assets/header.png");
    background-size: cover, cover;

    box-shadow: 0 5px 15px #a6a6a6;


    position: sticky;
    top: 0;
    z-index: 2;
}

ul {
    list-style: none;
    padding: 0;
}

.button {
    display: inline-block;
    font-size: 12px;
    line-height: 12px;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: 0.3s all ease;
}

.input[type="checkbox"],
.input[type="radio"] {
    display: none !important;
}

#contents-wrapper {
    display: flex;
    align-items: flex-start;
    box-shadow: 0 -5px 15px #a6a6a6;
    background-color: #eaeaea;
}

main {
    flex: 1 1 0;
    min-width: 0;
}

#sidebar {
    width: 300px;
    flex-shrink: 0;
    padding: 15px;
    background-color: #eaeaea;
    position: sticky;
    top: 110px;
    overflow-y: auto;
}

#menu-label {
    display: none;
}

@media (max-width: 690px) {
    #menu-label {
        display: inline-block;
        position: fixed;
        top: 15px;
        left: 15px;
        height: 50px;
        width: 50px;
        z-index: 3;
        background: #fafafa;
        border: none;
        border-radius: 25px;
        padding: 10px 16px;
        box-shadow: 0 1px 5px #a6a6a6;
        font-size: 24px;
        text-align: center;
        cursor: pointer;
    }

    #sidebar {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -70%) scale(0.8);
        background-color: #fafafa;
        border-radius: 4px;

        width: 90%;
        max-height: 80vh;
        overflow-y: auto;

        z-index: 100;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
    }

    #filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 50;
    }

    #contents-wrapper:has(#menu-button:checked) #sidebar {
        visibility: visible;
        opacity: 1;
        transform: translate(-50%, -70%) scale(1);
    }

    #contents-wrapper:has(#menu-button:checked) #filter-overlay {
        display: block;
    }
}

#footer-container {
    margin: 0 auto;
    max-width: 1200px;
    display: block;
    text-align: center;
    height: 330px;
    font-size: 11px;
    background-color: #eaeaea;
    margin-top: 10px;
    box-shadow: 0 5px 15px #a6a6a6;

    align-content: center;
}


/* ---------------フィルターコンテナ --------------*/


.filter-container {
    display: grid;
    width: 100%;
    grid-template-columns: auto;
    justify-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
    gap: 10px;
}

@media(max-width: 690px) {
    .filter-container {
        grid-template-columns: auto;
        align-items: center;
    }

    .filter-list {
        width: 90% !important;
        justify-self: center !important;
    }
}

.filter-list {
    background: #fafafa;
    display: flex;
    flex-wrap: wrap;

    width: 100%;
    margin: 0;
    vertical-align: bottom;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 5px #a6a6a6;
}

.filter-container li {
    display: grid;
    width: 100%;
    flex: 1 1 36px;
}

.filter-list:nth-child(5) li {
    flex: 1 0 20%;
}

.filter-list:nth-child(6) li {
    flex: 1 0 25%;
}

.filter-list:nth-child(7) li {
    flex: 1 0 20%;
}

.filter-container .button {
    font-size: 11px;
    height: 28px;
    box-shadow: 0 0 1px 0px #a6a6a6;
    margin: 0;
    display: inline-flex;
    flex: 1 1 36px;
    line-height: 12px;
}

.filter-container .input:checked+.button {
    background: #FFCA7F;
}

.filter-container img {
    max-height: 12px;
    margin: 0 auto;
}


#role img {
    background-color: #000;
    filter: invert();
    opacity: 0.8;
}




.filter-container label {
    cursor: pointer;
}


#search-container {
    display: flex;
    width: 100%;
    gap: 10px;
    margin: 10px 0;
    font-family: Arial, Helvetica, sans-serif;

}

#clear-search-btn {
    padding: 8px 16px;
    background: #ea3450;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;

    box-shadow: 0 1px 5px #ea3450;
}

#search-input {
    padding: 8px;
    border: 2px solid #ddd;
    background-color: #fafafa;
    border-radius: 4px;
    flex: 1;
}





/*------------ キャラクター----------------------*/

.char-container {
    flex: 1;
    padding: 15px;
    background-color: #eaeaea;
    min-width: 0;
}

.char-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px 5px;
    max-width: 960px;
    margin: 0 auto;
}

.char {
    min-width: 60px;
    min-height: 60px;
    border: 3px solid #fafafa;
    background: #dde;
    border-radius: 3px;
    box-shadow: 0 0 1px 1px #a6a6a6;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.char::before {
    z-index: 1;
    content: "";
    width: 12px;
    height: 12px;
    padding: 2px;
    position: absolute;
    top: -2px;
    right: -2px;
    background-size: 12px;
    background-color: #fafafa;
    background-repeat: no-repeat;
    background-position: center center;
    max-width: 100%;
    border-radius: 3px;
}

.char .alt-image {
    display: none;
}

body:has(#info-tag:checked) #char-container .char {
    opacity: 0.5;
    filter: grayscale(10%);
}

body:has(#info-tag:checked) #char-container .char.selected {
    opacity: 1;
    filter: grayscale(0%);
}

body:has(#info-tag:not(:checked)) #char-container .char.selected {
    border-color: #6a6aea;
}



.char[data-attribute="Fire"]::before {
    background-image: url("../img/assets/sprites/elements/element_red.png");
}

.char[data-attribute="Water"]::before {
    background-image: url("../img/assets/sprites/elements/element_blue.png");
}

.char[data-attribute="Thunder"]::before {
    background-image: url("../img/assets/sprites/elements/element_yellow.png");
}

.char[data-attribute="Wind"]::before {
    background-image: url("../img/assets/sprites/elements/element_green.png");
}

.char[data-attribute="Light"]::before {
    background-image: url("../img/assets/sprites/elements/element_white.png");
}

.char[data-attribute="Dark"]::before {
    background-image: url("../img/assets/sprites/elements/element_black.png");
}



/*------------詳細----------------------*/
#info-wrapper {
    position: fixed;
    background: #fafafa;
    border-radius: 3px;
    border-top: 1px solid #a6a6a6;
    box-shadow: 0 -5px 15px #808080;
    width: 100%;

    left: 0;
    bottom: 0;

    height: 350px;
    transition: 0.5s all;
    z-index: 2;
    text-align: center;

    transform: translateY(100%);
    transition: transform 0.5s ease;

    font-family: Arial, Helvetica, sans-serif;
}

#info-wrapper:has(.input:checked) {
    transform: translateY(0);
}

#infoButtons {
    width: 100%;
    position: absolute;
    transform: translateY(-100%);
    margin: 0 auto;
}

#infoButtons .button {
    background: #ddd;
    z-index: 3;
    border: 1px solid #a6a6a6;
    border-radius: 5px 5px 0 0;
    box-shadow: none;
    margin: 0 5px;
    padding: 10px;
    justify-content: center;
}

#infoButtons .input:checked+.button {
    background: #fafafa;
    border-bottom: 1px solid #fafafa;
}

.info-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    line-height: 1.5;
}

.charInfo-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.charInfo-panel #SubNameBlock {
    font-size: 11px;
    font-weight: normal;
    margin-bottom: -5px;
}

.charInfo-panel #JPNameBlock {
    font-size: 14px;
    font-weight: bold;
    line-height: 30px;
    display: inline-block;
}

#expandBlock {
    display: flex;
    flex: 1;
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 0;
}

#info-wrapper:has(#info-detail:checked) .charInfo-panel {
    display: flex;
}

.charInfo-panel .Art {
    min-height: 0;
    height: 100%;
    aspect-ratio: 1/1;
    display: flex;
    flex-shrink: 0;
}

.charInfo-panel .Art a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.charInfo-panel .Art a img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.charInfo-panel .alt-image {
    display: none;
}

.charInfo-panel .details {
    flex: 1;
    min-width: 0;
    height: 100%;
    text-align: left;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}

.charInfo-panel .details span {
    font-weight: normal;
}

#detailsFooter {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 10px;
    width: 100%;
}

/* --------------タグ管理パネルのデザイン -------------*/
#tag-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.info-wrapper:has(#info-tag:checked) #tag-panel {
    display: flex;
}

#tag-panel h4 {
    font-size: 16px;
}

.tag-controls {
    display: flex;
    gap: 10px;
}

#tag-panel #tag-message {
    font-size: 14px;
    margin-bottom: 10px;
}


#tag-panel .tag-controls input {
    padding: 8px;
    border: 2px solid #ddd;
    background-color: #fafafa;
    border-radius: 4px;
    flex: 1;
    /* 横幅を均等に分ける */
}

#tagedit-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#tag-panel .button {
    padding: 8px 16px;
    background: #fafafa;
    color: #333333;
    border: none;
    border-radius: 4px;
    box-shadow: 0 1px 5px #a6a6a6;
}

#tag-panel .safe {
    padding: 8px 16px;
    background: #2CC4B6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 1px 5px #2cc4b6;
}

#tag-panel .danger {
    color: white;
    background: #ea3450;
    box-shadow: 0 1px 5px #ea3450;
}

#tag-panel .tag-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    /* 右寄せ */
}

#tag-panel .tag-actions .button {
    padding: 8px 16px;
    font-size: 12px;
    color: #333333;
    border: none;
    background: #fafafa;
    border-radius: 4px;
    box-shadow: 0 1px 5px #a6a6a6;
}

#tag-panel .tag-actions .danger {
    color: #d9534f;
}

#all-btn {
    display: none;
}

#all-btn:checked+#all-btn-label {
    background-color: #FFCA7F;
    mix-blend-mode: multiply;
}

/*-----------------to DOリスト------------------*/


#toDo {
    display: none;
    overflow-y: auto;
}

body:has(#toDo:checked) #toDo {
    display: block;
}

#toDo ul {
    text-align: left;
}




/*-----------------キャラ名プレート------------------*/
#charNamePlate {
    position: absolute;
    z-index: 1;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px;
    box-shadow: 0 0 1px 1px #a6a6a6;
    pointer-events: none;
    border-radius: 5px;
    font-size: 11px;
}