:root {
    --bg: #0f1724;
    --panel: #0b1220;
    --accent: #ffd166;
    --muted: #0b1220;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #071129 0%, #0b1220 60%);
    color: white;
}

.app {
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-columns: 33% 33% 33%; /* center column has min width */
    align-items: center;
    justify-items: center;
    gap: 12px;
    padding: 18px;
    box-sizing: border-box;
}


.animal,
.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.animal {
    width: 90%;
    /* scale to fit column */
    max-width: 100%;
    /* ensure it never overflows */
    aspect-ratio: 1 / 1;
    /* keep square */
    border-radius: 18px;
    background: white;
    backdrop-filter: blur(2px);
    box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, outline-color .12s;
}

.animal:active {
    transform: scale(.9);
}

.animal.focus {
    outline: 4px solid rgba(255, 209, 102, 0.08);
}

.animal img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(2, 6, 23, 0.6));
}

.animal .label {
    margin-top: 8px;
    font-size: 20px;
    color: var(--muted);
    text-align: center;
    text-transform: capitalize;
}

.center {
    width: 100%;
    max-width: 100%;
    text-align: center;
    gap: 12px;
}

.sentence-wrap {
    width: 90%;
    display: grid;
    place-items: center;
}

.sentence {
    font-weight: 700;
    font-size: clamp(20px, 4vw, 48px);
    line-height: 1.1;
    padding: 12px 18px;
    border-radius: 12px;
    color: #061024;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.92));
    box-shadow: 0 10px 40px rgba(2, 6, 23, 0.5);
    max-width: 36ch;
    transform-origin: center;
    opacity: 0;
}

.sentence.show {
    animation: popIn .9s cubic-bezier(.16, 1, .3, 1) forwards;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(.96);
    }

    60% {
        opacity: 1;
        transform: translateY(-6px) scale(1.02);
    }

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

.controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent);
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

button.secondary {
    background: transparent;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.04);
}