/* Dragon Ball Dex — misma distribución que la Pokédex de Ingenio con Aguilar: lista clara a la izquierda y ficha a la derecha. */
@font-face {
  font-family: 'Outfit';
  src: url('_shared/fonts/outfit-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --vino: #5b1c32;
  --guinda: #8a1f3d;
  --borgona: #a83250;
  --rosa: #f2e9eb;
  --dorado: #d4af7c;
  --marfil: #faf8f7;
  --prof: #2a0d17;
  --ink: #2a0d17;
  --muted: #66545b;
  --line: rgba(91, 28, 50, 0.1);
  --shadow: rgba(91, 28, 50, 0.1) 0 10px 18px;
  --ki: #d4af7c;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', system-ui, sans-serif;
}
html {
  color-scheme: light;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
body {
  background: var(--marfil);
  color: var(--ink);
  padding: 64px clamp(14px, 4vw, 40px) 0;
  min-height: 100vh;
  position: relative;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
a {
  color: var(--guinda);
}
h1,
h2,
h3,
h4 {
  color: var(--ink);
  text-align: center;
  margin: 5px;
}
h4 {
  margin-top: 15px;
  font-size: 0.95rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.row {
  display: flex;
  flex-direction: row;
}
.container {
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  background: #fff;
}
:focus-visible {
  outline: 2px solid var(--guinda);
  outline-offset: 2px;
}
span {
  color: inherit;
}

/* barra superior de Ingenio con Aguilar */
.dtop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(14px, 4vw, 32px);
  background: linear-gradient(100deg, #2a0d17, #5b1c32);
  color: #faf8f7;
  box-shadow: 0 6px 24px rgba(42, 13, 23, 0.25);
}
.dtop a {
  color: #faf8f7;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.dtop__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dtop__brand span {
  font-size: 15px;
}
.dtop nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dtop nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(250, 248, 247, 0.28);
}
.dtop nav a:hover {
  background: rgba(250, 248, 247, 0.12);
}
html.embed .dtop {
  display: none;
}
html.embed body {
  padding-top: 12px;
}
@media (max-width: 520px) {
  .dtop__brand span {
    display: none;
  }
}

/* carga */
#loading-div {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--marfil);
  transition:
    opacity 0.45s ease,
    visibility 0.45s;
}
#loading-div.done {
  opacity: 0;
  visibility: hidden;
}
.loading-ball {
  height: 60px;
  width: auto;
  animation: pulseMark 1.6s ease-in-out infinite;
}
@keyframes pulseMark {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

/* distribución */
.dex {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  max-width: 1320px;
  margin: 0 auto;
}
#dex-list {
  flex: 1;
  min-width: 0;
}
.view[hidden] {
  display: none;
}
.dex.nopanel #panel {
  display: none;
}

.dex-bar {
  display: flex;
  justify-content: center;
  padding: 18px 0 4px;
}
.tabs {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
}
.tabs button {
  background: transparent;
  border: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  transition:
    background 0.2s,
    color 0.2s;
}
.tabs button small {
  font-weight: 500;
  font-size: 0.75rem;
}
.tabs button:hover {
  color: var(--guinda);
}
.tabs button[aria-selected='true'] {
  background: var(--guinda);
  color: #fff;
  box-shadow: #8a1f3d55 4px 5px 14px;
}

/* buscador */
#search-bar,
.search-lite {
  margin: 22px 10px 8px;
  padding: 12px 15px;
  align-items: center;
  gap: 12px;
}
.search {
  flex: 1;
  display: block;
}
.search input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 18px;
  color: var(--ink);
  padding: 6px 0;
}
.search input::placeholder {
  color: #9a8b90;
}
.search input::-webkit-search-cancel-button {
  appearance: none;
}
.sbtn {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--guinda);
  color: #fff;
  box-shadow: #8a1f3d55 5px 5px 15px;
}
#search-bar:focus-within,
.search-lite:focus-within {
  border-color: #d9b7c2;
}

