/* =============================================
   RESET & BASE (matches homepage)
   ============================================= */

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

:root {
  --red:        #D42B1E;
  --red-dark:   #8C1C12;
  --red-mid:    #B02418;
  --yellow:     #F2C12E;
  --yellow-dim: #8A6D18;
  --black:      #0E0E14;
  --surface-1:  #14141C;
  --surface-2:  #1C1C28;
  --surface-3:  #242433;
  --surface-4:  #2C2C40;
  --border:     rgba(255,255,255,0.07);
  --border-med: rgba(255,255,255,0.12);
  --text-1:     #F0F0F0;
  --text-2:     #9898B0;
  --text-3:     #5A5A72;

  --font-pixel: 'Press Start 2P', monospace;
  --font-cond:  'Barlow Condensed', sans-serif;
  --font-body:  'Barlow', sans-serif;

  /* type colors */
  --t-normal:   #9A9A78;
  --t-fire:     #E8722A;
  --t-water:    #5A8EE8;
  --t-electric: #D4A81A;
  --t-grass:    #5AB840;
  --t-ice:      #7ACECE;
  --t-fighting: #B82820;
  --t-poison:   #8830A0;
  --t-ground:   #C8A840;
  --t-flying:   #8878E0;
  --t-psychic:  #E04060;
  --t-bug:      #90A010;
  --t-rock:     #A89028;
  --t-ghost:    #584880;
  --t-dragon:   #5018E0;
  --t-dark:     #504030;
  --t-steel:    #9898B8;
  --t-fairy:    #D070A8;
}

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* =============================================
   NAV (identical to homepage)
   ============================================= */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(14,14,20,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 48px;
}

.wordmark {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text-1);
  text-decoration: none;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.wordmark span { color: var(--red); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 32px;
  flex: 1;
}

.nav-links a {
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-2);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-1); }

.nav-links a.active {
  color: var(--red);
}

.nav-open {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--red);
  color: white;
  padding: 8px 22px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: background 0.15s;
  box-shadow: 0 3px 0 var(--red-dark);
}

.nav-open:hover { background: #E03020; }

/* =============================================
   VIEW SYSTEM
   ============================================= */

.view { display: none; }
.view.active-view { display: block; }
.hidden { display: none !important; }

/* =============================================
   LIST VIEW — HEADER
   ============================================= */

.list-header {
  padding-top: 60px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 100;
}

.list-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.list-title-block {
  flex-shrink: 0;
}

.page-kicker {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.page-title {
  font-family: var(--font-cond);
  font-size: 32px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--text-1);
}

.list-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}

/* Search */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 36px 9px 36px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: var(--text-3); }
.search-input:focus { border-color: var(--border-med); }

.search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  display: none;
}

.search-clear.visible { display: block; }

/* Filters */
.filter-group {
  display: flex;
  gap: 8px;
}

.filter-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 14px;
  font-family: var(--font-cond);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%235A5A72' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.filter-select:focus { border-color: var(--border-med); color: var(--text-1); }

.results-count {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-3);
  white-space: nowrap;
  margin-left: auto;
}

/* =============================================
   DEX TABLE
   ============================================= */

.table-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px 32px;
  min-height: 60vh;
}

.dex-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.dex-table thead tr {
  border-bottom: 2px solid var(--border-med);
}

.dex-table th {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 12px;
  text-align: left;
  font-weight: 400;
  white-space: nowrap;
  user-select: none;
}

.col-num    { width: 64px; }
.col-sprite { width: 52px; }
.col-name   { width: auto; min-width: 160px; }
.col-types  { width: 140px; }
.col-hp,
.col-atk,
.col-def,
.col-spa,
.col-spd,
.col-spe    { width: 52px; text-align: right; }
.col-total  { width: 60px; text-align: right; }

.dex-table th.col-hp,
.dex-table th.col-atk,
.dex-table th.col-def,
.dex-table th.col-spa,
.dex-table th.col-spd,
.dex-table th.col-spe,
.dex-table th.col-total { text-align: right; }

/* Table rows */
.dex-table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}

.dex-table tbody tr:hover {
  background: var(--surface-2);
}

.dex-table tbody tr:hover .row-name {
  color: var(--red);
}

