:root {
    --primary-color: #583922; /* Pompompurin Brown */
    --secondary-color: #f9d423; /* Pompompurin Yellow */
    --background-color: #fff9e6; /* Light Cream */
    --text-color: #583922; /* Pompompurin Brown */
    --card-bg: #ffffff;
    --shadow: 0 4px 8px rgba(88, 57, 34, 0.15);
}

body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    text-align: center;
}

header {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    border-bottom: 5px solid var(--primary-color);
}

header h1 {
    margin: 0;
    font-weight: 700;
}

main {
    padding: 2rem 1rem;
}

#category-menu {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.category-button {
    background-color: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 150px;
    box-shadow: var(--shadow);
}

.category-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(88, 57, 34, 0.2);
}

.category-button.active {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.category-button img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    background-color: #ffeeb2;
    padding: 5px;
}

.category-button span {
    font-weight: bold;
    font-size: 1rem;
    color: var(--primary-color);
}

#collection-display {
    max-width: 1200px;
    margin: 0 auto;
}

.collection-content {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-in-out;
}

.collection-content.active {
    display: flex;
}

.collection-content h2 {
    width: 100%;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    margin-top: 0;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.collection-shelf {
    background-image: url('shelf.png');
    background-repeat: repeat-x;
    background-position: bottom;
    background-size: contain;
    width: 100%;
    padding: 2rem 1rem 4rem 1rem; /* Added more bottom padding for shelf */
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Align items to the bottom (on the shelf) */
    gap: 2rem;
    flex-wrap: wrap;
    min-height: 250px; /* Ensure shelf has height */
    box-sizing: border-box;
}

.figure-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 150px;
    transition: transform 0.2s ease;
    cursor: help;
}

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

.figure-item img {
    height: 150px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0px 5px 10px rgba(0,0,0,0.2)); /* Add a subtle shadow to figures */
    margin-bottom: 0.5rem;
}

.figure-item span {
    font-weight: bold;
    color: var(--primary-color);
    background-color: rgba(255, 249, 230, 0.8); /* Semi-transparent background for readability */
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.item-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.item-card:hover {
    transform: scale(1.05);
}

.item-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.item-card-info {
    padding: 1rem;
}

.item-card-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.item-card-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #a1887f;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}