/* =============================================
   RESET & BASE
   ============================================= */

*, *::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(141, 50, 168, 0.10);
  --border-med: rgba(141, 50, 168, 0.16);
  --text-1:     #F2ECFF;
  --text-2:     #A89BC4;
  --text-3:     #6B6284;

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

  /* pocket accent colors */
  --p-medicine:     #48C878;
  --p-pokeballs:    #E04040;
  --p-battle-items: #E08830;
  --p-berries:      #D870A8;
  --p-key-items:    #D4A81A;
  --p-machines:     #6870E0;
  --p-held-items:   #50B8E8;
  --p-other:        #9898B0;

  /* 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
   ============================================= */

.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;
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-links::-webkit-scrollbar { display: none; }
.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;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-links a:hover { 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: none;
  border-radius: 3px;
  flex-shrink: 0;
  transition: background 0.15s;
  box-shadow: 0 3px 0 var(--red-dark);
  cursor: pointer;
}
.nav-open:hover { background: #E03020; }

/* =============================================
   VIEW SWITCHING
   ============================================= */

.view { display: none; }
.view.active-view { display: block; }

/* Both views need top padding equal to the fixed site header height.
   Without this, sticky sub-headers render at their visual offset (56px)
   but flow siblings (item grid, detail content) start at flow y=0,
   landing visually under the sticky element. */
#listView,
#detailView {
  padding-top: 60px;
}

/* =============================================
   LIST HEADER
   ============================================= */

.list-header {
  position: sticky;
  top: 60px;
  z-index: 100;
  background: rgba(14,14,20,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.list-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px 10px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.list-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-kicker {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--red);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title {
  font-family: var(--font-cond);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--text-1);
}

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

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 180px;
  max-width: 360px;
}
.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-med);
  border-radius: 8px;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 32px 8px 32px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: rgba(255,255,255,0.25); }
.search-input::placeholder { color: var(--text-3); }
.search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}
.search-clear.visible { opacity: 1; pointer-events: auto; }

.results-count {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
  margin-left: auto;
}

/* POCKET PILLS */
.pocket-strip {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pocket-strip::-webkit-scrollbar { display: none; }

.pocket-pills {
  display: flex;
  gap: 6px;
  padding: 6px 0;
  white-space: nowrap;
}

.pocket-pill {
  font-family: var(--font-cond);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.pocket-pill:hover { background: var(--surface-3); color: var(--text-1); }
.pocket-pill.active {
  background: var(--pocket-color, var(--red));
  border-color: var(--pocket-color, var(--red));
  color: #fff;
}

/* =============================================
   SKELETON LOADER
   ============================================= */

.list-loader {
  max-width: 1280px;
  margin: 32px auto;
  padding: 0 24px;
  text-align: center;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.skel-card {
  height: 120px;
  background: var(--surface-2);
  border-radius: 12px;
  animation: shimmer 1.4s infinite;
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    var(--surface-3) 50%,
    var(--surface-2) 100%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loader-label {
  font-family: var(--font-cond);
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  margin-top: 12px;
}

/* =============================================
   ITEM GRID
   ============================================= */

.item-grid {
  max-width: 1280px;
  margin: 20px auto 0;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.item-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Pocket-colored background wash behind sprite — the main visual hook */
.item-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 40%;
  background: var(--pocket-color, transparent);
  opacity: 0.06;
  transition: opacity 0.15s;
  pointer-events: none;
}

.item-card:hover {
  border-color: var(--pocket-color, var(--border-med));
  box-shadow: 0 0 0 1px var(--pocket-color, transparent),
              inset 0 0 0 1px var(--pocket-color, transparent);
}
.item-card:hover::after { opacity: 0.12; }

.item-card-sprite {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.item-card-sprite img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  object-fit: contain;
  transition: transform 0.15s;
}
.item-card:hover .item-card-sprite img {
  transform: scale(1.12);
}
.item-card-sprite .no-sprite {
  font-size: 24px;
  line-height: 1;
  opacity: 0.35;
}

.item-card-name {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.25;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 1;
  width: 100%;
}

.item-card-divider {
  width: 24px;
  height: 1px;
  background: var(--pocket-color, var(--border));
  opacity: 0.4;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.item-card-cat {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0;
  text-transform: none;
  position: relative;
  z-index: 1;
  line-height: 1.2;
  width: 100%;
}

.hidden { display: none !important; }

/* =============================================
   GROUP HEADERS (pocket sections in All view)
   ============================================= */

.item-group-header {
  grid-column: 1 / -1;          /* span all columns */
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 0 10px;
  margin-top: 4px;
}
.item-group-header:first-child { padding-top: 16px; }

.item-group-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.item-group-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.item-group-label {
  font-family: var(--font-cond);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--text-1);
  line-height: 1;
}

.item-group-sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-3);
  line-height: 1;
}

.item-group-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--pocket-color, var(--border)), transparent);
  opacity: 0.3;
}

