/* =========================================================
   Diseño Pokébola (retro-moderno) · cartas, detalle,
   variantes de buscador y de botón de tema
   ========================================================= */

/* ---------- Cartas ---------- */
.pb-card {
  --pb-top: #cf2d0a;
  --pb-bottom: #f7f3e8;
  --pb-ink: #1c1c1c;
  --pb-edge: #1c1c1c;
  --pb-ring: #ffffff;
  --pb-chip: #1c1c1c;
  --pb-chip-ink: #ffffff;
  --pb-acc: #ff7a63;
  position: relative;
  width: min(100%, 200px);
  height: 260px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  background: var(--pb-bottom);
  border: 4px solid var(--pb-edge);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--pb-edge);
  font-family: "Press Start 2P", monospace;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
body.dark .pb-card,
html[data-theme="dark"] .pb-card,
html[data-theme="dark"] .pb-detail {
  --pb-bottom: #1e2235;
  --pb-ink: #f3f4f6;
  --pb-edge: #0b0c14;
  --pb-ring: #2b3050;
  --pb-chip: #0b0c14;
}
.pb-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 var(--pb-edge);
}
.pb-card:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--pb-edge);
}
.pb-card:focus-visible {
  outline: 3px solid #f5c518;
  outline-offset: 3px;
}
.pb-card.card-crying {
  animation: cry-bounce 0.42s ease;
}

.pb-top {
  position: relative;
  flex: none;
  height: 112px;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--pb-top);
}
.pb-top::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 56px;
  background: rgba(255, 255, 255, 0.16);
}
.pb-num {
  position: relative;
  font-size: 9px;
  color: #fff;
}
.pb-acc {
  position: absolute;
  bottom: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pb-acc);
}
.pb-acc--l {
  left: 12px;
}
.pb-acc--r {
  right: 12px;
}
.pb-band {
  flex: none;
  height: 16px;
  background: var(--pb-edge);
  border-top: 4px solid var(--pb-edge);
  border-bottom: 4px solid var(--pb-edge);
  box-sizing: content-box;
}
.pb-bottom {
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 8px 16px;
  background: var(--pb-bottom);
}
.pb-name {
  margin: 0;
  max-width: 100%;
  font-size: 9px;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: var(--pb-ink);
}
.pb-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.pb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--pb-chip);
  color: var(--pb-chip-ink);
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  text-transform: uppercase;
}
.pb-chip i {
  display: block;
  width: 7px;
  height: 7px;
}
.pb-ring {
  position: absolute;
  left: 50%;
  top: 82px;
  width: 80px;
  height: 80px;
  margin-left: -40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 5px solid var(--pb-edge);
  border-radius: 50%;
  background: var(--pb-ring);
}
.pb-ring img {
  max-width: 58px;
  max-height: 58px;
  object-fit: contain;
}

#pokemon-grid {
  max-width: 720px;
  gap: 28px 20px;
}
@media (max-width: 560px) {
  #pokemon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }
}

