:root {
  --bg: #f3efee;
  --surface: #ffffff;
  --surface-soft: #f7f4f3;
  --surface-mid: #ece8e7;
  --primary: #c31625;
  --primary-strong: #ee1515;
  --secondary: #30a7d7;
  --text: #1b1c1c;
  --muted: #5d4b49;
  --outline: #dbc7c5;
  --error: #ba1a1a;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 75, 75, 0.14), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(48, 167, 215, 0.12), transparent 24%),
    linear-gradient(180deg, #f7f3f2 0%, var(--bg) 100%);
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 30px rgba(184, 17, 32, 0.22);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar__dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 30%, #ffffff 0 14%, transparent 15%),
    linear-gradient(180deg, #ffffff 0 46%, #2f2f2f 46% 54%, #ffffff 54% 100%);
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.16),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
}

.topbar__dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #f7f7f7;
  border: 1px solid #333;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.topbar__kicker {
  margin: 0 0 2px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.topbar h1 {
  margin: 0;
  font-family: "Quicksand", sans-serif;
  font-size: 26px;
  line-height: 1;
}

.topbar__badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.app-shell {
  display: grid;
  place-items: center;
  padding: 32px 16px 48px;
}

.pokedex {
  width: min(100%, 460px);
  background: linear-gradient(180deg, #d01a2b 0%, #ac1220 100%);
  border-radius: 34px;
  padding: 12px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.pokedex__screen {
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
  border-radius: 26px;
  padding: 18px;
  border: 1px solid rgba(27, 28, 28, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.pokedex__intro {
  padding: 4px 2px 18px;
}

.pokedex__eyebrow {
  margin: 0 0 6px;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pokedex__intro h2 {
  margin: 0 0 6px;
  font-family: "Quicksand", sans-serif;
  font-size: 28px;
  line-height: 1.1;
}

.pokedex__intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.search,
.message,
.pokemon-card,
.details {
  position: relative;
}

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.search__field {
  position: relative;
}

.search__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
}

.search input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.search input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(48, 167, 215, 0.18);
}

.search__button {
  border: 0;
  border-radius: 18px;
  padding: 0 20px;
  background: var(--primary-strong);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

.search__button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.search__button:active {
  transform: translateY(1px);
}

.message {
  min-height: 24px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.message.is-error {
  color: var(--error);
  font-weight: 700;
}

.pokemon-card {
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  border-radius: 26px;
  padding: 18px;
  border: 1px solid rgba(228, 189, 186, 0.65);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

.pokemon-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pokemon-card__number {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--secondary);
}

.pokemon-card__name {
  margin: 0;
  font-family: "Quicksand", sans-serif;
  font-size: clamp(24px, 6vw, 32px);
  line-height: 1.1;
}

.pokemon-card__types {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.type-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.pokemon-card__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(97, 205, 254, 0.28), transparent 42%),
    linear-gradient(180deg, rgba(48, 167, 215, 0.1), rgba(255, 255, 255, 0.5));
}

.pokemon-card__glow {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 170px;
  height: 170px;
  transform: translate(-50%, -50%);
  background: rgba(97, 205, 254, 0.24);
  filter: blur(38px);
  border-radius: 50%;
}

.pokemon-card__image {
  position: relative;
  z-index: 1;
  width: min(78%, 320px);
  height: min(78%, 320px);
  object-fit: contain;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.14));
  animation: float 3.6s ease-in-out infinite;
  transition: transform 0.25s ease;
}

.pokemon-card__visual:hover .pokemon-card__image {
  transform: scale(1.04);
}

.pokemon-card__placeholder {
  position: relative;
  z-index: 1;
  max-width: 220px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}

.details {
  margin-top: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
  border-radius: 24px;
  padding: 18px;
  border: 1px solid rgba(228, 189, 186, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

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

.detail--full {
  grid-column: 1 / -1;
}

.detail {
  padding-top: 12px;
  border-top: 1px solid var(--surface-mid);
}

.detail__label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail__value {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 700;
}

.stats {
  display: grid;
  gap: 12px;
}

.stat {
  display: grid;
  gap: 6px;
}

.stat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat__name,
.stat__value {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat__value {
  color: var(--text);
}

.stat__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 85, 114, 0.12);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.07);
}

.stat__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #30a7d7, #61cdfe);
  transition: width 0.35s ease;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-12px) rotate(1deg);
  }
}

@media (max-width: 420px) {
  .topbar {
    padding: 14px 16px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .pokedex {
    border-radius: 30px;
    padding: 10px;
  }

  .pokedex__screen,
  .details {
    border-radius: 22px;
  }

  .pokedex__intro h2 {
    font-size: 24px;
  }

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

  .search__button {
    height: 46px;
  }
}