/* Section cards sub-grid */
.item-section-cards {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

/* Section pagination bar */
.item-section-pagebar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 0 20px;
}

.section-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid var(--border-med);
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.section-page-btn:hover:not(:disabled) {
  border-color: var(--pocket-color, var(--border-med));
  color: var(--text-1);
  background: rgba(255,255,255,0.04);
}
.section-page-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.section-page-info {
  font-family: var(--font-cond);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3);
  min-width: 40px;
  text-align: center;
}

/* =============================================
   NO RESULTS
   ============================================= */

.no-results {
  max-width: 1280px;
  margin: 64px auto;
  text-align: center;
}
.no-results-icon {
  display: block;
  font-family: var(--font-pixel);
  font-size: 28px;
  color: var(--text-3);
  margin-bottom: 16px;
}
.no-results-text {
  font-family: var(--font-cond);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 4px;
}
.no-results-sub {
  font-size: 14px;
  color: var(--text-3);
}

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

.pagination {
  max-width: 1280px;
  margin: 28px auto 48px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.page-btn {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--surface-2);
  border: 1px solid var(--border-med);
  color: var(--text-2);
  border-radius: 8px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.page-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text-1); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.page-info {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  min-width: 80px;
  text-align: center;
}

/* =============================================
   DETAIL VIEW
   ============================================= */

.detail-nav {
  position: sticky;
  top: 60px;
  z-index: 100;
  background: rgba(14,14,20,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  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-cond);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--text-1); }

.detail-nav-arrows {
  display: flex;
  gap: 8px;
}
.nav-arrow {
  background: var(--surface-2);
  border: 1px solid var(--border-med);
  color: var(--text-2);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.nav-arrow:hover { background: var(--surface-3); color: var(--text-1); }
.nav-arrow:disabled { opacity: 0.3; cursor: not-allowed; }

/* Game version bar (matches Pokédex detail) */
.detail-version-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 40px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}

.detail-version-bar.hidden {
  display: none;
}

.detail-version-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.detail-game-version {
  font-family: var(--font-body);
  font-size: 13px;
  min-width: 220px;
  max-width: min(100%, 420px);
  background: var(--surface-2);
  color: var(--text-1);
  border: 1px solid var(--border-med);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}

.detail-game-version:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Detail Loader */
.detail-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
}
.detail-loader-inner {
  text-align: center;
}
.detail-loader-ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--red);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Detail Content */
.detail-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* Detail Hero */
.detail-hero {
  border-bottom: 1px solid var(--border);
  padding: 40px 0 32px;
  margin-bottom: 32px;
  background: linear-gradient(135deg,
    transparent 0%,
    rgba(var(--hero-r,212), var(--hero-g,43), var(--hero-b,30), 0.04) 100%
  );
}

.detail-hero-inner {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

.detail-hero-left {
  flex: 1;
  min-width: 260px;
}

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

.detail-pocket-badge {
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--pocket-color, var(--surface-3));
  color: #fff;
  border-radius: 4px;
  padding: 3px 8px;
}

.detail-category-text {
  font-family: var(--font-cond);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.detail-name {
  font-family: var(--font-cond);
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  margin-bottom: 0;
  color: var(--text-1);
}

.detail-quick-facts {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.quick-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.qf-label {
  font-family: var(--font-cond);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.qf-val {
  font-family: var(--font-cond);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}

.detail-hero-right {
  flex-shrink: 0;
}

.item-sprite-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-sprite-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(var(--hero-r,212), var(--hero-g,43), var(--hero-b,30), 0.2) 0%,
    transparent 70%
  );
}

.detail-sprite {
  width: 120px;
  height: 120px;
  image-rendering: pixelated;
  object-fit: contain;
  position: relative;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
}

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

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
}

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

