:root {
  --bg: #0a0b0f;
  --surface: #12141a;
  --surface-elevated: #181b23;
  --border: #2a303c;
  --border-subtle: #1e232d;
  --text: #eceef2;
  --muted: #9aa3b5;
  --muted-dim: #6b7280;
  --accent: #9ae6b4;
  --accent-line: #4ade80;
  --twitch: #9146ff;
  --twitch-hover: #a970ff;
  --font-sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--font-sans);
  font-feature-settings: "tnum" 1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 8% -5%, rgba(145, 70, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 15%, rgba(56, 189, 248, 0.1), transparent 50%),
    radial-gradient(ellipse 80% 45% at 50% 105%, rgba(74, 222, 128, 0.07), transparent 55%),
    linear-gradient(165deg, #11131a 0%, #0c0e14 45%, #090a0f 100%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black, transparent);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
}

body.page-loaded [data-reveal] {
  animation: reveal-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}

body.page-loaded .reveal-header {
  animation: reveal-header-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes reveal-rise {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes reveal-header-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.page-loaded .chart-box[data-reveal] {
  animation: reveal-chart 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}

@keyframes reveal-chart {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  body.page-loaded .reveal-header {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #c6f6d5;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 11, 15, 0.52);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.02em;
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex-shrink: 0;
  transform: translateY(-1px);
  filter: drop-shadow(0 2px 10px rgba(145, 70, 255, 0.55));
  transition: filter 0.2s ease, transform 0.2s ease;
}

.brand:hover .brand-mark {
  filter: drop-shadow(0 2px 14px rgba(167, 139, 250, 0.65));
  transform: translateY(-1px) scale(1.04);
}

.brand-text {
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.lang-switch {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.is-active {
  background: var(--surface-elevated);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border-subtle);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 200px;
  padding: 0.35rem 0.55rem 0.35rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.user-menu-trigger:hover,
.user-menu.is-open .user-menu-trigger {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
}

.user-menu-trigger img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.user-menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.user-menu-chevron {
  flex-shrink: 0;
  color: var(--muted-dim);
  transition: transform 0.2s ease, color 0.15s;
}

.user-menu.is-open .user-menu-chevron {
  transform: rotate(180deg);
  color: var(--muted);
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  z-index: 50;
  animation: user-menu-in 0.18s ease-out;
}

@keyframes user-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-menu-logout {
  margin: 0;
  padding: 0;
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: var(--text);
}

.user-menu-item--danger:hover {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.42rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.25;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  text-decoration: none;
  background: #22262f;
  border-color: #363d4a;
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: transparent;
  color: var(--text);
}

.btn-twitch {
  background: var(--twitch);
  border-color: transparent;
  color: #fff;
  padding: 0.45rem 1rem;
}

.btn-twitch:hover {
  background: var(--twitch-hover);
  border-color: transparent;
  color: #fff;
}

form.inline {
  display: inline;
  margin: 0;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-head {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

h1 {
  font-size: 1.65rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: -0.03em;
}

.lead {
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.lead-strong {
  color: var(--text);
  font-weight: 500;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.stats-grid--wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 360px;
  margin-bottom: 1.5rem;
}

.stats-grid--pokedex {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

@media (max-width: 1100px) {
  .stats-grid--pokedex {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .stats-grid--pokedex {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .stats-grid,
  .stats-grid--wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .stats-grid,
  .stats-grid--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat-card {
  background: linear-gradient(155deg, rgba(22, 25, 33, 0.9), rgba(14, 16, 22, 0.85));
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.95rem 1rem;
  min-width: 0;
  backdrop-filter: blur(6px);
  transition: transform 0.3s ease, border-color 0.25s;
}

body.page-loaded .stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.stat-card .value {
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-card .label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.3;
}

.stat-card.accent-gold .value {
  color: #fbbf24;
}

.stat-card.accent-pink .value {
  color: #f472b6;
}

.stat-card.accent-green .value {
  color: var(--accent-line);
}

.stat-card.accent-cyan .value {
  color: #67e8f9;
}

.charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.charts.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .charts,
  .charts.cols-3 {
    grid-template-columns: 1fr;
  }
}

.chart-box {
  background: linear-gradient(160deg, rgba(24, 27, 35, 0.92), rgba(14, 16, 22, 0.88));
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem 1.1rem 1.15rem;
  min-width: 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s, box-shadow 0.35s, transform 0.35s;
}

body.page-loaded .chart-box:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 16px 40px rgba(0, 0, 0, 0.3);
}

.chart-box h3 {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.chart-box canvas {
  max-height: 220px;
}

.charts-home .chart-box,
.charts-profile {
  gap: 1.25rem;
}

.charts-home .chart-box {
  min-height: 280px;
}

.charts-home .chart-canvas-wrap {
  position: relative;
  height: 220px;
  width: 100%;
}

.charts-home .chart-canvas-wrap canvas {
  max-height: none !important;
  height: 100% !important;
  width: 100% !important;
}

.charts-profile {
  gap: 1.25rem;
}

.charts-profile .chart-box {
  min-height: 300px;
  padding: 1.15rem 1.2rem 1.35rem;
  background: linear-gradient(165deg, var(--surface) 0%, var(--surface-elevated) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.charts-profile .chart-box h3 {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.charts-profile .chart-canvas-wrap {
  position: relative;
  height: 240px;
  width: 100%;
}

.charts-profile .chart-canvas-wrap canvas {
  max-height: none;
  height: 100% !important;
  width: 100% !important;
}

.chart-box--rarity {
  min-height: 300px;
}

.rarity-viz {
  display: grid;
  grid-template-columns: minmax(148px, 168px) minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: center;
  min-height: 240px;
  padding-top: 0.25rem;
}

@media (max-width: 640px) {
  .rarity-viz {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.rarity-viz-ring-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  flex-shrink: 0;
  transform: scale(0.72);
  opacity: 0;
  transition: none;
}

.rarity-viz.is-animate .rarity-viz-ring-wrap {
  animation: rarity-ring-in 0.9s cubic-bezier(0.2, 1.1, 0.3, 1) forwards;
}

@keyframes rarity-ring-in {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.rarity-viz-glow {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.12), transparent 68%);
  filter: blur(8px);
  opacity: 0.85;
  animation: rarity-glow-pulse 3.5s ease-in-out infinite;
}

@keyframes rarity-glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

.rarity-viz-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ring);
  box-shadow:
    0 0 0 4px var(--surface-elevated),
    0 0 0 5px rgba(255, 255, 255, 0.06),
    inset 0 0 20px rgba(0, 0, 0, 0.35),
    0 12px 40px rgba(0, 0, 0, 0.35);
}

.rarity-viz-ring-hole {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.45);
}

.rarity-viz-core {
  position: absolute;
  inset: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
  pointer-events: none;
}

.rarity-viz-total {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.rarity-viz-sublabel {
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.rarity-viz-bars {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
}

.rarity-viz-row {
  display: grid;
  grid-template-columns: 10px minmax(4.5rem, 6.5rem) 1fr auto;
  gap: 0.5rem 0.65rem;
  align-items: center;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
  opacity: 0;
  transform: translateX(10px);
  transition: border-color 0.2s, background 0.2s;
}

.rarity-viz.is-animate .rarity-viz-row {
  animation: rarity-row-in 0.65s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
  animation-delay: var(--delay);
}

@keyframes rarity-row-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.rarity-viz-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-subtle);
}

.rarity-viz-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 10px color-mix(in srgb, var(--c) 55%, transparent);
}

.rarity-viz-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rarity-viz-track {
  height: 7px;
  border-radius: 99px;
  background: var(--border-subtle);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.rarity-viz-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #000), var(--c));
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 45%, transparent);
}

.rarity-viz.is-animate .rarity-viz-fill {
  animation: rarity-bar-grow 1s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
  animation-delay: calc(var(--delay) + 120ms);
}

@keyframes rarity-bar-grow {
  to {
    width: var(--w);
  }
}

.rarity-viz-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  min-width: 2.6rem;
  font-variant-numeric: tabular-nums;
}

.rarity-viz-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.rarity-viz-pct {
  font-size: 0.68rem;
  color: var(--muted);
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-dim);
  margin: 0 0 0.75rem;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.75rem;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface);
  max-width: 100%;
}

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
  table-layout: fixed;
}

table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-elevated);
  box-shadow: 0 1px 0 var(--border-subtle);
}

table.data th,
table.data td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.data th {
  color: var(--muted-dim);
  font-weight: 500;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data td.num,
table.data th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.data tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

table.data .col-rank {
  width: 2.5rem;
}

table.data .col-name {
  width: auto;
}

table.data .col-narrow {
  width: 4.5rem;
}

table.data .col-rarity-badge {
  width: 8.35rem;
}

table.data .col-num {
  width: 3rem;
}

table.data .col-poke {
  width: 14rem;
}

table.data .col-stat {
  width: 3.1rem;
}

table.data th.rarity-col,
table.data td.rarity-cell {
  text-align: center;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  vertical-align: middle;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

table.data td.rarity-cell .rarity-badge {
  display: inline-flex;
  margin-inline: auto;
  vertical-align: middle;
}

.poke-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.poke-cell--compact {
  gap: 0.45rem;
}

.poke-sprite {
  flex-shrink: 0;
  image-rendering: pixelated;
  object-fit: contain;
}

.pokedex-table-wrap {
  margin-bottom: 1.75rem;
}

.pokedex-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.pokedex-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.pokedex-field--search {
  flex: 1 1 12rem;
  max-width: 280px;
}

.pokedex-field-label {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-dim);
}

.pokedex-input {
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  line-height: 1.3;
  transition: border-color 0.15s, background 0.15s;
}

.pokedex-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.pokedex-input::placeholder {
  color: var(--muted-dim);
}

.pokedex-rarity {
  position: relative;
  min-width: 11rem;
}

.pokedex-rarity-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-width: 11rem;
  padding: 0.45rem 0.55rem 0.45rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pokedex-rarity-trigger:hover,
.pokedex-rarity.is-open .pokedex-rarity-trigger {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.pokedex-rarity-trigger.has-value {
  color: var(--text);
}

.pokedex-rarity-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.pokedex-rarity-chevron {
  flex-shrink: 0;
  color: var(--muted-dim);
  transition: transform 0.2s ease;
}

.pokedex-rarity.is-open .pokedex-rarity-chevron {
  transform: rotate(180deg);
}

.pokedex-rarity-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 100%;
  width: max-content;
  max-width: min(16rem, 90vw);
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42);
  animation: user-menu-in 0.18s ease-out;
}

.pokedex-rarity-opt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.48rem 0.6rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.pokedex-rarity-opt:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pokedex-rarity-opt.is-selected {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px var(--border-subtle) inset;
}

.pokedex-rarity-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rarity-fg, var(--muted));
}

.pokedex-rarity-dot--muted {
  background: var(--muted-dim);
}

.pokedex-rarity-opt.rarity-very-common { --rarity-fg: #9aa3b5; }
.pokedex-rarity-opt.rarity-common { --rarity-fg: #b8b4b0; }
.pokedex-rarity-opt.rarity-uncommon { --rarity-fg: #7dcda0; }
.pokedex-rarity-opt.rarity-rare { --rarity-fg: #b8a8f0; }
.pokedex-rarity-opt.rarity-very-rare { --rarity-fg: #9ca8f0; }
.pokedex-rarity-opt.rarity-legendary { --rarity-fg: #d4b86a; }
.pokedex-rarity-opt.rarity-imba { --rarity-fg: #dfa0c0; }

.pokedex-reset {
  align-self: flex-end;
  margin-bottom: 0.05rem;
}

.pokedex-meta {
  margin: 0 0 0 auto;
  padding-bottom: 0.35rem;
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}

.pokedex-meta-num {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin: 0 0.2rem;
}

@media (max-width: 640px) {
  .pokedex-meta {
    margin-left: 0;
    width: 100%;
  }
}

table.data .th-sort {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

table.data .th-sort:hover {
  color: var(--text);
}

table.data .th-sort.is-active {
  color: var(--text);
}

table.data .th-sort::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-left: 0.25rem;
  vertical-align: 0.05em;
  opacity: 0;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M6 3 2.5 7.5h7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

table.data .th-sort.is-active::after {
  opacity: 0.55;
}

table.data .th-sort.is-active[aria-sort="descending"]::after {
  transform: scaleY(-1);
}

.table-pokedex .poke-sprite {
  width: 40px;
  height: 40px;
}

table.data .col-bar {
  width: 5.5rem;
}

table.data td.col-share {
  vertical-align: middle;
}

table.data td.col-share .pick-bar {
  width: 100%;
  min-width: 3.5rem;
}

.poke-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poke-sub {
  font-size: 0.72rem;
  color: var(--muted-dim);
  margin-top: 0.1rem;
}

.pick-bar {
  height: 3px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.pick-bar span {
  display: block;
  height: 100%;
  max-width: 100%;
  background: linear-gradient(90deg, #22c55e, var(--accent-line));
  border-radius: 2px;
  min-width: 0;
}

.trainer-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  min-width: 0;
}

.trainer-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.trainer-link img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.empty-hint {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem !important;
  font-size: 0.875rem;
}

.rarity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 7.65rem;
  max-width: 100%;
  padding: 0.18rem 0.35rem;
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  border-radius: 6px;
  border: 1px solid var(--rarity-line, var(--border-subtle));
  background: var(--rarity-bg, rgba(255, 255, 255, 0.04));
  color: var(--rarity-fg, var(--muted));
  box-shadow: none;
}

.rarity-very-common {
  --rarity-fg: #9aa3b5;
  --rarity-bg: rgba(71, 85, 105, 0.14);
  --rarity-line: rgba(71, 85, 105, 0.35);
}

.rarity-common {
  --rarity-fg: #b8b4b0;
  --rarity-bg: rgba(120, 113, 108, 0.12);
  --rarity-line: rgba(120, 113, 108, 0.32);
}

.rarity-uncommon {
  --rarity-fg: #7dcda0;
  --rarity-bg: rgba(74, 222, 128, 0.08);
  --rarity-line: rgba(74, 222, 128, 0.22);
}

.rarity-rare {
  --rarity-fg: #b8a8f0;
  --rarity-bg: rgba(167, 139, 250, 0.09);
  --rarity-line: rgba(167, 139, 250, 0.24);
}

.rarity-very-rare {
  --rarity-fg: #9ca8f0;
  --rarity-bg: rgba(129, 140, 248, 0.1);
  --rarity-line: rgba(129, 140, 248, 0.26);
}

.rarity-legendary {
  --rarity-fg: #d4b86a;
  --rarity-bg: rgba(251, 191, 36, 0.09);
  --rarity-line: rgba(251, 191, 36, 0.24);
}

.rarity-imba {
  --rarity-fg: #dfa0c0;
  --rarity-bg: rgba(244, 114, 182, 0.09);
  --rarity-line: rgba(244, 114, 182, 0.24);
}

.charts-home .chart-box h3 {
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.03em;
}

.charts-home .chart-box:nth-child(1) {
  border-top: 2px solid rgba(74, 222, 128, 0.65);
}

.charts-home .chart-box:nth-child(2) {
  border-top: 2px solid rgba(129, 140, 248, 0.65);
}

.charts-home .chart-box:nth-child(3) {
  border-top: 2px solid rgba(56, 189, 248, 0.65);
}

.cta-strip {
  margin-top: 2rem;
  padding: 1rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(
    135deg,
    rgba(145, 70, 255, 0.08),
    rgba(34, 197, 94, 0.05)
  );
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-strip p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}