:root {
  color-scheme: dark;
  --bg: #0b1018;
  --surface: #121a26;
  --surface-2: #192332;
  --surface-3: #222e3f;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f7f9fc;
  --muted: #9eacbd;
  --accent: #67e8c0;
  --accent-2: #7aa7ff;
  --danger: #ff6b7a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 85% -10%, rgba(103, 232, 192, 0.13), transparent 32rem),
    radial-gradient(circle at 5% 12%, rgba(122, 167, 255, 0.12), transparent 28rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR",
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: var(--accent);
}

.hero {
  padding: max(28px, env(safe-area-inset-top)) 20px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 24, 0.72);
  backdrop-filter: blur(18px);
}

.hero__inner,
.shell,
.footer {
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

.brand__mark,
.loading__ball {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 3px solid #e8edf5;
  border-radius: 50%;
  background: linear-gradient(#ef4d5d 0 46%, #1f2937 46% 54%, #f5f7fa 54%);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.05);
}

.brand__mark::after,
.loading__ball::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 3px solid #1f2937;
  border-radius: 50%;
  background: #f5f7fa;
  content: "";
  transform: translate(-50%, -50%);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 5vw, 2.6rem);
  line-height: 1.1;
}

.hero__copy {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.summary__item {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #cfdae8;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
}

.summary__item strong {
  color: var(--text);
}

.shell {
  padding: 22px 16px 50px;
}

.controls {
  position: sticky;
  z-index: 10;
  top: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 26, 38, 0.88);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px);
}

.search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-3);
}

.search:focus-within {
  border-color: rgba(103, 232, 192, 0.55);
  box-shadow: 0 0 0 3px rgba(103, 232, 192, 0.1);
}

.search__icon {
  color: var(--accent);
  font-size: 1.5rem;
}

.search input {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search input::placeholder {
  color: #8090a5;
}

.search__clear,
.detail-panel__close {
  border: 0;
  color: var(--muted);
  background: transparent;
}

.search__clear {
  width: 36px;
  height: 36px;
  font-size: 1.45rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.filters label {
  display: grid;
  gap: 5px;
}

.filters label > span {
  padding-left: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.filters select {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-2);
}

.result-count {
  margin: 11px 3px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

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

.pokemon-card {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  min-height: 168px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 52%),
    var(--surface);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.17);
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.pokemon-card:active {
  transform: scale(0.985);
}

.pokemon-card:hover {
  border-color: rgba(103, 232, 192, 0.34);
  background:
    linear-gradient(145deg, rgba(103, 232, 192, 0.08), transparent 52%),
    var(--surface);
}

.pokemon-card__image-wrap {
  display: grid;
  place-items: center;
  width: 84px;
  height: 104px;
  align-self: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.pokemon-card__image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: auto;
}

.pokemon-card__body {
  min-width: 0;
  padding-left: 8px;
}

.pokemon-card__number {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.pokemon-card h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.3;
}

.name-en,
.detail-hero__english {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

.pokemon-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.72rem;
}

.pokemon-card__meta strong {
  color: var(--text);
}

.load-more {
  display: block;
  width: min(320px, 100%);
  height: 48px;
  margin: 22px auto 0;
  border: 1px solid rgba(103, 232, 192, 0.4);
  border-radius: 14px;
  color: var(--accent);
  background: rgba(103, 232, 192, 0.07);
  font-weight: 800;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 260px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 1.08rem;
}

.footer {
  padding: 0 20px max(36px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.6;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.footer__note {
  margin-top: 16px;
}

.detail-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(5px);
}

.detail-panel {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  width: min(760px, 100%);
  height: 100dvh;
  overflow: auto;
  padding: max(54px, env(safe-area-inset-top)) 20px max(30px, env(safe-area-inset-bottom));
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 100% 0, rgba(103, 232, 192, 0.12), transparent 26rem),
    var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 180ms ease;
  overscroll-behavior: contain;
}

.detail-panel.is-open {
  transform: translateX(0);
}

.detail-panel__close {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.7rem;
}

.detail-hero {
  display: grid;
  grid-template-columns: 126px 1fr;
  align-items: center;
  gap: 16px;
}

.detail-hero__image {
  width: 126px;
  height: 126px;
  object-fit: contain;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
}

.detail-hero h2 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 6vw, 2rem);
}

.detail-section {
  margin-top: 28px;
}

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

.detail-section h3 {
  margin: 0;
  font-size: 1rem;
}

.detail-section__title span {
  color: var(--muted);
  font-size: 0.73rem;
}