.section-title {
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

.effect-text {
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.7;
}

/* ATTRIBUTES LIST */
.attr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.attr-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pocket-color, var(--red));
  flex-shrink: 0;
  margin-top: 6px;
  --pocket-color: var(--red);
}
/* attr-list uses CSS grid the same as info-grid */
.attr-list {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 6px 10px;
  align-items: start;
}

/* FLING BLOCK */
.fling-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fling-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.fling-label {
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.fling-val {
  font-family: var(--font-cond);
  font-size: 28px;
  font-weight: 900;
  color: var(--text-1);
}
.fling-note {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.fling-note strong {
  color: var(--text-1);
  font-weight: 600;
}

/* Item Info — game data bubbles */
.game-info-bubbles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-info-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.game-info-bubble-label {
  display: block;
  font-family: var(--font-cond);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}

.game-info-bubble-value {
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.45;
}

.game-info-bubble--flavor .game-info-bubble-value {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-2);
  line-height: 1.65;
}

.game-info-bubble-note {
  display: block;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  color: var(--text-3);
}

.game-info-bubble--muted .game-info-bubble-value {
  font-style: normal;
  color: var(--text-3);
}

/* INFO GRID */
.info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  align-items: baseline;
}
.ig-label {
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.ig-val {
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}

/* BERRY FLAVORS */
.berry-flavors {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.berry-flavor-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--surface-3);
  border-radius: 8px;
  padding: 8px 14px;
  min-width: 64px;
}
.bf-label {
  font-family: var(--font-cond);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.bf-val {
  font-family: var(--font-cond);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}

/* =============================================
   FOOTER
   ============================================= */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 32px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-wordmark {
  font-size: 8px;
  opacity: 0.6;
}
.footer-note {
  font-size: 11px;
  color: var(--text-3);
  flex: 1;
  min-width: 200px;
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  font-family: var(--font-cond);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text-1); }

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

@media (max-width: 768px) {
  .nav-inner { gap: 16px; padding: 0 20px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; }
  .list-header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .list-controls { width: 100%; }
  .search-wrap { max-width: 100%; }
  .detail-hero-inner { flex-direction: column; }
  .detail-version-bar { padding-left: 20px; padding-right: 20px; }
  .item-sprite-wrap { width: 120px; height: 120px; }
  .detail-sprite { width: 96px; height: 96px; }
  .detail-name { font-size: 36px; }
}

/* ── Game filter ── */
.filter-select {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-1);
  border: 1px solid var(--border-med);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: rgba(255,255,255,0.25); }

