:root {
  --bg: #0f172a;
  --card: #111827;
  --card-2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --good: #22c55e;
  --maybe: #f59e0b;
  --bad: #ef4444;
  --border: rgba(255,255,255,.1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1e3a8a 0, var(--bg) 45%);
  color: var(--text);
}

.app { max-width: 1100px; margin: 0 auto; padding: 32px 18px; }
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}
.eyebrow { color: var(--accent); font-weight: 700; margin: 0 0 8px; }
h1 { font-size: clamp(36px, 7vw, 72px); margin: 0; line-height: .95; }
.subtitle { max-width: 680px; color: var(--muted); font-size: 18px; }
.badge {
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}
.grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 18px; }
.card {
  background: rgba(17,24,39,.88);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 20px 70px rgba(0,0,0,.25);
}
h2 { margin-top: 0; }
label { display: block; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
select, input, button {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 16px;
}
select, input { background: var(--card-2); color: var(--text); }
input::placeholder { color: #6b7280; }
button {
  background: var(--accent);
  color: #00111a;
  font-weight: 800;
  cursor: pointer;
}
.iv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.iv-grid select {
  display: none;
}
.iv-stat-segment {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2,6,23,.45);
}
.iv-stat-segment button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 30px;
  margin: 0;
  padding: 6px 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
}
.iv-stat-segment button.active {
  background: linear-gradient(135deg, rgba(56,189,248,.95), rgba(124,77,255,.82));
  color: white;
  box-shadow: 0 10px 24px rgba(56,189,248,.14);
}
.note, .muted { color: var(--muted); }
.note { font-size: 13px; line-height: 1.4; }
.empty { color: var(--muted); padding: 50px 0; text-align: center; }
.hidden { display: none; }
.pokemon-title { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.result-name { font-size: 28px; font-weight: 800; margin: 0 0 4px; }
.decision { padding: 8px 12px; border-radius: 999px; font-weight: 900; }
.decision.keep { background: rgba(34,197,94,.18); color: var(--good); }
.decision.maybe { background: rgba(245,158,11,.18); color: var(--maybe); }
.decision.transfer { background: rgba(239,68,68,.18); color: var(--bad); }
.league-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 24px 0; }
.league-box, .name-box { background: rgba(255,255,255,.045); border: 1px solid var(--border); border-radius: 18px; padding: 16px; }
.league-name { color: var(--muted); margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.rank { font-size: 34px; font-weight: 900; margin: 0 0 6px; }
.copy-row { display: flex; gap: 10px; align-items: center; }
code { flex: 1; background: #020617; padding: 14px; border-radius: 12px; overflow: auto; }
.copy-row button { width: auto; min-width: 110px; margin: 0; }
@media (max-width: 800px) {
  .grid, .league-results { grid-template-columns: 1fr; }
  .hero { flex-direction: column; }
  .iv-grid { grid-template-columns: 1fr; }
}

.type-line {
  display: inline-block;
  margin: 4px 0 0;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(56,189,248,.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: capitalize;
}

.stat-section {
  background: rgba(255,255,255,.045);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-top: 18px;
}

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

.stat-grid div {
  background: rgba(2,6,23,.5);
  border-radius: 14px;
  padding: 12px;
}

.stat-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.stat-grid strong {
  font-size: 24px;
}

.effective-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.effective-grid > div {
  background: rgba(2,6,23,.5);
  border-radius: 14px;
  padding: 12px;
}

.small-title {
  margin: 0 0 6px;
  font-weight: 800;
  color: var(--text);
}

@media (max-width: 760px) {
  .stat-grid,
  .effective-grid {
    grid-template-columns: 1fr;
  }
}

.family-box {
  background: rgba(255,255,255,.045);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-top: 18px;
}

.family-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.family-buttons button {
  width: auto;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 14px;
  background: rgba(56,189,248,.14);
  color: var(--text);
}

.family-buttons button.active {
  background: var(--accent);
  color: #00111a;
}

.family-buttons button small {
  display: block;
  color: inherit;
  opacity: .72;
  font-weight: 600;
}

.small-decision {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  padding: 6px 10px;
}

.rank-good { color: var(--good); }
.rank-maybe { color: var(--maybe); }
.rank-bad { color: var(--bad); }
.rank-none { color: var(--muted); }

.rank-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: -4px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: -6px;
}

.good-dot { background: var(--good); }
.maybe-dot { background: var(--maybe); }
.bad-dot { background: var(--bad); }

.left-name-box {
  margin-top: 6px;
}

.calc-settings-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.calc-settings-row > label {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.calc-settings-row > label[hidden] {
  display: none !important;
}

.level-cap-segment,
.iv-floor-segment {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2,6,23,.45);
}

.level-cap-segment {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 1fr;
  min-height: 52px;
}

.mega-level-segment {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 0;
}

.iv-floor-segment {
  grid-template-columns: repeat(20, minmax(0, 1fr));
  grid-template-rows: repeat(2, 1fr);
  min-height: 112px;
}

.iv-floor-segment button:nth-child(-n + 5) {
  grid-column: span 4;
}

.iv-floor-segment button:nth-child(n + 6) {
  grid-column: span 5;
}

#levelCap,
#ivFloor,
#megaLevel {
  display: none;
}

.level-cap-segment button,
.iv-floor-segment button {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 11px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.1;
}

.mega-level-segment button {
  padding: 9px 6px;
  font-size: 13px;
}

.mega-buddy-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.mega-buddy-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.mega-buddy-toggle small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.level-cap-segment button.active,
.iv-floor-segment button.active {
  background: linear-gradient(135deg, rgba(56,189,248,.95), rgba(124,77,255,.82));
  color: white;
  box-shadow: 0 10px 24px rgba(56,189,248,.16);
}

.iv-floor-segment button {
  justify-items: center;
  align-content: center;
  gap: 1px;
  padding: 6px 1px;
}
.iv-floor-segment button strong,
.iv-floor-segment button span {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  text-align: center;
}

.iv-floor-segment button strong {
  white-space: nowrap;
}

.iv-floor-segment button span {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: inherit;
  opacity: .94;
  white-space: nowrap;
  overflow-wrap: normal;
}

.left-name-box code {
  min-height: 46px;
}

.fmt-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:14px}

/* v21 chip-style name format controls */
.name-format-builder {
  margin-bottom: 16px;
}

.name-box .name-format-builder {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.name-format-builder > label {
  display: block;
  margin-bottom: 8px;
}

.fmt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.fmt-chip {
  margin: 0;
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.fmt-chip input {
  width: auto;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.fmt-chip:has(input:checked) {
  background: rgba(56,189,248,.16);
  border-color: rgba(56,189,248,.55);
  color: var(--accent);
  font-weight: 800;
}

.legal-page {
  line-height: 1.7;
  max-width: 900px;
  margin: 0 auto;
}

.legal-page h2 {
  font-size: 32px;
  margin-bottom: 8px;
}

.legal-page h3 {
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--text);
}

.legal-page p {
  color: var(--muted);
}

.legal-page a,
footer a {
  color: var(--accent);
}

.top-rankings-box { margin-top: 16px; }
.top-rankings { overflow-x: auto; margin-top: 10px; }
.top-rankings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.top-rankings-table th,
.top-rankings-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.top-rankings-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.top-rankings-table td:first-child { font-weight: 900; }
.top-rankings-empty { color: var(--muted); font-size: 13px; }

.pokemon-suggestions{
  max-height:260px;
  overflow-y:auto;
  border:1px solid var(--border);
  border-radius:12px;
  margin-top:6px;
  background:var(--surface);
  display:none;
  position:relative;
  z-index:20;
}
.pokemon-suggestion{
  padding:10px 12px;
  cursor:pointer;
  border-bottom:1px solid var(--border);
}
.pokemon-suggestion:last-child{
  border-bottom:none;
}
.pokemon-suggestion:hover{
  background:rgba(255,255,255,.06);
}

/* v39: Top 250 ranking list with scroll */
.top-rankings {
  max-height: 560px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 12px;
}

.top-rankings-table thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 2;
}

/* v40 IV Floor selector */

.quick-results-bar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin:14px 0;
}

.quick-pill{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--surface);
  font-size:13px;
  font-weight:700;
}