/* ---------- Detalle (modal) ---------- */
.modal__panel.pb-modal {
  padding: 0;
  overflow: auto;
  width: min(640px, 94vw);
  border: 4px solid #1c1c1c;
  border-radius: 22px;
  box-shadow: 0 8px 0 #1c1c1c;
}
html[data-theme="dark"] .modal__panel.pb-modal {
  border-color: #0b0c14;
  box-shadow: 0 8px 0 #0b0c14;
  background: #1e2235;
}
.pb-modal .modal__close {
  z-index: 3;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.pb-detail {
  --pb-top: #cf2d0a;
  --pb-bottom: #f7f3e8;
  --pb-ink: #1c1c1c;
  --pb-edge: #1c1c1c;
  --pb-ring: #ffffff;
  --pb-chip: #1c1c1c;
  --pb-chip-ink: #fff;
  --pb-acc: #ff7a63;
  position: relative;
  color: var(--pb-ink);
  background: var(--pb-bottom);
}
.pb-detail__top {
  position: relative;
  height: 130px;
  padding: 18px 22px;
  box-sizing: border-box;
  background: var(--pb-top);
  overflow: hidden;
}
.pb-detail__top::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.16);
}
.pb-detail__id {
  position: relative;
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  color: #fff;
}
.pb-detail__name {
  position: relative;
  margin: 12px 0 0;
  max-width: calc(100% - 60px);
  font-family: "Press Start 2P", monospace;
  font-size: 18px;
  line-height: 1.3;
  text-transform: uppercase;
  color: #fff;
  overflow-wrap: anywhere;
}
.pb-detail .pb-acc {
  bottom: 12px;
}
.pb-detail__ring {
  position: absolute;
  left: 50%;
  top: 70px;
  width: 128px;
  height: 128px;
  margin-left: -64px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 6px solid var(--pb-edge);
  border-radius: 50%;
  background: var(--pb-ring);
  z-index: 2;
}
.pb-detail__ring img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
}
.pb-detail__body {
  padding: 74px 22px 24px;
}
.pb-chips--lg {
  margin-bottom: 16px;
}
.pb-chips--lg .pb-chip {
  font-size: 9px;
  padding: 7px 10px;
}
.pb-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.pb-tabs button {
  flex: 1;
  min-height: 44px;
  padding: 8px;
  border: 3px solid var(--pb-edge);
  border-radius: 10px;
  background: transparent;
  color: var(--pb-ink);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  cursor: pointer;
}
.pb-tabs button.active {
  background: var(--pb-top);
  color: #fff;
}
.pb-detail section[hidden] {
  display: none;
}
.pb-detail .stat__bar {
  background: rgba(128, 128, 128, 0.25);
}
.pb-detail .stat {
  grid-template-columns: 110px 1fr 36px;
}
.pb-detail .ability {
  background: rgba(128, 128, 128, 0.18);
}
.pb-sub {
  margin: 18px 0 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  text-transform: uppercase;
}
.pb-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.pb-info__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 3px solid var(--pb-edge);
  border-radius: 10px;
  font-family: "Press Start 2P", monospace;
}
.pb-info__row span {
  font-size: 7px;
  opacity: 0.75;
  text-transform: uppercase;
}
.pb-info__row b {
  font-size: 11px;
}
.pb-flavor {
  margin: 14px 0 0;
  font-family: "VT323", monospace;
  font-size: 20px;
  line-height: 1.2;
}
.pb-map {
  margin-top: 14px;
  overflow: hidden;
  border: 3px solid var(--pb-edge);
  border-radius: 12px;
}
.pb-map iframe {
  display: block;
  width: 100%;
  height: 240px;
  border: 0;
}
html[data-theme="dark"] .pb-map iframe {
  filter: invert(0.9) hue-rotate(180deg) brightness(0.9) contrast(0.9);
}
.pb-map__cap {
  padding: 8px 10px;
  background: var(--pb-top);
  color: #fff;
  font-family: "VT323", monospace;
  font-size: 17px;
}
.pb-places {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pb-place {
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(128, 128, 128, 0.2);
  font-family: "VT323", monospace;
  font-size: 18px;
}
@media (max-width: 480px) {
  .pb-detail__name {
    font-size: 13px;
  }
}

/* ---------- Selector de estilos ---------- */
.style-picker {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
}
.style-picker summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  min-height: 44px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  border: 3px solid #1c1c1c;
  border-radius: 10px;
  background: #f5c518;
  color: #1c1c1c;
  box-shadow: 0 4px 0 #1c1c1c;
}
.style-picker summary::-webkit-details-marker {
  display: none;
}
.style-picker__body {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border: 3px solid #1c1c1c;
  border-radius: 12px;
  background: #f7f3e8;
  color: #1c1c1c;
  box-shadow: 0 4px 0 #1c1c1c;
}
.style-picker label {
  display: grid;
  gap: 6px;
}
.style-picker select {
  min-height: 40px;
  padding: 6px;
  border: 2px solid #1c1c1c;
  border-radius: 6px;
  background: #fff;
  color: #1c1c1c;
  font-family: inherit;
  font-size: 9px;
}
html[data-theme="dark"] .style-picker__body {
  background: #1e2235;
  color: #f3f4f6;
  border-color: #f5c518;
}
html[data-theme="dark"] .style-picker summary {
  border-color: #0b0c14;
  box-shadow: 0 4px 0 #0b0c14;
}
@media (max-width: 780px) {
  .style-picker {
    top: auto;
    bottom: 76px;
  }
}