/* ── Game filter beta tag ── */
.gen-filter-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.beta-tag {
  font-family: var(--font-pixel);
  font-size: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-3);
  color: var(--yellow-dim, #8A6D18);
  border: 1px solid var(--yellow-dim, #8A6D18);
  border-radius: 4px;
  padding: 3px 6px;
  cursor: help;
  white-space: nowrap;
  opacity: 0.85;
  transition: opacity 0.15s;
  align-self: center;
  position: relative;
  top: 1px;
}
.beta-tag:hover { opacity: 1; }
/* ═══════════════════════════════════════════════════════════════
   LOCATIONS (matches Pokédex detail layout)
═══════════════════════════════════════════════════════════════ */

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

.location-list .location-row {
  display: grid;
  grid-template-columns: minmax(100px, 160px) 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

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

.location-game {
  font-family: var(--font-cond);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.35;
}

.location-place {
  font-family: var(--font-cond);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
}

.location-suffix {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.location-method {
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

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

.location-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 0 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.loc-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.loc-page-btn:hover:not(:disabled) {
  color: var(--text-1);
  border-color: rgba(255, 255, 255, 0.3);
}

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

.loc-page-info {
  color: var(--text-2);
  font-size: 11px;
  min-width: 70px;
  text-align: center;
}

@media (max-width: 768px) {
  .location-list .location-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .location-game { grid-column: 1 / -1; }
  .location-place { grid-column: 1; }
  .location-method { grid-column: 2; grid-row: 2; align-self: end; }
}
/* ═══════════════════════════════════════════════════════════════
   EVOLUTION USES
═══════════════════════════════════════════════════════════════ */

.evo-use-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.evo-use-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  background: var(--surface-3);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.evo-use-chain {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.evo-species-link,
.evo-species-name {
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  text-decoration: none;
}
.evo-species-link:hover { color: var(--yellow); }

.evo-arrow {
  color: var(--text-3);
  font-size: 14px;
}

.evo-use-how {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-2);
}

/* ═══════════════════════════════════════════════════════════════
   NATURE MINT
═══════════════════════════════════════════════════════════════ */

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

.nature-name {
  font-family: var(--font-cond);
  font-size: 22px;
  font-weight: 900;
  color: var(--text-1);
  letter-spacing: 0.02em;
}

.nature-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nature-stat {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

.nature-stat--up   { background: rgba(80,184,232,0.15); color: #50B8E8; }
.nature-stat--down { background: rgba(208,48,48,0.15);  color: #E05050; }
.nature-stat--neutral { background: var(--surface-3); color: var(--text-3); }

.nature-flavor {
  font-size: 13px;
  color: var(--text-2);
}
.nature-flavor strong { color: var(--text-1); }

.nature-note {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}
.nature-note strong { color: var(--text-2); }

/* ═══════════════════════════════════════════════════════════════
   SPECIES CANDY
═══════════════════════════════════════════════════════════════ */

.candy-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.candy-species-link {
  font-family: var(--font-cond);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.candy-species-link:hover { color: var(--yellow); }

.candy-note {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   TERA SHARD
═══════════════════════════════════════════════════════════════ */

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

.tera-type-badge {
  display: inline-block;
  font-family: var(--font-cond);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  padding: 5px 14px;
  border-radius: 6px;
  align-self: flex-start;
}

.tera-note {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
}
.tera-note strong { color: var(--text-1); }

/* ═══════════════════════════════════════════════════════════════
   TM MOVE HISTORY
═══════════════════════════════════════════════════════════════ */

.tm-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-history-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}

.tm-history-row--active {
  background: var(--surface-3);
  border-color: var(--border-med);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}

.tm-history-gen {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.02em;
  border-right: 1px solid var(--border);
  padding-right: 12px;
}
.tm-history-row--active .tm-history-gen { color: var(--text-2); }

.tm-history-move {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tm-history-name {
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.01em;
}

.tm-history-badges { display: flex; gap: 5px; align-items: center; }

.tm-type-badge {
  font-family: var(--font-cond);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1.4;
}

.tm-class-badge {
  font-family: var(--font-cond);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1.4;
}
.tm-class-physical { background: #C03028; color: #fff; }
.tm-class-special  { background: #6890F0; color: #fff; }
.tm-class-status   { background: #444460; color: var(--text-2); }

.tm-history-stats {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  gap: 8px;
  align-items: center;
}

.tm-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tm-stat-l {
  font-family: var(--font-cond);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tm-stat-v {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

.tm-history-games {
  grid-column: 2 / 4;
  grid-row: 2;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-3);
  padding-top: 2px;
}

.tm-history-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 8px;
  font-style: italic;
}

/* === Portal nav additions === */
.nav-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-back {
  font-family: var(--font-pixel); font-size: 6px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-3); text-decoration: none;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0; transition: color 0.15s;
}
.nav-back:hover { color: var(--red); }
.nav-divider { width: 1px; height: 16px; background: var(--border); flex-shrink: 0; }
.nav-tag {
  font-family: var(--font-pixel); font-size: 6px; letter-spacing: 1px;
  color: var(--red); background: rgba(141, 50, 168, 0.1);
  border: 1px solid rgba(141, 50, 168, 0.2); padding: 4px 9px; border-radius: 2px; flex-shrink: 0;
}
.nav-inner { gap: 28px !important; }
@media (max-width: 640px) {
  .nav-inner { gap: 16px !important; }
  .nav-tag { display: none; }
}