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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 40%, #4facfe 100%);
  background-attachment: fixed;
  color: #1a1a2e;
}

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ── Header ── */
.header {
  text-align: center;
  margin-bottom: 2rem;
  padding-top: 1rem;
}
.header h1 {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.header p {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

/* ── Search ── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}
.autocomplete-wrap {
  position: relative;
  flex: 1;
}
.autocomplete-wrap input {
  width: 100%;
}
.search-bar input {
  flex: 1;
  padding: 12px 18px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  background: rgba(255,255,255,0.95);
  color: #1a1a2e;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.search-bar input::placeholder { color: #aaa; }
.search-bar input:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 4px 20px rgba(102,126,234,0.4);
}

/* ── Autocomplete ── */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #f0f0f0;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active { background: #f5f3ff; }
.autocomplete-item img {
  width: 38px;
  height: 38px;
  image-rendering: pixelated;
}
.autocomplete-item .ac-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  text-transform: capitalize;
  flex: 1;
}
.autocomplete-item .ac-num { font-size: 11px; color: #bbb; }
.autocomplete-item .ac-types { display: flex; gap: 4px; }

/* ── Type filters ── */

.type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.92);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.type-pill {
  padding: 5px 13px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: opacity 0.15s, transform 0.1s;
  user-select: none;
  text-transform: capitalize;
  background: rgba(255,255,255,0.85);
  color: #444;
}
.type-pill.active {
  opacity: 1;
  transform: scale(1.08);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.type-pill:hover { opacity: 0.9; }

/* ── Pokemon grid ── */
.pokemon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.poke-card {
  border-radius: 18px;
  padding: 14px 10px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.poke-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.25);
  pointer-events: none;
}
.poke-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.9);
}
.poke-card img {
  width: 76px;
  height: 76px;
  image-rendering: pixelated;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}
.poke-card .poke-num {
  font-size: 11px;
  color: rgba(0,0,0,0.4);
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.poke-card .poke-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-transform: capitalize;
  margin-top: 2px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}
