.route1-pokedex {
    --r1-bg: #eef0f3;
    --r1-bg-deep: #f8f9fa;
    --r1-panel: #ffffff;
    --r1-panel-soft: #eceff2;
    --r1-panel-light: #dfe3e8;
    --r1-text: #202124;
    --r1-muted: #5f6368;
    --r1-red: #d9272e;
    --r1-red-bright: #f0444b;
    --r1-border: rgba(31, 35, 40, .14);
    width: 100%;
    max-width: 980px;
    min-width: 0;
    margin: 2rem auto;
    padding: clamp(1.15rem, 3vw, 2.5rem);
    color: var(--r1-text);
    background:
        radial-gradient(circle at top right, rgba(217, 39, 46, .10), transparent 38%),
        linear-gradient(145deg, var(--r1-bg-deep), var(--r1-bg) 62%, #e3e6ea);
    border: 1px solid var(--r1-border);
    border-top: 5px solid var(--r1-red);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(31, 35, 40, .16);
    font-family: inherit;
    overflow: hidden;
    container-type: inline-size;
}

.route1-pokedex,
.route1-pokedex * {
    box-sizing: border-box;
}

.route1-pokedex img {
    max-width: 100%;
}

.route1-pokedex__header {
    max-width: 720px;
    margin: 0 auto 1.5rem;
    text-align: center;
}

.route1-pokedex__eyebrow {
    display: inline-block;
    margin-bottom: .55rem;
    color: var(--r1-red-bright);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.route1-pokedex h2,
.route1-pokedex h3 {
    color: var(--r1-text);
    margin-top: 0;
}

.route1-pokedex h2 {
    margin-bottom: .55rem;
    font-size: clamp(2rem, 5vw, 3.15rem);
    line-height: 1.05;
}

.route1-pokedex__header p {
    margin: 0;
    color: var(--r1-muted);
    font-size: 1.02rem;
    line-height: 1.65;
}

.route1-pokedex__form {
    width: 100%;
    max-width: 700px;
    min-width: 0;
    margin: 0 auto;
}

.route1-pokedex__search-row {
    display: flex;
    width: 100%;
    min-width: 0;
    gap: .75rem;
}

.route1-pokedex__input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 0 1rem;
    color: #171717;
    background: #f7f7f7;
    border: 2px solid #c4c8ce;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
}

.route1-pokedex__input:focus {
    border-color: var(--r1-red-bright);
    box-shadow: 0 0 0 4px rgba(240, 68, 75, .18);
}

.route1-pokedex__button {
    flex: 0 0 auto;
    min-width: 120px;
    min-height: 54px;
    padding: 0 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, var(--r1-red-bright), #b61920);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(217, 39, 46, .25);
    transition: transform .15s ease, filter .15s ease;
}

.route1-pokedex__button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.route1-pokedex__button:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}

.route1-pokedex__hint {
    margin: .55rem 0 0;
    color: var(--r1-muted);
    font-size: .86rem;
    text-align: center;
}

.route1-pokedex__status {
    min-height: 2.2rem;
    margin: 1rem 0 .4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .6rem;
    text-align: center;
}

.route1-pokedex__status--error {
    color: #a9141b;
}

.route1-pokedex__status--loading {
    color: #b61920;
}

.route1-pokedex__spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(240, 68, 75, .24);
    border-top-color: var(--r1-red-bright);
    border-radius: 50%;
    animation: route1-spin .8s linear infinite;
}

@keyframes route1-spin {
    to { transform: rotate(360deg); }
}

.route1-pokedex__result {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.route1-pokedex__card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, .98);
    border: 1px solid var(--r1-border);
    border-radius: 20px;
    box-shadow: 0 14px 34px rgba(31, 35, 40, .14);
}

.route1-pokedex__image-panel,
.route1-pokedex__details {
    min-width: 0;
    max-width: 100%;
}

.route1-pokedex__image-panel {
    min-height: 350px;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at center, rgba(95, 99, 104, .14) 0 3px, transparent 4px),
        linear-gradient(145deg, #eef1f4, #d9dde2);
    background-size: 28px 28px, auto;
    border-right: 1px solid rgba(31, 35, 40, .10);
}