.dex-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.row-num {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-3);
}

.row-sprite-wrap {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.row-sprite {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.row-sprite-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
}

.row-name {
  font-family: var(--font-cond);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-1);
  transition: color 0.12s;
}

.row-types {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.row-stat {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-2);
  text-align: right;
}

.row-stat.total {
  color: var(--text-1);
  font-size: 7px;
}

/* Stat coloring by value */
.stat-low    { color: #FF5959; }
.stat-mid    { color: var(--text-2); }
.stat-high   { color: #5AB840; }
.stat-great  { color: #7ACECE; }

/* =============================================
   TYPE TAGS (shared)
   ============================================= */

.type-tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 5.5px;
  letter-spacing: 0.4px;
  padding: 4px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
  color: white;
}

.type-tag.normal   { background: var(--t-normal); }
.type-tag.fire     { background: var(--t-fire); }
.type-tag.water    { background: var(--t-water); }
.type-tag.electric { background: var(--t-electric); }
.type-tag.grass    { background: var(--t-grass); }
.type-tag.ice      { background: var(--t-ice); color: #0E0E14; }
.type-tag.fighting { background: var(--t-fighting); }
.type-tag.poison   { background: var(--t-poison); }
.type-tag.ground   { background: var(--t-ground); color: #0E0E14; }
.type-tag.flying   { background: var(--t-flying); }
.type-tag.psychic  { background: var(--t-psychic); }
.type-tag.bug      { background: var(--t-bug); }
.type-tag.rock     { background: var(--t-rock); }
.type-tag.ghost    { background: var(--t-ghost); }
.type-tag.dragon   { background: var(--t-dragon); }
.type-tag.dark     { background: var(--t-dark); }
.type-tag.steel    { background: var(--t-steel); color: #0E0E14; }
.type-tag.fairy    { background: var(--t-fairy); }

/* Large type tags for detail view */
.type-tag.large {
  font-size: 8px;
  padding: 6px 14px;
  border-radius: 4px;
}
/* need some padding */
#detailView {
  padding-top: 60px;
}

/* =============================================
   LOADER / EMPTY STATES
   ============================================= */

.table-loader {
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loader-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.loader-row {
  height: 60px;
  background: var(--surface-2);
  border-radius: 4px;
  animation: shimmer 1.4s ease-in-out infinite;
  animation-delay: calc(var(--d) * 0.08s);
  opacity: 0.7;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.8; }
}

.loader-label {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-3);
  letter-spacing: 1px;
}

.no-results {
  padding: 80px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.no-results-icon {
  font-family: var(--font-pixel);
  font-size: 32px;
  color: var(--text-3);
  display: block;
}

.no-results-text {
  font-family: var(--font-cond);
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text-2);
}

.no-results-sub {
  font-size: 14px;
  color: var(--text-3);
}

/* =============================================
   PAGINATION
   ============================================= */

.pagination {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 40px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border-top: 1px solid var(--border);
}

.page-btn {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 10px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}

.page-btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-med);
  color: var(--text-1);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.page-info {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-3);
}

/* =============================================
   DETAIL VIEW — NAV BAR
   ============================================= */

.detail-nav {
  position: sticky;
  top: 60px;
  z-index: 100;
  background: rgba(14,14,20,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
  letter-spacing: 0.3px;
}

.back-btn:hover { color: var(--text-1); }

.detail-nav-arrows {
  display: flex;
  gap: 8px;
}

.nav-arrow {
  font-family: var(--font-pixel);
  font-size: 9px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}

.nav-arrow:hover {
  background: var(--surface-3);
  color: var(--text-1);
  border-color: var(--border-med);
}

/* =============================================
   DETAIL LOADER
   ============================================= */

.detail-loader {
  padding: 120px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.detail-loader-ball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--red);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.detail-loader-inner p {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-3);
  letter-spacing: 1px;
}

/* =============================================
   DETAIL HERO
   ============================================= */

.detail-hero {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

/* subtle grid background */
.detail-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.5;
  pointer-events: none;
}

.detail-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-gen-badge {
  font-family: var(--font-pixel);
  font-size: 6px;
  padding: 5px 10px;
  background: var(--surface-3);
  border: 1px solid var(--border-med);
  border-radius: 3px;
  color: var(--text-3);
  letter-spacing: 0.5px;
}

.detail-category-text {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-3);
}