/* ---------- Buscador: variantes ---------- */
html[data-search-style]:where(:not([data-search-style="classic"])) main .pokedex-search {
  --s-bg: #ffffff;
  --s-field: #ffffff;
  --s-ink: #1c1c1c;
  --s-edge: #1c1c1c;
  --s-btn: #cf2d0a;
  --s-btn-ink: #ffffff;
  --s-radius: 999px;
  --s-font: "Press Start 2P", monospace;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}
html[data-theme="dark"][data-search-style]:where(:not([data-search-style="classic"])) main .pokedex-search {
  --s-bg: #1e2235;
  --s-field: #12141f;
  --s-ink: #f3f4f6;
  --s-edge: #0b0c14;
}
html[data-search-style]:where(:not([data-search-style="classic"])) main .pokedex-search::before,
html[data-search-style]:where(:not([data-search-style="classic"])) main .pokedex-top {
  display: none;
}
html[data-search-style]:where(:not([data-search-style="classic"])) main .pokedex-screen {
  background: var(--s-bg);
  border: 4px solid var(--s-edge);
  border-radius: min(var(--s-radius), 36px);
  box-shadow: 0 6px 0 var(--s-edge);
  padding: 8px 10px !important;
}
html[data-search-style]:where(:not([data-search-style="classic"])) main .pokedex-title {
  margin: 0 0 12px !important;
  font-family: var(--s-font);
  font-size: 1.1rem;
  color: #cf2d0a;
  text-shadow: none;
}
html[data-theme="dark"][data-search-style]:where(:not([data-search-style="classic"])) main .pokedex-title {
  color: #f5c518;
}
html[data-search-style]:where(:not([data-search-style="classic"])) main .input-group-text,
html[data-search-style]:where(:not([data-search-style="classic"])) main .form-control,
html[data-search-style]:where(:not([data-search-style="classic"])) main .dropdown-toggle {
  background: var(--s-field) !important;
  color: var(--s-ink) !important;
  border: 0 !important;
  font-family: var(--s-font);
  font-size: 0.7rem;
  box-shadow: none !important;
  border-radius: calc(var(--s-radius) / 2) !important;
}
html[data-search-style]:where(:not([data-search-style="classic"])) main .form-control::placeholder {
  color: var(--s-ink);
  opacity: 0.6;
}
html[data-search-style]:where(:not([data-search-style="classic"])) main .input-group {
  border: 3px solid var(--s-edge);
  border-radius: var(--s-radius);
  overflow: hidden;
}
html[data-search-style]:where(:not([data-search-style="classic"])) main #generation-filter {
  border: 3px solid var(--s-edge) !important;
  border-radius: var(--s-radius) !important;
}
html[data-search-style]:where(:not([data-search-style="classic"])) main #search-btn {
  background: var(--s-btn) !important;
  color: var(--s-btn-ink) !important;
  border: 3px solid var(--s-edge) !important;
  border-radius: var(--s-radius) !important;
  font-family: var(--s-font);
  box-shadow: 0 3px 0 var(--s-edge);
}
html[data-search-style]:where(:not([data-search-style="classic"])) main #search-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--s-edge);
}
html[data-search-style]:where(:not([data-search-style="classic"])) main .dropdown-menu {
  background: var(--s-bg) !important;
  border: 3px solid var(--s-edge) !important;
  border-radius: 14px;
}
html[data-search-style]:where(:not([data-search-style="classic"])) main .gen-option {
  color: var(--s-ink) !important;
  font-family: var(--s-font);
  font-size: 0.65rem;
}
html[data-search-style]:where(:not([data-search-style="classic"])) main .gen-option:hover,
html[data-search-style]:where(:not([data-search-style="classic"])) main .gen-option.active {
  background: var(--s-btn) !important;
  color: var(--s-btn-ink) !important;
}
@media (max-width: 991px) {
  html[data-search-style]:where(:not([data-search-style="classic"])) main .pokedex-screen {
    border-radius: 24px;
  }
}