.route1-pokedex__artwork {
    display: block;
    width: 100%;
    max-width: 330px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 16px 16px rgba(31, 35, 40, .22));
}

.route1-pokedex__no-image {
    font-size: 6rem;
    font-weight: 900;
    color: rgba(31, 35, 40, .28);
}

.route1-pokedex__details {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.35rem, 4vw, 2.4rem);
    overflow: hidden;
}

.route1-pokedex__number {
    max-width: 100%;
    color: var(--r1-red-bright);
    font-weight: 900;
    letter-spacing: .035em;
    overflow-wrap: anywhere;
}

.route1-pokedex__details h3 {
    max-width: 100%;
    margin: .25rem 0 .65rem;
    font-size: clamp(2rem, 8cqw, 3.2rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
    word-break: normal;
}

.route1-pokedex__types {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.15rem;
}

.route1-pokedex__type {
    display: inline-flex;
    padding: .35rem .72rem;
    border-radius: 999px;
    color: white;
    background: #666;
    border: 1px solid rgba(255, 255, 255, .28);
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.route1-pokedex__type--normal{background:#77736d}.route1-pokedex__type--fire{background:#d74228}.route1-pokedex__type--water{background:#386fa8}.route1-pokedex__type--electric{background:#b99116}.route1-pokedex__type--grass{background:#487f4b}.route1-pokedex__type--ice{background:#4f8f94}.route1-pokedex__type--fighting{background:#963b34}.route1-pokedex__type--poison{background:#7b3d86}.route1-pokedex__type--ground{background:#967437}.route1-pokedex__type--flying{background:#6879ac}.route1-pokedex__type--psychic{background:#b83f69}.route1-pokedex__type--bug{background:#74831f}.route1-pokedex__type--rock{background:#7f6c31}.route1-pokedex__type--ghost{background:#504372}.route1-pokedex__type--dragon{background:#52399b}.route1-pokedex__type--dark{background:#493e39}.route1-pokedex__type--steel{background:#6d7283}.route1-pokedex__type--fairy{background:#ad5d81}

.route1-pokedex__description {
    max-width: 100%;
    margin: 0;
    color: #3c4043;
    line-height: 1.72;
    font-size: 1.04rem;
    overflow-wrap: break-word;
}

.route1-pokedex__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    width: 100%;
    min-width: 0;
    margin: 1.25rem 0 0;
}

.route1-pokedex__stats div {
    min-width: 0;
    padding: .8rem 1rem;
    background: #f1f3f4;
    border-left: 3px solid var(--r1-red);
    border-radius: 10px;
}

.route1-pokedex__stats dt {
    color: var(--r1-muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.route1-pokedex__stats dd {
    max-width: 100%;
    margin: .2rem 0 0;
    color: #202124;
    font-weight: 800;
    overflow-wrap: anywhere;
}

/* Stack the card according to the plugin's actual available width,
   not the width of the visitor's entire monitor. */
@container (max-width: 700px) {
    .route1-pokedex__search-row {
        flex-direction: column;
    }

    .route1-pokedex__button {
        width: 100%;
    }

    .route1-pokedex__card {
        grid-template-columns: 1fr;
    }

    .route1-pokedex__image-panel {
        min-height: 280px;
        border-right: 0;
        border-bottom: 1px solid rgba(31, 35, 40, .10);
    }
}

/* Browser-width fallback for older browsers without container queries. */
@media (max-width: 720px) {
    .route1-pokedex {
        border-radius: 16px;
    }

    .route1-pokedex__search-row {
        flex-direction: column;
    }

    .route1-pokedex__button {
        width: 100%;
    }

    .route1-pokedex__card {
        grid-template-columns: 1fr;
    }

    .route1-pokedex__image-panel {
        min-height: 280px;
        border-right: 0;
        border-bottom: 1px solid rgba(31, 35, 40, .10);
    }
}

@container (max-width: 430px) {
    .route1-pokedex__stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .route1-pokedex__stats {
        grid-template-columns: 1fr;
    }
}