.detail-number {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.detail-name {
  font-family: var(--font-cond);
  font-size: clamp(52px, 6vw, 80px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -1px;
  line-height: 0.95;
  color: var(--text-1);
  margin-bottom: 16px;
}

.detail-types {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.detail-flavor {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 28px;
  font-style: italic;
}

.detail-quick-facts {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.quick-fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qf-label {
  font-family: var(--font-pixel);
  font-size: 5.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qf-val {
  font-family: var(--font-cond);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
}

/* Sprite area */
.sprite-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
}

.sprite-bg-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.2;
  pointer-events: none;
  transition: background 0.4s;
}

.detail-sprite {
  width: 220px;
  height: 220px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  position: relative;
  z-index: 1;
  transition: opacity 0.2s;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.5));
}

.sprite-toggle-wrap {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
}

.sprite-toggle {
  font-family: var(--font-pixel);
  font-size: 6px;
  padding: 7px 14px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
}

.sprite-toggle.active {
  background: var(--red);
  color: white;
}

/* Forms */
.forms-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.forms-label {
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.forms-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.form-btn {
  font-family: var(--font-pixel);
  font-size: 5.5px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.form-btn:hover { border-color: var(--border-med); color: var(--text-1); }
.form-btn.active { background: var(--red); border-color: var(--red); color: white; }

/* =============================================
   DETAIL GRID
   ============================================= */

.detail-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 0;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 40px;
  align-items: start;
}

.detail-full {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 60px;
}

.detail-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* =============================================
   BASE STATS
   ============================================= */

.stats-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-row {
  display: grid;
  grid-template-columns: 28px 36px 1fr 36px;
  align-items: center;
  gap: 12px;
}

.stat-label {
  font-family: var(--font-pixel);
  font-size: 5.5px;
  color: var(--text-3);
  text-transform: uppercase;
}

.stat-num {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-2);
  text-align: right;
}

.stat-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

.stat-max {
  font-family: var(--font-pixel);
  font-size: 5.5px;
  color: var(--text-3);
  text-align: right;
}

.stat-total-row {
  display: grid;
  grid-template-columns: 28px 36px 1fr 36px;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}

.stat-total-label {
  font-family: var(--font-pixel);
  font-size: 5.5px;
  color: var(--text-3);
  grid-column: 1 / 3;
  text-align: right;
}

.stat-total-val {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-1);
  grid-column: 4;
  text-align: right;
}

/* =============================================
   TYPE EFFECTIVENESS
   ============================================= */

.effectiveness-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.eff-group {}
.eff-label {
  font-family: var(--font-pixel);
  font-size: 5.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}

.eff-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.eff-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-pixel);
  font-size: 5.5px;
  padding: 5px 8px;
  border-radius: 3px;
  color: white;
  text-transform: uppercase;
}

.eff-multiplier {
  font-size: 5px;
  opacity: 0.8;
  font-weight: normal;
}

.eff-none {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-3);
  font-style: italic;
}

/* =============================================
   INFO GRID (training, breeding)
   ============================================= */

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.info-row:last-child { border-bottom: none; }

.info-key {
  font-family: var(--font-pixel);
  font-size: 5.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding-top: 3px;
}

.info-val {
  font-family: var(--font-cond);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
}

.info-val small {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-3);
  display: block;
}

/* Gender ratio bar */
.gender-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
  width: 100%;
}
.gender-bar-m { background: #5A8EE8; }
.gender-bar-f { background: #E04060; }
.gender-genderless { background: var(--surface-3); width: 100%; }

/* EV yield tags */
.ev-tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 5.5px;
  padding: 4px 8px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-2);
  margin-right: 4px;
  margin-bottom: 4px;
}

/* =============================================
   ABILITIES
   ============================================= */

.abilities-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ability-card {
  padding: 14px 16px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s;
}

.ability-card:hover { border-color: var(--border-med); }

.ability-card.hidden-ability {
  border-style: dashed;
}

.ability-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ability-name {
  font-family: var(--font-cond);
  font-size: 18px;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--text-1);
}