/* filtros */
.tools {
  display: grid;
  gap: 0.8rem;
  margin: 14px 10px 6px;
  justify-items: center;
}
.tools__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
  justify-content: center;
}
.sel {
  display: grid;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  padding-left: 0.5rem;
}
.sel select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 42px;
  min-width: 150px;
  padding: 0 34px 0 14px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%232a0d17' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 14px center;
  color: var(--ink);
  font-size: 14px;
  box-shadow: var(--shadow);
}
.sel select:hover {
  border-color: #d9b7c2;
}
.pill {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.pill:hover {
  border-color: #d9b7c2;
  transform: translateY(-1px);
}
.pill[aria-pressed='true'] {
  background: var(--guinda);
  border-color: var(--guinda);
  color: #fff;
}
.pill--ghost {
  background: transparent;
  box-shadow: none;
  border-color: #d9b7c2;
  color: var(--guinda);
}
.pill[hidden] {
  display: none;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.chip {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid var(--c, var(--guinda));
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}
.chip:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--c, var(--guinda)) 12%, #fff);
}
.chip[aria-pressed='true'] {
  background: var(--c, var(--guinda));
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.chip[data-k='all'] {
  --c: var(--guinda);
}
.dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}
.count {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.none {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 0;
}

.has-img > .orb {
  display: none;
}
.mini {
  position: relative;
}
.mini.has-img .ini {
  display: none;
}
.p-art.has-img > img {
  animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* tarjetas de personaje (el retrato «sale» de la tarjeta, como en la Pokédex) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 16px;
  padding: 0 10px;
  margin-top: 4px;
}
.card {
  position: relative;
  margin-top: 74px;
  padding: 52px 14px 16px;
  text-align: center;
  border: 2px solid #fff;
  transition:
    border-color 0.12s,
    transform 0.2s,
    box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 148px;
}
.card:hover,
.card.is-sel {
  border-color: color-mix(in srgb, var(--ki) 70%, #d9b7c2);
}
.card.is-sel {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--ki) 28%, transparent),
    var(--shadow);
}
.card:hover .art {
  transform: translateX(-50%) scale(1.12);
}
.card__open {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: none;
  border: 0;
  border-radius: 20px;
}
.art {
  position: absolute;
  left: 50%;
  top: -74px;
  width: 112px;
  height: 112px;
  transform: translateX(-50%);
  transition: transform 0.15s;
  pointer-events: none;
  display: grid;
  place-items: end center;
}
.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 8px rgba(42, 13, 23, 0.22));
}
.orb {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  color: #fff;
  background: radial-gradient(
    circle at 32% 26%,
    color-mix(in srgb, var(--ki) 70%, #fff),
    var(--ki) 55%,
    color-mix(in srgb, var(--ki) 62%, #000)
  );
  box-shadow:
    inset 0 -8px 14px rgba(0, 0, 0, 0.2),
    0 14px 22px -10px var(--ki),
    0 0 0 5px color-mix(in srgb, var(--ki) 18%, transparent);
}
.orb .sig {
  position: absolute;
  inset: 12%;
  width: 76%;
  height: 76%;
  fill: rgba(255, 255, 255, 0.14);
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.orb .emb {
  position: relative;
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(242, 233, 235, 0.8);
  color: #c9b4bb;
  font-size: 17px;
  line-height: 1;
  transition:
    transform 0.15s,
    color 0.15s,
    background 0.15s;
}
.fav-btn:hover {
  transform: scale(1.1);
  background: var(--rosa);
}
.fav-btn[aria-pressed='true'] {
  color: #e0405f;
  background: #ffe7ec;
}
.num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.nm {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}
.tag {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  background: color-mix(in srgb, var(--c, #d9b7c2) 48%, #fff);
  line-height: 1.3;
}
.tag--ghost {
  background: #f2e9eb;
  color: var(--muted);
}
.tag .dot {
  margin-right: 0.3rem;
  vertical-align: 1px;
}
.more {
  margin: 1.4rem auto 0;
  display: flex;
}
#sentinel {
  height: 1px;
}

/* otras vistas */
.fgrid,
.ugrid,
.bgrid {
  display: grid;
  gap: 16px;
  padding: 0 10px;
  margin-top: 12px;
}
.fgrid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.ugrid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.bgrid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-top: 22px;
}
.fc {
  position: relative;
  text-align: left;
  padding: 16px 16px 16px 22px;
  border: 2px solid #fff;
  display: grid;
  align-content: start;
  gap: 0.4rem;
  overflow: hidden;
  background: #fff;
  transition:
    border-color 0.15s,
    transform 0.2s;
}
.fc::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--ki);
  box-shadow: 0 0 20px 2px var(--ki);
}
.fc:hover,
.fc:focus-visible {
  border-color: color-mix(in srgb, var(--ki) 60%, #d9b7c2);
  transform: translateY(-3px);
}
.fc h3 {
  text-align: left;
  margin: 0;
  font-size: 1.1rem;
}
.fc .es {
  color: var(--muted);
  font-size: 0.8rem;
}
.fc p {
  margin: 0;
  color: #5d4b52;
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.avs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
  align-items: center;
}
.mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background: radial-gradient(
    circle at 30% 25%,
    color-mix(in srgb, var(--ki) 70%, #fff),
    color-mix(in srgb, var(--ki) 70%, #000)
  );
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(42, 13, 23, 0.2);
  overflow: hidden;
}
.mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.uc,
.bs {
  padding: 18px;
  display: grid;
  gap: 0.65rem;
  align-content: start;
}
.uc h3,
.bs h3 {
  text-align: left;
  margin: 0;
  font-size: 1.2rem;
}
.uc > .tag,
.bs > .tag {
  justify-self: start;
}
.uc .plus {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.uc .plus b {
  color: var(--guinda);
}
.uc p,
.bs > p {
  margin: 0;
  color: #5d4b52;
  font-size: 0.9rem;
  line-height: 1.5;
}
.link {
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  border: 2px solid #ead9de;
  background: #fff;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.link:hover,
.link:focus-visible {
  border-color: var(--guinda);
  color: var(--guinda);
}
.btn-open {
  justify-self: start;
}
.orbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(
    circle at 32% 28%,
    color-mix(in srgb, var(--bc) 50%, #fff),
    var(--bc) 55%,
    color-mix(in srgb, var(--bc) 60%, #000)
  );
  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.25),
    0 8px 14px -6px var(--bc);
  transition: transform 0.15s;
}
.ball:hover {
  transform: translateY(-3px) scale(1.08);
}
.ball svg {
  width: 100%;
  height: 100%;
  display: block;
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  margin: 0;
}
.facts div {
  background: var(--rosa);
  padding: 8px 12px;
  border-radius: 18px;
  text-align: center;
}
.facts dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.facts dd {
  margin: 0.1rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.rules {
  margin: 0;
  padding-left: 1.1rem;
  color: #5d4b52;
  font-size: 0.88rem;
  display: grid;
  gap: 0.3rem;
  line-height: 1.45;
}

/* ficha del personaje */
#panel {
  position: sticky;
  top: 238px;
  width: 380px;
  flex: none;
  margin-top: 186px;
  height: calc(100vh - 256px);
  min-height: 380px;
  padding: 0 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
}
html.embed #panel {
  top: 200px;
  height: calc(100vh - 214px);
  margin-top: 170px;
}
.p-art {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% - 14px);
  height: 190px;
  display: grid;
  place-items: end center;
  pointer-events: none;
  z-index: 1;
}
.p-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 10px 12px rgba(42, 13, 23, 0.25));
  animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.p-art .orb {
  width: 150px;
  height: 150px;
  margin-bottom: 6px;
  animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.p-art .orb .emb {
  font-size: 2.6rem;
}
.p-art .ghost {
  width: 170px;
  height: 170px;
  color: var(--ki);
  opacity: 0.1;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
  margin-bottom: 8px;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
}
.panel-x {
  display: none;
}
#panel-in {
  overflow-y: auto;
  scrollbar-width: none;
  padding: 44px 0 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
#panel-in::-webkit-scrollbar {
  display: none;
}
.empty-hint {
  margin: auto;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.4;
  padding: 0 1rem;
}
.idrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.idrow .fav-btn {
  position: static;
  width: 30px;
  height: 30px;
  font-size: 15px;
}
#panel h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 4px 0 0;
}
.alt {
  color: var(--muted);
  font-size: 0.88rem;
}
.panel-bio {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #4a3940;
  margin: 4px 4px 0;
}
.pfacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.pfacts div {
  background: var(--rosa);
  border-radius: 26px;
  padding: 8px 6px;
}
.pfacts div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.pfacts dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.pfacts dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}
.cnts {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.cnts div {
  flex: 1;
  background: var(--rosa);
  border-radius: 26px;
  padding: 8px 4px;
}
.cnts b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 auto 3px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.82rem;
  background: var(--guinda);
}
.cnts div:nth-child(2) b {
  background: #7d5bd1;
}
.cnts div:nth-child(3) b {
  background: #3f8fd9;
}
.cnts span {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ladder {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 4px 10px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.lad {
  flex: 0 0 74px;
  background: none;
  border: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 4px 0;
  border-radius: 20px;
  scroll-snap-align: start;
}
.lad:hover {
  background: rgba(0, 0, 0, 0.03);
}
.lad .fo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(
    circle at 32% 26%,
    color-mix(in srgb, var(--ki) 65%, #fff),
    var(--ki) 60%,
    color-mix(in srgb, var(--ki) 60%, #000)
  );
  box-shadow:
    0 8px 14px -8px var(--ki),
    0 0 0 4px color-mix(in srgb, var(--ki) 16%, transparent);
}
.lad .fo svg {
  width: 70%;
  height: 70%;
  fill: rgba(255, 255, 255, 0.18);
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.lad small {
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.15;
  color: #4a3940;
  max-width: 74px;
  overflow-wrap: anywhere;
}
.pl {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 2px;
}
.fus-it {
  background: var(--rosa);
  border-radius: 22px;
  padding: 8px 10px;
  margin: 4px 0;
  text-align: center;
}
.fus-it b {
  display: block;
  font-size: 0.95rem;
}
.fus-it small {
  color: var(--muted);
  font-size: 0.7rem;
}
.outs {
  display: grid;
  gap: 6px;
}
.oi {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: var(--rosa);
  border-radius: 22px;
  padding: 8px 12px;
}
.oi svg {
  width: 40px;
  height: 46px;
}
.oi b {
  font-size: 0.9rem;
  display: block;
}
.oi small {
  color: #5d4b52;
  font-size: 0.78rem;
  line-height: 1.35;
  display: block;
}
.rel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.rel .rbtn {
  background: none;
  border: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 62px;
}
.rel .rbtn .mini {
  width: 46px;
  height: 46px;
  font-size: 0.8rem;
}
.rel .rbtn small {
  font-size: 0.64rem;
  font-weight: 600;
  color: #4a3940;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}
.acts .pill {
  min-height: 38px;
  font-size: 13px;
  padding: 0 14px;
}
.dnav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.dnav .pill {
  min-height: 36px;
  font-size: 12px;
  padding: 0 12px;
  max-width: 49%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  line-height: 32px;
}
.empty {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.3rem 0;
}
.tgl-note {
  color: var(--muted);
  font-size: 0.78rem;
}
.credits {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 36px 12px 52px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.credits a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* diálogo (transformaciones y comparador) */
.dlg {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  color: var(--ink);
  width: min(680px, calc(100% - 1.2rem));
  max-height: calc(100vh - 1.4rem);
  overflow: auto;
  box-shadow: 0 40px 90px -20px rgba(42, 13, 23, 0.5);
  margin: auto;
}
.dlg::backdrop {
  background: rgba(42, 13, 23, 0.55);
  backdrop-filter: blur(4px);
}
.dlg[open] {
  animation: dlgin 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes dlgin {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
}
.dlg-x {
  position: sticky;
  top: 0.6rem;
  float: right;
  margin: 0.6rem 0.6rem 0 0;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 0;
  background: var(--rosa);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}
.dlg-x:hover {
  opacity: 0.6;
}
.dh {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.4rem 1.4rem 1rem;
  background: radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--ki) 26%, transparent), transparent 62%);
}
.dh .orb {
  width: 76px;
  height: 76px;
  margin: 0;
}
.dh .orb .emb {
  font-size: 1.5rem;
}
.dh h2 {
  text-align: left;
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
}
.dh .alt {
  margin-top: 2px;
}
.dh .tags {
  justify-content: flex-start;
}
.dbody {
  padding: 0 1.4rem 1.4rem;
  display: grid;
  gap: 1rem;
}
.dbody p {
  margin: 0;
  line-height: 1.55;
}
.dbody h3 {
  text-align: left;
  margin: 0;
  font-size: 1rem;
}
.dbody .plus {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.cmpwrap {
  overflow-x: auto;
}
.cmp {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 440px;
}
.cmp th,
.cmp td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.cmp thead th {
  text-align: center;
}
.cmp tbody th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 26%;
}
.cp {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
}
.cp .orb {
  width: 64px;
  height: 64px;
  margin: 0;
}
.cp .orb .emb {
  font-size: 1.2rem;
}
.cp .art2 {
  position: relative;
  width: 74px;
  height: 74px;
}
.cp .art2 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tray {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100% - 20px);
  padding: 0.7rem 1rem;
  border: 2px solid var(--guinda);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 50px -12px rgba(42, 13, 23, 0.4);
  font-size: 0.88rem;
}
.tray[hidden] {
  display: none;
}
.tray i {
  color: var(--muted);
  font-style: normal;
}
.tr-a {
  display: flex;
  gap: 0.5rem;
}
.tray .pill {
  min-height: 34px;
  font-size: 13px;
  box-shadow: none;
}
.tray .pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pill--solid {
  background: var(--guinda);
  border-color: var(--guinda);
  color: #fff;
}

body.sheet-open .tray,
body.sheet-open .totop {
  display: none;
}
.totop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 35;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  border: 0;
  background: var(--marfil);
  box-shadow: var(--shadow);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.totop[hidden] {
  display: none;
}
.totop:hover {
  opacity: 0.6;
}

/* tableta y celular: la ficha es una hoja que sube desde abajo */
@media (max-width: 1099px) {
  .dex {
    display: block;
  }
  #panel {
    position: fixed;
    z-index: 50;
    left: 50%;
    bottom: 0;
    top: auto;
    margin: 0;
    width: calc(100% - 24px);
    max-width: 560px;
    height: min(80vh, 640px);
    min-height: 0;
    transform: translate(-50%, 110%);
    transition: transform 0.35s ease;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    visibility: hidden;
  }
  #panel.open {
    transform: translate(-50%, 0);
    visibility: visible;
  }
  #panel-bg {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(42, 13, 23, 0.5);
    backdrop-filter: blur(3px);
  }
  #panel-bg[hidden] {
    display: none;
  }
  .panel-x {
    display: grid;
    place-items: center;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 60;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 0;
    background: var(--rosa);
    font-size: 1.6rem;
    line-height: 1;
    box-shadow: var(--shadow);
  }
  #panel:not(.open) .panel-x {
    display: none;
  }
  .p-art {
    height: 160px;
  }
  .p-art .orb {
    width: 124px;
    height: 124px;
  }
  #panel-in {
    padding-top: 38px;
  }
  .totop {
    bottom: 78px;
  }
}
@media (max-width: 700px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    padding: 0 2px;
  }
  .card {
    margin-top: 62px;
    padding: 46px 8px 14px;
    min-height: 130px;
  }
  .art {
    top: -62px;
    width: 100px;
    height: 100px;
  }
  .orb {
    width: 80px;
    height: 80px;
  }
  .orb .emb {
    font-size: 1.5rem;
  }
  .nm {
    font-size: 1.02rem;
  }
  .tag {
    font-size: 0.72rem;
  }
  .fav-btn {
    width: 32px;
    height: 32px;
    top: 8px;
    right: 8px;
  }
  #search-bar,
  .search-lite {
    margin: 16px 0 6px;
  }
  .search input {
    font-size: 16px;
  }
  .tools {
    margin: 12px 0 4px;
  }
  .sel select {
    min-width: 140px;
  }
  .tabs button {
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
  }
  .tabs button small {
    display: none;
  }
  .fgrid,
  .ugrid,
  .bgrid {
    padding: 0;
  }
  .dh {
    grid-template-columns: 64px 1fr;
    padding: 1.1rem 1rem 0.8rem;
  }
  .dh .orb {
    width: 60px;
    height: 60px;
  }
  .dbody {
    padding: 0 1rem 1.1rem;
  }
  .tray {
    bottom: 8px;
    font-size: 0.8rem;
  }
}
@media (max-width: 700px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tabs button {
    white-space: nowrap;
    flex: none;
  }
  .dex-bar {
    padding-top: 12px;
  }
  .tools__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
    align-items: end;
  }
  .sel {
    padding-left: 0.3rem;
    min-width: 0;
  }
  .sel select {
    width: 100%;
    min-width: 0;
  }
  .tools__row .pill {
    width: 100%;
    justify-content: center;
    padding: 0 10px;
  }
  #f-series {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    width: 100%;
    padding: 2px 2px 8px;
    scrollbar-width: none;
    margin: 0 -2px;
  }
  #f-series::-webkit-scrollbar {
    display: none;
  }
  #f-series .chip {
    flex: none;
    white-space: nowrap;
  }
  .tools {
    justify-items: stretch;
  }
  .count {
    justify-self: center;
  }
}
@media (max-width: 700px) {
  .cmp {
    min-width: 0;
    font-size: 0.8rem;
  }
  .cmp tbody th {
    width: 24%;
    font-size: 0.6rem;
    letter-spacing: 0.03em;
  }
  .cmp th,
  .cmp td {
    padding: 0.45rem 0.35rem;
  }
  .cp .art2,
  .cp .orb {
    transform: scale(0.85);
  }
}
@media (max-width: 380px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  #panel {
    height: 94vh;
  }
  .p-art {
    display: none;
  }
  #panel-in {
    padding-top: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── imágenes propias: mismo marco, aura, entrada y movimiento para todas (se generan con herramientas/dex-imagenes.py) ── */