.poke-card .poke-types {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 6px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ── Type badge ── */
.type-badge {
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  background: rgba(255,255,255,0.3);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
}

/* ── Load more ── */
.load-more {
  display: block;
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: background 0.15s;
}
.load-more:hover { background: rgba(255,255,255,0.35); }

/* ── Back button ── */
.back-btn {
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.back-btn:hover { background: #fff; }

/* ── Detail panel ── */
.detail-panel {
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  color: #1a1a2e;
}
.detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f0f0f0;
}
.detail-header img {
  width: 110px;
  height: 110px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}
.detail-title .poke-num { font-size: 13px; color: #bbb; font-weight: 600; }
.detail-title h2 {
  font-size: 26px;
  font-weight: 700;
  text-transform: capitalize;
  color: #1a1a2e;
}
.detail-title .types-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* type badge w detail — ciemniejsze bo białe tło */
.detail-title .type-badge,
.tab-content .type-badge {
  background: transparent;
  color: inherit;
  border: none;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 1.25rem;
  background: #f5f5f5;
  border-radius: 12px;
  padding: 4px;
  overflow-x: auto;
}
.tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-radius: 9px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tab.active {
  background: #fff;
  color: #5a4fcf;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.tab:hover:not(.active) { color: #555; }

/* ── Section title ── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1rem 0 8px;
}

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: #f8f7ff;
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid #ede9ff;
}
.stat-card .stat-label { font-size: 11px; color: #aaa; margin-bottom: 2px; font-weight: 600; }
.stat-card .stat-val { font-size: 20px; font-weight: 700; color: #1a1a2e; }

.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.stat-bar-label { font-size: 12px; color: #888; width: 85px; flex-shrink: 0; font-weight: 500; }
.stat-bar-wrap {
  flex: 1;
  background: #f0f0f0;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.stat-bar-fill { height: 100%; border-radius: 99px; }
.stat-bar-num { font-size: 12px; font-weight: 700; color: #333; width: 30px; text-align: right; }

/* ── Weaknesses ── */
.weakness-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.weakness-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}
.weakness-badge .mult { font-size: 11px; opacity: 0.8; }

/* ── Moves ── */
.moves-list { display: flex; flex-wrap: wrap; gap: 6px; }
.move-pill {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: #f5f3ff;
  border: 1px solid #ede9ff;
  color: #5a4fcf;
  text-transform: capitalize;
}

/* ── PVP ── */
.pvp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pvp-card {
  background: #f8f7ff;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  border: 1px solid #ede9ff;
}
.pvp-card .pvp-league { font-size: 11px; color: #aaa; margin-bottom: 4px; font-weight: 600; }
.pvp-card .pvp-cp { font-size: 22px; font-weight: 700; color: #5a4fcf; }
.pvp-card .pvp-label { font-size: 11px; color: #bbb; margin-top: 3px; }
.pvp-note { font-size: 12px; color: #bbb; margin-top: 10px; }

/* ── Evolution ── */
.evo-chain { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.evo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 10px;
  border-radius: 14px;
  transition: background 0.15s;
}
.evo-item:hover { background: #f5f3ff; }
.evo-item img {
  width: 70px;
  height: 70px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
}
.evo-item span { font-size: 12px; color: #888; text-transform: capitalize; margin-top: 4px; font-weight: 500; }
.evo-arrow { font-size: 22px; color: #ccc; }

/* ── Misc ── */
.loading-msg { text-align: center; padding: 2rem; color: rgba(255,255,255,0.8); font-size: 14px; }
.no-results { text-align: center; padding: 2rem; color: rgba(255,255,255,0.7); font-size: 14px; }
.error-msg { text-align: center; padding: 2rem; color: #e63946; font-size: 14px; }

/* ── Forms selector ── */
.forms-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 12px;
  background: #f8f7ff;
  border-radius: 14px;
  border: 1px solid #ede9ff;
}
.form-btn {
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid #ede9ff;
  background: #fff;
  color: #888;
  text-transform: capitalize;
  transition: all 0.15s;
}
.form-btn:hover { border-color: #a89de8; color: #5a4fcf; }
.form-btn.active {
  background: #5a4fcf;
  border-color: #5a4fcf;
  color: #fff;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.footer strong {
  color: rgba(255,255,255,0.8);
  font-weight: 600;
}
.footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  transition: color 0.15s;
}
.footer a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* ── Types two-column layout ── */
.types-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.types-col-header {
  font-size: 14px;
  font-weight: 700;
  color: #5a4fcf;
  margin-bottom: 0.75rem;
  padding-bottom: 6px;
  border-bottom: 2px solid #ede9ff;
}
@media (max-width: 600px) {
  .types-two-col { grid-template-columns: 1fr; }
}

/* ── Moves table ── */
.moves-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #ede9ff;
}
.moves-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.moves-table thead tr {
  background: #f8f7ff;
}
.moves-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.moves-table td {
  padding: 8px 10px;
  border-top: 1px solid #f5f3ff;
  vertical-align: middle;
}
.move-row:hover { background: #f8f7ff; }
.move-elite { background: #fffbf0; }
.move-elite:hover { background: #fff8e6; }
.move-name {
  text-transform: capitalize;
  font-weight: 500;
  color: #1a1a2e;
}
.move-num {
  text-align: right;
  font-weight: 600;
  color: #333;
  font-variant-numeric: tabular-nums;
}
.move-type-badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.move-elite-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Move recommendation ── */
.move-recommendation {
  background: linear-gradient(135deg, #f8f7ff, #ede9ff);
  border: 1px solid #d4ccff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 0.5rem;
}
.move-rec-title {
  font-size: 11px;
  font-weight: 700;
  color: #5a4fcf;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.move-rec-moves {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.move-rec-pill {
  padding: 6px 14px;
  background: #5a4fcf;
  color: #fff;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}
.move-rec-arrow {
  font-size: 18px;
  color: #5a4fcf;
  font-weight: 700;
}

/* ── Ranking ── */
.ranking-row:hover { background: #f8f7ff; }
.ranking-pos {
  font-size: 14px;
  font-weight: 700;
  color: #bbb;
  width: 30px;
}
.ranking-pos:first-child { color: #FFD700; }
.ranking-sprite img {
  image-rendering: pixelated;
  display: block;
}
.ranking-name {
  text-transform: capitalize;
  font-weight: 600;
  color: #1a1a2e;
}
.ranking-atk {
  font-weight: 600;
  color: #F08030;
  text-align: right;
}
.ranking-dps {
  text-align: right;
  font-size: 15px;
}
