:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #182033;
  --muted: #667085;
  --line: #d8dee9;
  --red: #d64045;
  --gold: #f2b705;
  --blue: #246bfe;
  --green: #0f8f72;
  --shadow: 0 12px 28px rgba(24, 32, 51, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(214, 64, 69, 0.1), transparent 250px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 4vw, 56px) 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

main {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto 48px;
}

.progress-panel {
  display: grid;
  min-width: 148px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: right;
}

.progress-panel span:first-child {
  font-size: 2rem;
  font-weight: 800;
}

.progress-panel span:nth-child(2) {
  color: var(--muted);
}

.progress-panel strong {
  color: var(--green);
}

.controls,
.summary-row,
.pagination {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.controls {
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.search-field {
  flex: 1 1 250px;
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 0 14px;
}

button:hover {
  border-color: var(--blue);
}

.summary-row {
  justify-content: space-between;
  margin: 16px 0;
}

.summary-row p {
  margin: 0;
  color: var(--muted);
}

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

.pokemon-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  min-height: 214px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(24, 32, 51, 0.06);
}

.pokemon-card.caught {
  border-color: rgba(15, 143, 114, 0.5);
  background: linear-gradient(180deg, rgba(15, 143, 114, 0.08), #fff 110px);
}

.sprite-box {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 8px;
  background: #eef2f8;
}

.sprite-box img {
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.card-main {
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  margin: 0;
  font-size: 1.08rem;
}

.dex-line {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.star {
  width: 38px;
  min-width: 38px;
  padding: 0;
  color: #8a94a6;
  font-size: 1.22rem;
}

.star.active {
  border-color: rgba(242, 183, 5, 0.45);
  color: var(--gold);
  background: rgba(242, 183, 5, 0.12);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  color: var(--ink);
  font-weight: 800;
}

.check-row input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--green);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.chip {
  border-radius: 999px;
  background: #edf1f7;
  color: #344054;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 8px;
}

.locations {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.locations strong {
  color: var(--ink);
}

.pagination {
  justify-content: center;
  margin-top: 18px;
}

.pagination span {
  min-width: 130px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 680px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-panel {
    text-align: left;
  }

  .controls,
  .summary-row {
    align-items: stretch;
    flex-direction: column;
  }

  label,
  input,
  select,
  button {
    width: 100%;
  }

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