.quick-good{ color:#22c55e; }
.quick-maybe{ color:#facc15; }
.quick-bad{ color:#ef4444; }
.quick-best{ color:#facc15; font-weight:900; }

.quick-view-btn{
  margin-left:auto;
}


/* v44 color scheme */
.rank-one,
.quick-best{
  color:#a855f7 !important; /* purple */
  text-shadow:0 0 10px rgba(168,85,247,.35);
}

.rank-good,
.quick-good{
  color:#ec4899 !important; /* pink */
}

.rank-maybe,
.rank-bad,
.quick-bad{
  color:#ef4444 !important; /* red */
}

.top-rank-one td:first-child{
  color:#a855f7 !important;
}


/* v45: yellow instead of pink */
.rank-good,
.quick-good{
  color:#facc15 !important; /* yellow */
}


/* v46 force consistent colors everywhere */
.rank-one,
.quick-best,
.top-rank-one td:first-child{
  color:#a855f7 !important; /* purple */
}

.rank-good,
.quick-good{
  color:#facc15 !important; /* yellow */
}

.rank-maybe,
.rank-bad,
.quick-bad{
  color:#ef4444 !important; /* red */
}


/* v47 real color fix */
.rank-one {
  color:#a855f7 !important;
  text-shadow:0 0 10px rgba(168,85,247,.35);
}

.quick-best {
  color:#a855f7 !important;
  text-shadow:0 0 10px rgba(168,85,247,.35);
}

.rank-good,
.quick-good {
  color:#facc15 !important;
}

.rank-bad,
.rank-maybe,
.quick-bad,
.quick-maybe {
  color:#ef4444 !important;
}

.top-rank-one,
.top-rank-one td {
  color:#a855f7 !important;
}



.scroll-top-btn:hover{
  transform:translateY(-2px);
}

.scroll-top-btn{
  position:fixed;
  right:20px;
  bottom:20px;
  width:52px;
  height:52px;
  border:none;
  border-radius:50%;
  cursor:pointer;
  z-index:99999;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  font-weight:900;
  color:white;
  background:#a855f7;
  box-shadow:0 6px 18px rgba(0,0,0,.30);
  opacity:0;
  pointer-events:none;
  transform:translateY(12px);
  transition:opacity .2s ease, transform .2s ease;
}

.scroll-top-btn.show{
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
}

.scroll-top-btn:hover{
  transform:translateY(-2px);
}

.selected-iv-comparison{
  position:sticky;
  top:0;
  z-index:5;
  margin:10px 0;
}

.selected-iv-card{
  display:grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap:8px;
  padding:10px;
  border:1px solid rgba(168,85,247,.45);
  border-radius:14px;
  background:rgba(17,24,39,.96);
  box-shadow:0 8px 22px rgba(0,0,0,.22);
}

.selected-iv-card div{
  background:rgba(255,255,255,.045);
  border-radius:10px;
  padding:8px;
}

.selected-iv-card span{
  display:block;
  color:var(--muted);
  font-size:11px;
  margin-bottom:3px;
}

.selected-iv-card strong{
  color:var(--text);
  font-size:14px;
}

.selected-iv-card > div:first-child strong{
  color:#a855f7;
  font-size:18px;
}

.selected-label{
  color:#a855f7 !important;
  font-weight:800;
}

.selected-iv-empty{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  color:var(--muted);
}

.cp-target-panel{
  display:grid;
  gap:12px;
  margin-top:12px;
  padding:14px;
  border:1px solid rgba(34,211,238,.22);
  border-radius:16px;
  background:rgba(2,6,23,.32);
}

.cp-target-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.cp-target-head .league-name{
  margin:0;
}

.cp-target-head span,
.cp-target-note{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.cp-target-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 132px;
  gap:10px;
  align-items:end;
}

.cp-target-slider,
.cp-target-number{
  margin:0;
}

.cp-target-number span{
  display:block;
  font-weight:900;
  color:var(--muted);
}

.cp-target-number input{
  min-width:0;
}

.cp-stepper{
  display:grid;
  grid-template-columns:38px minmax(0,1fr) 38px;
  gap:6px;
  align-items:center;
  margin-top:8px;
}

.cp-stepper input,
.cp-stepper button{
  margin:0;
}

.cp-stepper button{
  width:38px;
  height:46px;
  display:grid;
  place-items:center;
  padding:0;
  border-radius:12px;
  background:rgba(34,211,238,.16);
  border-color:rgba(34,211,238,.28);
  color:#e0f2fe;
  font-size:20px;
  line-height:1;
}

.cp-target-stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}

.cp-target-stats div{
  min-width:0;
  padding:10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  background:rgba(255,255,255,.055);
}

.cp-target-stats span{
  display:block;
  color:var(--muted);
  font-size:11px;
  text-transform:uppercase;
  font-weight:950;
}

.cp-target-stats strong{
  display:block;
  margin-top:4px;
  color:var(--text);
  font-size:17px;
}

.cp-target-note{
  margin:0;
}

.evolution-cp-check{
  display:grid;
  gap:10px;
  padding-top:4px;
}

.evolution-cp-list{
  display:grid;
  gap:8px;
}

.evolution-cp-row{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) auto auto;
  align-items:center;
  gap:8px;
  padding:8px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  background:rgba(255,255,255,.045);
}

.evolution-cp-sprite{
  width:34px;
  height:34px;
  object-fit:contain;
}

.evolution-cp-row strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--text);
}

.evolution-cp-row em{
  font-style:normal;
  font-weight:950;
  color:#e0f2fe;
}

.evolution-cp-row small{
  padding:5px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:950;
}

.evolution-cp-row.is-ok small{
  background:rgba(34,197,94,.14);
  color:#bbf7d0;
}

.evolution-cp-row.is-over small{
  background:rgba(239,68,68,.16);
  color:#fecaca;
}

@media (max-width: 760px){
  .selected-iv-card{
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }
  .cp-target-grid,
  .cp-target-stats{
    grid-template-columns:1fr;
  }
  .evolution-cp-row{
    grid-template-columns:34px minmax(0,1fr) auto;
  }
  .evolution-cp-row small{
    grid-column:2 / -1;
    width:max-content;
  }
}

.stat-filters{
  margin:10px 0 12px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.045);
}

.stat-filter-head{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}

.stat-filter-head .league-name{
  margin:0;
  margin-right:auto;
}

.stat-filter-head button{
  width:auto;
  margin-top:0;
  padding:7px 10px;
  font-size:12px;
}

.stat-filter-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}

.stat-filter-grid label{
  margin:0;
  color:var(--muted);
  font-size:13px;
}

.stat-filter-grid span{
  color:var(--accent);
  font-weight:800;
}

.stat-filter-grid input{
  min-height:38px;
  padding:8px 10px;
  margin-top:5px;
}

@media (max-width:760px){
  .stat-filter-grid{
    grid-template-columns:1fr;
  }
}

/* v54 slider stat filters */
.slider-filter-grid {
  gap: 12px;
}

.slider-filter {
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.slider-filter span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.slider-filter strong {
  color: var(--accent);
  font-size: 15px;
}

.slider-filter small {
  display: block;
  margin: 4px 0 8px;
  color: var(--muted);
  opacity: .8;
}

.slider-filter input[type="range"] {
  width: 100%;
  min-height: 28px;
  padding: 0;
  cursor: pointer;
  accent-color: #a855f7;
}

.cmp-box{
  margin-top:18px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.045);
}

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

.cmp-head .league-name{ margin:0; }

.cmp-leagues{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}

.cmp-leagues label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  width:auto;
  padding:7px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:rgba(255,255,255,.045);
  margin:0;
  font-size:13px;
}

.cmp-leagues input{
  width:auto;
  min-height:auto;
}

.cmp-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.cmp-card{
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(2,6,23,.45);
}

.cmp-card input,
.cmp-card select{
  margin-bottom:8px;
}

.cmp-iv-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}

.cmp-iv-grid label{
  font-size:12px;
  margin:0;
}

.cmp-result{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  background:rgba(255,255,255,.055);
  font-weight:800;
}

.cmp-win{ color:#a855f7; }
.cmp-tie{ color:#facc15; }

@media (max-width:760px){
  .cmp-grid{ grid-template-columns:1fr; }
  .cmp-iv-grid{ grid-template-columns:repeat(3,1fr); }
  .iv-floor-segment{
    grid-template-columns:repeat(3,minmax(0,1fr));
    grid-template-rows:repeat(3,1fr);
    min-height:172px;
  }
  .iv-floor-segment button:nth-child(n){
    grid-column:auto;
  }
}


/* v60 PVPium branding */
.top-tools-nav{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}
.top-tools-nav a,
.top-tools-nav span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:8px 12px;
  border:1px solid var(--border);
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:var(--text);
  text-decoration:none;
  font-weight:700;
  font-size:13px;
}
.top-tools-nav a.active{
  border-color:rgba(168,85,247,.65);
  box-shadow:0 0 0 1px rgba(168,85,247,.25) inset;
}
.top-tools-nav span{
  color:var(--muted);
}
.site-footer{
  margin-top:34px;
  padding:20px 0;
  color:var(--muted);
  text-align:center;
  font-size:12px;
}


.version-corner{
  position:fixed;
  right:12px;
  bottom:10px;
  z-index:999;
  padding:5px 8px;
  border:1px solid var(--border);
  border-radius:999px;
  background:rgba(15,23,42,.82);
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  backdrop-filter:blur(8px);
}


/* v67 guide pages */
.guide-page{
  max-width:920px;
  margin:0 auto;
  padding:28px 18px 80px;
}
.guide-article{
  margin-top:24px;
  padding:28px;
  border:1px solid var(--border);
  border-radius:24px;
  background:rgba(15,23,42,.72);
  box-shadow:0 20px 70px rgba(0,0,0,.24);
}
.guide-article h1{
  margin:0 0 14px;
  font-size:clamp(34px,6vw,64px);
  line-height:1.02;
}
.guide-article h2{
  margin:30px 0 10px;
  font-size:clamp(22px,3vw,32px);
}
.guide-article p,
.guide-article li{
  color:var(--muted);
  font-size:17px;
  line-height:1.75;
}
.guide-article a{
  color:#38bdf8;
  font-weight:800;
}
.guide-meta{
  color:#38bdf8;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:12px;
  margin-bottom:10px;
}
.guide-nav{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}
.guide-nav a{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  text-decoration:none;
  font-size:13px;
  font-weight:800;
}
.guide-callout{
  margin:26px 0;
  padding:18px;
  border-radius:18px;
  border:1px solid rgba(56,189,248,.35);
  background:rgba(56,189,248,.08);
}
.guides-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:18px;
}
.guide-card-link{
  display:block;
  padding:18px;
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.045);
  color:var(--text);
  text-decoration:none;
}
.guide-card-link strong{
  display:block;
  font-size:18px;
  margin-bottom:6px;
}
.guide-card-link span{
  color:var(--muted);
  font-size:14px;
}
@media (max-width:720px){
  .guide-article{padding:20px}
  .guides-list{grid-template-columns:1fr}
}


