:root {
    --background-color: #293237;
    --text-color: #ffffff;
    --tier-s-color: #FF4136;
    --tier-a-color: #FF851B;
    --tier-b-color: #FFDC00;
    --tier-c-color: #2ECC40;
    --tier-d-color: #0074D9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
.hide{
    display: none;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}
header{
    background-color: #000;
}
.inner-header{
    width: 1168px;
    height: 64px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}
.logo{
    display: block;
    width: 163px;
    height: 30px;
    overflow: hidden;
}
.logo img {
    width: 100%;
    height: auto;
}
.nav{
    display: flex;
    gap: 1rem;
    align-items: center;
}
.nav a{
    display: flex block;
    gap: .5rem;
    align-items: center;
    border: solid 1px #dbdbdb;
    padding: .2rem .5rem;
    border-radius: .3rem;
    color: #FFF;
    font-size: 1rem;
    text-decoration: none;
}
.nav a:hover{
    background-color: #181818;
}
.container {
    max-width: 1168px;
    margin: 0 auto;
}
.container h1{
    margin-top: 1rem;
}
.black{
    background-color: #000;
}

.tierlist {
    background-color: #1a1a17;
    display: flex;
    flex-direction: column;
    border: solid 2px #000;
    margin-top: 1.5rem;
}

.tier {
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.tierlist .tier{
    border-bottom: solid 2px #000;
}
.tierlist .tier:last-child{
    border-bottom: none;
}

.rank {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 4rem;
    max-width: 8rem;
    min-height: 3.5rem;
    padding: .5rem;
    font-size: 1.5rem;
    flex-shrink: 0;
    font-weight: bold;
    color: var(--background-color);
    cursor: pointer;
    word-break: break-word;
    white-space: normal;
}

.view {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    min-height: 3.5rem;
}
.tier-img{
    padding: 0;
    gap: 0;
    min-height: 5rem;
}
.obj {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    font-size: 1rem;
    padding: 5px 10px;
    color: #181818;
    cursor: grab;
    position: relative;
    transition: all 0.2s ease;
    max-height: 2.3rem;
}
.obj-img{
    padding: 0;
    border-radius: 0;
    max-height: 120px;
}
.obj-img img{
    max-height: 120px;
}
.obj:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.delete-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4136;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.obj:hover .delete-btn {
    opacity: 1;
}

.operate {
    display: flex;
}

.add-btn {
    background-color: #f19131;
    border: none;
    color: var(--text-color);
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-left: solid 2px #000;
    border-right: solid 2px #000;;
}

.setup {
    width: 30px;
    border: none;
    background-image: url('../images/Settings.png');
    background-size: 1.4rem;
    background-repeat: no-repeat;
    cursor: pointer;
    background-color: #000;
    background-position: 3px;
}


.setup:hover,
.shift:hover,
.add-btn:hover {
    background-color: #FFC07D;
}

.input-section {
    margin-top: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
}

.input-section h3 {
    margin-bottom: 15px;
}

#nameInput {
    width: 100%;
    height: 300px;
    resize: vertical;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    margin-bottom: 10px;
}

.backup {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
}
.backup-img {
    margin-top: 20px;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.1);
}
.select-image{
    border: solid 1px #ccc;
    padding: .5rem;
    margin-top: 20px;
}
.select-image input{
    font-size: 20px;
}
.savepic{
    text-align: center;
    margin-top: 20px;
}
.savepic button{
    width: 100%;
    max-width: 350px;
    font-size: 18px;
    margin-bottom: 20px;
    background: #3a5795;
    color: #fff;
    border-radius: 6px;
}
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.popup-content {
    background-color: var(--background-color);
    padding: 0 20px 20px 20px;
    border-radius: 10px;
    min-width: 300px;
}

.popup-content .info {
    width: 100%;
    background-color: var(--background-color);
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-content .info button {
    background-color: black;
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: none;
    font-size: 1.4rem;
    line-height: 1.6rem;
    text-align: center;
    cursor: pointer;
    padding: 0;
}
.popup-content .info #downloadLink{
    display: block;
    padding: .2rem 2rem;
    font-size: 1rem;
    color: #CCC;
    background-color: #0074D9;
    text-decoration: none;
}

.popup-content .info button:hover {
    background-color: #333;
}


.popup-content .block{
    background-color: var(--background-color);
    min-width: 300px;
    max-height: 800px;
    text-align: center;
    overflow-y: auto;
}

.popup-content .block img{
    max-width: 800px;
}

.popup input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
}

.popup label {
    display: block;
    margin-top: 10px;
    color: var(--text-color);
}

.sortable-ghost {
    opacity: 0.4;
    background-color: #c8ebfb;
}

.tier-dragging {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.color-options {
    display: flex;
    justify-content: space-around;
    gap: .5rem;
    margin: 1rem 0;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.color-option:hover,
.color-option.selected {
    transform: scale(1.1);
    border-color: white;
}

.buttons{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}
.set-buttons{
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}
.tier-button {
    padding: 12px 24px;
    cursor: pointer;
    border: 0;
    border-radius: .2rem;
}
.tier-button:hover {
    background-color: #656b6e;
}
.tier-button:focus {
    outline: none;
}
.tier-inp{
    text-align: center;
    font-weight: 700;
    color: #FFF;
}
.demo-mode { background-color: #4CAF50; }
.demo-mode:hover { background-color: #45a049; }
.clear-cache { background-color: #2196F3; }
.clear-cache:hover { background-color: #1e87db; }
.generate-image { background-color: #FF9800; }
.generate-image:hover { background-color: #e68a00; }
.undo { background-color: #f44336; }
.undo:hover { background-color: #da190b; }
.redo { background-color: #9C27B0; }
.redo:hover { background-color: #7B1FA2; }
.w100{
    width: 100%;
}
.tips{
    width: 1168px;
    margin: 1rem auto;
}
.tips h2{
    font-size: 1.4rem;
}
.tips ol{
    padding-left: 1rem;
    line-height: 1.5;
    color: #dddddd;
}
.tips ol li span{
    background-color: #1a1a17;
    padding: .2rem .5rem;
    margin: 0 .2rem;
    border-radius: .2rem;
}
footer{
    margin: 1rem 0 0 0;
    padding: 3rem 0;
    background-color: #242c31;
}
footer a{
    text-decoration: none;
    color: #FFF;
}
.foot{
    width: 1168px;
    margin: auto;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}
.foot div{
    display: flex;
    gap: 1rem;
    flex-direction: column;
}
.foot div p{
    font-size: .8rem;
}
footer a:hover{
    text-decoration: underline;
}
.about{
    width: 40rem;
}
.block{
    background-color: #181818;
}
.title-body, .content{
    width: 750px;
    margin: auto;
    padding: 2rem 0;
}
@media (max-width: 768px) {
    .tier {
        flex-direction: column;
    }
    .tierlist{
        width: 100%;
    }
    .rank {
        width: 100%;
        max-width: 100%;
        padding: 10px 0;
    }
    .inner-header{
        width: 100%;
        padding: .5rem .8rem;
    }
    .nav{
        display: none;
    }
    .operate {
        flex-direction: row;
        justify-content: space-between;
    }
    .popup-content img{
        max-width: 100%;
    }
    .foot{
        width: 100%;
        flex-direction: column;
        padding: 0 .8rem;
    }
    .about{
        width: 100%;
    }
    .title-body, .content{
        width: 100%;
        padding: .8rem;
    }
}