:root {
  --page: #f6f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #687284;
  --line: #dfe4ee;
  --accent: #e63946;
  --accent-dark: #bc2330;
  --focus: #2a9d8f;
  --shadow: 0 16px 36px rgba(34, 45, 72, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(42, 157, 143, 0.14), transparent 30%),
    linear-gradient(180deg, #eef3f8 0%, var(--page) 42%, #fff 100%);
  color: var(--ink);
  font-family: "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 300px);
  gap: 32px;
  align-items: center;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 28px;
}

.header-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: 0;
}

.header-copy p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.header-copy .maker-credit {
  margin-top: 10px;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.header-art {
  display: grid;
  place-items: center;
  width: min(240px, 55vw);
  min-height: min(240px, 55vw);
  justify-self: center;
}

.header-art > * {
  grid-area: 1 / 1;
}

.pokeball {
  position: relative;
  width: min(240px, 55vw);
  aspect-ratio: 1;
  border: 12px solid #202633;
  border-radius: 50%;
  background: linear-gradient(#e63946 0 47%, #202633 47% 53%, #fff 53% 100%);
  box-shadow: var(--shadow);
}

.pokeball span {
  position: absolute;
  inset: 50%;
  width: 76px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 10px solid #202633;
  border-radius: 50%;
  background: #fff;
}

.type-emblem {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  width: min(240px, 55vw);
  aspect-ratio: 1;
  border: 12px solid rgba(32, 38, 51, 0.9);
  border-radius: 50%;
  background: var(--type-color, var(--accent));
  color: #fff;
  box-shadow:
    var(--shadow),
    0 0 0 1px color-mix(in srgb, var(--type-color, var(--accent)) 72%, white) inset;
  text-align: center;
}

.type-emblem[hidden] {
  display: none;
}

.type-emblem span {
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  border: 8px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: var(--type-color, var(--accent));
  box-shadow:
    0 10px 22px color-mix(in srgb, var(--type-color, var(--accent)) 50%, transparent),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.type-emblem img {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: contain;
  image-rendering: auto;
}

.type-emblem strong {
  font-size: 1.2rem;
  line-height: 1;
}

.mega-emblem {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  width: min(240px, 55vw);
  aspect-ratio: 1;
  color: #202633;
  text-align: center;
}

.mega-emblem[hidden] {
  display: none;
}

.mega-emblem img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: var(--shadow);
}

.mega-emblem strong {
  position: absolute;
  bottom: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #202633;
  padding: 6px 12px;
  font-size: 0.92rem;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(34, 45, 72, 0.14);
}

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

.controls {
  display: grid;
  grid-template-columns: minmax(130px, 170px) minmax(220px, 1fr) repeat(4, minmax(116px, 170px));
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 26px rgba(43, 54, 79, 0.08);
  backdrop-filter: blur(10px);
}

.search-box,
.select-box {
  display: grid;
  gap: 7px;
}

.search-box span,
.select-box span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.18);
}

.status-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.status-row p {
  color: var(--muted);
  font-weight: 700;
}

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

.pokemon-card {
  min-width: 0;
  animation: cardEnter 240ms ease both;
  animation-delay: var(--card-delay, 0ms);
}

