:root {
    --primary-color: #FF9F1C;
    --secondary-color: #FFBF69;
    --background-color: #CBF3F0;
    --text-color: #2EC4B6;
    --white: #ffffff;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    text-align: center;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    /* Increased max-width */
    width: 95%;
    position: relative;
}

header {
    position: relative;
    margin-bottom: 2rem;
}

header h1 {
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
}

header p {
    color: #888;
    font-size: 1.1rem;
    margin-top: 0;
}

#settings-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

#settings-btn:hover {
    opacity: 1;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Dynamic Grid for Animals */
.animals-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.animal-container {
    width: 200px;
    height: 200px;
    position: relative;
    transition: transform 0.3s ease;
}

.animal-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.animal-container.drag-over {
    transform: scale(1.1);
}

/* Eat animation */
.eating-anim {
    animation: chew 0.3s infinite alternate;
}

@keyframes chew {
    0% {
        transform: scaleY(1);
    }

    100% {
        transform: scaleY(0.95);
    }
}

/* Food Tray */
.food-tray {
    background-color: #eee;
    padding: 1rem 2rem;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    min-width: 300px;
}

.food-item {
    width: 80px;
    height: 80px;
    cursor: grab;
    transition: transform 0.2s;
    user-select: none;
    z-index: 100;
    /* Ensure draggable is on top */
}

.food-item:active {
    cursor: grabbing;
}

.food-item:hover {
    transform: scale(1.1);
}

.food-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.food-item.eaten {
    display: none;
}

/* Message Area */
#message-area {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease-out;
}

#message-area.hidden {
    display: none;
}

#message-area p {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

#reset-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 5px 0 #e08e1a;
    transition: transform 0.1s, box-shadow 0.1s;
}

#reset-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #e08e1a;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

#animal-selection-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
    text-align: left;
}

.animal-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 10px;
}

.animal-option:hover {
    background-color: #f0f0f0;
}

.animal-option img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.animal-option input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#save-settings {
    background-color: var(--text-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
}