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

:root {
    --bg: #020617;
    --card-bg: rgba(15, 23, 42, 0.96);
    --border-soft: rgba(148, 163, 184, 0.4);
    --accent: #22c55e;
    --accent-soft: rgba(34, 197, 94, 0.25);
    --wrong: #f97373;
    --correct: #22c55e;
    --text: #f9fafb;
    --muted: #9ca3af;
    --radius-xl: 26px;
    --radius-lg: 18px;
    --shadow-soft: 0 32px 90px rgba(15, 23, 42, 0.95);
    --transition-fast: 0.18s ease-out;
}

body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, #22c55e20, transparent 60%),
        radial-gradient(circle at bottom right, #0ea5e920, transparent 60%),
        var(--bg);
    display: flex;
    justify-content: center;
    padding: 18px;
}

.app {
    width: 100%;
    max-width: 760px;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.logo-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #22c55e, #0ea5e9);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.logo-text {
    font-size: 0.95rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.mini-label {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.card {
    padding: 20px 18px 18px;
    border-radius: var(--radius-xl);
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at 0% 0%, var(--accent-soft), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(34, 197, 94, 0.18), transparent 55%);
    opacity: 0.7;
    filter: blur(28px);
    z-index: -1;
}

.card-header {
    margin-bottom: 16px;
}

.card-header h1 {
    font-size: 1.4rem;
    font-weight: 650;
    margin-bottom: 4px;
}

.card-header p {
    font-size: 0.9rem;
    color: var(--muted);
}

.progress {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

.image-wrap {
    position: relative;
    margin-top: 16px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.9);
    background: radial-gradient(circle at 50% 0, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.96));
    aspect-ratio: 16 / 9;
}

#animal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

#animal-img.visible {
    opacity: 1;
}

.image-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        #1f2933 25%,
        #111827 40%,
        #1f2933 65%
    );
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    opacity: 0;
    pointer-events: none;
}

.image-skeleton.visible {
    opacity: 1;
}

.options {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.option-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition:
        background var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.option-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.8);
}

.option-btn:disabled {
    cursor: default;
    opacity: 0.95;
}

.option-btn.correct {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.9);
    color: #bbf7d0;
}

.option-btn.wrong {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.9);
    color: #fecaca;
}

.bottom-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.timer {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #22c55e, #0ea5e9);
    transition: width 0.15s linear;
}

.next-btn {
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.next-btn:hover:not(:disabled) {
    background: rgba(15, 23, 42, 1);
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.9);
}

.next-btn:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

.result {
    margin-top: 18px;
    padding: 10px 12px 4px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px dashed rgba(148, 163, 184, 0.6);
    animation: fadeInUp 0.25s ease-out;
}

.result h2 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.result p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.again-btn {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: transparent;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

.hidden {
    display: none;
}

/* anims */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    body { padding: 10px; }
    .card { padding: 16px 12px 14px; border-radius: 22px; }
    .card-header h1 { font-size: 1.25rem; }
}