:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --surface-3: #e8ebf0;
  --border: #e2e6ec;
  --border-strong: #ccd3dc;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --accent: #e3350d;
  --accent-hover: #c42c09;
  --accent-soft: rgba(227, 53, 13, 0.1);
  --weak: #e11d48;
  --resist: #16a34a;
  --immune: #475569;
  --male: #3b82f6;
  --female: #ec4899;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 16px -6px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 48px -18px rgba(15, 23, 42, 0.32);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --topbar-h: 64px;
  --pokeball: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M2.17 46A48 48 0 0 1 97.83 46H66.52A17 17 0 0 0 33.48 46ZM2.17 54A48 48 0 0 0 97.83 54H66.52A17 17 0 0 1 33.48 54ZM50 40a10 10 0 1 1 0 20a10 10 0 1 1 0-20Z'/%3E%3C/svg%3E");
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: light;
}

html.dark-mode {
  --bg: #0b0d12;
  --surface: #141820;
  --surface-2: #1a1f29;
  --surface-3: #252b37;
  --border: #232935;
  --border-strong: #343c4b;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #8a94a8;
  --accent: #ff5a38;
  --accent-hover: #ff7556;
  --accent-soft: rgba(255, 90, 56, 0.15);
  --weak: #fb7185;
  --resist: #4ade80;
  --immune: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 16px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 48px -18px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  -webkit-user-select: none;
  user-select: none;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--max-width);
  height: var(--topbar-h);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-name span {
  color: var(--accent);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}

.theme-toggle .icon-sun,
html.dark-mode .theme-toggle .icon-moon {
  display: none;
}

html.dark-mode .theme-toggle .icon-sun {
  display: block;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 40px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lang-switch .icon {
  width: 16px;
  height: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.link-btn {
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: currentColor;
  opacity: 0.6;
  -webkit-mask: var(--chevron) center / contain no-repeat;
  mask: var(--chevron) center / contain no-repeat;
  pointer-events: none;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 42px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  cursor: pointer;
}

.select-wrap select:hover {
  border-color: var(--border-strong);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  min-width: 0;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 18px;
}

.card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.card-hint {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.tag {
  --tc: var(--type-normal);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 11px 0 6px;
  border-radius: 999px;
  background: var(--tc);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.tag::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: currentColor;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
  -webkit-mask: var(--ti) center / contain no-repeat;
  mask: var(--ti) center / contain no-repeat;
}

.site-footer {
  max-width: var(--max-width);
  margin: 56px auto 0;
  padding: 24px 24px 100px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer a {
  color: var(--text-2);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  :root {
    --topbar-h: 58px;
  }

  body {
    font-size: 14px;
  }

  .topbar-inner {
    padding: 0 12px;
    gap: 10px;
  }

  .brand-name {
    display: none;
  }

  .lang-switch {
    padding: 0;
  }

  .lang-switch .icon {
    display: none;
  }

  .card {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .card-title {
    font-size: 17px;
  }

  .select-wrap select {
    font-size: 16px;
  }

  .site-footer {
    margin-top: 40px;
    padding: 20px 16px calc(84px + env(safe-area-inset-bottom));
  }
}

.donate-widget {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 56;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

body.compare-mode .donate-widget {
  display: none;
}

.donate-fab {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #0070ba, #003087);
  color: #fff;
  box-shadow: 0 10px 22px -8px rgba(0, 48, 135, 0.7);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.donate-fab svg {
  width: 24px;
  height: 24px;
}

.donate-fab:hover {
  transform: scale(1.08);
}

.donate-fab.pulse {
  animation: donate-pulse 2s ease-in-out 3;
}

@keyframes donate-pulse {
  0%,
  100% {
    box-shadow: 0 10px 22px -8px rgba(0, 48, 135, 0.7), 0 0 0 0 rgba(0, 112, 186, 0.45);
  }

  50% {
    box-shadow: 0 10px 22px -8px rgba(0, 48, 135, 0.7), 0 0 0 12px rgba(0, 112, 186, 0);
  }
}

.donate-card {
  position: relative;
  width: min(300px, calc(100vw - 40px));
  padding: 22px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: donate-in 0.22s ease-out;
}

@keyframes donate-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.donate-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.donate-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.donate-close .icon {
  width: 16px;
  height: 16px;
}

.donate-title {
  margin: 0 0 4px;
  padding-right: 28px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.donate-subtitle {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.donate-paypal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0070ba, #003087);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.donate-paypal-btn svg {
  width: 18px;
  height: 18px;
}

.donate-paypal-btn:hover {
  filter: brightness(1.1);
}

@media (max-width: 640px) {
  .donate-widget {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .donate-fab {
    width: 50px;
    height: 50px;
  }
}
