:root {
    --primary-color: #2a9d8f;
    --secondary-color: #e9c46a;
    --background-color: #264653;
    --text-color: #ffffff;
    --correct-color: #2a9d8f;
    --incorrect-color: #e76f51;
    --placeholder-bg: rgba(255, 255, 255, 0.1);
    --card-bg: #2f5261;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow-y: auto;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

h1 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
}

input[type="text"] {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 1rem;
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.player-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

button {
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #238276;
}

/* Game Screen */
.scores {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
    gap: 1rem;
}

.player-info {
    flex: 1;
    padding: 0.8rem;
    background-color: var(--background-color);
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.player-info.current-player {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

.player-info span {
    display: block;
}

.player-info span:first-child {
    font-weight: 600;
}
.player-info span:last-child {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

#turn-indicator {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

#message-area {
    min-height: 24px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.game-area {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 10px; /* for scrollbar */
}

#animal-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.animal-card {
    background-color: var(--correct-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    color: var(--text-color);
    text-transform: capitalize;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.input-area {
    display: flex;
    gap: 1rem;
}

.remaining-text {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

#end-screen button {
    margin-top: 1rem;
}

/* Responsive styles */
@media (min-width: 600px) {
    .container {
        padding: 2.5rem;
    }
    .player-inputs {
        flex-direction: row;
    }
}