/* =========================
   RESET
========================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,
body{
    width:100%;
    height:100%;
}

body{
    background:#f5f6f8;
    font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;

    color:#222;
}

/* =========================
   APP
========================= */

.app{

    width:100%;
    height:100vh;

    display:flex;

    overflow:hidden;
}

/* =========================
   GAME AREA
========================= */

.game-area{

    flex:1;

    display:flex;
    flex-direction:column;

    justify-content:center;
    align-items:center;

    padding:20px;
}

/* =========================
   CHARACTER
========================= */

.character-container{

    width:min(70vw,700px);
    height:min(70vw,700px);

    display:flex;

    justify-content:center;
    align-items:center;
}

#character{

    width:100%;
    height:100%;

    position:relative;

    overflow:hidden;

    border-radius:20px;

    background:white;

    box-shadow:
    0 10px 30px rgba(0,0,0,.08);
}

/* =========================
   LAYERS
========================= */

.layer{

    position:absolute;

    inset:0;

    width:100%;
    height:100%;

    object-fit:contain;

    pointer-events:none;

    user-select:none;
}

/* 배경 */

.background{

    z-index:0;

    object-fit:cover;
}

/* 캐릭터 */

.body{
    z-index:1;
}

.bottom{
    z-index:2;
}

.shoes{
    z-index:3;
}

.top{
    z-index:4;
}

.accessory{
    z-index:5;
}

.hat{
    z-index:6;
}

/* =========================
   BUTTONS
========================= */

.action-buttons{

    margin-top:20px;

    display:flex;

    flex-wrap:wrap;

    gap:12px;
}

.action-buttons button{

    border:none;

    padding:12px 18px;

    border-radius:12px;

    cursor:pointer;

    background:white;

    font-size:15px;

    box-shadow:
    0 3px 12px rgba(0,0,0,.08);

    transition:.2s;
}

.action-buttons button:hover{

    transform:translateY(-2px);

    box-shadow:
    0 8px 20px rgba(0,0,0,.12);
}

/* =========================
   SIDEBAR
========================= */

.sidebar{

    width:420px;

    background:white;

    border-left:1px solid #e5e5e5;

    display:flex;

    flex-direction:column;
}

.sidebar h2{

    padding:20px;

    border-bottom:1px solid #eee;
}

/* =========================
   TABS
========================= */

.tabs{

    display:flex;

    gap:8px;

    overflow-x:auto;

    padding:15px;
}

.tabs::-webkit-scrollbar{
    display:none;
}

.tab{

    border:none;

    border-radius:999px;

    padding:10px 16px;

    cursor:pointer;

    white-space:nowrap;

    background:#eee;

    transition:.2s;
}

.tab:hover{

    background:#ddd;
}

.tab.active{

    background:#222;

    color:white;
}

/* =========================
   CAROUSEL
========================= */

.carousel-wrapper{

    display:flex;

    align-items:center;

    gap:10px;

    padding:15px;
}

.scroll-btn{

    width:42px;
    height:42px;

    border:none;

    border-radius:50%;

    cursor:pointer;

    background:#f1f1f1;

    flex-shrink:0;
}

.scroll-btn:hover{

    background:#ddd;
}

.carousel{

    flex:1;

    display:flex;

    gap:12px;

    overflow-x:auto;

    scroll-behavior:smooth;

    padding:5px;
}

.carousel::-webkit-scrollbar{

    height:8px;
}

.carousel::-webkit-scrollbar-thumb{

    background:#ccc;

    border-radius:999px;
}

/* =========================
   ITEM CARD
========================= */

.item-card{

    width:120px;

    flex-shrink:0;

    background:white;

    border-radius:14px;

    border:2px solid transparent;

    position:relative;

    cursor:pointer;

    transition:.2s;
}

.item-card:hover{

    transform:translateY(-3px);
}

.item-card.active{

    border-color:#00c853;
}

.item-card img{

    width:100%;
    height:120px;

    object-fit:contain;

    display:block;

    padding:8px;
}

.item-name{

    text-align:center;

    font-size:12px;

    padding-bottom:10px;
}

/* =========================
   CHECK BADGE
========================= */

.check-badge{

    position:absolute;

    top:6px;
    right:6px;

    width:24px;
    height:24px;

    border-radius:50%;

    background:#00c853;

    color:white;

    display:flex;

    justify-content:center;
    align-items:center;

    font-weight:bold;
}

/* =========================
   SAVE SECTION
========================= */

.save-section{

    flex:1;

    overflow-y:auto;

    border-top:1px solid #eee;

    padding:15px;
}

.save-section h3{

    margin-bottom:15px;
}

/* =========================
   SAVE SLOT
========================= */

.save-slots{

    display:flex;

    flex-direction:column;

    gap:10px;
}

.slot{

    border:1px solid #e5e5e5;

    border-radius:12px;

    background:#fafafa;

    padding:12px;

    display:flex;

    flex-wrap:wrap;

    gap:8px;

    align-items:center;
}

.slot span{

    width:70px;

    font-weight:600;
}

.slot button{

    border:none;

    cursor:pointer;

    padding:8px 10px;

    border-radius:8px;

    transition:.2s;
}

.slot button:hover{

    opacity:.85;
}

.save-slot{

    background:#c8f7c5;
}

.load-slot{

    background:#d6e9ff;
}

.delete-slot{

    background:#ffd6d6;
}

/* =========================
   MOBILE
========================= */

@media (max-width:1024px){

    .app{

        flex-direction:column;
    }

    .sidebar{

        width:100%;

        height:420px;

        border-left:none;

        border-top:1px solid #ddd;
    }

    .character-container{

        width:90vw;
        height:90vw;
    }
}

@media (max-width:768px){

    .tabs{

        padding:10px;
    }

    .carousel-wrapper{

        padding:10px;
    }

    .item-card{

        width:100px;
    }

    .item-card img{

        height:100px;
    }

    .action-buttons{

        justify-content:center;
    }

    .action-buttons button{

        font-size:14px;
    }
}

@media (max-width:480px){

    .slot{

        flex-direction:column;

        align-items:flex-start;
    }

    .slot span{

        width:auto;
    }

    .sidebar{

        height:460px;
    }
}