* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.app {
    height: 100vh;
    display: grid;
    grid-template-columns: 220px 1fr 420px;
    gap: 12px;
    padding: 12px;
    background: #e9fbff;
}

.left,
.right,
.center {
    background: #ffffffcc;
    border: 1px solid #b8e8f2;
    border-radius: 12px;
    padding: 12px;
    overflow: hidden;
}

.left h1 {
    margin: 0 0 10px;
    font-size: 18px;
}

.categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    overflow: auto;
    max-height: calc(100vh - 120px);
    padding-right: 6px;
}

.catBtn {
    text-align: left;
    border: 1px solid #cfeef6;
    background: white;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
}

.catBtn.active {
    border-color: #31c3df;
    box-shadow: 0 0 0 2px #b6f0fb;
}

.hint {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.75;
}

.center {
    display: grid;
    grid-template-rows: 1fr auto;
}

.stage {
    display: grid;
    place-items: center;
    padding: 12px;
    overflow: hidden;
}

.doll {
    width: 260px;
    height: 360px;
    position: relative;
    background: #f6ffff;
    border: 1px dashed #b8e8f2;
    border-radius: 16px;
}

.doll img.layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    /* helps if pixel art */
    pointer-events: none;
}

.controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding-top: 8px;
}

.controls button {
    border: 1px solid #cfeef6;
    background: white;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.gridHeader {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.title {
    font-weight: 700;
}

.sub {
    font-size: 12px;
    opacity: 0.7;
}

.count {
    font-size: 12px;
    opacity: 0.8;
}

.grid {
    margin-top: 10px;
    overflow: auto;
    height: calc(100vh - 90px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding-right: 6px;
}

.card {
    border: 1px solid #cfeef6;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    background: white;
    display: grid;
    gap: 6px;
}

.card:hover {
    border-color: #31c3df;
}

.thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f3fbff;
    border-radius: 10px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

/* .thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
} */

.card .label {
    font-size: 11px;
    opacity: 0.8;
    word-break: break-word;
}

.gridActions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.miniBtn {
    border: 1px solid #cfeef6;
    background: white;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
}

.miniBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.description {
    font-size: 10px;
    font-family: verdana;
    margin-bottom: 8px;
}

.thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: translateY(-12%);
}

.loadMoreBtn {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #cfeef6;
    background: white;
    cursor: pointer;
}