.ability-badge {
  font-family: var(--font-pixel);
  font-size: 5px;
  padding: 3px 7px;
  border-radius: 2px;
  letter-spacing: 0.3px;
}

.ability-badge.hidden {
  background: rgba(212,43,30,0.15);
  border: 1px solid rgba(212,43,30,0.3);
  color: var(--red);
}

.ability-badge.normal {
  background: var(--surface-4);
  border: 1px solid var(--border);
  color: var(--text-3);
}

.ability-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* =============================================
   EVOLUTION LINE
   ============================================= */

.evo-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.evo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-align: center;
}

.evo-stage:hover {
  background: var(--surface-3);
  border-color: var(--border);
}

.evo-stage.current {
  background: var(--surface-3);
  border-color: var(--red);
}

.evo-sprite {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
}

.evo-num {
  font-family: var(--font-pixel);
  font-size: 5px;
  color: var(--text-3);
}

.evo-name {
  font-family: var(--font-cond);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-1);
}

.evo-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}

.evo-arrow svg {
  color: var(--text-3);
}

.evo-condition {
  font-family: var(--font-pixel);
  font-size: 4.5px;
  color: var(--text-3);
  text-align: center;
  max-width: 64px;
  line-height: 1.6;
  text-transform: uppercase;
}

/* No evo */
.evo-solo {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  font-style: italic;
  padding: 20px 0;
}

/* =============================================
   LOCATION
   ============================================= */

.location-block {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.location-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.location-row:last-child { border-bottom: none; }

.location-game {
  font-family: var(--font-pixel);
  font-size: 5.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.location-place {
  font-family: var(--font-cond);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  text-align: right;
  text-transform: capitalize;
}

.location-none {
  font-size: 13px;
  color: var(--text-3);
  font-style: italic;
  text-align: center;
  padding: 16px 0;
}

/* =============================================
   MOVESET
   ============================================= */

.move-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.move-tab {
  font-family: var(--font-pixel);
  font-size: 6px;
  padding: 9px 16px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.move-tab:hover { color: var(--text-2); border-color: var(--border-med); }

.move-tab.active {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.move-table-wrap {
  overflow-x: auto;
}

.move-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.move-table th {
  font-family: var(--font-pixel);
  font-size: 5.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-med);
  white-space: nowrap;
}

.move-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.move-table tr:last-child td { border-bottom: none; }

.move-table tr:hover td { background: rgba(255,255,255,0.02); }

.move-level {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-3);
}

.move-name {
  font-family: var(--font-cond);
  font-size: 16px;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--text-1);
}

.move-stat {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--text-2);
}

.move-stat.em { color: var(--text-3); }

.move-none {
  text-align: center;
  padding: 40px;
  font-size: 13px;
  color: var(--text-3);
  font-style: italic;
}

/* =============================================
   FOOTER (same as homepage)
   ============================================= */

.site-footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  padding: 40px 80px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-wordmark { font-size: 10px; flex-shrink: 0; }

.footer-note {
  font-size: 12px;
  color: var(--text-3);
  flex: 1;
}

.footer-links { display: flex; gap: 24px; }

.footer-links a {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--text-2); }

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1100px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .detail-hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .list-header-inner {
    padding: 14px 20px;
    gap: 12px;
  }

  .table-wrap,
  .pagination {
    padding-left: 16px;
    padding-right: 16px;
  }

  .col-hp, .col-atk, .col-def,
  .col-spa, .col-spd, .col-spe { display: none; }

  .col-total { display: table-cell; }

  .detail-hero { padding: 32px 20px; }
  .detail-grid, .detail-full { padding-left: 20px; padding-right: 20px; }
  .detail-name { font-size: 42px; }

  .nav-links { display: none; }
  .nav-inner { gap: 24px; }

  .site-footer { padding: 32px 24px; }

  .filter-group { flex-wrap: wrap; }
  .filter-select { font-size: 12px; padding: 8px 10px; }
}

@media (max-width: 480px) {
  .list-controls { gap: 8px; }
  .search-wrap { max-width: 100%; }
  .results-count { display: none; }
  .col-types { width: 100px; }
  .nav-open { display: none; }
}