/* v67 integrated guide pages */
.guide-page{
  width:min(1180px, calc(100% - 32px));
  margin:0 auto;
  padding:34px 0 90px;
}
.guide-hero{
  display:grid;
  grid-template-columns:1fr auto;
  gap:18px;
  align-items:start;
  margin-bottom:22px;
}
.guide-brand{
  color:#38bdf8;
  font-weight:900;
  letter-spacing:.02em;
  margin-bottom:8px;
}
.guide-hero h1{
  margin:0;
  font-size:clamp(42px,7vw,84px);
  line-height:.98;
}
.guide-hero p{
  max-width:820px;
  color:var(--muted);
  font-size:clamp(16px,2vw,21px);
  line-height:1.55;
}
.guide-nav{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}
.guide-nav a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:8px 13px;
  border:1px solid var(--border);
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:var(--text);
  text-decoration:none;
  font-size:13px;
  font-weight:900;
}
.guide-nav a:hover{
  border-color:rgba(56,189,248,.55);
}
.guide-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 300px;
  gap:18px;
  align-items:start;
}
.guide-article{
  padding:28px;
  border:1px solid var(--border);
  border-radius:26px;
  background:linear-gradient(180deg,rgba(15,23,42,.86),rgba(15,23,42,.62));
  box-shadow:0 20px 70px rgba(0,0,0,.24);
}
.guide-article h2{
  margin:34px 0 12px;
  font-size:clamp(23px,3vw,33px);
}
.guide-article p,
.guide-article li{
  color:var(--muted);
  font-size:17px;
  line-height:1.78;
}
.guide-article a{
  color:#38bdf8;
  font-weight:900;
}
.guide-meta{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#38bdf8;
  background:rgba(56,189,248,.1);
  border:1px solid rgba(56,189,248,.22);
  border-radius:999px;
  padding:7px 10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
  margin-bottom:18px;
}
.guide-callout{
  margin:26px 0;
  padding:18px;
  border-radius:18px;
  border:1px solid rgba(56,189,248,.35);
  background:rgba(56,189,248,.08);
}
.guide-sidebar{
  position:sticky;
  top:18px;
  padding:18px;
  border:1px solid var(--border);
  border-radius:22px;
  background:rgba(255,255,255,.045);
}
.guide-sidebar h3{
  margin:0 0 12px;
}
.guide-sidebar a{
  display:block;
  color:var(--text);
  text-decoration:none;
  padding:10px 0;
  border-top:1px solid rgba(255,255,255,.08);
  font-weight:800;
  font-size:14px;
}
.guide-sidebar a:hover{
  color:#38bdf8;
}
.guides-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:18px;
}
.guide-card-link{
  display:block;
  padding:18px;
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.045);
  color:var(--text);
  text-decoration:none;
}
.guide-card-link strong{
  display:block;
  font-size:18px;
  margin-bottom:6px;
}
.guide-card-link span{
  color:var(--muted);
  font-size:14px;
  line-height:1.45;
}
.guide-cta{
  margin-top:22px;
  padding:18px;
  border-radius:20px;
  border:1px solid rgba(168,85,247,.35);
  background:rgba(168,85,247,.09);
}
.guide-cta a{
  display:inline-flex;
  margin-top:8px;
  padding:10px 14px;
  border-radius:999px;
  background:#38bdf8;
  color:#07111f;
  text-decoration:none;
  font-weight:900;
}
@media (max-width:900px){
  .guide-hero{grid-template-columns:1fr}
  .guide-nav{justify-content:flex-start}
  .guide-layout{grid-template-columns:1fr}
  .guide-sidebar{position:static}
}
@media (max-width:680px){
  .guide-page{width:min(100% - 20px, 1180px);padding-top:20px}
  .guide-article{padding:20px;border-radius:22px}
  .guides-list{grid-template-columns:1fr}
}


@media (max-width: 768px){
  .app{
    padding:16px 12px !important;
    overflow-x:hidden;
  }
  .hero{
    display:block !important;
    margin-bottom:18px !important;
  }
  h1{
    font-size: clamp(28px, 10vw, 52px) !important;
    line-height:1.05 !important;
  }
  .subtitle{
    font-size:15px !important;
  }
  .grid{
    grid-template-columns:1fr !important;
  }
  .card{
    padding:16px !important;
    border-radius:18px !important;
  }
  .tabs, .nav, .guide-nav{
    flex-wrap:wrap !important;
  }
  .version-badge, .version, .v-badge{
    transform:scale(.9);
  }
  body{
    overflow-x:hidden !important;
  }
}


/* v67 requested UI cleanup */
#pokemonSuggestions,
.pokemon-suggestions{
  display:none !important;
}

.form-card #familyBox{
  display:block;
  margin:10px 0 14px;
}

.form-card #familyBox.hidden{
  display:none;
}

.result-card #familyBox{
  display:none !important;
}

.stat-section{
  display:none !important;
}

.league-results{
  gap:10px;
}

.league-box .muted{
  line-height:1.45;
}

@media (max-width:768px){
  .league-box .muted{
    font-size:12px;
  }
}


/* v67 search cleanup */
#pokemonSelect{
  display:none !important;
}

#pokemonSuggestions.pokemon-suggestions{
  display:block !important;
}

#pokemonSuggestions.pokemon-suggestions.hidden{
  display:none !important;
}

/* v67 requested UI cleanup */
.form-card #familyBox{
  display:block;
  margin:10px 0 14px;
}

.form-card #familyBox.hidden{
  display:none;
}

.result-card #familyBox{
  display:none !important;
}

.stat-section{
  display:none !important;
}

.league-results{
  gap:10px;
}

.league-box .muted{
  line-height:1.45;
}

@media (max-width:768px){
  .league-box .muted{
    font-size:12px;
  }
}

#pokemonSuggestions{
  margin-top:8px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(15,23,42,.96);
  overflow:hidden;
  max-height:260px;
  overflow-y:auto;
  position:relative;
  z-index:50;
}

#pokemonSuggestions.hidden{
  display:none !important;
}

.pokemon-suggestion{
  width:100%;
  display:flex;
  justify-content:flex-start;
  text-align:left;
  border:0;
  border-bottom:1px solid rgba(255,255,255,.08);
  border-radius:0;
  background:transparent;
  color:var(--text);
  padding:10px 12px;
  font-weight:800;
}

.pokemon-suggestion:hover{
  background:rgba(56,189,248,.12);
}


/* v69 compact results experiment */
.league-results{
  display:none !important;
}

.stat-section{
  display:none !important;
}

.result-card{
  padding-top:18px;
}

#result .pokemon-title{
  margin-bottom:10px;
}

#familyBox{
  margin-bottom:12px;
}


/* v69 top rankings inside result + league buttons */
.result-card .top-rankings-box{
  margin:14px 0 0;
}

.top-league-buttons{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin:10px 0 12px;
}

.top-league-btn{
  min-height:38px;
  padding:8px 9px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.055);
  color:var(--text);
  font-size:13px;
  font-weight:900;
}

.top-league-btn.active{
  border-color:rgba(168,85,247,.8);
  background:rgba(168,85,247,.18);
  box-shadow:0 0 0 1px rgba(168,85,247,.24) inset;
}

.hidden-select{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  pointer-events:none !important;
}

@media (max-width:520px){
  .top-league-buttons{
    grid-template-columns:repeat(2,1fr);
  }
}


