* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #fdf6f8;
    color: #444;
    margin: 0;
    height: 100vh;
    overflow: auto; /* Allow the page to scroll if content is large */
}

h1 {
    text-align: center;
    color: #d17b88;
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 24px;
}

#game-layout {
    display: grid;
    grid-template-columns: 275px 1fr 275px;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header header header"
        "left-bar stage right-bar"
        "footer footer footer";
    width: 100%;
    padding: 10px;
    gap: 10px;
}

#top-bar { grid-area: header; display: flex; gap: 10px; }
#left-bar { grid-area: left-bar; display: flex; flex-direction: column; gap: 10px; }
#doll-stage { grid-area: stage; }
#right-bar { grid-area: right-bar; display: flex; flex-direction: column; gap: 10px; }
#bottom-bar { grid-area: footer; display: flex; gap: 10px; }

/* Styling for all item panels */
#top-bar, #left-bar, #right-bar, #bottom-bar {
    overflow: auto;
}

.category-box {
    background-color: #fff;
    border: 1px solid #ffe4e8;
    border-radius: 8px;
    padding: 10px;
    flex-shrink: 0;
}

/* Specific styling for vertical vs horizontal bars */
#left-bar .category-box, #right-bar .category-box {
    flex-direction: column;
}
#top-bar .category-box, #bottom-bar .category-box {
    min-width: 250px;
}

.category-box h4 {
    margin: 0 0 10px 0;
    color: #d17b88;
    font-weight: 600;
    border-bottom: 1px solid #ffe4e8;
    padding-bottom: 5px;
    font-size: 14px;
}

.items-grid {
    display: flex;
    gap: 10px;
}

/* Vertical panels have wrapping grids */
#left-bar .items-grid, #right-bar .items-grid {
    flex-wrap: wrap;
}

/* Horizontal panels scroll horizontally */
#top-bar .items-grid, #bottom-bar .items-grid {
    overflow-x: auto;
    padding-bottom: 10px;
}

.draggable-item {
    cursor: grab;
    transition: transform 0.2s ease;
    width: 65px;
    height: 65px;
    object-fit: contain;
    background-color: #fdf6f8;
    border-radius: 4px;
}

.draggable-item:hover {
    transform: scale(1.1);
}

#doll-stage {
    border: 2px solid #ffb6c1;
    border-radius: 10px;
    position: relative;
    display: flex; /* Helps center the image */
    justify-content: center;
    align-items: center;
}

.doll-base-img {
    width: 1232px; /* Adjust the size of the base dolls */
    height: auto;
    position: relative;
    z-index: 0; /* Keep the base image at the bottom */
}