.ability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ability {
  display: grid;
  gap: 2px;
  padding: 8px 11px;
  border: 1px solid rgba(122, 167, 255, 0.28);
  border-radius: 11px;
  color: #dbe7ff;
  background: rgba(122, 167, 255, 0.08);
  font-size: 0.82rem;
  font-weight: 700;
}

.ability small,
.move__name small {
  display: block;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
}

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

.stat {
  display: grid;
  grid-template-columns: 74px 42px 1fr;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
}

.stat__label {
  color: var(--muted);
}

.stat__value {
  text-align: right;
  font-weight: 800;
}

.stat__track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.stat__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.move-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.move-tools input,
.move-tools select {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface-2);
}

.move-tools input {
  padding: 0 12px;
}

.move-tools select {
  padding: 0 28px 0 10px;
}

.move-list {
  display: grid;
  gap: 7px;
}

.move {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 72px 62px minmax(150px, auto);
  align-items: center;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.75rem;
}

.move__name {
  min-width: 0;
  padding-right: 8px;
}

.move__name strong {
  font-weight: 800;
}

.move__category {
  color: var(--muted);
  text-transform: capitalize;
}

.move__value {
  color: #dbe4ef;
  text-align: right;
  white-space: nowrap;
}

.move-empty {
  padding: 28px 10px;
  color: var(--muted);
  text-align: center;
}

.detail-source {
  display: inline-block;
  margin-top: 26px;
  font-size: 0.76rem;
}

.battle-tools {
  display: grid;
  gap: 12px;
}

.type-matchup-card,
.threat-card,
.battle-calculator,
.calc-subsection {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.type-matchup-card,
.threat-card,
.calc-subsection {
  padding: 14px;
}

.calc-subsection__title,
.point-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.calc-subsection__title h4 {
  margin: 0;
  font-size: 0.88rem;
}

.calc-subsection__title > span,
.point-header span,
.field-note {
  color: var(--muted);
  font-size: 0.68rem;
}

#typeProfile {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.matchup-group {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 8px;
}

.matchup-group > strong {
  color: var(--muted);
  font-size: 0.72rem;
}

.matchup-4 > strong,
.matchup-2 > strong {
  color: #ff8a98;
}

.matchup-0 > strong {
  color: var(--accent);
}

.opponent-empty,
.opponent-selected {
  width: 100%;
  min-height: 82px;
  border: 1px dashed rgba(103, 232, 192, 0.38);
  border-radius: 16px;
  color: var(--text);
  background: rgba(103, 232, 192, 0.055);
}

.opponent-empty {
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 13px;
}

.opponent-empty > span {
  color: var(--accent);
  font-size: 1.35rem;
}

.opponent-empty small {
  color: var(--muted);
}

.opponent-selected {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  text-align: left;
}

.opponent-selected img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.opponent-selected span {
  display: grid;
  gap: 2px;
}

.opponent-selected small {
  color: var(--muted);
}

.opponent-selected b {
  color: var(--accent);
  font-size: 0.74rem;
}

.threat-card {
  display: grid;
  gap: 8px;
}

.threat-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.1);
}

.threat-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 11px;
  cursor: pointer;
  list-style: none;
  font-size: 0.77rem;
}

.threat-group summary::-webkit-details-marker,
.battle-calculator > summary::-webkit-details-marker,
.compact-details > summary::-webkit-details-marker {
  display: none;
}

.threat-group summary span {
  color: var(--muted);
}

.threat-moves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 8px 8px;
}

.threat-moves > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 46px;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.threat-moves b,
.threat-moves small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.threat-moves b {
  font-size: 0.73rem;
}

.threat-moves small {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.59rem;
}

.threat-moves .type-badge {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.battle-calculator {
  overflow: hidden;
}

.battle-calculator > summary {
  padding: 14px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(135deg, rgba(122, 167, 255, 0.1), transparent);
}

.battle-calculator > summary span {
  display: grid;
  gap: 3px;
}

.battle-calculator > summary small {
  color: var(--muted);
}

.calculator-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.calc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.calc-form-grid label,
.rank-grid label,
.point-input {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.calc-form-grid label > span,
.rank-grid label > span,
.point-input > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.calc-form-grid select,
.calc-form-grid input[type="number"],
.rank-grid select,
.point-input input,
.opponent-picker input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-2);
}

.calc-form-grid select,
.rank-grid select {
  padding: 0 28px 0 9px;
}

.point-input input,
.calc-form-grid input[type="number"],
.opponent-picker input {
  padding: 0 10px;
}

.calc-form-grid select:disabled {
  color: #c7d0dc;
  opacity: 0.68;
}