/* Píldora Pokébola: usa los valores por defecto de arriba */
html[data-search-style="pill"] main #search-btn {
  background: linear-gradient(180deg, #cf2d0a 0 46%, #1c1c1c 46% 54%, #ffffff 54%) !important;
  color: #1c1c1c !important;
  text-shadow: 0 1px 0 #fff;
}

/* Consola retro (verde tipo Game Boy) */
html[data-search-style="retro"] main .pokedex-search {
  --s-bg: #8bac0f;
  --s-field: #9bbc0f;
  --s-ink: #0f380f;
  --s-edge: #0f380f;
  --s-btn: #306230;
  --s-btn-ink: #e6f2b5;
  --s-radius: 4px;
}
html[data-theme="dark"][data-search-style="retro"] main .pokedex-search {
  --s-bg: #0f380f;
  --s-field: #306230;
  --s-ink: #c8e07a;
  --s-edge: #8bac0f;
  --s-btn: #8bac0f;
  --s-btn-ink: #0f380f;
}
html[data-search-style="retro"] main .pokedex-screen {
  border-radius: 6px !important;
  background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 4px);
}
html[data-search-style="retro"] main .pokedex-title {
  color: #0f380f;
}
html[data-theme="dark"][data-search-style="retro"] main .pokedex-title {
  color: #c8e07a;
}

/* Cristal moderno */
html[data-search-style="glass"] main .pokedex-search {
  --s-bg: rgba(255, 255, 255, 0.55);
  --s-field: rgba(255, 255, 255, 0.7);
  --s-ink: #1c1c1c;
  --s-edge: rgba(28, 28, 28, 0.15);
  --s-btn: #cf2d0a;
  --s-radius: 20px;
  --s-font: "VT323", monospace;
}
html[data-theme="dark"][data-search-style="glass"] main .pokedex-search {
  --s-bg: rgba(30, 34, 53, 0.6);
  --s-field: rgba(18, 20, 31, 0.7);
  --s-ink: #f3f4f6;
  --s-edge: rgba(255, 255, 255, 0.18);
}
html[data-search-style="glass"] main .pokedex-screen {
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18) !important;
  border-width: 1px !important;
}
html[data-search-style="glass"] main .pokedex-title,
html[data-search-style="glass"] main .form-control,
html[data-search-style="glass"] main .dropdown-toggle,
html[data-search-style="glass"] main #search-btn,
html[data-search-style="glass"] main .gen-option {
  font-size: 1.15rem;
}
html[data-search-style="glass"] main #search-btn {
  background: linear-gradient(135deg, #cf2d0a, #ff7a3d) !important;
  border-width: 0 !important;
  box-shadow: 0 6px 16px rgba(207, 45, 10, 0.4);
}

/* ---------- Botón de tema: variantes ---------- */
/* Interruptor sol/luna */
html[data-toggle-style="switch"] .theme-toggle {
  position: absolute;
  width: 78px;
  height: 40px;
  padding: 0;
  border: 3px solid #1c1c1c;
  border-radius: 999px;
  background: #bfe3ff;
  box-shadow: 0 4px 0 #1c1c1c;
  font-size: 0;
  overflow: hidden;
}
html[data-toggle-style="switch"] .theme-toggle > * {
  display: none !important;
}
html[data-toggle-style="switch"] .theme-toggle::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f5c518;
  box-shadow: 0 0 0 3px #ffe27a;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