/* v85 clickable quick result pills */
.quick-clickable{
  cursor:pointer;
  transition:transform .15s ease, border-color .15s ease, background .15s ease;
}

.quick-clickable:hover,
.quick-clickable:focus{
  transform:translateY(-1px);
  border-color:rgba(56,189,248,.65) !important;
  background:rgba(56,189,248,.10) !important;
  outline:none;
}

/* v85 CMP target */
#cmpCheckerCard{
  scroll-margin-top:16px;
}


/* v85 rank colors unified */
.rank-gold{
  --rank-accent:#fbbf24;
}

.rank-pink{
  --rank-accent:#ec4899;
}

.rank-red{
  --rank-accent:#ef4444;
}

.selected-iv-card.rank-gold,
.selected-iv-card.rank-pink,
.selected-iv-card.rank-red{
  border-left:4px solid var(--rank-accent) !important;
}

.selected-iv-card.rank-gold strong:first-of-type,
.selected-iv-card.rank-pink strong:first-of-type,
.selected-iv-card.rank-red strong:first-of-type{
  color:var(--rank-accent) !important;
}


/* v85 safe rank colors */
.quick-pill.quick-elite{
  color:#fbbf24 !important;
  border-color:rgba(251,191,36,.55) !important;
  background:rgba(251,191,36,.10) !important;
}
.quick-pill.quick-keep{
  color:#ec4899 !important;
  border-color:rgba(236,72,153,.55) !important;
  background:rgba(236,72,153,.10) !important;
}
.quick-pill.quick-meta{
  color:#f97316 !important;
  border-color:rgba(249,115,22,.55) !important;
  background:rgba(249,115,22,.10) !important;
}
.quick-pill.quick-transfer{
  color:#ef4444 !important;
  border-color:rgba(239,68,68,.55) !important;
  background:rgba(239,68,68,.10) !important;
}

.quick-pill .quick-league,
.quick-pill .quick-decision{
  font-weight:900;
}

.quick-pill small{
  margin-left:4px;
  color:inherit;
  opacity:.95;
}

.rank-orange{
  --rank-accent:#f97316;
}

.selected-iv-card.rank-gold .selected-label,
.selected-iv-card.rank-pink .selected-label,
.selected-iv-card.rank-orange .selected-label,
.selected-iv-card.rank-red .selected-label{
  color:var(--rank-accent) !important;
}


/* v85 decision moved from Quick Results to Selected IV */
.quick-pill .quick-decision{
  display:none !important;
}

.selected-decision{
  display:block;
  margin-top:6px;
  font-style:normal;
  font-size:12px;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.selected-decision.decision-elite{
  color:#fbbf24;
}
.selected-decision.decision-keep{
  color:#ec4899;
}
.selected-decision.decision-meta{
  color:#f97316;
}
.selected-decision.decision-transfer{
  color:#ef4444;
}


/* v100-family-quick footer legal/navigation links */
.footer-links{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px 16px;
  margin:12px 0 4px;
  font-size:13px;
}

.footer-links a{
  color:var(--muted);
  text-decoration:none;
}

.footer-links a:hover{
  color:var(--accent);
  text-decoration:underline;
}


/* v100-family-quick visible footer fix */
.pvpium-footer{
  display:block !important;
  width:100% !important;
  max-width:1180px !important;
  margin:56px auto 24px !important;
  padding:24px 18px !important;
  text-align:center !important;
  color:var(--muted) !important;
  border-top:1px solid rgba(255,255,255,.12) !important;
  opacity:1 !important;
  visibility:visible !important;
}

.pvpium-footer p{
  margin:8px auto !important;
  max-width:900px !important;
  color:var(--muted) !important;
  font-size:13px !important;
  line-height:1.6 !important;
}

.pvpium-footer strong{
  color:var(--text) !important;
}

.pvpium-footer .footer-links{
  display:flex !important;
  flex-wrap:wrap !important;
  justify-content:center !important;
  align-items:center !important;
  gap:10px 18px !important;
  margin:14px 0 !important;
  opacity:1 !important;
  visibility:visible !important;
}

.pvpium-footer .footer-links a{
  display:inline-block !important;
  color:#7dd3fc !important;
  text-decoration:none !important;
  font-weight:800 !important;
  font-size:14px !important;
}

.pvpium-footer .footer-links a:hover{
  text-decoration:underline !important;
}


/* v100-family-quick single footer cleanup */
.pvpium-footer{
  display:block !important;
  width:100% !important;
  max-width:1180px !important;
  margin:56px auto 24px !important;
  padding:24px 18px !important;
  text-align:center !important;
  color:var(--muted) !important;
  border-top:1px solid rgba(255,255,255,.12) !important;
}
.pvpium-footer p{
  margin:8px auto !important;
  max-width:900px !important;
  color:var(--muted) !important;
  font-size:13px !important;
  line-height:1.6 !important;
}
.pvpium-footer strong{
  color:var(--text) !important;
}
.pvpium-footer .footer-links{
  display:flex !important;
  flex-wrap:wrap !important;
  justify-content:center !important;
  gap:10px 18px !important;
  margin:14px 0 !important;
}
.pvpium-footer .footer-links a{
  color:#7dd3fc !important;
  text-decoration:none !important;
  font-weight:800 !important;
  font-size:14px !important;
}
.pvpium-footer .footer-links a:hover{
  text-decoration:underline !important;
}


/* v100-family-quick force single footer */
.pvpium-footer{
  display:block !important;
  width:100% !important;
  max-width:1180px !important;
  margin:56px auto 24px !important;
  padding:24px 18px !important;
  text-align:center !important;
  color:var(--muted) !important;
  border-top:1px solid rgba(255,255,255,.12) !important;
  opacity:1 !important;
  visibility:visible !important;
}
.pvpium-footer p{
  margin:8px auto !important;
  max-width:900px !important;
  color:var(--muted) !important;
  font-size:13px !important;
  line-height:1.6 !important;
}
.pvpium-footer strong{
  color:var(--text) !important;
}
.pvpium-footer .footer-links{
  display:flex !important;
  flex-wrap:wrap !important;
  justify-content:center !important;
  gap:10px 18px !important;
  margin:14px 0 !important;
}
.pvpium-footer .footer-links a{
  color:#7dd3fc !important;
  text-decoration:none !important;
  font-weight:800 !important;
  font-size:14px !important;
}
.pvpium-footer .footer-links a:hover{
  text-decoration:underline !important;
}



/* v100-family-quick: Evolution Family Results using Quick Results style */
.family-league-results{
  margin:14px 0 16px;
}

.family-card{
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  background:rgba(255,255,255,.045);
  padding:14px;
}

.family-title{
  font-size:15px;
  font-weight:900;
  color:var(--text);
  margin-bottom:10px;
}

.family-quick-row{
  padding:10px 0;
  border-top:1px solid rgba(255,255,255,.08);
}

.family-quick-row:first-of-type{
  border-top:0;
}

.family-quick-name{
  color:var(--text);
  font-size:14px;
  font-weight:900;
  margin-bottom:8px;
}

.family-quick-pills{
  display:grid;
  grid-template-columns:repeat(4, minmax(72px, 1fr));
  gap:8px;
}

.family-quick-pill{
  margin:0 !important;
  width:100%;
  min-height:34px;
  justify-content:center;
  font-size:12px;
  white-space:nowrap;
}

@media (max-width:720px){
  .family-quick-pills{
    grid-template-columns:repeat(2, 1fr);
  }
}


/* v101 family width alignment fix */
.family-league-results{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

.family-card{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

.family-quick-row,
.family-quick-pills{
  width:100% !important;
  box-sizing:border-box !important;
}





/* v103 family no white gap - align with Top 250 card */
#familyLeagueResults{
  width:100% !important;
  max-width:100% !important;
  margin:14px 0 18px !important;
  padding:0 !important;
  box-sizing:border-box !important;
}

#familyLeagueResults .family-card{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 !important;
  padding:16px !important;
  box-sizing:border-box !important;
  background:rgba(255,255,255,.045) !important;
  border:1px solid rgba(255,255,255,.12) !important;
  border-radius:18px !important;
  overflow:hidden !important;
}

#familyLeagueResults .family-title{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 0 12px !important;
  padding:0 !important;
  color:var(--muted) !important;
  font-size:13px !important;
  font-weight:900 !important;
  letter-spacing:.1em !important;
  text-transform:uppercase !important;
  box-sizing:border-box !important;
}

#familyLeagueResults .family-quick-row{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 !important;
  padding:10px 0 !important;
  box-sizing:border-box !important;
  border-top:1px solid rgba(255,255,255,.08) !important;
}

#familyLeagueResults .family-quick-row:first-of-type{
  border-top:0 !important;
  padding-top:0 !important;
}

#familyLeagueResults .family-quick-name{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 0 8px !important;
  color:var(--text) !important;
  font-size:14px !important;
  font-weight:900 !important;
  box-sizing:border-box !important;
}

