* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.25), transparent 30%),
        radial-gradient(circle at bottom right, rgba(239, 68, 68, 0.22), transparent 28%),
        #020617;
    background-attachment: fixed;
    color: #e5e7eb;
}

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

.navbar {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 800;
    letter-spacing: -0.03em;
}

nav {
    display: flex;
    gap: 18px;
    color: #94a3b8;
}

nav a:hover {
    color: #f8fafc;
}

.hero {
    width: min(1120px, calc(100% - 32px));
    min-height: calc(100vh - 96px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 32px;
    align-items: center;
}

.hero-content,
.panel,
.hero-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
    border-radius: 28px;
}

.hero-content {
    padding: 56px;
}

.hero-card {
    padding: 32px;
}

.eyebrow {
    margin: 0 0 14px;
    color: #60a5fa;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(40px, 7vw, 76px);
    line-height: 0.95;
    letter-spacing: -0.07em;
}

h2 {
    margin: 12px 0;
}

.hero-text,
.subtitle {
    color: #94a3b8;
    line-height: 1.7;
}

.hero-text {
    max-width: 680px;
    margin: 24px 0 0;
    font-size: 18px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.button,
button {
    border: 0;
    border-radius: 999px;
    padding: 13px 20px;
    font-weight: 800;
    cursor: pointer;
}

.primary,
button {
    background: #ef4444;
    color: white;
}

.secondary {
    background: rgba(148, 163, 184, 0.14);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.pokeball {
    width: 104px;
    height: 104px;
    border-radius: 999px;
    background:
        linear-gradient(#ef4444 0 48%, #111827 48% 52%, #f8fafc 52%),
        #f8fafc;
    position: relative;
    box-shadow: 0 20px 50px rgba(239, 68, 68, 0.22);
}

.pokeball::after {
    content: "";
    position: absolute;
    inset: 35px;
    border-radius: 999px;
    background: #020617;
    border: 8px solid #f8fafc;
}

.hero-card ul {
    padding-left: 20px;
    color: #cbd5e1;
    line-height: 1.9;
}

.page {
    width: min(720px, calc(100% - 32px));
    margin: 0 auto;
    padding: 64px 0;
}

.panel {
    padding: 36px;
}

.search-form {
    display: flex;
    gap: 12px;
    margin-top: 26px;
}

input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.72);
    color: #f8fafc;
    font-size: 16px;
}

input::placeholder {
    color: #64748b;
}

.message {
    min-height: 24px;
    margin: 18px 0;
    color: #fca5a5;
    font-weight: 700;
}

.pokemon-card {
    margin-top: 24px;
    text-align: center;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    padding-top: 24px;
}

.pokemon-card img {
    width: 148px;
    height: 148px;
    image-rendering: pixelated;
    filter: drop-shadow(0 20px 32px rgba(96, 165, 250, 0.28));
}

.details {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    color: #cbd5e1;
}

.stats {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stats li {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    padding: 10px;
}

.hidden {
    display: none;
}

@media (max-width: 820px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 32px 0;
    }

    .hero-content {
        padding: 36px;
    }

    .search-form {
        flex-direction: column;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}

.wide {
    width: min(1120px, calc(100% - 32px));
}

.pokemon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.pokemon-list-card {
    display: grid;
    place-items: center;
    padding: 22px 16px;
    min-height: 190px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background:
        radial-gradient(circle at top, rgba(96, 165, 250, 0.16), transparent 55%),
        rgba(15, 23, 42, 0.92);
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.pokemon-list-card:hover {
    transform: translateY(-4px);
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.2);
}

.pokemon-list-card img {
    width: 96px;
    height: 96px;
    image-rendering: pixelated;
    filter: drop-shadow(0 14px 24px rgba(96, 165, 250, 0.26));
}

.pokemon-list-card h2 {
    margin: 8px 0 0;
    font-size: 18px;
    text-align: center;
}

.pokemon-list-card p {
    margin: 4px 0 0;
    color: #94a3b8;
    font-weight: 700;
}

.back-link {
    display: inline-flex;
    margin-bottom: 24px;
    color: #93c5fd;
    font-weight: 800;
}

.pokemon-detail {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 32px;
    align-items: start;
    margin-top: 28px;
}

.pokemon-visual {
    margin-top: 0;
    position: sticky;
    top: 24px;
}

.pokemon-visual img {
    width: 220px;
    height: 220px;
    image-rendering: pixelated;
    filter: drop-shadow(0 22px 38px rgba(96, 165, 250, 0.3));
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.info-grid article {
    padding: 18px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.info-grid span {
    display: block;
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.info-grid strong {
    color: #f8fafc;
}

.detail-stats li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

@media (max-width: 820px) {
    .pokemon-detail {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

.pill-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill-list li {
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.25);
    color: #dbeafe;
    font-weight: 800;
}

.detail-stats {
    margin-bottom: 28px;
}

.detail-stats li {
    display: grid;
    grid-template-columns: 150px 1fr 92px;
    align-items: center;
}

.detail-stats strong {

    white-space: nowrap;

}

.stat-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.stat-bar div {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa, #ef4444);
}

.detail-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 32px;
}

.detail-stats li {
    display: grid;
    grid-template-columns: 150px 1fr 72px;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
}

.stat-name {
    color: #cbd5e1;
    font-weight: 800;
    text-transform: capitalize;
}

.stat-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.stat-bar div {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa, #ef4444);
}

.detail-stats strong {
    text-align: right;
    color: #f8fafc;
}

.pokemon-info h2 {
    margin: 32px 0 14px;
}

.pokemon-info .pill-list {
    margin: 0 0 28px;
}

.pokemon-info .detail-stats {
    margin: 0 0 32px;
}

.pokemon-info {
    align-self: start;
}

.pokemon-info h2:first-of-type {
    margin-top: 0;
}

.pokemon-profile-card {
    display: grid;
    gap: 18px;
}

.profile-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
}

.profile-info-grid article:nth-child(2) {
    grid-column: span 2;
}

.pokemon-detail {
    grid-template-columns: 0.7fr 1.3fr;
    align-items: start;
}

.detail-stats li {
    grid-template-columns: 150px 1fr 92px;
}

.detail-stats strong {
    white-space: nowrap;
}

.home-page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 64px 0;
}

.home-intro {
    max-width: 840px;
    margin-bottom: 40px;
}

.type-section {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
    border-radius: 28px;
    padding: 36px;
}

.section-heading {
    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 0;
    font-size: 32px;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
}

.type-card {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: white;
    font-weight: 900;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition:
        transform 160ms ease,
        filter 160ms ease,
        box-shadow 160ms ease;
}

.type-card:hover {
    transform: translateY(-3px);
    filter: brightness(1.08);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.type-normal {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.type-fire {
    background: linear-gradient(135deg, #f97316, #dc2626);
}

.type-water {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.type-electric {
    background: linear-gradient(135deg, #facc15, #f59e0b);
}

.type-grass {
    background: linear-gradient(135deg, #22c55e, #15803d);
}

.type-ice {
    background: linear-gradient(135deg, #67e8f9, #0891b2);
}

.type-fighting {
    background: linear-gradient(135deg, #ef4444, #991b1b);
}

.type-poison {
    background: linear-gradient(135deg, #a855f7, #6b21a8);
}

.type-ground {
    background: linear-gradient(135deg, #d97706, #92400e);
}

.type-flying {
    background: linear-gradient(135deg, #93c5fd, #6366f1);
}

.type-psychic {
    background: linear-gradient(135deg, #f472b6, #be185d);
}

.type-bug {
    background: linear-gradient(135deg, #84cc16, #4d7c0f);
}

.type-rock {
    background: linear-gradient(135deg, #a8a29e, #57534e);
}

.type-ghost {
    background: linear-gradient(135deg, #818cf8, #4338ca);
}

.type-dragon {
    background: linear-gradient(135deg, #7c3aed, #1d4ed8);
}

.type-dark {
    background: linear-gradient(135deg, #374151, #030712);
}

.type-steel {
    background: linear-gradient(135deg, #cbd5e1, #64748b);
}

.type-fairy {
    background: linear-gradient(135deg, #f9a8d4, #ec4899);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 36px;
}

.about-grid article {
    padding: 22px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.about-grid p {
    color: #94a3b8;
    line-height: 1.7;
}

.load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}


.sprite-placeholder {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: #cbd5e1;
  font-weight: 900;
}

.sprite-placeholder span {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background:
    linear-gradient(#ef4444 0 47%, #111827 47% 53%, #f8fafc 53%);
  border: 3px solid #111827;
  position: relative;
}

.sprite-placeholder span::after {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 999px;
  background: #f8fafc;
  border: 5px solid #111827;
}

.sprite-placeholder small {
  color: #94a3b8;
}