html[data-theme="dark"][data-toggle-style="switch"] .theme-toggle {
  background: #1e2235;
  border-color: #f5c518;
  box-shadow: 0 4px 0 #0b0c14;
}
html[data-theme="dark"][data-toggle-style="switch"] .theme-toggle::before {
  transform: translateX(38px);
  background: transparent;
  box-shadow: inset -7px -3px 0 0 #e9e4ff;
}
html[data-toggle-style="switch"] .theme-toggle:hover {
  transform: none;
}

/* Pokébola que gira */
html[data-toggle-style="ball"] .theme-toggle {
  position: absolute;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 4px solid #1c1c1c;
  border-radius: 50%;
  background: linear-gradient(180deg, #cf2d0a 0 42%, #1c1c1c 42% 58%, #ffffff 58%);
  box-shadow: 0 4px 0 #1c1c1c;
  font-size: 0;
  overflow: hidden;
  transition: transform 0.4s ease;
}
html[data-toggle-style="ball"] .theme-toggle > * {
  display: none !important;
}
html[data-toggle-style="ball"] .theme-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 3px solid #1c1c1c;
  border-radius: 50%;
  background: #fff;
}
html[data-toggle-style="ball"] .theme-toggle:hover {
  transform: rotate(180deg);
  box-shadow: 0 4px 0 #1c1c1c;
}
html[data-theme="dark"][data-toggle-style="ball"] .theme-toggle {
  background: linear-gradient(180deg, #262b38 0 42%, #f5c518 42% 58%, #1e2235 58%);
  border-color: #f5c518;
  box-shadow: 0 4px 0 #0b0c14;
}
html[data-theme="dark"][data-toggle-style="ball"] .theme-toggle::after {
  border-color: #f5c518;
  background: #1e2235;
}

/* Pixel */
html[data-toggle-style="pixel"] .theme-toggle {
  border: 4px solid #1c1c1c;
  border-radius: 0;
  background: #f5c518;
  color: #1c1c1c;
  text-shadow: none;
  box-shadow: 4px 4px 0 #1c1c1c;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  padding: 8px 10px;
  image-rendering: pixelated;
}
html[data-toggle-style="pixel"] .theme-toggle:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #1c1c1c;
}
html[data-theme="dark"][data-toggle-style="pixel"] .theme-toggle {
  background: #1e2235;
  color: #f5c518;
  border-color: #f5c518;
  box-shadow: 4px 4px 0 #0b0c14;
}

/* ---------- Mapas del juego ---------- */
.pb-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.pb-regions button {
  min-height: 40px;
  padding: 6px 12px;
  border: 3px solid var(--pb-edge);
  border-radius: 999px;
  background: transparent;
  color: var(--pb-ink);
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  cursor: pointer;
}
.pb-regions button.active {
  background: var(--pb-top);
  color: #fff;
}
.pb-map__img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #0b0c14;
}
.pb-map__img--pixel {
  image-rendering: pixelated;
  padding: 8px;
  box-sizing: border-box;
}