#familyLeagueResults .family-quick-pills{
  display:grid !important;
  width:100% !important;
  max-width:100% !important;
  grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
  gap:8px !important;
  margin:0 !important;
  padding:0 !important;
  box-sizing:border-box !important;
}

#familyLeagueResults .family-quick-pill{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  margin:0 !important;
  box-sizing:border-box !important;
  justify-content:center !important;
}

@media (max-width:720px){
  #familyLeagueResults .family-quick-pills{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  }
}


/* v105 family spacing */
#familyLeagueResults .family-quick-row{
  padding-top:16px !important;
  padding-bottom:16px !important;
}

#familyLeagueResults .family-quick-name{
  margin-bottom:12px !important;
}

#familyLeagueResults .family-quick-pills{
  gap:12px !important;
}


/* v106 arrow width fix */
#familyLeagueResults{
  width: calc(100% + 160px) !important;
  max-width: calc(100% + 160px) !important;
  margin-right: -160px !important;
}

#familyLeagueResults .family-card{
  width:100% !important;
  max-width:none !important;
}


/* v107 grow the visible Family Results card to the right */
#familyLeagueResults{
  overflow:visible !important;
}

#familyLeagueResults .family-card{
  width:calc(100% + 170px) !important;
  max-width:none !important;
  margin-right:-170px !important;
  box-sizing:border-box !important;
}

#familyLeagueResults .family-quick-pills{
  display:grid !important;
  grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
  gap:12px !important;
  width:100% !important;
}

#familyLeagueResults .family-quick-pill{
  width:100% !important;
  min-width:0 !important;
  justify-content:center !important;
}


/* v108 REAL FIX: family result same structural width as Top 250 */
#familyLeagueResults.family-league-results{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 0 18px 0 !important;
  padding:0 !important;
  box-sizing:border-box !important;
  overflow:visible !important;
}

#familyLeagueResults .family-card{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  margin-right:0 !important;
  padding:16px !important;
  box-sizing:border-box !important;
}

#familyLeagueResults .family-quick-row{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

#familyLeagueResults .family-quick-pills{
  display:grid !important;
  grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
  gap:12px !important;
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

#familyLeagueResults .family-quick-pill{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  justify-content:center !important;
  box-sizing:border-box !important;
}

@media (max-width:720px){
  #familyLeagueResults .family-quick-pills{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  }
}


.family-rank-highlight{
  outline:3px solid #facc15 !important;
  outline-offset:-2px !important;
  border-radius:4px !important;
}

/* =========================================================
   PVPium v120 Full Premium UI System
   Shared across IV Checker, Team Builder, Guides and Legal pages
   ========================================================= */
