@font-face{
    font-family: 'ArkPixel';
    src: url('./fonts/ark-pixel-12px-monospaced-zh_cn.ttf.woff2');
    font-display: swap;
}
body{
    height: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'ArkPixel', sans-serif;
    user-select: none;
}
.hidden{
    display: none !important;
}
.sprite{
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}
.sprite-full{
    background-size: contain;
}
.flip-x{
    transform: scaleX(-1);
}
.flip-y{
    transform: scaleY(-1);
}



#window{
    position: relative;
    width: 400px;
    height: 400px;
    background-color: rgba(219, 231, 255, 0.144);
    /* border: solid 1px #eee; */
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    overflow: hidden;
}
#main{
    width: 200px;
    height: 200px;
    transition: width 0.3s ease, height 0.3s ease;
}
#main-wrapper{
    position: relative;
    width: 200px;
    height: 200px;
    color: #888;
    /* background-color: antiquewhite; */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}
#main-background{
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url(pictures/main_background.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    z-index: 1;
}
#main-pawns{
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}
#main-foreground{
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url(pictures/main_foreground.png);
    /* background-size: contain; */
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    z-index: 3;
}



#menu{
    position: absolute;
    width: 32px;
    height: 200px;
    padding: 4px 2px;
    box-sizing: border-box;
    /* background-color: bisque; */
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 4;
}
.menu-btn{
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    /* transition: all 0.3s; */
}
.menu-btn:hover{
    transform: scale(1.1);
}
.menu-btn + .menu-btn{
    margin-top: 4px;
}



#panels{
    position: absolute;
    width: 240px;
    height: fit-content;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}
#panel-body{
    position: relative;
    width: 240px;
    height: 180px;
    padding: 8px;
    box-sizing: border-box;
    border-image: url(pictures/panel_background.png) 9 fill repeat;
    border-image-width: auto;
    image-rendering: pixelated;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#panel-footer{
    width: 100%;
    height: 32px;
    padding: 0 2px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#panel-tabs{
    position: absolute;
    left: 16px;
    top: 0;
    width: 100%;
    display: flex;
    align-items: flex-end;
}
.panel-tab{
    position: relative;
    width: 33px;
    height: 30px;
    top: -7px;
    background-image: url(pictures/panel_tab_1.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    cursor: pointer;
    z-index: 1;
}
.panel-tab.checked{
    z-index: 3;
}
.panel-tab + .panel-tab{
    margin-left: 1px;
}
#panel-containers{
    position: relative;
    width: 100%;
    height: 100%;
    margin-top: 12px;
    border-image: url(pictures/panel_background_2.png) 3 fill stretch;
    border-image-width: auto;
    image-rendering: pixelated;
    z-index: 2;
}
.panel-container{
    display: none;
}
.panel-container.checked{
    display: block;
}
#panel-close{
    position: absolute;
    right: 19px;
    top: 3px;
    width: 18px;
    height: 18px;
    background-image: url(pictures/close.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
}
#panel-money{
    letter-spacing: 1px;
}
.panel-arrows{
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-arrow{
    width: 21px;
    height: 15px;
    background-image: url(pictures/arrow.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    cursor: pointer;
}
.panel-arrow + .panel-arrow{
    margin-left: 4px;
}



.item-slots{
    width: 100%;
    height: 100%;
    padding: 4px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    justify-items: center;
    align-items: center;
}
.item-slot{
    position: relative;
    width: 64px;
    height: 64px;
    border-image: url(pictures/slot.png) 3 fill stretch;
    border-image-width: auto;
    image-rendering: pixelated;
    cursor: pointer;
    overflow: hidden;
}
.item-slot-icon{
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    transform: translate(-50%, -50%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    pointer-events: none;
}
.item-slot-amount{
    position: absolute;
    right: 0;
    bottom: 0;
    height: 12px;
    padding: 0 4px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: white;
    background-color: #888;
    border-top-left-radius: 4px;
}
.item-slot-buy-price-tag{
    position: absolute;
    left: 3px;
    bottom: 3px;
    width: calc(100% - 6px);
    height: 12px;
    padding: 0 4px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: white;
    background-color: gold;
}



#item-popup{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 220px;
    background-color: aliceblue;
    border: #888 2px solid;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 6;
}
#item-popup-bar{
    padding: 4px;
    display: flex;
    justify-content: flex-end;
    background-color: #8884;
}
#item-popup-header{
    height: 64px;
    padding: 4px 0;
    margin: 0 4px;
    display: flex;
    border-bottom: #aaa 2px dashed;
}
#item-popup-icon{
    width: 64px;
    height: 64px;
    background-color: antiquewhite;
    border: burlywood 2px solid;
    border-radius: 4px;
    box-sizing: border-box;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}
