body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #f0f0f0;
    min-height: 100vh;
    margin: 0;
}

h1 {
    font-family: 'Bangers', cursive;
    color: #333;
    font-size: 2.2em;
    letter-spacing: 2px;
}

#gameArea {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    flex-grow: 1;
}

#animalGrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.animal {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
}

.animal:hover {
    transform: scale(1.05);
}

.animal-emoji {
    font-size: 2.2em;
}

.animal-name {
    font-size: 0.8em;
    margin-top: 5px;
    text-align: center;
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
}

.selected-blue {
    box-shadow: 0 0 0 3px blue;
    border-radius: 10px;
}

.selected-red {
    box-shadow: 0 0 0 3px red;
    border-radius: 10px;
}

#mixButton, #startOverButton, #shareButton {
    font-size: 1.2em;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mixButton {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 480px;
}

#mixButton:hover, #startOverButton:hover, #shareButton:hover {
    background-color: #45a049;
}

#result {
    margin-top: 20px;
    font-size: 1.2em;
    text-align: center;
}

#generatedImage {
    max-width: 100%;
    height: auto;
    display: none;
    margin-top: 20px;
}

#startOverButton, #shareButton {
    display: none;
}

#buttonContainer {
    display: flex;
    justify-content: center;
    width: 100%;
}

@keyframes mixAnimation {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.mixing {
    position: fixed;
    top: 50%;
    left: 50%;
    animation: mixAnimation 2s linear infinite;
    background-color: rgba(76, 175, 80, 0.9);
    padding: 20px;
    border-radius: 10px;
    z-index: 1000;
}

.loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
