#dex-search { display: block; max-width: 26rem; margin: .45rem 0; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); gap: .85rem; }
.dex-card {
  position: relative; display: grid; align-content: center; justify-items: center; gap: .45rem;
  aspect-ratio: 1; padding: .9rem; border: 1px solid var(--line); border-radius: .85rem;
  background: radial-gradient(ellipse at center, #352046, var(--panel) 75%);
  color: var(--text); font: inherit; cursor: pointer;
}
.dex-card:hover { border-color: var(--accent); }
.dex-card > img { width: 4.8rem; height: 4.8rem; object-fit: contain; }
.dex-card strong { line-height: 1.2; }
.dex-evolutions { position: absolute; top: .4rem; right: .4rem; display: flex; align-items: center; gap: .15rem; }
.dex-evolutions img { width: 1.45rem; height: 1.45rem; object-fit: contain; }
.dex-types { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; }
.dex-types span { border-radius: .35rem; background: #402953; padding: .1rem .4rem; font-size: .875rem; }
#dex-more { margin-block: 1.25rem; }
#dex-more[hidden] { display: none; }
#dex-detail {
  width: min(42rem, calc(100% - 1.5rem)); max-height: 90dvh; padding: 1.2rem;
  border: 1px solid var(--line); border-radius: 1rem; color: var(--text); background: var(--panel);
}
#dex-detail::backdrop { background: #0a0610c9; }
#dex-detail form { float: right; display: block; padding: 0; margin: 0 0 .5rem .75rem; border: 0; }
#dex-content { clear: both; }
.dex-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .55rem; }
.dex-stats div { border: 1px solid var(--line); padding: .45rem .65rem; border-radius: .4rem; }
.dex-stats dd { color: var(--accent); margin: 0; font-weight: 750; }
#dex-content details { margin-block: .8rem; border-top: 1px solid var(--line); padding-top: .75rem; }
#dex-content summary { cursor: pointer; font-weight: 650; }
.dex-moves { width: 100%; text-align: left; border-collapse: collapse; }
.dex-moves td, .dex-moves th { padding: .4rem; border-bottom: 1px solid var(--line); }
.dex-sources { margin-top: 1.5rem; }

.dex-evolutions span { color: var(--muted); font-size: .8rem; }
@media (max-width: 32rem) {
  .dex-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr)); }
  .dex-card > img { width: 4rem; height: 4rem; }
}

.dex-stats .dex-stat-total { background: #402953; border-color: var(--accent); }
.dex-megas h3 { margin-top: 1.1rem; }
.dex-mega-preview { display: flex; align-items: center; gap: .8rem; }
.dex-mega-preview img { width: 4.25rem; height: 4.25rem; object-fit: contain; }