.card-button {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 245px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  color: inherit;
  text-align: left;
  box-shadow: 0 8px 18px rgba(34, 45, 72, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.card-button:hover {
  transform: translateY(-3px);
  border-color: rgba(230, 57, 70, 0.45);
  box-shadow: var(--shadow);
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pokemon-number {
  color: var(--muted);
  font-weight: 800;
}

.pokemon-image {
  width: 116px;
  height: 116px;
  justify-self: center;
  object-fit: contain;
  image-rendering: auto;
}

.pokemon-name {
  margin: 0;
  min-height: 32px;
  font-size: 1.05rem;
  line-height: 1.2;
  text-transform: capitalize;
}

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

.type-pill {
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.pokemon-dialog {
  position: relative;
  width: min(760px, calc(100% - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.pokemon-dialog::backdrop {
  background: rgba(17, 24, 39, 0.54);
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.dialog-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 22px;
  padding: 28px;
}

.dialog-layout.slide-from-left {
  animation: detailSlideLeft 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dialog-layout.slide-from-right {
  animation: detailSlideRight 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.detail-nav {
  position: absolute;
  top: 168px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 56px;
  height: 72px;
  border: 1px solid rgba(223, 228, 238, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 2.7rem;
  line-height: 1;
  transform: translateY(-50%);
  box-shadow: 0 8px 20px rgba(34, 45, 72, 0.08);
  opacity: 0.72;
  backdrop-filter: blur(8px);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.detail-nav:hover {
  border-color: rgba(230, 57, 70, 0.45);
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-dark);
  opacity: 1;
  transform: translateY(-50%) scale(1.03);
}

.detail-nav-prev {
  left: 10px;
}

.detail-nav-next {
  right: 10px;
}

@keyframes detailSlideLeft {
  from {
    opacity: 0;
    transform: translateX(-54px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes detailSlideRight {
  from {
    opacity: 0;
    transform: translateX(54px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.dialog-visual {
  position: relative;
  display: grid;
  place-items: center;
  align-self: stretch;
  border-radius: var(--radius);
  background: #f4f7fb;
  min-height: 260px;
  padding: 18px;
}

.dialog-visual img {
  width: 100%;
  height: 100%;
  max-width: 238px;
  max-height: 330px;
  object-fit: contain;
}

.cry-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(42, 157, 143, 0.34);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: var(--focus);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(34, 45, 72, 0.14);
  backdrop-filter: blur(8px);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.cry-button:hover {
  transform: translateY(-1px);
  border-color: rgba(42, 157, 143, 0.7);
  background: #fff;
}

.dialog-detail-sections {
  grid-column: 1 / -1;
}

.dialog-info h2 {
  margin: 4px 0 10px;
  font-size: 2rem;
  line-height: 1.1;
}

.name-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 14px;
}

.name-list div {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.name-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.name-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 1.05rem;
}

.ability-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.ability-list div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}

.ability-list span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.ability-list strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
}

.pokedex-description {
  margin: 0 0 18px;
}

.pokedex-description h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.pokedex-description p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 12px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.65;
}

.type-matchups {
  margin: 0 0 18px;
}

.type-matchups h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.matchup-list {
  display: grid;
  gap: 6px;
}

.matchup-group {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 9px 10px;
}

.matchup-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
}

.matchup-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.matchup-heading strong {
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.1);
  color: var(--focus);
  padding: 3px 7px;
  font-size: 0.72rem;
}

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

.matchup-none {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 560px) {
  .matchup-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.evolution-section {
  margin: 0 0 18px;
}

.evolution-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.section-loading,
.evolution-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.evolution-tree {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: 2px 12px 8px;
}

.evolution-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  width: max-content;
}

.evolution-node-branch {
  align-items: flex-start;
  width: min(100%, 680px);
}

.evolution-node-branch > .evolution-card {
  flex: 0 0 auto;
  margin-top: 6px;
}

.evolution-node-branch > .evolution-children {
  flex: 1;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  align-items: start;
  width: 100%;
  gap: 12px;
}

.evolution-node-branch > .evolution-children > .evolution-node {
  width: auto;
}

.evolution-node-branch > .evolution-children > .evolution-node > .evolution-card {
  width: 100%;
}

.evolution-node-branch > .evolution-children > .evolution-node::after {
  display: none;
}

.evolution-generation-groups {
  display: grid;
  gap: 12px;
  width: 100%;
}

.evolution-generation-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.evolution-generation-label {
  justify-self: end;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.1);
  color: var(--focus);
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.evolution-generation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
}

.evolution-generation-cards .evolution-node {
  width: auto;
}

.evolution-generation-cards .evolution-node::before,
.evolution-generation-cards .evolution-node::after {
  display: none;
}

.evolution-generation-cards .evolution-card {
  width: 100%;
}

.evolution-children {
  position: relative;
  display: grid;
  gap: 10px;
  padding-left: 22px;
}

.evolution-children::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--line);
}

.evolution-children > .evolution-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -22px;
  width: 22px;
  height: 2px;
  background: var(--line);
}

.evolution-children > .evolution-node:not(:only-child)::after {
  content: "";
  position: absolute;
  left: -22px;
  width: 2px;
  background: var(--line);
}

.evolution-children > .evolution-node:first-child::after {
  top: 50%;
  bottom: -5px;
}

.evolution-children > .evolution-node:last-child::after {
  top: -5px;
  bottom: 50%;
}

.evolution-children > .evolution-node:not(:first-child):not(:last-child)::after {
  top: -5px;
  bottom: -5px;
}

.evolution-card {
  position: relative;
  display: grid;
  gap: 6px;
  align-items: center;
  justify-items: center;
  width: 128px;
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: inherit;
  font: inherit;
  padding: 10px;
  text-align: center;
}

.evolution-card:hover:not(:disabled) {
  border-color: rgba(42, 157, 143, 0.55);
  box-shadow: 0 8px 18px rgba(34, 45, 72, 0.08);
}

.evolution-card:disabled {
  cursor: default;
  opacity: 0.72;
}

.evolution-trigger {
  min-height: 20px;
  max-width: 100%;
  display: inline-grid;
  gap: 2px;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.1);
  color: var(--focus);
  padding: 4px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
}

.evolution-trigger span {
  display: block;
}

.evolution-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.evolution-card strong {
  font-size: 0.86rem;
}

.form-section {
  margin: 0 0 18px;
}

.form-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.form-loading {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
}

.form-card {
  display: grid;
  gap: 6px;
  align-items: center;
  justify-items: center;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px;
  color: inherit;
  font: inherit;
  text-align: center;
}

.form-card:hover {
  border-color: rgba(230, 57, 70, 0.45);
  box-shadow: 0 8px 18px rgba(34, 45, 72, 0.08);
}

.form-card img {
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.form-card strong {
  font-size: 0.88rem;
}

.form-version-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.form-version-list em {
  max-width: 100%;
  border-radius: 999px;
  background: rgba(230, 57, 70, 0.08);
  color: var(--accent-dark);
  padding: 3px 7px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.stat-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.stat-row {
  display: grid;
  grid-template-columns: 90px 1fr 34px;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
}

.stat-bar {
  height: 8px;
  border-radius: 999px;
  background: #e7ebf3;
  overflow: hidden;
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2a9d8f, #e9c46a);
}

.move-section {
  margin-top: 18px;
}

.move-loading,
.move-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.move-details {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  overflow: hidden;
}

.move-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  padding: 12px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.move-details summary::marker {
  content: "";
}

.move-details summary::-webkit-details-marker {
  display: none;
}

.move-summary-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.move-summary-title::before {
  content: "";
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(42, 157, 143, 0.38);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.22)),
    rgba(42, 157, 143, 0.12);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.move-summary-title::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--focus);
  border-bottom: 2px solid var(--focus);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 160ms ease;
}

.move-details[open] .move-summary-title::before {
  border-color: rgba(42, 157, 143, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.16)),
    rgba(42, 157, 143, 0.18);
}

.move-details[open] .move-summary-title::after {
  transform: translateY(-35%) rotate(225deg);
}

.move-details summary small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: right;
}

.move-version-select {
  max-width: min(260px, 48vw);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 900;
}

.move-empty {
  padding: 0 12px 12px;
}

.move-tabs {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.move-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.move-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.move-tab-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
}

.move-tab-input:nth-of-type(1):checked ~ .move-tab-list .move-tab-button:nth-child(1),
.move-tab-input:nth-of-type(2):checked ~ .move-tab-list .move-tab-button:nth-child(2),
.move-tab-input:nth-of-type(3):checked ~ .move-tab-list .move-tab-button:nth-child(3),
.move-tab-input:nth-of-type(4):checked ~ .move-tab-list .move-tab-button:nth-child(4) {
  border-color: rgba(42, 157, 143, 0.4);
  background: rgba(42, 157, 143, 0.1);
  color: var(--focus);
}

.move-tab-panels {
  height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.move-group {
  display: none;
}

.move-group h4 {
  margin: 0 0 8px;
  font-size: 0.88rem;
}

.move-group .move-empty {
  padding: 0;
}

.move-tab-input:nth-of-type(1):checked ~ .move-tab-panels .move-group:nth-child(1),
.move-tab-input:nth-of-type(2):checked ~ .move-tab-panels .move-group:nth-child(2),
.move-tab-input:nth-of-type(3):checked ~ .move-tab-panels .move-group:nth-child(3),
.move-tab-input:nth-of-type(4):checked ~ .move-tab-panels .move-group:nth-child(4) {
  display: block;
}

.move-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: start;
  gap: 8px;
}

.move-row {
  align-self: start;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.move-row summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 38px;
  padding: 7px 9px;
  color: inherit;
  font-weight: inherit;
  list-style: none;
  cursor: pointer;
}

.move-row summary::marker {
  content: "";
}

.move-row summary::-webkit-details-marker {
  display: none;
}

.move-row summary span {
  flex: 0 0 auto;
  color: var(--focus);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.move-row summary strong {
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-row[open] {
  grid-column: 1 / -1;
  border-color: rgba(42, 157, 143, 0.42);
  box-shadow: 0 8px 18px rgba(34, 45, 72, 0.08);
}

.move-detail-body {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 9px;
}

.move-detail-meta,
.move-detail-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.move-detail-extra {
  padding-top: 2px;
}

.move-type-badge,
.move-class-badge,
.move-contact-badge,
.move-metric {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.move-type-badge {
  color: #fff;
}

.move-class-badge,
.move-contact-badge,
.move-metric {
  border: 1px solid rgba(42, 157, 143, 0.2);
  background: rgba(42, 157, 143, 0.08);
  color: var(--focus);
}

.move-metric small {
  margin-right: 4px;
  color: var(--muted);
  font-size: 0.64rem;
}

.move-detail-body p {
  margin: 0;
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.45;
}

.empty-state,
.error-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  padding: 22px;
}

.error-state {
  color: var(--accent-dark);
}

.go-placeholder {
  gap: 8px;
}

.go-placeholder strong {
  color: var(--ink);
  font-size: 1rem;
}

.go-placeholder span {
  max-width: 520px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.go-section {
  margin: 0 0 18px;
}

.go-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

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

.go-stat,
.go-cost,
.go-move {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px;
}

.go-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.go-stat strong {
  display: block;
  margin-top: 3px;
  font-size: 1.08rem;
}

.go-cost {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.go-move-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.go-move {
  display: grid;
  align-content: start;
  gap: 8px;
  background: #fff;
}

.go-move-head {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.go-move .type-pill {
  width: fit-content;
}

.go-move-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 900;
}

.go-move-badge.is-legacy {
  background: rgba(230, 57, 70, 0.1);
  color: var(--accent-dark);
}

.go-move-badge.is-signature {
  background: rgba(72, 97, 220, 0.12);
  color: #4861dc;
}

.go-move-badge.is-shadow {
  background: rgba(104, 114, 132, 0.14);
  color: var(--muted);
}

.go-move-badge.is-purified {
  background: rgba(42, 157, 143, 0.1);
  color: var(--focus);
}

.go-move strong {
  font-size: 1rem;
  line-height: 1.25;
}

.go-move-modes {
  display: grid;
  gap: 6px;
}

.go-move-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.go-move-mode b {
  flex: 0 0 100%;
  color: var(--ink);
  font-size: 0.74rem;
}

.go-move-mode span + span {
  margin-left: 0;
}

.go-move-mode span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.08);
  color: var(--focus);
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}

.go-move small {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 760px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 14px;
    align-items: center;
    padding: 24px 0 18px;
  }

  .header-copy h1 {
    font-size: 2.25rem;
  }

  .header-copy p:not(.eyebrow):not(.maker-credit) {
    display: none;
  }

  .header-copy .maker-credit {
    margin-top: 8px;
    font-size: 0.78rem;
  }

  .header-art {
    width: 96px;
    min-height: 96px;
  }

  .pokeball {
    width: 96px;
    border-width: 6px;
  }

  .type-emblem {
    width: 96px;
    border-width: 6px;
    gap: 5px;
  }

  .mega-emblem {
    width: 96px;
  }

  .mega-emblem img {
    width: 100%;
    height: 100%;
  }

  .mega-emblem strong {
    bottom: 7px;
    padding: 4px 7px;
    font-size: 0.66rem;
  }

  .type-emblem span {
    width: 68px;
    height: 68px;
    border-width: 5px;
  }

  .type-emblem img {
    width: 48px;
    height: 48px;
  }

  .type-emblem strong {
    font-size: 0.78rem;
  }

  .pokeball span {
    width: 34px;
    border-width: 5px;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .dialog-layout {
    grid-template-columns: 1fr;
  }

  .status-row {
    min-height: 48px;
    padding: 10px 0;
  }

  .status-row p {
    margin: 0;
    font-size: 0.9rem;
  }

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

  .card-button {
    min-height: 224px;
  }

  .dialog-layout {
    padding: 22px;
  }

  .detail-nav {
    top: 160px;
    width: 42px;
    height: 54px;
    font-size: 2rem;
  }

  .detail-nav-prev {
    left: 8px;
  }

  .detail-nav-next {
    right: 8px;
  }

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

@media (prefers-reduced-motion: reduce) {
  .pokemon-card,
  .dialog-layout.slide-from-left,
  .dialog-layout.slide-from-right {
    animation: none;
  }

  .card-button,
  .detail-nav {
    transition: none;
  }
}