#item-popup-title{
    height: 64px;
    margin-left: 4px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
#item-popup-name{
    color: #444;
    line-height: 16px;
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}
#item-popup-tags{
    display: flex;
    flex-wrap: wrap;
    overflow: hidden;
    margin: -2px;
}
#item-popup-data{
    height: 16px;
    color: #888;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.item-popup-tag{
    margin: 2px;
    font-size: 14px;
    line-height: 14px;
    color: gold;
}
#item-popup-close{
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    background-color: antiquewhite;
    border: #888 1px solid;
    border-radius: 4px;
    cursor: pointer;
}
#item-popup-body{
    padding: 0 4px;
    flex-grow: 1;
}
#item-popup-content{
    width: 100%;
    height: 100%;
    color: #444;
    overflow: hidden;
}
#item-popup-buttons{
    display: flex;
    justify-content: center;
    padding: 4px;
    margin: -2px;
}
.item-popup-button{
    min-width: 64px;
    height: 24px;
    margin: 2px;
    color: #888;
    background-color: antiquewhite;
    border: burlywood 1px solid;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.item-popup-button:hover{
    background-color: bisque;
}



.guid-slots{
    height: 100%;
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.guid-slot{
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.guid-slot-symbol{
    width: 15px;
    height: 15px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}



#craft{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 129px;
    display: flex;
    background-image: url(pictures/craft.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    z-index: 5;
}
#craft-slot-left{
    position: absolute;
    left: 40px;
    top: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#craft-slot-right{
    position: absolute;
    right: 24px;
    top: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#craft-slot-icon{
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url(pictures/craft_slot.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}
#craft-slot-icon-img{
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    overflow: hidden;
}
#craft-arrows{
    margin-top: 8px;
    display: flex;
    align-items: center;
}
.craft-arrow{
    width: 18px;
    height: 15px;
    background-image: url(pictures/arrow_2.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    cursor: pointer;
}
.craft-arrow + .craft-arrow{
    margin-left: 4px;
}
#craft-close{
    position: absolute;
    right: 20px;
    top: -2px;
    width: 22px;
    height: 20px;
    background-color: #00000001;
    cursor: pointer;
}
#craft-ok{
    position: absolute;
    left: 55%;
    bottom: -4px;
    transform: translateX(-50%);
    width: 33px;
    height: 21px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    border-image: url(pictures/craft_button.png) 3 fill repeat;
    border-image-width: auto;
    image-rendering: pixelated;
    cursor: pointer;
}



#messages{
    position: absolute;
    top: 8px;
    width: 400px;
    padding: 0 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 9;
}
.message{
    width: fit-content;
    padding: 2px 4px;
    text-align: center;
    background-color: #EEEEEE88;
    border: #DDDDDDAA 1px dashed;
    border-radius: 4px;
}
.message + .message{
    margin-top: 4px;
}

#crosshair{
    position: absolute;
    width: 20px;
    height: 20px;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    background-image: url(pictures/crosshair.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    z-index: 10;
    pointer-events: none;
}



.float-text{
    position: absolute;
    transform: translate(-50%, -50%);
    animation: floatUp 1.5s ease-out forwards;
    user-select: none;
    pointer-events: none;
    z-index: 10;
}
@keyframes floatUp {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -150%);
    }
}
@keyframes riseAndFade {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50%  { transform: translate(-50%, -80%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
}
@keyframes floatRotateFade {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -140%) rotate(15deg);
    }
}



#dev{
    margin-top: 4px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dev-buttons{
    width: 400px;
    display: flex;
    gap: 4px;
}