:root {
    --pokedex-red: #e3350d;
    --pokedex-dark-red: #8b0000;
    --pokedex-bg: #111217;
    --screen-bg: #d4f7e6;
    --screen-border: #9bb8c1;
    --accent-blue: #2a75bb;
    --accent-yellow: #ffcb05;
    --accent-green: #3cba54;
    --text-main: #1b1b1b;
    --text-muted: #4b4b4b;
    --shadow-strong: 0 18px 40px rgba(0, 0, 0, 0.7);
}

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

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #2b3a67 0, #050816 45%, #02010a 100%);
    color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

a {
    color: inherit;
    text-decoration: none;
}

.pokedex-shell {
    width: min(1200px, 100vw - 32px);
    background: linear-gradient(145deg, var(--pokedex-red), #b9200c);
    border-radius: 32px;
    border: 3px solid #000;
    box-shadow: var(--shadow-strong);
    padding: 18px 22px 24px;
    position: relative;
    overflow: hidden;
}

.site-header,
.site-footer {
    width: min(1200px, 100vw - 32px);
}

.site-header-inner,
.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    color: #e5e7eb;
    font-size: 13px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: inherit;
}

.site-logo-mark {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff 0, #ffcb05 40%, #e3350d 80%);
    box-shadow: 0 0 0 2px #111827;
}