:root{
  --bg:#070914;
  --bg2:#0b1024;
  --surface:rgba(17,24,39,.72);
  --surface2:rgba(30,41,59,.72);
  --surface3:rgba(255,255,255,.06);
  --line:rgba(255,255,255,.12);
  --line2:rgba(124,77,255,.28);
  --txt:#f8fafc;
  --txt2:#b9c3d7;
  --txt3:#7f8da8;
  --violet:#8b5cf6;
  --violet2:#6d5dfc;
  --cyan:#22d3ee;
  --blue:#38bdf8;
  --green:#34d399;
  --orange:#fb923c;
  --red:#fb7185;
  --yellow:#facc15;
  --shadow:0 24px 90px rgba(0,0,0,.42);
  --radius:24px;
}
html{scroll-behavior:smooth}
body{
  min-height:100vh;
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% -10%, rgba(124,77,255,.42), transparent 34%),
    radial-gradient(circle at 86% 6%, rgba(34,211,238,.26), transparent 28%),
    linear-gradient(145deg, var(--bg), var(--bg2) 52%, #060816);
  color:var(--txt);
}
body:before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;
  background-image:linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size:46px 46px;mask-image:linear-gradient(to bottom, black, transparent 88%);
}
.app,.guide-page{max-width:1240px;margin:0 auto;padding:32px 18px 48px}.guide-page{max-width:1120px}
.hero,.guide-hero{
  position:relative;overflow:hidden;align-items:center;padding:24px;border:1px solid var(--line);border-radius:30px;
  background:linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  box-shadow:var(--shadow);backdrop-filter:blur(18px);margin-bottom:22px;
}
.hero:after,.guide-hero:after{content:"";position:absolute;right:-110px;top:-100px;width:300px;height:300px;background:radial-gradient(circle, rgba(139,92,246,.38), transparent 66%);filter:blur(6px)}
.eyebrow,.guide-brand,.guide-meta{display:inline-flex;align-items:center;gap:8px;color:#bfefff;font-weight:900;letter-spacing:.08em;text-transform:uppercase;font-size:12px}.eyebrow:before,.guide-brand:before{content:"✦";color:var(--cyan)}
h1{font-size:clamp(32px,5vw,62px);letter-spacing:-.055em;line-height:.95;color:#f8fafc;text-wrap:balance}.hero h1:empty:after{content:"IV Rank Checker"}
.subtitle,.guide-hero p,.muted{color:var(--txt2)}
.top-tools-nav,.guide-nav{display:flex;flex-wrap:wrap;gap:10px;z-index:1}.top-tools-nav a,.guide-nav a,.footer-links a{
  text-decoration:none;color:var(--txt2);font-weight:800;border:1px solid var(--line);background:rgba(255,255,255,.055);border-radius:999px;padding:10px 14px;transition:.18s ease;
}
.top-tools-nav a:hover,.top-tools-nav a.active,.guide-nav a:hover{color:white;border-color:rgba(139,92,246,.7);background:linear-gradient(135deg, rgba(124,77,255,.32), rgba(34,211,238,.14));transform:translateY(-1px)}
.grid{grid-template-columns:minmax(330px,.82fr) minmax(0,1.55fr);gap:20px;align-items:start}.card,.guide-article,.guide-sidebar,.tb-panel,.intro-card{
  border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.042));box-shadow:var(--shadow);backdrop-filter:blur(18px)
}
.card{padding:22px}.form-card{position:sticky;top:18px}.card h2,.guide-article h2{letter-spacing:-.03em}.form-card h2:before{content:"🔍 ";font-size:.9em}.result-card h2:before{content:"🏆 ";font-size:.9em}
label{color:var(--txt2);font-weight:760;font-size:13px;letter-spacing:.01em}select,input,button,textarea{
  border:1px solid rgba(255,255,255,.12);border-radius:15px;padding:13px 14px;outline:none;transition:border .18s ease, box-shadow .18s ease, transform .18s ease;background:rgba(2,6,23,.54);color:var(--txt)
}select:focus,input:focus,textarea:focus{border-color:rgba(34,211,238,.55);box-shadow:0 0 0 4px rgba(34,211,238,.12)}button{background:linear-gradient(135deg,var(--violet),var(--cyan));color:white;font-weight:950;border:0;box-shadow:0 12px 30px rgba(99,102,241,.22)}button:hover{transform:translateY(-1px);filter:brightness(1.06)}
.iv-grid{gap:12px}.quick-results-bar,.fmt-row,.top-league-buttons,.selection-actions,.cmp-leagues{display:flex;flex-wrap:wrap;gap:9px}.quick-pill,.fmt-chip,.top-league-btn,.family-quick-pill{
  width:auto;margin:0;border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.065);color:var(--txt);padding:9px 12px;font-weight:900
}.quick-view-btn{width:auto;margin:0;margin-left:auto;padding:9px 14px}.fmt-chip input{width:auto;margin:0 5px 0 0}.fmt-chip{display:inline-flex;align-items:center;margin:0;cursor:pointer}.name-box,.league-box,.stat-section,.family-card,.cmp-box,.cmp-card,.selected-iv-comparison,.stat-filters{background:rgba(2,6,23,.38);border:1px solid var(--line);border-radius:20px}.league-name{color:var(--txt3);font-weight:950}.copy-row button{background:rgba(139,92,246,.22);border:1px solid rgba(139,92,246,.45)}
@media(min-width:981px){
  .quick-results-bar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .quick-results-bar .quick-pill{width:100%;text-align:center}
  .quick-results-bar .quick-view-btn{grid-column:1/-1;width:100%;margin:0;padding:11px 14px}
}
.premium-result-hero{display:grid;grid-template-columns:150px minmax(0,1fr) 150px;gap:18px;align-items:center;border:1px solid rgba(139,92,246,.28);border-radius:26px;padding:18px;background:linear-gradient(135deg, rgba(124,77,255,.22), rgba(34,211,238,.08) 55%, rgba(255,255,255,.04));position:relative;overflow:hidden}.premium-result-hero:after{content:"";position:absolute;inset:auto -70px -90px auto;width:190px;height:190px;background:radial-gradient(circle, rgba(34,211,238,.25), transparent 68%)}
.pokemon-art-frame{height:150px;border-radius:25px;display:grid;place-items:center;background:radial-gradient(circle at 50% 42%, rgba(255,255,255,.16), rgba(255,255,255,.04));border:1px solid rgba(255,255,255,.12)}#pokemonSprite{max-width:138px;max-height:138px;filter:drop-shadow(0 18px 24px rgba(0,0,0,.42))}.hero-kicker,.hero-rank-label{display:block;color:#a5f3fc;text-transform:uppercase;font-size:11px;letter-spacing:.12em;font-weight:950}.result-name{font-size:clamp(28px,4vw,44px);letter-spacing:-.04em}.type-line{background:linear-gradient(135deg,rgba(34,211,238,.16),rgba(139,92,246,.18));border:1px solid rgba(34,211,238,.22)}.hero-rank-panel{text-align:center;border:1px solid rgba(255,255,255,.14);border-radius:22px;padding:16px;background:rgba(2,6,23,.4)}.hero-rank-panel strong{display:block;font-size:42px;line-height:1;color:#fff}.hero-rank-panel small{color:var(--txt2);font-weight:800}.hero-stat-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:14px 0 18px}.hero-stat-strip div{border:1px solid var(--line);border-radius:18px;padding:14px;background:rgba(255,255,255,.055)}.hero-stat-strip span{display:block;color:var(--txt3);font-size:11px;text-transform:uppercase;font-weight:950;letter-spacing:.08em}.hero-stat-strip strong{display:block;margin-top:5px;font-size:18px}.league-results{grid-template-columns:repeat(4,1fr)}.league-box{padding:14px}.rank{font-size:30px}.league-box:nth-child(1){border-color:rgba(52,211,153,.28)}.league-box:nth-child(2){border-color:rgba(139,92,246,.32)}.league-box:nth-child(3){border-color:rgba(251,146,60,.32)}.league-box:nth-child(4){border-color:rgba(56,189,248,.32)}.small-decision{display:inline-flex;margin-top:8px;padding:6px 10px;font-size:12px}
.family-card{padding:16px;margin:18px 0}.family-title{font-size:13px;text-transform:uppercase;letter-spacing:.1em;color:var(--txt3);font-weight:950;margin-bottom:10px}.family-quick-row{display:grid;grid-template-columns:160px 1fr;gap:10px;align-items:center;padding:12px;border-radius:16px;background:rgba(255,255,255,.045);margin:8px 0}.family-quick-name{font-weight:950}.family-quick-pills{display:flex;gap:8px;flex-wrap:wrap}.family-quick-pill{cursor:pointer}.family-quick-pill.rank-good{border-color:rgba(52,211,153,.45);color:#bbf7d0}.family-quick-pill.rank-mid{border-color:rgba(250,204,21,.42);color:#fde68a}.family-quick-pill.rank-bad{border-color:rgba(251,113,133,.38);color:#fecdd3}
.top-rankings{overflow:auto;max-height:620px;border-radius:18px}.top-rankings-table{width:100%;border-collapse:separate;border-spacing:0 7px}.top-rankings-table th{position:sticky;top:0;background:#12182d;color:var(--txt3);z-index:1}.top-rankings-table td,.top-rankings-table th{padding:10px 12px;text-align:left}.top-rankings-table tbody tr{background:rgba(255,255,255,.045);transition:.15s ease}.top-rankings-table tbody tr:hover{background:rgba(139,92,246,.16);transform:scale(1.005)}.top-rank-one{outline:1px solid rgba(250,204,21,.45)}.selected-rank-row{outline:2px solid rgba(34,211,238,.85);background:rgba(34,211,238,.14)!important}.stat-filter-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.stat-filter-head button{width:auto;margin:0;padding:9px 12px;background:rgba(255,255,255,.08);border:1px solid var(--line)}input[type=range]{accent-color:var(--cyan)}
.cmp-box{margin-top:18px;padding:16px}.cmp-head{display:flex;justify-content:space-between;gap:12px}.cmp-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.cmp-card{padding:14px}.cmp-iv-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.cmp-result{margin-top:12px;border-radius:16px;padding:14px;background:rgba(34,211,238,.08);border:1px solid rgba(34,211,238,.18)}
.home-guides-section{max-width:1240px;margin:22px auto}.guides-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.guide-card-link{display:block;text-decoration:none;color:var(--txt);border:1px solid var(--line);border-radius:20px;background:linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.035));padding:18px;transition:.18s ease}.guide-card-link:hover{transform:translateY(-3px);border-color:rgba(139,92,246,.55);box-shadow:0 16px 45px rgba(0,0,0,.24)}.guide-card-link strong{display:block;font-size:17px}.guide-card-link span{display:block;color:var(--txt2);margin-top:6px;line-height:1.45}.site-footer{max-width:1240px;margin:24px auto 0;color:var(--txt2);border:1px solid var(--line);border-radius:24px;padding:22px;background:rgba(255,255,255,.045)}.footer-links{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}.version-corner{position:fixed;right:12px;bottom:10px;border:1px solid var(--line);border-radius:999px;background:rgba(2,6,23,.72);color:var(--txt3);font-size:11px;padding:5px 9px;backdrop-filter:blur(10px)}.scroll-top-btn{position:fixed;right:16px;bottom:48px;width:44px;height:44px;border-radius:999px;margin:0;padding:0}
/* Guide / content pages */
.guide-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:20px;align-items:start}.guide-article{padding:28px;line-height:1.75}.guide-article p,.guide-article li{color:var(--txt2)}.guide-article a{color:#93c5fd;font-weight:800}.guide-sidebar{position:sticky;top:18px;padding:20px}.guide-sidebar a{display:block;color:var(--txt2);text-decoration:none;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.08);font-weight:800}.guide-sidebar a:hover{color:white}.guide-cta{margin-top:16px;border-radius:20px;padding:16px;background:linear-gradient(135deg,rgba(124,77,255,.22),rgba(34,211,238,.08));border:1px solid rgba(139,92,246,.28)}.guide-cta a{display:inline-flex;border:0;background:linear-gradient(135deg,var(--violet),var(--cyan));color:white;border-radius:999px;padding:10px 14px;margin-top:8px}
@media(max-width:980px){.grid,.guide-layout,.tb-grid{grid-template-columns:1fr!important}.form-card,.guide-sidebar{position:static}.premium-result-hero{grid-template-columns:112px 1fr}.hero-rank-panel{grid-column:1/-1}.hero-stat-strip,.league-results{grid-template-columns:repeat(2,1fr)}.guides-list{grid-template-columns:1fr}}
@media(max-width:640px){.app,.guide-page{padding:16px 12px 36px}.hero,.guide-hero{padding:18px;border-radius:24px}.top-tools-nav a,.guide-nav a{flex:1;text-align:center}.premium-result-hero{grid-template-columns:1fr;text-align:center}.pokemon-art-frame{height:132px}.hero-stat-strip,.league-results,.cmp-grid,.cmp-iv-grid,.family-quick-row,.calc-settings-row{grid-template-columns:1fr}.quick-view-btn{width:100%;margin-left:0}.iv-grid{grid-template-columns:repeat(3,1fr)}.card{padding:16px}.guide-article{padding:20px}.top-rankings-table{font-size:13px}.top-rankings-table td,.top-rankings-table th{padding:8px}}

/* =========================================================
   PVPium + Product Polish Layer
   ========================================================= */
.form-card{overflow:visible}
#pokemonSearch{font-weight:850;font-size:17px;padding-left:16px;background:linear-gradient(180deg,rgba(2,6,23,.72),rgba(15,23,42,.68));}
.pokemon-suggestions{
  position:absolute;z-index:40;margin-top:-8px;width:min(100%,420px);max-height:390px;overflow:auto;
  border:1px solid rgba(139,92,246,.34);border-radius:22px;padding:8px;
  background:rgba(7,9,20,.96);box-shadow:0 28px 80px rgba(0,0,0,.48);backdrop-filter:blur(20px);
}
.pokemon-suggestion{
  width:100%;display:flex;align-items:center;gap:12px;margin:0 0 6px;padding:10px 12px;border-radius:16px;
  background:transparent;border:1px solid transparent;color:var(--txt);box-shadow:none;text-align:left;
}
.pokemon-suggestion:hover{background:rgba(139,92,246,.16);border-color:rgba(139,92,246,.28);transform:none;filter:none}
.pokemon-suggestion span{display:grid;gap:2px}.pokemon-suggestion strong{font-size:14px}.pokemon-suggestion small{font-size:11px;color:var(--txt3);font-weight:800}.suggestion-sprite{width:42px;height:42px;object-fit:contain;filter:drop-shadow(0 8px 14px rgba(0,0,0,.35))}
.pokemon-mini-placeholder{display:grid;place-items:center;width:42px;height:42px;border-radius:999px;background:rgba(255,255,255,.08);font-weight:950}
.pokemon-art-frame{position:relative}.pokemon-art-frame:before{content:"";position:absolute;inset:16px;border-radius:999px;background:radial-gradient(circle,rgba(255,255,255,.18),transparent 64%);filter:blur(4px)}
#pokemonSprite{position:relative;z-index:1;transition:transform .22s ease, filter .22s ease}.premium-result-hero:hover #pokemonSprite{transform:translateY(-4px) scale(1.035);filter:drop-shadow(0 24px 28px rgba(0,0,0,.48))}
.family-evo-card{grid-template-columns:minmax(190px,.8fr) minmax(0,1.2fr)!important;border:1px solid rgba(255,255,255,.1);transition:.18s ease}
.family-evo-card:hover{background:rgba(139,92,246,.11)!important;border-color:rgba(139,92,246,.32);transform:translateY(-1px)}
.family-quick-main{display:flex;align-items:center;gap:12px;min-width:0}.family-sprite{width:54px;height:54px;object-fit:contain;border-radius:16px;background:radial-gradient(circle,rgba(255,255,255,.13),rgba(255,255,255,.04));border:1px solid rgba(255,255,255,.1);padding:4px;filter:drop-shadow(0 10px 16px rgba(0,0,0,.34))}.family-quick-main small{color:var(--txt3);font-weight:800}.family-quick-name{margin:0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quick-elite{background:linear-gradient(135deg,rgba(250,204,21,.24),rgba(139,92,246,.16))!important;border-color:rgba(250,204,21,.48)!important;color:#fef3c7!important}.quick-keep{background:rgba(52,211,153,.14)!important;border-color:rgba(52,211,153,.34)!important;color:#bbf7d0!important}.quick-meta{background:rgba(251,146,60,.14)!important;border-color:rgba(251,146,60,.34)!important;color:#fed7aa!important}.quick-transfer{background:rgba(251,113,133,.1)!important;border-color:rgba(251,113,133,.22)!important;color:#fecdd3!important}
.card{animation:pvpiumFadeUp .28s ease both}.result-card{animation-delay:.03s}@keyframes pvpiumFadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.top-rankings-table tbody tr td:first-child{font-weight:950;color:#e0e7ff}.top-rankings-table tbody tr.top-rank-one td:first-child{color:#facc15}.selected-iv-comparison{border-color:rgba(34,211,238,.32)!important;background:linear-gradient(135deg,rgba(34,211,238,.1),rgba(139,92,246,.08))!important}.top-league-btn[data-league="LL"]{--league:#34d399}.top-league-btn[data-league="GL"]{--league:#8b5cf6}.top-league-btn[data-league="UL"]{--league:#fb923c}.top-league-btn[data-league="ML"]{--league:#38bdf8}.top-league-btn.active{background:linear-gradient(135deg,var(--league),rgba(255,255,255,.08))!important;color:white!important;border-color:color-mix(in srgb,var(--league),white 12%)!important}
.site-footer strong:after{content:"  ";font-size:11px;color:var(--txt3);font-weight:800;margin-left:8px}
@media(max-width:640px){.pokemon-suggestions{position:fixed;left:12px;right:12px;top:145px;width:auto;max-height:58vh}.family-evo-card{grid-template-columns:1fr!important}.family-quick-pills{grid-template-columns:repeat(2,minmax(0,1fr))!important}.suggestion-sprite{width:38px;height:38px}.family-sprite{width:48px;height:48px}}

/* v122 dedicated CMP Checker page */
.cmp-app{max-width:1180px}.cmp-hero h1{margin:6px 0 8px;font-size:clamp(2.25rem,5vw,4.2rem);letter-spacing:-.05em}.cmp-page-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:18px;align-items:start}.cmp-page-card{padding:22px}.cmp-page-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:18px}.cmp-leagues-page{margin:0;display:flex;flex-wrap:wrap;justify-content:flex-end}.cmp-vs-grid{display:grid;grid-template-columns:minmax(0,1fr) 74px minmax(0,1fr);gap:14px;align-items:stretch}.cmp-battle-card{position:relative;min-height:260px;padding:18px;background:linear-gradient(180deg,rgba(255,255,255,.085),rgba(255,255,255,.035));border:1px solid rgba(148,163,184,.22);box-shadow:0 18px 44px rgba(2,6,23,.28)}.cmp-player-label{display:inline-flex;align-items:center;gap:8px;margin-bottom:12px;padding:7px 10px;border-radius:999px;background:rgba(124,77,255,.18);border:1px solid rgba(124,77,255,.35);font-weight:950;color:#eef2ff}.cmp-vs-badge{align-self:center;justify-self:center;width:64px;height:64px;border-radius:999px;display:grid;place-items:center;font-weight:1000;letter-spacing:.04em;color:white;background:linear-gradient(135deg,#7c4dff,#22d3ee);box-shadow:0 0 0 8px rgba(124,77,255,.10),0 18px 50px rgba(34,211,238,.16)}.cmp-result-page{margin-top:18px;font-size:1.05rem;line-height:1.75;background:linear-gradient(135deg,rgba(34,211,238,.12),rgba(124,77,255,.12));border-color:rgba(34,211,238,.3)}.cmp-help-card{position:sticky;top:16px;padding:22px}.cmp-help-card h2{margin:6px 0 10px}.cmp-tips{display:grid;gap:10px;margin:18px 0}.cmp-tips div{display:flex;gap:10px;align-items:center;padding:12px;border-radius:16px;background:rgba(2,6,23,.32);border:1px solid var(--line)}.cmp-tips strong{width:28px;height:28px;border-radius:999px;display:grid;place-items:center;background:rgba(34,211,238,.15);border:1px solid rgba(34,211,238,.25);color:#a5f3fc}.button-link{display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;border-radius:14px;padding:10px 14px;font-weight:950;color:white;background:linear-gradient(135deg,rgba(124,77,255,.9),rgba(34,211,238,.72));border:1px solid rgba(255,255,255,.18);box-shadow:0 12px 28px rgba(2,6,23,.25)}.button-link.full{width:100%}.tool-crosslink{margin-top:18px;padding:16px;border-radius:20px;background:linear-gradient(135deg,rgba(124,77,255,.12),rgba(34,211,238,.09));border:1px solid rgba(148,163,184,.20);display:flex;align-items:center;justify-content:space-between;gap:14px}.cmp-win{font-weight:1000;color:#86efac}.cmp-tie{font-weight:1000;color:#fde68a}
@media(max-width:900px){.cmp-page-layout{grid-template-columns:1fr}.cmp-help-card{position:static}.cmp-page-head{display:block}.cmp-leagues-page{justify-content:flex-start;margin-top:12px}.cmp-vs-grid{grid-template-columns:1fr}.cmp-vs-badge{width:54px;height:54px;margin:2px auto}.tool-crosslink{align-items:flex-start;flex-direction:column}.button-link{width:100%}}

.home-seo-panel{max-width:var(--pvpium-page-width,1180px);width:calc(100% - 36px);margin:0 auto 20px;padding:26px;border:1px solid var(--line);border-radius:24px;background:linear-gradient(135deg,rgba(15,23,42,.9),rgba(30,41,59,.72));box-shadow:0 22px 70px rgba(0,0,0,.24);display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;align-items:end}.home-seo-panel h1{margin:8px 0 10px;font-size:clamp(30px,4vw,48px)}.home-seo-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}.button-link.secondary{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18)}.home-content-grid{max-width:var(--pvpium-page-width,1180px);width:calc(100% - 36px);margin:22px auto 0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.content-card{line-height:1.7}.content-card h2{margin-top:0}.content-card h3{margin:18px 0 8px}.content-card p,.content-card li{color:var(--txt2)}.content-card ul{padding-left:20px}.cmp-content-grid{width:100%;margin-top:20px}@media(max-width:900px){.home-seo-panel{grid-template-columns:1fr}.home-seo-actions{justify-content:flex-start}.home-content-grid{grid-template-columns:1fr}}@media(max-width:760px){.home-seo-panel,.home-content-grid{width:calc(100% - 24px)}.home-seo-panel{padding:20px}}


/* v126 fixed simple version badge */
.version-corner{
  position:fixed !important;
  right:12px !important;
  bottom:10px !important;
  z-index:2147483647 !important;
  transform:none !important;
  transition:none !important;
  animation:none !important;
  pointer-events:none;
  user-select:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:38px;
  padding:5px 9px !important;
  border:1px solid rgba(255,255,255,.14) !important;
  border-radius:999px !important;
  background:rgba(2,6,23,.78) !important;
  color:rgba(226,232,240,.72) !important;
  font-size:11px !important;
  font-weight:900 !important;
  line-height:1 !important;
  backdrop-filter:blur(10px);
}
.version-corner:hover{transform:none !important;}

.hero .badge{position:relative;z-index:1000;}
.hero .badge a{display:block;pointer-events:auto;}

/* v130 mobile responsive hardening */
html, body{
  width:100%;
  max-width:100%;
  overflow-x:hidden !important;
}
img, svg, canvas, video{max-width:100%;height:auto;}
.app,.guide-page,.home-guides-section,.site-footer{
  width:min(100%,1240px);
  max-width:100%;
}
.grid,.card,.form-card,.result-card,.guide-article,.guide-sidebar,.hero,.guide-hero,
.name-box,.league-box,.stat-section,.family-card,.cmp-box,.cmp-card,.selected-iv-comparison,.stat-filters,
.premium-result-hero,.hero-stat-strip,.league-results,.quick-results-bar,.fmt-row,.top-league-buttons,.selection-actions,
.copy-row,.family-quick-row,.family-quick-main,.family-quick-pills{
  min-width:0 !important;
  max-width:100% !important;
}
select,input,button,textarea,code{min-width:0;max-width:100%;}

@media(max-width:640px){
  .app,.guide-page{
    width:100% !important;
    padding-left:12px !important;
    padding-right:12px !important;
  }
  .hero,.guide-hero,.card,.guide-article,.guide-sidebar,.site-footer{
    width:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;
  }
  .top-tools-nav,.guide-nav{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    width:100%;
  }
  .top-tools-nav a,.guide-nav a{
    width:100% !important;
    min-width:0 !important;
    padding:12px 8px !important;
    white-space:normal !important;
    line-height:1.18;
  }
  .quick-results-bar,.fmt-row,.top-league-buttons,.selection-actions,.cmp-leagues{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
  }
  .quick-pill,.fmt-chip,.top-league-btn,.family-quick-pill,.stat-filter-head button{
    width:100% !important;
    min-width:0 !important;
    justify-content:center;
    text-align:center;
  }
  .iv-grid,.cmp-iv-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
  label{min-width:0;}
  input,select,textarea{font-size:16px !important;}
  #pokemonSearch{
    width:100% !important;
    font-size:16px !important;
    text-overflow:ellipsis;
  }
  .stat-filter-head{
    display:grid !important;
    grid-template-columns:1fr 1fr;
    gap:10px;
  }
  .stat-filter-head h3{
    grid-column:1/-1;
    margin-bottom:2px;
  }
  .stat-filters,.stat-section{
    overflow:hidden !important;
  }
  .stat-filters input[type=range],.stat-section input[type=range]{
    width:100% !important;
  }
  .top-rankings{
    width:100% !important;
    max-width:100% !important;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch;
  }
  .top-rankings-table{
    width:max-content !important;
    min-width:100% !important;
    font-size:14px !important;
  }
  .top-rankings-table td,.top-rankings-table th{
    padding:9px 10px !important;
    white-space:nowrap;
  }
  .copy-row{
    display:grid !important;
    grid-template-columns:1fr;
  }
  .copy-row button{width:100% !important;}
  .pokemon-suggestions{
    left:12px !important;
    right:12px !important;
    width:auto !important;
    max-width:calc(100vw - 24px) !important;
  }
  .scroll-top-btn{right:12px !important;bottom:50px !important;}
  .version-corner{right:12px !important;bottom:10px !important;}
}

@media(max-width:380px){
  .quick-results-bar,.fmt-row,.top-league-buttons,.selection-actions,.cmp-leagues{
    grid-template-columns:1fr !important;
  }
  .iv-grid,.cmp-iv-grid{grid-template-columns:1fr !important;}
}


/* v130: mobile autocomplete fix - keep suggestions directly under search input on iOS keyboard */
@media (max-width: 640px){
  #pokemonSuggestions.pokemon-suggestions,
  .form-card #pokemonSuggestions.pokemon-suggestions{
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 230px !important;
    margin: 8px 0 14px !important;
    transform: none !important;
  }
}