/* ---------- Reproductor de música (consola Pokébola) ---------- */
.music-player.music-player {
  gap: 10px;
  min-width: 340px;
  padding: 6px 10px 6px 8px;
  background: #cf2d0a;
  border: 4px solid #1c1c1c;
  border-radius: 18px;
  box-shadow: 0 5px 0 #1c1c1c;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-family: "Press Start 2P", monospace;
}
html[data-theme="dark"] .music-player.music-player {
  background: #262b38;
  border-color: #f5c518;
  box-shadow: 0 5px 0 #0b0c14;
}
.music-player .music-note {
  position: relative;
  width: 34px;
  height: 34px;
  flex: none;
  font-size: 0;
  border: 3px solid #1c1c1c;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0 44%, #1c1c1c 44% 56%, #f7f3e8 56%);
  box-sizing: border-box;
}
.music-player .music-note::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 2px solid #1c1c1c;
  border-radius: 50%;
  background: #fff;
}
.music-player .music-note.playing {
  animation: pb-spin 1.6s linear infinite;
}
@keyframes pb-spin {
  to {
    transform: rotate(360deg);
  }
}
.music-screen {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 3px solid #1c1c1c;
  border-radius: 8px;
  background: #9bbc0f;
  color: #0f380f;
}
html[data-theme="dark"] .music-screen {
  background: #0f380f;
  color: #9bbc0f;
  border-color: #0b0c14;
}
.music-player .music-track {
  flex: 1;
  min-width: 0;
  font-family: "VT323", monospace;
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1;
  opacity: 1;
}
.music-eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  flex: none;
}
.music-eq i {
  display: block;
  width: 3px;
  height: 3px;
  background: currentColor;
}
.music-note.playing ~ .music-screen .music-eq i {
  animation: pb-eq 0.6s ease-in-out infinite alternate;
}
.music-eq i:nth-child(2) { animation-delay: 0.15s; }
.music-eq i:nth-child(3) { animation-delay: 0.3s; }
.music-eq i:nth-child(4) { animation-delay: 0.45s; }
@keyframes pb-eq {
  from { height: 3px; }
  to { height: 14px; }
}
.music-player .music-controls {
  gap: 6px;
}
.music-player .music-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #1c1c1c;
  border-radius: 50%;
  background: #f7f3e8;
  color: #1c1c1c;
  font-size: 13px;
  box-shadow: 0 3px 0 #1c1c1c;
}
.music-player .music-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}
.music-player .music-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1c1c1c;
}
.music-player .music-btn--play {
  width: 42px;
  height: 42px;
  background: #f5c518;
  font-size: 16px;
}
html[data-theme="dark"] .music-player .music-btn {
  background: #1e2235;
  color: #f3f4f6;
  border-color: #0b0c14;
  box-shadow: 0 3px 0 #0b0c14;
}
html[data-theme="dark"] .music-player .music-btn--play {
  background: #f5c518;
  color: #1c1c1c;
}
@media (max-width: 780px) {
  .music-player.music-player {
    min-width: 0;
  }
}

/* ---------- Corrección: desplegable de generaciones sobre las cartas (móvil) ---------- */
main .pokedex-search {
  position: relative;
  z-index: 40;
}
main .pokedex-search .dropdown-menu {
  z-index: 1060;
  background: #ffffff;
  border: 3px solid #1c1c1c;
  border-radius: 14px;
  box-shadow: 0 8px 0 #1c1c1c;
  max-height: 55vh;
  overflow-y: auto;
  opacity: 1;
}
html[data-theme="dark"] main .pokedex-search .dropdown-menu {
  background: #1e2235;
  border-color: #0b0c14;
  box-shadow: 0 8px 0 #0b0c14;
}

@media (max-width: 480px) {
  .music-player.music-player {
    gap: 6px;
    padding: 5px 8px 5px 6px;
    box-sizing: border-box;
  }
  .music-player .music-note {
    width: 28px;
    height: 28px;
  }
  .music-eq {
    display: none;
  }
  .music-player .music-controls {
    gap: 4px;
  }
  .music-player .music-btn {
    width: 32px;
    height: 32px;
  }
  .music-player .music-btn--play {
    width: 38px;
    height: 38px;
  }
}