@keyframes imgin {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}
.art.has-img::before,
.p-art.has-img::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 78%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--ki) 42%, transparent), transparent 68%);
  filter: blur(6px);
  opacity: 0.85;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 0;
}
.art.has-img > img,
.p-art.has-img > img {
  z-index: 1;
}
.art.has-img > img {
  animation: imgin 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.card:hover .art.has-img::before {
  opacity: 1;
  transform: translateX(-50%) scale(1.15);
}
.p-art.has-img::before {
  width: 62%;
  bottom: 2%;
  filter: blur(10px);
}
.p-art.has-img > img {
  animation:
    rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    bob 5.5s ease-in-out 0.5s infinite;
}
.lad .fo.has-img {
  background: radial-gradient(
    circle at 50% 35%,
    color-mix(in srgb, var(--ki) 28%, #fff),
    color-mix(in srgb, var(--ki) 70%, #fff)
  );
  overflow: hidden;
}
.lad .fo.has-img svg {
  display: none;
}
.lad .fo > img,
.dh .orb--img > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.dh .orb--img {
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 35%,
    color-mix(in srgb, var(--ki) 28%, #fff),
    color-mix(in srgb, var(--ki) 70%, #fff)
  );
}
.dh .orb--img .sig {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .p-art.has-img > img,
  .art.has-img > img {
    animation: none !important;
  }
}

/* ── modo Pixel: sprites ampliados sin suavizar, animación por pasos ── */
.dex-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.stylesw {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}
.stylesw[aria-pressed='true'] {
  background: var(--wine, #8b1e3f);
  color: #fff;
  border-color: transparent;
}
.px-mode .art img,
.px-mode .p-art img,
.px-mode .lad .fo > img,
.px-mode .dh .orb--img > img,
.px-mode .mini img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  filter: none;
}
.px-mode .art.has-img > img {
  animation: imgin 0.3s steps(4) both;
}
.px-mode .p-art.has-img > img {
  animation:
    rise 0.3s steps(4),
    pxbob 1.1s steps(1) 0.4s infinite;
}
.px-mode .art.has-img::before,
.px-mode .p-art.has-img::before {
  filter: none;
}
@keyframes pxbob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .px-mode .p-art.has-img > img {
    animation: none !important;
  }
}
