:root {
    color-scheme: light;
    --cream: #fff9f1;
    --orange: #e99b65;
    --green: #a7c7a1;
    --ink: #38332f
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: radial-gradient(ellipse at 90% 5%, #e6efd9 0, transparent 42%), var(--cream);
    color: var(--ink);
    font: 15px/1.65 system-ui, sans-serif
}

main {
    max-width: 480px;
    padding: 18px 20px 40px;
    margin: auto
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px
}

header img {
    width: 104px;
    height: auto
}

select {
    max-width: 155px;
    padding: 8px;
    border: 1px solid #dfd8ca;
    border-radius: 10px;
    background: #fff;
    color: var(--ink)
}

.intro {
    text-align: center
}

h1 {
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -1px;
    margin: 12px 0
}

h2 {
    font-size: 19px
}

p {
    margin: 10px 0
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 3px;
    color: #937157
}

.subtitle {
    font-size: 18px;
    font-weight: 600
}

.muted {
    color: #776e63;
    font-size: 13px
}

.card {
    background: #fff;
    border: 1px solid #ecdfce;
    border-radius: 24px;
    padding: 22px;
    margin: 20px 0;
    box-shadow: 0 12px 32px #76543208
}

.hero {
    width: 210px;
    height: 210px;
    object-fit: contain;
    border-radius: 38px;
    margin: 12px auto
}

.photo {
    display: block;
    max-width: 100%;
    max-height: 270px;
    object-fit: contain;
    border-radius: 18px;
    margin: 10px auto
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

button,
.button,
.file-label {
    font: inherit;
    border: 0;
    cursor: pointer;
    border-radius: 14px;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    color: var(--ink);
    background: #f1eddf
}

.primary {
    background: var(--orange);
    font-weight: 700;
    width: 100%;
    margin-top: 14px;
    box-shadow: 0 6px 15px #e99b6526
}

button:disabled {
    opacity: .45;
    cursor: wait
}

.file-label {
    flex: 1;
    background: #edf2e6
}

input[type=file] {
    width: 100%;
    font-size: 13px;
    margin: 10px 0
}

.animals {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px
}

.animal {
    text-align: center;
    font-size: 12px
}

.animal img {
    width: 100%;
    border-radius: 15px
}

.notice {
    font-size: 12px;
    background: #edf2e6;
    padding: 14px;
    border-radius: 14px
}

.rank {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 16px;
    align-items: center
}

.rank img {
    width: 80px;
    border-radius: 16px
}

.rank.first {
    display: block;
    text-align: center
}

.rank.first img {
    width: 165px
}

.score {
    color: #aa602d;
    font-size: 30px;
    font-weight: 800
}

.score small {
    font-size: 12px
}

.rank h2 {
    margin: 0
}

.evidence {
    font-size: 12px;
    background: #fff9f1;
    border-radius: 12px;
    padding: 12px;
    text-align: left
}

.evidence p {
    margin: 5px 0
}

#status {
    white-space: pre-line;
    color: #a2482e;
    font-size: 14px
}

#loading {
    text-align: center;
    padding: 25px
}

.paw {
    font-size: 42px;
    animation: pulse 1.2s infinite
}

@keyframes pulse {
    50% {
        opacity: .35;
        transform: translateY(-7px)
    }
}

[hidden] {
    display: none !important
}

footer {
    text-align: center;
    font-size: 12px;
    color: #776e63;
    margin: 28px 0
}

a {
    color: inherit
}

:focus-visible {
    outline: 3px solid #69875f;
    outline-offset: 3px
}

@media(prefers-reduced-motion:reduce) {
    .paw {
        animation: none
    }
}

@media(max-width:350px) {
    main {
        padding: 12px
    }

    .animals {
        grid-template-columns: repeat(3, 1fr)
    }

    h1 {
        font-size: 25px
    }
}

body h1 {
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -1px;
    margin: 12px 0;
    font-weight: 700
}

body h2 {
    font-size: 19px;
    font-weight: 700
}

body p {
    margin: 10px 0
}

body header img {
    width: 104px;
    height: auto
}

body select {
    padding: 8px;
    border: 1px solid #dfd8ca;
    border-radius: 10px;
    background: #fff
}

body input[type=file] {
    margin: 10px 0
}

body button {
    font: inherit
}

body .rank h2 {
    margin: 0
}

body .evidence p {
    margin: 5px 0
}

@media(max-width:350px) {
    body h1 {
        font-size: 25px
    }
}