:root {
    color-scheme: light dark;
    --type-color: #f5f5f5;
    --type-card-bg: #ffffff;
    --type-card-shadow: rgba(0, 0, 0, 0.1);
}

html,
body {
    height: 100%;
    margin: 0;
}
}

.title {
    margin: 8px 0 16px;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
    /* Pastel rainbow text */
    background: linear-gradient(90deg, #ff8da1, #ffd66b, #9be7ff, #c8a6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body {
    display: grid;
    place-items: center;
    background: var(--type-color);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.stats-widget .stats-reset {
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    cursor: pointer;
}

.stats-widget .stats-reset:hover {
    background: #fff;
}

.app {
    width: 100%;
    max-width: 420px;
    padding: 16px;
}

.info {
    .stats-widget .stats-reset {
        border-color: rgba(255, 255, 255, 0.2);
        background: rgba(50, 50, 50, 0.8);
        color: #eee;
    }

    .stats-widget .stats-reset:hover {
        background: rgba(60, 60, 60, 0.95);
    }

    display: none;
    /* hidden until reveal */
    background: color-mix(in oklab, var(--type-card-bg) 85%, #ffffff);
    border-radius: 12px;
    box-shadow: 0 6px 16px var(--type-card-shadow);
    padding: 12px 16px;
    margin: 0 0 16px;
    text-align: center;
}

.info.show {
    display: block;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    justify-content: center;
}

.label {
    color: #444;
    font-weight: 600;
}

.display-name {
    font-size: 1.4rem;
    font-weight: 800;
}

.types {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.strength {
    font-weight: 800;
    text-align: center;
}

.card {
    background: var(--type-card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 24px var(--type-card-shadow);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    outline: none;
}

.card:active {
    transform: scale(0.995);
}

#sprite {
    width: 100%;
    max-width: 320px;
    height: auto;
    image-rendering: crisp-edges;
}

.name {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 12px;
    letter-spacing: 0.06em;
}

.hint {
    margin-top: 8px;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 16px;
    /* add extra spacing above hint */

    /* Stats widget */
    .stats-widget {
        position: fixed;
        right: 12px;
        bottom: 12px;
        padding: 6px 10px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.85);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        font-size: 12px;
        color: #333;
        backdrop-filter: saturate(1.2) blur(6px);
    }

    .stats-widget .stat-item strong {
        font-weight: 700;
    }

    .stats-widget .divider {
        margin: 0 6px;
        color: #999;
    }

    @media (prefers-color-scheme: dark) {
        .stats-widget {
            background: rgba(30, 30, 30, 0.7);
            color: #ddd;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
        }

        .stats-widget .divider {
            color: #aaa;
        }
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background: color-mix(in oklab, var(--type-color) 35%, #121212);
    }

    .card {
        background: color-mix(in oklab, var(--type-card-bg) 65%, #1e1e1e);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    }

    .info {
        background: color-mix(in oklab, var(--type-card-bg) 35%, #1e1e1e);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    }

    .hint {
        color: #aaa;
    }
}