.wide-field {
  grid-column: span 2;
}

.toggle-field {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.toggle-field input {
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
  accent-color: var(--accent);
}

.toggle-field span {
  color: #dbe4ef !important;
  font-size: 0.72rem !important;
}

.range-with-value {
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}

.range-with-value input {
  accent-color: var(--accent);
}

.range-with-value output {
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.point-header {
  margin-top: 15px;
  font-size: 0.76rem;
}

.point-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.point-input {
  text-align: center;
}

.point-input input {
  text-align: center;
}

.compact-details {
  margin-top: 10px;
}

.compact-details > summary {
  padding: 8px 2px;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 800;
  list-style: none;
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 3px;
}

.bulk-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.bulk-summary div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 6px;
  border-radius: 9px;
  text-align: center;
  background: rgba(103, 232, 192, 0.055);
}

.bulk-summary span {
  color: var(--muted);
  font-size: 0.58rem;
}

.bulk-summary strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
}

.bulk-formula-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.45;
}

.speed-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.045);
}

.speed-summary__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.speed-summary__header span,
.speed-summary__values span {
  color: var(--muted);
  font-size: 0.6rem;
}

.speed-summary__values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.speed-summary__values div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 5px;
  border-radius: 9px;
  text-align: center;
  background: rgba(255, 255, 255, 0.035);
}

.speed-summary__values strong {
  font-size: 0.84rem;
}

.speed-verdict {
  margin: 0;
  color: #93c5fd;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.45;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.advanced-field {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.damage-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.damage-result-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(103, 232, 192, 0.18);
  border-radius: 12px;
  background: rgba(103, 232, 192, 0.045);
}

.damage-result-card > span,
.damage-result-card small {
  color: var(--muted);
  font-size: 0.64rem;
}

.damage-result-card > strong {
  font-size: 1.1rem;
}

.damage-result-card > b {
  color: #d8e4f3;
  font-size: 0.78rem;
}

.damage-result-card > em {
  color: var(--accent);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
}

.calc-description,
.calc-error {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding: 9px;
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.64rem;
  line-height: 1.5;
}

.calc-error {
  color: #ffc0c7;
}

.opponent-picker {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(6px);
}

.opponent-picker__dialog {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(560px, 100%);
  height: min(720px, 100%);
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.opponent-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.opponent-picker__header button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.45rem;
}

.opponent-picker input {
  margin-bottom: 10px;
}

.opponent-results {
  display: grid;
  gap: 6px;
  overflow: auto;
  overscroll-behavior: contain;
}

.opponent-results button {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 64px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
}

.opponent-results img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.opponent-results button > span:not(.type-list) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.opponent-results small {
  color: var(--muted);
}

.opponent-results .type-list {
  justify-content: flex-end;
  margin: 0;
}

.loading {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  background: var(--bg);
}

.loading__ball {
  width: 48px;
  height: 48px;
  animation: bounce 900ms ease-in-out infinite alternate;
}

.fatal {
  max-width: 520px;
  padding: 24px;
  text-align: center;
}

@keyframes bounce {
  to {
    transform: translateY(-8px) rotate(12deg);
  }
}

body.detail-open {
  overflow: hidden;
}

@media (max-width: 620px) {
  .hero {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero__copy {
    font-size: 0.9rem;
  }

  .controls {
    top: 6px;
  }

  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .filters select {
    padding-right: 22px;
    padding-left: 8px;
    font-size: 0.75rem;
  }

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

  .pokemon-card {
    grid-template-columns: 88px 1fr;
    min-height: 148px;
  }

  .detail-panel {
    width: 100%;
    border-left: 0;
  }

  .detail-hero {
    grid-template-columns: 104px 1fr;
  }

  .detail-hero__image {
    width: 104px;
    height: 104px;
  }

  .move {
    grid-template-columns: minmax(92px, 1fr) 62px minmax(132px, auto);
    font-size: 0.67rem;
  }

  .move__category {
    display: none;
  }

  .type-matchup-card,
  .threat-card,
  .calc-subsection {
    padding: 12px;
  }

  .threat-moves {
    grid-template-columns: 1fr;
  }

  .calc-form-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .point-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rank-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bulk-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toggle-grid,
  .advanced-field {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .damage-results {
    grid-template-columns: 1fr;
  }

  .matchup-group {
    grid-template-columns: 66px 1fr;
  }

  .opponent-picker__dialog {
    width: 100%;
    height: 100%;
    border-radius: 16px;
  }

  .opponent-results button {
    grid-template-columns: 48px 1fr;
  }

  .opponent-results .type-list {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