/* v134 mobile nav tap fix */
@media (max-width: 760px){
  header,
  .site-header,
  .topbar,
  .nav,
  .tools-nav,
  .main-nav,
  .header-nav,
  .nav-links{
    position:relative !important;
    z-index:9999 !important;
    pointer-events:auto !important;
  }

  header a,
  .site-header a,
  .topbar a,
  .nav a,
  .tools-nav a,
  .main-nav a,
  .header-nav a,
  .nav-links a{
    position:relative !important;
    z-index:10000 !important;
    pointer-events:auto !important;
    touch-action:manipulation !important;
    -webkit-tap-highlight-color:rgba(34,211,238,.25);
  }

  header::before,
  header::after,
  .site-header::before,
  .site-header::after,
  .topbar::before,
  .topbar::after,
  .hero::before,
  .hero::after,
  .page-hero::before,
  .page-hero::after{
    pointer-events:none !important;
  }
}


/* Mobile autocomplete: keep results between the input and the on-screen keyboard. */
.cmp-pokemon-suggestions{
  position:absolute;
  left:18px;
  right:18px;
  z-index:1000;
  margin-top:6px;
  max-height:260px;
  overflow-y:auto;
  border:1px solid rgba(148,163,184,.25);
  border-radius:14px;
  background:#08101e;
  box-shadow:0 20px 50px rgba(0,0,0,.45);
  padding:6px;
}
.cmp-pokemon-suggestions.hidden{display:none}
.cmp-pokemon-suggestion{
  display:block;
  width:100%;
  border:0;
  border-radius:10px;
  padding:11px 12px;
  text-align:left;
  background:transparent;
  color:#f8fafc;
  font-weight:850;
  cursor:pointer;
}
.cmp-pokemon-suggestion:hover{background:rgba(139,92,246,.16)}
@media(max-width:640px){
  #pokemonSuggestions.pokemon-suggestions,
  .form-card #pokemonSuggestions.pokemon-suggestions{
    max-height:220px !important;
    overflow-y:auto !important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
  .cmp-pokemon-suggestions{
    max-height:220px;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
}

.pwa-install-banner{
  position:fixed!important;
  left:10px!important;
  right:10px!important;
  bottom:10px!important;
  z-index:10020!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:8px!important;
  min-height:0!important;
  max-height:96px!important;
  margin:0!important;
  padding:10px 42px 10px 12px!important;
  border:1px solid rgba(56,189,248,.22)!important;
  border-radius:14px!important;
  background:linear-gradient(135deg,rgba(15,23,42,.97),rgba(30,41,59,.95))!important;
  box-shadow:0 12px 34px rgba(0,0,0,.34)!important;
  color:#f8fafc!important;
  backdrop-filter:blur(10px);
  overflow:visible!important;
}
.pwa-install-banner[hidden]{display:none!important}
.pwa-install-banner div{min-width:0!important;display:grid!important;gap:2px!important}
.pwa-install-banner strong{font-size:12px!important;font-weight:950!important;line-height:1.1!important;color:#f8fafc!important}
.pwa-install-banner span,.pwa-install-banner p{margin:0!important;color:#cbd5e1!important;font-size:10px!important;line-height:1.25!important}
.pwa-install-banner button{
  width:auto!important;
  min-width:58px!important;
  max-width:96px!important;
  height:auto!important;
  border:0!important;
  border-radius:10px!important;
  padding:8px 12px!important;
  background:linear-gradient(135deg,#38bdf8,#8b5cf6)!important;
  color:#06111f!important;
  font-weight:950!important;
  font-size:12px!important;
  line-height:1!important;
  cursor:pointer!important;
  white-space:nowrap!important;
}
.pwa-install-banner .pwa-install-close{
  position:absolute!important;
  top:8px!important;
  right:8px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:26px!important;
  min-width:26px!important;
  max-width:26px!important;
  height:26px!important;
  padding:0!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.12)!important;
  color:#e2e8f0!important;
  font-size:18px!important;
  line-height:1!important;
}
@media(min-width:761px){
  .pwa-install-banner{display:none!important}
}

.scroll-top-btn{
  position:fixed!important;
  right:18px!important;
  bottom:58px!important;
  width:46px!important;
  height:46px!important;
  z-index:99999!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin:0!important;
  padding:0!important;
  border:1px solid rgba(125,211,252,.48)!important;
  border-radius:999px!important;
  background:linear-gradient(135deg,#0f172a,#12304a 54%,#155e75)!important;
  color:#e0f2fe!important;
  box-shadow:0 14px 34px rgba(8,13,24,.34),0 0 0 1px rgba(139,92,246,.12) inset!important;
  font-size:22px!important;
  font-weight:950!important;
  line-height:1!important;
  cursor:pointer!important;
  opacity:0;
  pointer-events:none;
  transform:translateY(12px);
  transition:opacity .18s ease, transform .18s ease, border-color .18s ease, filter .18s ease;
}
.scroll-top-btn.show{
  opacity:1!important;
  pointer-events:auto!important;
  transform:translateY(0)!important;
}
.scroll-top-btn:hover{
  transform:translateY(-2px)!important;
  border-color:rgba(34,211,238,.75)!important;
  filter:brightness(1.08);
}
@media(max-width:760px){
  .scroll-top-btn{
    right:12px!important;
    bottom:58px!important;
    width:42px!important;
    height:42px!important;
    font-size:20px!important;
  }
}

.version-corner{
  display:none!important;
}
