/* Counting Safari Game Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #10B981;
    --primary-light: #6EE7B7;
    --secondary: #F59E0B;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-muted: #64748B;
    --success: #10B981;
    --error: #EF4444;
    --savanna: #FEF3C7;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(180deg, #87CEEB 0%, #98D8AA 50%, #C4A574 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#game-container {
    width: 100%;
    max-width: 600px;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header */
#game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--background);
    border-bottom: 1px solid #E5E7EB;
}

.game-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

.stats {
    display: flex;
    gap: 24px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface);
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.icon-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Game Area */
#game-area {
    padding: 20px;
}

/* Question */
.question {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--savanna) 0%, #FDE68A 100%);
    border-radius: 16px;
    margin-bottom: 20px;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.animal-icon {
    font-size: 32px;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Safari Scene */
.safari-scene {
    position: relative;
    height: 250px;
    background: linear-gradient(180deg,
            #87CEEB 0%,
            #98FB98 40%,
            #C4A574 100%);
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 4px solid #8B4513;
}

.safari-scene::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(180deg, transparent 0%, #C4A574 100%);
}

.safari-animal {
    position: absolute;
    font-size: 40px;
    cursor: default;
    user-select: none;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s;
}

.safari-animal:hover {
    transform: scale(1.2);
}

.safari-animal.counted {
    animation: pop 0.3s ease;
}

@keyframes pop {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* Decorative elements */
.tree {
    position: absolute;
    font-size: 60px;
    opacity: 0.7;
    pointer-events: none;
}

/* Answers */
.answers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.answer-btn {
    padding: 20px;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    background: var(--surface);
    border: 3px solid var(--primary-light);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.answer-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
    border-color: var(--primary);
}

.answer-btn.correct {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border-color: var(--success);
    animation: celebrate 0.5s ease;
}

.answer-btn.wrong {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-color: var(--error);
    animation: shake 0.5s ease;
}

@keyframes celebrate {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Feedback */
.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 24px 48px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    z-index: 50;
    animation: popIn 0.3s ease;
}

.feedback.hidden {
    display: none;
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.stars {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-content h2 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 32px;
}

.result-stat {
    display: flex;
    flex-direction: column;
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.result-label {
    font-size: 14px;
    color: var(--text-muted);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--background);
    color: var(--text);
    border: 2px solid #E5E7EB;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Responsive */
@media (max-width: 480px) {
    .safari-scene {
        height: 200px;
    }

    .safari-animal {
        font-size: 32px;
    }

    .answers {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .answer-btn {
        padding: 16px;
        font-size: 22px;
    }

    .stats {
        gap: 12px;
    }

    .stat-value {
        font-size: 16px;
    }
}