.site-logo-text {
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.site-nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.site-nav-link {
    padding: 4px 10px;
    border-radius: 999px;
    text-decoration: none;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.site-nav-link:hover {
    background: rgba(15, 23, 42, 0.6);
}

.site-nav-link-secondary {
    opacity: 0.85;
}

.site-footer-inner {
    font-size: 11px;
    color: rgba(229, 231, 235, 0.85);
}

.site-footer-text {
    white-space: nowrap;
}

.site-footer-secondary {
    opacity: 0.8;
}

.pokedex-top-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}

.pokedex-logo-light {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 25% 25%, #ffffff 0, #9ad0ff 30%, var(--accent-blue) 65%, #0b2340 100%);
    border: 4px solid #f5f5f5;
    box-shadow: 0 0 0 4px #1b2a40, 0 8px 16px rgba(0, 0, 0, 0.6);
}

.pokedex-indicators {
    display: flex;
    gap: 10px;
}

.indicator-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #000;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.indicator-dot.red { background: #ff4b4b; }
.indicator-dot.yellow { background: #ffd54f; }
.indicator-dot.green { background: #66bb6a; }

.pokedex-title-area {
    flex: 1;
    text-align: right;
}

.pokedex-title {
    font-size: 28px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    margin: 0;
    color: #fff;
    text-shadow: 0 3px 0 #000;
}

.pokedex-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.78);
}

.pokedex-body {
    display: block;
}

.screen {
    background: radial-gradient(circle at top left, #f7ffff 0, var(--screen-bg) 48%, #b0d7c6 100%);
    border-radius: 20px;
    border: 3px solid var(--screen-border);
    padding: 18px 18px 16px;
    position: relative;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.screen-inner {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    padding: 14px 14px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Use dark text inside light screens for proper contrast */
    color: var(--text-main);
}

.screen-label {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #405370;
}

.screen-label span {
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: rgba(255, 255, 255, 0.7);
}

.screen-shadow-bar {
    position: absolute;
    inset: auto 14px 10px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.08));
}

.search-header {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.search-field {
    flex: 1;
    position: relative;
}

.search-field input {
    width: 100%;
    border-radius: 999px;
    border: 0;
    padding: 10px 14px 10px 32px;
    font-size: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font-size: 13px;
    opacity: 0.6;
}

.search-button {
    border-radius: 999px;
    border: none;
    padding: 9px 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: #1b1b1b;
    background: linear-gradient(145deg, var(--accent-yellow), #ffb300);
    cursor: pointer;
    box-shadow: 0 3px 0 #b08000;
}

.search-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #b08000;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-pill {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    outline: none;
}

.filter-pill.active {
    background: linear-gradient(145deg, var(--accent-blue), #1d4ed8);
    color: #f9fafb;
    border-color: rgba(15, 23, 42, 0.4);
}

.filter-pill.active .filter-dot {
    border-color: rgba(15, 23, 42, 0.6);
}

.filter-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
}

.filter-dot.grass { background: #78c850; }
.filter-dot.fire { background: #f08030; }
.filter-dot.water { background: #6890f0; }
.filter-dot.electric { background: #f8d030; }
.filter-dot.psychic { background: #f85888; }
.filter-dot.dragon { background: #7038f8; }

.pokemon-grid {
    flex: 1;
    overflow: auto;
    padding-right: 4px;
}

.pokemon-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.pokemon-card {
    border-radius: 14px;
    padding: 10px 8px 9px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(234, 246, 243, 0.96));
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    position: relative;
}

.pokemon-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 55%);
    opacity: 0;
    transition: opacity 0.12s ease;
}

.pokemon-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
    border-color: rgba(0, 0, 0, 0.18);
}

.pokemon-card:hover::before {
    opacity: 1;
}

.pokemon-id {
    align-self: flex-start;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #7b8b8e;
}

.pokemon-sprite-wrapper {
    width: 88px;
    height: 88px;
    border-radius: 16px;
    background: radial-gradient(circle at top, #ffffff, #c9dee8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.pokemon-sprite {
    max-width: 80px;
    max-height: 80px;
    image-rendering: pixelated;
}

.pokemon-name {
    font-size: 14px;
    font-weight: 700;
    text-transform: capitalize;
    color: var(--text-main);
}

.type-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.type-badge {
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.type-badge.grass { background: #5dbb63; }
.type-badge.fire { background: #f48a45; }
.type-badge.water { background: #3b82f6; }
.type-badge.electric { background: #facc15; color: #1b1b1b; }
.type-badge.ice { background: #4fd1c5; }
.type-badge.fighting { background: #c53030; }
.type-badge.poison { background: #9f7aea; }
.type-badge.ground { background: #d97757; }
.type-badge.flying { background: #8b5cf6; }
.type-badge.psychic { background: #fb7185; }
.type-badge.bug { background: #84cc16; }
.type-badge.rock { background: #a16207; }
.type-badge.ghost { background: #6b21a8; }
.type-badge.dragon { background: #4c1d95; }
.type-badge.dark { background: #111827; }
.type-badge.steel { background: #9ca3af; color: #111827; }
.type-badge.fairy { background: #ec4899; }

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.detail-title {
    font-size: 22px;
    margin: 0;
    text-transform: capitalize;
    color: var(--text-main);
}

.detail-number {
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
    gap: 10px;
}

.detail-image-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.detail-main-sprite {
    width: 160px;
    height: 160px;
    border-radius: 28px;
    background: radial-gradient(circle at top, #ffffff, #c9dee8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.detail-main-sprite img {
    max-width: 136px;
    max-height: 136px;
    image-rendering: pixelated;
}

.detail-physical {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.detail-physical span {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
}

.detail-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.stat-row {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 11px;
}

.stat-name {
    width: 64px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.stat-bar-container {
    flex: 1;
    height: 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #16a34a, #15803d);
}

.stat-value {
    width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.chip {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-muted);
}

.abilities-list {
    font-size: 11px;
    margin: 0;
    padding-left: 16px;
    color: var(--text-main);
}

.nav-controls {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.nav-button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 10px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(145deg, #1f2937, #020617);
    color: #f9fafb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    box-shadow: 0 3px 0 #020617;
}

.nav-button.secondary {
    background: linear-gradient(145deg, #e5e7eb, #cbd5f5);
    color: #111827;
    box-shadow: 0 3px 0 #9ca3af;
}

.nav-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.6);
}

.pill-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
}

.pill-cta-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}

.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

.badge-small {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

@media (max-width: 960px) {
    .pokedex-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .pokedex-shell {
        padding: 14px 14px 18px;
        border-radius: 22px;
    }

    .pokedex-title {
        font-size: 22px;
        letter-spacing: 0.22em;
    }

    .pokedex-logo-light {
        width: 52px;
        height: 52px;
    }
}