/* ---------- Megaevolución ---------- */
.pb-gem {
  display: block;
  width: 22px;
  height: 22px;
  flex: none;
  transform: rotate(45deg);
  border-radius: 4px;
  border: 3px solid #fff;
  background: conic-gradient(from 0deg, #ff5da2, #f5c518, #5de0a2, #5db7ff, #b45dff, #ff5da2);
}
.pb-mega-gem {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
  border-radius: 3px;
  border: 2px solid #fff;
  background: conic-gradient(from 0deg, #ff5da2, #f5c518, #5de0a2, #5db7ff, #b45dff, #ff5da2);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}
.pb-stone {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 3px solid var(--pb-edge);
  border-radius: 12px;
  background: rgba(128, 128, 128, 0.12);
}
.pb-stone img {
  image-rendering: pixelated;
  flex: none;
}
.pb-stone div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "Press Start 2P", monospace;
}
.pb-stone span {
  font-size: 7px;
  opacity: 0.75;
  text-transform: uppercase;
}
.pb-stone b {
  font-size: 10px;
}
.pb-stage {
  position: relative;
  height: 300px;
  overflow: hidden;
  perspective: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--pb-edge);
  border-radius: 20px;
  background: radial-gradient(circle at 50% 60%, #34286a, #12141f 72%);
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}
.pb-stage:active {
  cursor: grabbing;
}
.pb-stage.is-mega {
  background: radial-gradient(circle at 50% 60%, #6a2fa8, #12141f 72%);
  border-color: #f5c518;
}
.pb-stage__glow {
  position: absolute;
  bottom: 34px;
  width: 220px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 214, 90, 0.55), transparent 70%);
}
.pb-stage__spin {
  transform-style: preserve-3d;
  will-change: transform;
}
.pb-stage__spin img {
  display: block;
  width: 190px;
  height: 190px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.5));
}
.pb-stage.flash .pb-stage__spin img {
  animation: pb-flash 0.7s ease-out;
}
@keyframes pb-flash {
  0% { filter: brightness(6) saturate(0) drop-shadow(0 0 24px #fff); transform: scale(0.8); }
  60% { filter: brightness(1.8) drop-shadow(0 0 20px #ffd65a); transform: scale(1.12); }
  100% { filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.5)); transform: scale(1); }
}
.pb-stage__cap {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  color: #ffd65a;
}
.pb-stage__hint {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  color: #fff;
  opacity: 0.8;
}
.pb-mega-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.pb-mega-btn {
  flex: 1 1 180px;
  min-height: 46px;
  padding: 10px;
  border: 3px solid var(--pb-edge);
  border-radius: 12px;
  background: #f5c518;
  color: #1c1c1c;
  box-shadow: 0 4px 0 var(--pb-edge);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  cursor: pointer;
}
.pb-mega-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--pb-edge);
}
.pb-mega-form {
  min-width: 56px;
  min-height: 46px;
  padding: 10px 14px;
  border: 3px solid var(--pb-edge);
  border-radius: 12px;
  background: transparent;
  color: var(--pb-ink);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  cursor: pointer;
}
.pb-mega-form.active {
  background: var(--pb-top);
  color: #fff;
}
.pb-mega-meta {
  margin-top: 6px;
}
.pb-tabs button[hidden] {
  display: none;
}
@media (max-width: 480px) {
  .pb-tabs button {
    font-size: 7px;
  }
  .pb-stage {
    height: 260px;
  }
  .pb-stage__spin img {
    width: 160px;
    height: 160px;
  }
}

/* ---------- Formas primigenias (Groudon / Kyogre) ---------- */
.pb-mega-gem--red,
.pb-mega-gem--blue {
  transform: none;
  border-radius: 50%;
  border: 2px solid #fff;
}
.pb-mega-gem--red {
  background: radial-gradient(circle at 35% 30%, #ffb3a0, #e3350d 55%, #7a1204);
}
.pb-mega-gem--blue {
  background: radial-gradient(circle at 35% 30%, #b3d4ff, #1f6bff 55%, #0b2a7a);
}
.pb-stage--red.is-mega {
  background: radial-gradient(circle at 50% 60%, #b02a0a, #1c0a07 72%);
  border-color: #ff7a4d;
}
.pb-stage--blue.is-mega {
  background: radial-gradient(circle at 50% 60%, #1550c8, #070d1f 72%);
  border-color: #5db7ff;
}
.pb-stage--red.is-mega .pb-stage__glow {
  background: radial-gradient(ellipse, rgba(255, 110, 60, 0.6), transparent 70%);
}
.pb-stage--blue.is-mega .pb-stage__glow {
  background: radial-gradient(ellipse, rgba(80, 160, 255, 0.6), transparent 70%);
}
