.portal-dex {
  width: 100%;
  max-width: 1700px;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 48px);
  color: var(--text-primary);
}


/* =========================================================
   HERO
   ========================================================= */

.dex-hero {
  min-height: 390px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, .9fr);
  align-items: center;
  gap: 30px;
  padding: clamp(34px, 4.5vw, 68px);
  border: 1px solid var(--border-luminous);
  border-radius: 28px;
  background:
    radial-gradient(
      circle at 78% 38%,
      color-mix(in srgb, var(--region-accent) 25%, transparent),
      transparent 34%
    ),
    radial-gradient(
      circle at 12% 12%,
      color-mix(in srgb, var(--region-secondary) 10%, transparent),
      transparent 32%
    ),
    linear-gradient(
      135deg,
      color-mix(
        in srgb,
        var(--region-atmosphere) 44%,
        var(--surface-elevated)
      ),
      var(--surface-inset)
    );
}

.dex-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .16;
  pointer-events: none;
  background-image:
    linear-gradient(
      color-mix(in srgb, var(--region-accent) 15%, transparent) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--region-accent) 15%, transparent) 1px,
      transparent 1px
    );
  background-size:
    var(--region-grid)
    var(--region-grid);
  mask-image:
    linear-gradient(
      90deg,
      black,
      transparent 75%
    );
}

.dex-hero__copy {
  position: relative;
  z-index: 4;
}

.dex-hero__region {
  margin-bottom: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: .62rem;
  letter-spacing: .1em;
}

.dex-hero__region b {
  color: var(--region-accent);
}

.dex-hero__region i {
  width: 1px;
  height: 12px;
  background: var(--border);
}

.dex-hero h1 {
  margin: 10px 0 15px;
  font-size: clamp(4rem, 7vw, 7.5rem);
  line-height: .82;
  letter-spacing: -.065em;
}

.dex-hero__copy > p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-secondary);
}

.dex-hero__copy > p strong {
  color: var(--text-primary);
}

.dex-hero__copy > p span {
  color: var(--region-accent);
}

.dex-hero__chips {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dex-hero__chips span {
  padding: 6px 9px;
  border: 1px solid
    color-mix(
      in srgb,
      var(--region-accent) 30%,
      var(--border)
    );
  border-radius: 999px;
  color: var(--text-muted);
  font-size: .59rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.dex-hero__visual {
  min-height: 300px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dex-hero__orbit {
  width: 285px;
  height: 285px;
  position: absolute;
  border: 1px solid
    color-mix(
      in srgb,
      var(--region-accent) 28%,
      transparent
    );
  border-radius: 50%;
  box-shadow:
    0 0 75px
      color-mix(
        in srgb,
        var(--region-accent) 12%,
        transparent
      ),
    inset 0 0 65px
      color-mix(
        in srgb,
        var(--region-accent) 6%,
        transparent
      );
}

.dex-hero__orbit i {
  position: absolute;
  inset: 42px;
  border: 1px solid
    color-mix(
      in srgb,
      var(--region-secondary) 17%,
      transparent
    );
  border-radius: 50%;
}

.dex-hero__orbit i + i {
  inset: 88px;
}

.dex-hero__pokemon {
  width: min(330px, 72%);
  max-height: 330px;
  position: relative;
  z-index: 3;
  object-fit: contain;
  filter:
    drop-shadow(
      0 30px 28px rgba(0, 0, 0, .5)
    );
}

.dex-hero__collection {
  min-width: 155px;
  position: absolute;
  right: 0;
  top: 12px;
  z-index: 5;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    color-mix(
      in srgb,
      var(--surface-inset) 88%,
      transparent
    );
  backdrop-filter: blur(10px);
}

.dex-hero__collection > span,
.dex-hero__collection > em {
  display: block;
  color: var(--text-muted);
  font-size: .58rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .11em;
}

.dex-hero__collection strong {
  display: block;
  margin: 5px 0;
  color: var(--region-accent);
  font-size: 2.7rem;
  line-height: 1;
}

.dex-hero__collection strong small {
  color: var(--text-secondary);
  font-size: .8rem;
}

.dex-hero__region-word {
  position: absolute;
  right: -12px;
  bottom: -15px;
  color:
    color-mix(
      in srgb,
      var(--region-accent) 13%,
      transparent
    );
  font-size: clamp(4rem, 8vw, 8rem);
  font-weight: 950;
  letter-spacing: -.08em;
}


/* =========================================================
   BOOM SYSTEMS
   ========================================================= */

.dex-systems {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dex-system-card {
  min-height: 125px;
  padding: 19px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background:
    radial-gradient(
      circle at 100% 0,
      color-mix(in srgb, var(--region-accent) 8%, transparent),
      transparent 48%
    ),
    var(--surface-elevated);
}

.dex-system-card__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid
    color-mix(
      in srgb,
      var(--region-accent) 35%,
      var(--border)
    );
  border-radius: 12px;
  color: var(--region-accent);
  background: var(--surface-inset);
  font-size: 1.2rem;
}

.dex-system-card small {
  display: block;
  color: var(--text-muted);
  font-size: .56rem;
  font-weight: 950;
  letter-spacing: .11em;
}

.dex-system-card strong {
  display: block;
  margin-top: 3px;
  font-size: 1.65rem;
}

.dex-system-card__name {
  font-size: 1.05rem !important;
}

.dex-system-card p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: .72rem;
}

.dex-system-card--shiny .dex-system-card__icon,
.dex-system-card--shiny strong {
  color: var(--shiny);
}


/* =========================================================
   REGION PROGRESS
   ========================================================= */

.dex-region-section {
  margin-top: 28px;
}

.dex-region-section > header {
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.dex-region-section h2 {
  margin: 5px 0 0;
  font-size: 2rem;
}

.dex-region-section > header p {
  margin: 0;
  color: var(--text-secondary);
}

.dex-regions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dex-region-card {
  min-height: 110px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-inset);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition:
    transform var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast);
}

.dex-region-card:hover,
.dex-region-card[aria-pressed=true] {
  transform: translateY(-2px);
  border-color: var(--region-accent);
}

.dex-region-card--kanto {
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(242,100,100,.12),
      transparent 52%
    ),
    var(--surface-inset);
}

.dex-region-card--johto {
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(232,189,85,.12),
      transparent 52%
    ),
    var(--surface-inset);
}

.dex-region-card--hoenn {
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(76,225,181,.12),
      transparent 52%
    ),
    var(--surface-inset);
}

.dex-region-card__header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.dex-region-card__header span {
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.dex-region-card__header b {
  font-size: 1.1rem;
}

.dex-region-card__header small {
  color: var(--text-muted);
  font-size: .7rem;
}

.dex-region-card > strong {
  color: var(--text-muted);
  font-size: .57rem;
  letter-spacing: .1em;
}

.dex-region-card progress {
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}

.dex-region-card progress::-webkit-progress-bar {
  background: var(--border);
}

.dex-region-card progress::-webkit-progress-value {
  background: var(--region-accent);
}

.dex-region-card progress::-moz-progress-bar {
  background: var(--region-accent);
}


/* =========================================================
   CONTROLS
   ========================================================= */

.dex-control-panel {
  margin: 22px 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-elevated);
}

.dex-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dex-tabs button,
.dex-filter-row button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-inset);
  color: var(--text-secondary);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .09em;
  cursor: pointer;
}

.dex-tabs button[aria-pressed=true],
.dex-filter-row button[aria-pressed=true] {
  color: var(--text-primary);
  border-color: var(--region-accent);
  background:
    color-mix(
      in srgb,
      var(--region-accent) 11%,
      var(--surface-inset)
    );
}

.dex-tools {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.dex-search {
  width: min(440px, 100%);
}

.dex-search span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.dex-search input {
  width: 100%;
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-inset);
  color: var(--text-primary);
  font: inherit;
}

.dex-search input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.dex-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}


/* =========================================================
   WORKSPACE
   ========================================================= */

.dex-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 430px);
  gap: 18px;
  align-items: start;
}

.dex-index {
  min-width: 0;
}

.dex-index > header {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: .6rem;
  letter-spacing: .1em;
}

.dex-index > header div {
  display: flex;
  gap: 12px;
}

.dex-index > header b {
  color: var(--region-accent);
}


/* =========================================================
   SPECIES GRID
   ========================================================= */

.dex-grid {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fill,
      minmax(120px, 1fr)
    );
  gap: 8px;
}

.dex-entry {
  min-height: 170px;
  position: relative;
  overflow: hidden;
  padding: 10px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(
      150deg,
      var(--surface-elevated),
      var(--surface-inset)
    );
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition:
    transform var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.dex-entry--kanto {
  background:
    radial-gradient(
      circle at 90% 12%,
      rgba(242,100,100,.08),
      transparent 46%
    ),
    var(--surface-inset);
}

.dex-entry--johto {
  background:
    radial-gradient(
      circle at 90% 12%,
      rgba(232,189,85,.08),
      transparent 46%
    ),
    var(--surface-inset);
}

.dex-entry--hoenn {
  background:
    radial-gradient(
      circle at 90% 12%,
      rgba(76,225,181,.08),
      transparent 46%
    ),
    var(--surface-inset);
}

.dex-entry:hover,
.dex-entry[aria-selected=true] {
  transform: translateY(-3px);
  border-color: var(--region-accent);
  box-shadow:
    0 12px 30px rgba(0,0,0,.16);
}

.dex-entry[aria-selected=true] {
  background:
    linear-gradient(
      150deg,
      color-mix(
        in srgb,
        var(--region-accent) 11%,
        var(--surface-elevated)
      ),
      var(--surface-inset)
    );
}

.dex-entry:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.dex-entry__top {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dex-entry__number {
  color: var(--text-muted);
  font-size: .56rem;
}

.dex-shiny {
  color: var(--shiny);
  font-size: .49rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: .06em;
}

.dex-entry__art {
  height: 93px;
  position: relative;
  display: grid;
  place-items: center;
}

.dex-entry__orbit {
  width: 68px;
  height: 68px;
  position: absolute;
  border: 1px solid
    color-mix(
      in srgb,
      var(--region-accent) 12%,
      transparent
    );
  border-radius: 50%;
}

.dex-entry img {
  width: 88px;
  height: 88px;
  position: relative;
  z-index: 2;
  object-fit: contain;
  filter:
    drop-shadow(
      0 9px 10px rgba(0,0,0,.35)
    );
}

.dex-entry.is-missing {
  opacity: .58;
}

.dex-entry img.dex-species-silhouette {
  filter:
    brightness(0)
    saturate(0)
    opacity(.5)
    drop-shadow(
      0 0 11px
      color-mix(
        in srgb,
        var(--region-accent) 25%,
        transparent
      )
    );
}

.dex-entry__copy {
  margin-top: auto;
}

.dex-entry__copy strong {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dex-entry__state {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .04em;
}


/* =========================================================
   SPECIMEN DETAIL
   ========================================================= */

.dex-detail {
  --specimen-accent:
    var(--region-accent);

  position: sticky;
  top: 24px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid
    color-mix(
      in srgb,
      var(--specimen-accent) 32%,
      var(--border)
    );
  border-radius: 22px;
  background:
    radial-gradient(
      circle at 50% 17%,
      color-mix(
        in srgb,
        var(--specimen-accent) 13%,
        transparent
      ),
      transparent 34%
    ),
    linear-gradient(
      165deg,
      var(--surface-elevated),
      var(--surface-inset)
    );
}

.dex-detail--kanto {
  --specimen-accent: #f26464;
}

.dex-detail--johto {
  --specimen-accent: #e8bd55;
}

.dex-detail--hoenn {
  --specimen-accent: #4ce1b5;
}

.dex-detail > header {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: .57rem;
  font-weight: 900;
  letter-spacing: .09em;
}

.dex-detail > header b {
  color: var(--positive);
}

.dex-detail.is-missing > header b {
  color: var(--text-muted);
}

.dex-detail__scanner {
  height: 300px;
  position: relative;
  display: grid;
  place-items: center;
}

.dex-detail__orbit {
  width: 225px;
  height: 225px;
  position: absolute;
  border: 1px solid
    color-mix(
      in srgb,
      var(--specimen-accent) 35%,
      transparent
    );
  border-radius: 50%;
  box-shadow:
    0 0 55px
      color-mix(
        in srgb,
        var(--specimen-accent) 10%,
        transparent
      );
}

.dex-detail__orbit i {
  position: absolute;
  inset: 35px;
  border: 1px solid
    color-mix(
      in srgb,
      var(--specimen-accent) 18%,
      transparent
    );
  border-radius: 50%;
}

.dex-detail__orbit i + i {
  inset: 78px;
}

.dex-detail__scanner img,
.dex-detail__silhouette {
  width: min(275px, 84%);
  height: 265px;
  position: relative;
  z-index: 3;
  object-fit: contain;
  filter:
    drop-shadow(
      0 22px 23px rgba(0,0,0,.48)
    );
}

.dex-detail__missing-image {
  filter:
    brightness(0)
    saturate(0)
    opacity(.38) !important;
}

.dex-detail__shiny {
  position: absolute;
  right: 0;
  bottom: 12px;
  z-index: 5;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--shiny);
  color: #111;
  font-size: .54rem;
  font-weight: 950;
  letter-spacing: .08em;
}

.dex-detail__identity p {
  margin: 0;
  color: var(--specimen-accent);
  font-size: .57rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.dex-detail__identity h2 {
  margin: 4px 0 7px;
  font-size: 2.2rem;
  line-height: 1;
}

.dex-detail__types {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dex-detail__types span {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: .57rem;
  font-weight: 850;
}

.dex-detail__metrics {
  margin: 17px 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--border);
}

.dex-detail__metrics div {
  padding: 10px;
  background: var(--surface-inset);
}

.dex-detail__metrics dt {
  color: var(--text-muted);
  font-size: .52rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.dex-detail__metrics dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.dex-specimens h3 {
  font-size: .69rem;
  letter-spacing: .09em;
}

.dex-specimens h3 span {
  color: var(--specimen-accent);
}

.dex-specimens ol {
  max-height: 185px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.dex-specimens li {
  padding: 9px 2px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  border-top: 1px solid var(--border);
  font-size: .65rem;
}

.dex-specimens li small {
  grid-column: 1 / -1;
  color: var(--text-muted);
}

.dex-specimens__empty {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-inset);
}

.dex-specimens__empty p {
  margin: 0;
  color: var(--text-secondary);
  font-size: .75rem;
  line-height: 1.5;
}

.dex-specimens__empty a {
  margin-top: 10px;
  display: inline-block;
  color: var(--specimen-accent);
  font-size: .6rem;
  font-weight: 900;
  text-decoration: none;
}


/* =========================================================
   EMPTY / LOADING / ERROR
   ========================================================= */

.dex-empty {
  min-height: 320px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--text-secondary);
}

.dex-empty > span {
  margin: 0 auto 12px;
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--region-accent);
  font-size: 1.4rem;
}

.dex-empty h3,
.dex-empty p {
  margin: 4px 0;
}

.dex-detail--empty {
  min-height: 320px;
  display: grid;
  place-content: center;
  text-align: center;
}

.dex-loading,
.dex-link-error {
  min-height: 55vh;
  display: grid;
  place-content: center;
  text-align: center;
}

.dex-loading {
  grid-auto-flow: column;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}

.dex-loading span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--region-accent);
  box-shadow:
    0 0 14px
    var(--region-accent);
}

.dex-link-error h1 {
  margin: 8px 0;
}

.dex-link-error p {
  color: var(--text-secondary);
}

.dex-link-error button {
  min-height: 42px;
  margin: 16px auto 0;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--region-accent);
  color: #101010;
  font-weight: 900;
}


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

@media (max-width: 1150px) {
  .dex-hero {
    grid-template-columns: 1fr .8fr;
  }

  .dex-systems {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .dex-hero {
    grid-template-columns: 1fr;
  }

  .dex-hero__visual {
    min-height: 270px;
  }

  .dex-workspace {
    grid-template-columns: 1fr;
  }

  .dex-detail {
    position: relative;
    top: auto;
    grid-row: 1;
  }
}

@media (max-width: 700px) {
  .portal-dex {
    padding: 18px 13px 95px;
  }

  .dex-hero {
    padding: 30px 18px;
    border-radius: 18px;
  }

  .dex-hero h1 {
    font-size: 3.5rem;
  }

  .dex-hero__region {
    flex-wrap: wrap;
  }

  .dex-systems {
    grid-template-columns: 1fr 1fr;
  }

  .dex-regions {
    overflow-x: auto;
    grid-template-columns:
      repeat(
        3,
        minmax(175px, 1fr)
      );
  }

  .dex-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .dex-search {
    width: 100%;
  }

  .dex-grid {
    grid-template-columns:
      repeat(3, 1fr);
    gap: 5px;
  }

  .dex-entry {
    min-height: 145px;
    padding: 7px;
  }

  .dex-entry__art {
    height: 75px;
  }

  .dex-entry img {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 430px) {
  .dex-systems {
    grid-template-columns: 1fr;
  }

  .dex-grid {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .dex-region-section > header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dex-entry,
  .dex-region-card {
    transition: none;
  }

  .dex-entry:hover,
  .dex-region-card:hover {
    transform: none;
  }
}


/* =========================================================
   PUBLIC TRAINER POKEDEX
   ========================================================= */

.dex-public-trainer {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns:
    112px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}

.dex-public-trainer__avatar {
  width: 108px;
  height: 108px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border:
    2px solid
    color-mix(
      in srgb,
      var(--region-accent) 65%,
      var(--border)
    );
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      color-mix(
        in srgb,
        var(--region-accent) 17%,
        var(--surface-elevated)
      ),
      var(--surface-inset)
    );
  box-shadow:
    0 0 0 6px
      color-mix(
        in srgb,
        var(--region-accent) 8%,
        transparent
      ),
    0 0 35px
      color-mix(
        in srgb,
        var(--region-accent) 22%,
        transparent
      );
}

.dex-public-trainer__avatar > span {
  color: var(--region-accent);
  font-size: 2rem;
  font-weight: 950;
}

.dex-public-trainer__avatar-image {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 2;
  object-fit: cover;
}

.dex-public-trainer__identity {
  min-width: 0;
}

.dex-public-trainer__identity h1 {
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dex-public-trainer__identity > p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-secondary);
}

.dex-public-trainer__identity > p strong {
  color: var(--text-primary);
}

.dex-public-trainer__identity > p span {
  color: var(--region-accent);
}

.dex-back-community {
  margin-top: 15px;
  display: inline-block;
  color: var(--region-accent);
  font-size: .61rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-decoration: none;
}

.dex-back-community:hover {
  text-decoration: underline;
}


@media (max-width: 700px) {
  .dex-public-trainer {
    grid-template-columns:
      76px minmax(0, 1fr);
    gap: 14px;
  }

  .dex-public-trainer__avatar {
    width: 74px;
    height: 74px;
  }

  .dex-public-trainer__identity h1 {
    font-size: 2.7rem;
  }
}


/* =========================================================
   PUBLIC TRAINER NAME - NEVER TRUNCATE
   ========================================================= */

.dex-public-trainer__identity {
  min-width: 0;
  width: 100%;
}

.dex-public-trainer__identity h1 {
  width: 100%;
  max-width: 760px;
  margin: 8px 0 6px;

  /* Override gamla ellipsis-regler */
  overflow: visible;
  text-overflow: clip;
  white-space: normal;

  /* Långa TikTok-namn får krympa snyggt */
  font-size: clamp(2.8rem, 5vw, 5.8rem);
  line-height: .86;
  letter-spacing: -.055em;

  overflow-wrap: anywhere;
  word-break: normal;
}

@media (max-width: 1100px) {
  .dex-public-trainer__identity h1 {
    font-size: clamp(2.5rem, 5.5vw, 4.8rem);
  }
}

@media (max-width: 700px) {
  .dex-public-trainer__identity h1 {
    font-size: clamp(2rem, 9vw, 3.4rem);
    line-height: .9;
  }
}

/* PUBLIC TRAINER NAME - AUTO FIT ONE LINE */

.dex-public-trainer__identity h1 {
  width: 100%;
  max-width: 760px;

  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: normal !important;
  word-break: normal !important;

  font-size: clamp(3rem, 5.8vw, 5.8rem);
  line-height: .86;
  letter-spacing: -.055em;
}


/* =========================================================
   POKEDEX RECORD V2
   TYPES / SHINY / MATCHUPS
   ========================================================= */


/* ---------- TYPE COLORS ---------- */

.dex-type,
.dex-matchup-chip {
  --poke-type: #7d8a96;
}

.dex-type[data-poke-type="normal"],
.dex-matchup-chip[data-poke-type="normal"] {
  --poke-type: #a8a77a;
}

.dex-type[data-poke-type="fire"],
.dex-matchup-chip[data-poke-type="fire"] {
  --poke-type: #ee8130;
}

.dex-type[data-poke-type="water"],
.dex-matchup-chip[data-poke-type="water"] {
  --poke-type: #6390f0;
}

.dex-type[data-poke-type="electric"],
.dex-matchup-chip[data-poke-type="electric"] {
  --poke-type: #f7d02c;
}

.dex-type[data-poke-type="grass"],
.dex-matchup-chip[data-poke-type="grass"] {
  --poke-type: #7ac74c;
}

.dex-type[data-poke-type="ice"],
.dex-matchup-chip[data-poke-type="ice"] {
  --poke-type: #96d9d6;
}

.dex-type[data-poke-type="fighting"],
.dex-matchup-chip[data-poke-type="fighting"] {
  --poke-type: #c22e28;
}

.dex-type[data-poke-type="poison"],
.dex-matchup-chip[data-poke-type="poison"] {
  --poke-type: #a33ea1;
}

.dex-type[data-poke-type="ground"],
.dex-matchup-chip[data-poke-type="ground"] {
  --poke-type: #e2bf65;
}

.dex-type[data-poke-type="flying"],
.dex-matchup-chip[data-poke-type="flying"] {
  --poke-type: #a98ff3;
}

.dex-type[data-poke-type="psychic"],
.dex-matchup-chip[data-poke-type="psychic"] {
  --poke-type: #f95587;
}

.dex-type[data-poke-type="bug"],
.dex-matchup-chip[data-poke-type="bug"] {
  --poke-type: #a6b91a;
}

.dex-type[data-poke-type="rock"],
.dex-matchup-chip[data-poke-type="rock"] {
  --poke-type: #b6a136;
}

.dex-type[data-poke-type="ghost"],
.dex-matchup-chip[data-poke-type="ghost"] {
  --poke-type: #735797;
}

.dex-type[data-poke-type="dragon"],
.dex-matchup-chip[data-poke-type="dragon"] {
  --poke-type: #6f35fc;
}

.dex-type[data-poke-type="dark"],
.dex-matchup-chip[data-poke-type="dark"] {
  --poke-type: #705746;
}

.dex-type[data-poke-type="steel"],
.dex-matchup-chip[data-poke-type="steel"] {
  --poke-type: #b7b7ce;
}

.dex-type[data-poke-type="fairy"],
.dex-matchup-chip[data-poke-type="fairy"] {
  --poke-type: #d685ad;
}


/* ---------- SHARED TYPE CHIP ---------- */

.dex-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  border:
    1px solid
    color-mix(
      in srgb,
      var(--poke-type) 60%,
      var(--border)
    );
  border-radius: 999px;
  background:
    color-mix(
      in srgb,
      var(--poke-type) 16%,
      var(--surface-inset)
    );
  color:
    color-mix(
      in srgb,
      var(--poke-type) 74%,
      white
    );
  font-size: .52rem;
  font-weight: 950;
  letter-spacing: .055em;
  line-height: 1;
}


/* ---------- GRID TYPES ---------- */

.dex-entry__types {
  min-height: 18px;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dex-entry__types .dex-type {
  padding: 3px 5px;
  font-size: .44rem;
}


/* ---------- SHINY GRID CARD ---------- */

.dex-entry {
  position: relative;
}

.dex-entry.is-shiny {
  border-color: var(--shiny) !important;
  background:
    radial-gradient(
      circle at 50% 28%,
      color-mix(
        in srgb,
        var(--shiny) 23%,
        transparent
      ),
      transparent 46%
    ),
    linear-gradient(
      155deg,
      color-mix(
        in srgb,
        var(--shiny) 7%,
        var(--surface-elevated)
      ),
      var(--surface-inset)
    );
  box-shadow:
    inset 0 0 28px
      color-mix(
        in srgb,
        var(--shiny) 7%,
        transparent
      ),
    0 0 18px
      color-mix(
        in srgb,
        var(--shiny) 16%,
        transparent
      );
}

.dex-entry.is-shiny::after {
  content: "✦";
  position: absolute;
  right: 9px;
  top: 31px;
  color: var(--shiny);
  font-size: .7rem;
  text-shadow:
    0 0 8px
    var(--shiny);
}

.dex-entry__shiny-signal {
  position: absolute;
  right: 7px;
  top: 7px;
  z-index: 4;
  padding: 4px 6px;
  border:
    1px solid
    color-mix(
      in srgb,
      var(--shiny) 60%,
      transparent
    );
  border-radius: 999px;
  background:
    color-mix(
      in srgb,
      var(--shiny) 15%,
      #071019
    );
  color: var(--shiny);
  font-size: .45rem;
  font-weight: 950;
  letter-spacing: .055em;
  box-shadow:
    0 0 12px
    color-mix(
      in srgb,
      var(--shiny) 18%,
      transparent
    );
}

.dex-entry.is-shiny strong {
  color:
    color-mix(
      in srgb,
      var(--shiny) 78%,
      white
    );
}


/* ---------- DETAIL SHINY ---------- */

.dex-detail.is-shiny {
  border-color:
    color-mix(
      in srgb,
      var(--shiny) 75%,
      var(--border)
    );
  box-shadow:
    inset 0 0 48px
      color-mix(
        in srgb,
        var(--shiny) 5%,
        transparent
      );
}

.dex-detail__shiny {
  border:
    1px solid
    color-mix(
      in srgb,
      var(--shiny) 65%,
      transparent
    ) !important;
  background:
    color-mix(
      in srgb,
      var(--shiny) 13%,
      #071019
    ) !important;
  color: var(--shiny) !important;
  box-shadow:
    0 0 20px
    color-mix(
      in srgb,
      var(--shiny) 20%,
      transparent
    );
}

.dex-detail__metrics dd.has-shiny {
  color: var(--shiny);
  text-shadow:
    0 0 10px
    color-mix(
      in srgb,
      var(--shiny) 35%,
      transparent
    );
}


/* ---------- DETAIL TYPES ---------- */

.dex-detail__types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dex-detail__types .dex-type {
  padding: 6px 9px;
  font-size: .57rem;
}


/* ---------- TYPE ANALYSIS ---------- */

.dex-matchups {
  margin-top: 18px;
  padding: 17px;
  display: grid;
  grid-template-columns:
    1fr 1fr;
  gap: 10px;
  border:
    1px solid
    color-mix(
      in srgb,
      var(--region-accent) 16%,
      var(--border)
    );
  border-radius: 15px;
  background:
    linear-gradient(
      145deg,
      color-mix(
        in srgb,
        var(--region-accent) 4%,
        var(--surface-inset)
      ),
      var(--surface-inset)
    );
}

.dex-matchups__intro {
  grid-column: 1 / -1;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.dex-matchups__intro > span {
  color: var(--region-accent);
  font-size: .56rem;
  font-weight: 950;
  letter-spacing: .11em;
}

.dex-matchups__intro p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: .66rem;
}

.dex-matchup-group {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background:
    color-mix(
      in srgb,
      var(--surface-elevated) 55%,
      transparent
    );
}

.dex-matchup-group h3 {
  margin: 0 0 9px;
  font-size: .62rem;
  letter-spacing: .08em;
}

.dex-matchup-group--weak h3 {
  color: #ff6b73;
}

.dex-matchup-group--strong h3 {
  color: var(--positive);
}

.dex-matchup-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dex-matchup-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border:
    1px solid
    color-mix(
      in srgb,
      var(--poke-type) 55%,
      var(--border)
    );
  border-radius: 999px;
  background:
    color-mix(
      in srgb,
      var(--poke-type) 13%,
      var(--surface-inset)
    );
  color:
    color-mix(
      in srgb,
      var(--poke-type) 72%,
      white
    );
  font-size: .48rem;
  font-weight: 900;
}

.dex-matchup-chip b {
  color: var(--text-primary);
  font-size: .48rem;
}

.dex-matchup-group--weak
.dex-matchup-chip b {
  color: #ff8990;
}

.dex-matchup-group--strong
.dex-matchup-chip b {
  color: var(--positive);
}

.dex-matchup-none {
  color: var(--text-muted);
  font-size: .62rem;
}


/* ---------- SHINY SPECIMENS ---------- */

.dex-specimens li.is-shiny {
  background:
    linear-gradient(
      90deg,
      color-mix(
        in srgb,
        var(--shiny) 7%,
        transparent
      ),
      transparent
    );
}

.dex-specimen-shiny {
  margin-right: 5px;
  color: var(--shiny);
  font-size: .55rem;
  letter-spacing: .05em;
}


/* ---------- MOBILE ---------- */

@media (max-width: 650px) {
  .dex-matchups {
    grid-template-columns: 1fr;
  }

  .dex-matchups__intro {
    grid-column: auto;
  }
}


/* =========================================================
   LEGENDARY POKEMON
   ========================================================= */

.dex-entry__signals {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.dex-entry__signals
.dex-entry__shiny-signal {
  position: static;
}

.dex-entry__legendary-signal {
  padding: 4px 6px;
  border: 1px solid rgba(255, 209, 74, .65);
  border-radius: 999px;
  background: rgba(65, 49, 5, .92);
  color: #ffd94f;
  font-size: .43rem;
  font-weight: 950;
  letter-spacing: .05em;
  box-shadow:
    0 0 13px rgba(255, 210, 65, .18);
}

.dex-entry.is-legendary {
  border-color:
    color-mix(
      in srgb,
      #ffd94f 34%,
      var(--border)
    );
}

.dex-entry.is-legendary:not(.is-shiny) {
  background:
    radial-gradient(
      circle at 50% 25%,
      rgba(255, 215, 75, .09),
      transparent 48%
    ),
    var(--surface-inset);
}

.dex-detail__rarity {
  margin: 8px 0 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dex-legendary-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(255, 211, 68, .7);
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      rgba(255, 209, 57, .14),
      rgba(255, 185, 30, .06)
    );
  color: #ffd94f;
  font-size: .56rem;
  font-weight: 950;
  letter-spacing: .075em;
  box-shadow:
    0 0 17px rgba(255, 210, 55, .13);
}


/* Shiny + Legendary gets the full crown treatment */

.dex-entry.is-shiny.is-legendary {
  border-color: #ffd83f !important;
  box-shadow:
    inset 0 0 34px rgba(255, 208, 54, .1),
    0 0 22px rgba(255, 204, 42, .22);
}

.dex-entry.is-shiny.is-legendary strong {
  color: #ffe36a;
}


/* =========================================================
   SHINY WOW SHOWCASE - LARGE RECORD CARD
   ========================================================= */

.dex-detail.is-shiny {
  border-color:
    color-mix(
      in srgb,
      var(--shiny) 82%,
      var(--border)
    );
  background:
    radial-gradient(
      circle at 50% 0%,
      color-mix(
        in srgb,
        var(--shiny) 8%,
        transparent
      ),
      transparent 42%
    ),
    linear-gradient(
      180deg,
      color-mix(
        in srgb,
        var(--shiny) 3%,
        transparent
      ),
      transparent 25%
    );
  box-shadow:
    inset 0 0 60px
      color-mix(
        in srgb,
        var(--shiny) 7%,
        transparent
      ),
    0 0 24px
      color-mix(
        in srgb,
        var(--shiny) 12%,
        transparent
      );
}

.dex-detail.is-shiny .dex-detail__scanner {
  position: relative;
  border-radius: 26px;
  background:
    radial-gradient(
      circle at 50% 30%,
      color-mix(
        in srgb,
        var(--shiny) 14%,
        transparent
      ),
      transparent 50%
    );
}

.dex-detail.is-shiny .dex-detail__scanner::before,
.dex-detail.is-shiny .dex-detail__scanner::after {
  content: "✦";
  position: absolute;
  z-index: 2;
  color: var(--shiny);
  text-shadow:
    0 0 10px var(--shiny),
    0 0 24px
      color-mix(
        in srgb,
        var(--shiny) 40%,
        transparent
      );
  opacity: .95;
  pointer-events: none;
}

.dex-detail.is-shiny .dex-detail__scanner::before {
  top: 18px;
  right: 46px;
  font-size: 1rem;
}

.dex-detail.is-shiny .dex-detail__scanner::after {
  left: 44px;
  top: 54px;
  font-size: .8rem;
}

.dex-detail.is-shiny .dex-detail__orbit i {
  border-color:
    color-mix(
      in srgb,
      var(--shiny) 46%,
      var(--region-accent)
    ) !important;
  box-shadow:
    0 0 18px
      color-mix(
        in srgb,
        var(--shiny) 14%,
        transparent
      );
}

.dex-detail__shiny-showcase {
  margin-top: 16px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border:
    1px solid
    color-mix(
      in srgb,
      var(--shiny) 70%,
      transparent
    );
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      color-mix(
        in srgb,
        var(--shiny) 18%,
        #0a1320
      ),
      color-mix(
        in srgb,
        var(--shiny) 6%,
        #071019
      )
    );
  box-shadow:
    inset 0 0 18px
      color-mix(
        in srgb,
        var(--shiny) 10%,
        transparent
      ),
    0 0 24px
      color-mix(
        in srgb,
        var(--shiny) 18%,
        transparent
      );
}

.dex-detail__shiny-burst {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      color-mix(
        in srgb,
        var(--shiny) 40%,
        #403200
      ),
      color-mix(
        in srgb,
        var(--shiny) 15%,
        #151100
      )
    );
  color: var(--shiny);
  font-size: 1rem;
  font-weight: 900;
  box-shadow:
    0 0 18px
      color-mix(
        in srgb,
        var(--shiny) 24%,
        transparent
      );
}

.dex-detail__shiny-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dex-detail__shiny-copy strong {
  color:
    color-mix(
      in srgb,
      var(--shiny) 82%,
      white
    );
  font-size: .74rem;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.1;
}

.dex-detail__shiny-copy small {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: .58rem;
  line-height: 1.2;
}

.dex-detail__shiny-badge {
  padding: 6px 11px;
  border:
    1px solid
    color-mix(
      in srgb,
      var(--shiny) 75%,
      transparent
    );
  border-radius: 999px;
  background:
    color-mix(
      in srgb,
      var(--shiny) 14%,
      #0b1320
    );
  color: var(--shiny);
  font-size: .62rem;
  font-weight: 950;
  letter-spacing: .08em;
  white-space: nowrap;
  box-shadow:
    0 0 16px
      color-mix(
        in srgb,
        var(--shiny) 14%,
        transparent
      );
}

.dex-detail.is-shiny h2 {
  color:
    color-mix(
      in srgb,
      var(--shiny) 35%,
      white
    );
  text-shadow:
    0 0 18px
      color-mix(
        in srgb,
        var(--shiny) 10%,
        transparent
      );
}

.dex-detail.is-shiny .dex-detail__metrics dd.has-shiny {
  color: var(--shiny);
  text-shadow:
    0 0 14px
      color-mix(
        in srgb,
        var(--shiny) 30%,
        transparent
      );
}

@media (max-width: 650px) {
  .dex-detail__shiny-showcase {
    grid-template-columns: 1fr;
    justify-items: start;
    border-radius: 18px;
  }

  .dex-detail__shiny-badge {
    justify-self: start;
  }
}


/* =========================================================
   SHINY CARD - LIVE SPARKLES / TWINKLE
   ========================================================= */

/*
 * BOOM POKEDEX SHINY STICKY FIX
 *
 * Shiny sparkle layer previously changed this card to
 * position: relative, overriding the normal sticky detail.
 *
 * Sticky is also a positioned element, so the absolute
 * sparkle pseudo-elements continue to work.
 */
.dex-detail.is-shiny {
  position: sticky;
  top: 24px;
  overflow: hidden;
}

/*
 * On stacked/mobile Pokédex layouts the detail card should
 * remain in document flow instead of becoming sticky.
 */
@media (max-width: 900px) {
  .dex-detail.is-shiny {
    position: relative;
    top: auto;
  }
}

/* stort mjukt glitterfält över hela kortet */
.dex-detail.is-shiny::before,
.dex-detail.is-shiny::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* bakre sparkle-lager */
.dex-detail.is-shiny::before {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 225, 95, .95) 0 2px, transparent 3px),
    radial-gradient(circle at 22% 62%, rgba(255, 229, 130, .8) 0 1.5px, transparent 3px),
    radial-gradient(circle at 40% 12%, rgba(255, 236, 170, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 20%, rgba(255, 224, 92, .85) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 42%, rgba(255, 241, 175, .8) 0 1.5px, transparent 3px),
    radial-gradient(circle at 73% 77%, rgba(255, 220, 84, .8) 0 2px, transparent 3px),
    radial-gradient(circle at 29% 86%, rgba(255, 236, 150, .75) 0 1.5px, transparent 3px);
  opacity: .7;
  animation:
    dexShinyTwinkleA 4.8s ease-in-out infinite,
    dexShinyFloatA 9s linear infinite;
}

/* främre sparkle-lager */
.dex-detail.is-shiny::after {
  background:
    radial-gradient(circle at 18% 32%, rgba(255, 247, 196, .95) 0 2.5px, transparent 4px),
    radial-gradient(circle at 56% 18%, rgba(255, 226, 102, .9) 0 2px, transparent 4px),
    radial-gradient(circle at 87% 25%, rgba(255, 238, 150, .95) 0 2.5px, transparent 4px),
    radial-gradient(circle at 78% 64%, rgba(255, 220, 70, .85) 0 2px, transparent 4px),
    radial-gradient(circle at 46% 78%, rgba(255, 245, 190, .85) 0 2px, transparent 4px),
    radial-gradient(circle at 12% 74%, rgba(255, 223, 96, .85) 0 2px, transparent 4px);
  opacity: .55;
  animation:
    dexShinyTwinkleB 3.6s ease-in-out infinite,
    dexShinyFloatB 12s linear infinite;
}

/* se till att innehåll ligger över sparkles */
.dex-detail.is-shiny > * {
  position: relative;
  z-index: 1;
}

/* extra glow runt pokemon-bilden */
.dex-detail.is-shiny .dex-detail__scanner img {
  filter:
    drop-shadow(0 0 10px rgba(255, 216, 90, .20))
    drop-shadow(0 0 22px rgba(255, 214, 80, .14));
}

/* shiny banner lever lite */
.dex-detail.is-shiny .dex-detail__shiny-showcase {
  animation:
    dexShinyBannerPulse 2.8s ease-in-out infinite;
}

/* små blinkande punkter i scanner-zonen */
.dex-detail.is-shiny .dex-detail__scanner {
  position: relative;
}

.dex-detail.is-shiny .dex-detail__scanner .dex-shiny-particle,
.dex-detail.is-shiny .dex-detail__scanner .dex-shiny-particle-2,
.dex-detail.is-shiny .dex-detail__scanner .dex-shiny-particle-3 {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff5be 0%, #ffd84d 52%, rgba(255,216,77,0) 72%);
  box-shadow:
    0 0 10px rgba(255, 223, 110, .45),
    0 0 18px rgba(255, 215, 75, .22);
  pointer-events: none;
}

.dex-detail.is-shiny .dex-detail__scanner .dex-shiny-particle {
  top: 12%;
  left: 18%;
  animation: dexOrb1 3.8s ease-in-out infinite;
}

.dex-detail.is-shiny .dex-detail__scanner .dex-shiny-particle-2 {
  top: 26%;
  right: 16%;
  animation: dexOrb2 4.6s ease-in-out infinite;
}

.dex-detail.is-shiny .dex-detail__scanner .dex-shiny-particle-3 {
  bottom: 18%;
  left: 24%;
  animation: dexOrb3 5.2s ease-in-out infinite;
}

/* animationer */
@keyframes dexShinyTwinkleA {
  0%, 100% { opacity: .35; }
  20% { opacity: .75; }
  40% { opacity: .45; }
  65% { opacity: .85; }
  82% { opacity: .55; }
}

@keyframes dexShinyTwinkleB {
  0%, 100% { opacity: .25; }
  18% { opacity: .55; }
  50% { opacity: .82; }
  70% { opacity: .35; }
  88% { opacity: .68; }
}

@keyframes dexShinyFloatA {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(3px, -4px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes dexShinyFloatB {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(-4px, 3px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes dexShinyBannerPulse {
  0%, 100% {
    box-shadow:
      inset 0 0 18px rgba(255, 216, 85, .10),
      0 0 16px rgba(255, 216, 85, .16);
  }
  50% {
    box-shadow:
      inset 0 0 24px rgba(255, 216, 85, .18),
      0 0 24px rgba(255, 216, 85, .24);
  }
}

@keyframes dexOrb1 {
  0%, 100% { transform: translate(0, 0) scale(.8); opacity: .35; }
  50% { transform: translate(10px, -8px) scale(1.2); opacity: 1; }
}

@keyframes dexOrb2 {
  0%, 100% { transform: translate(0, 0) scale(.7); opacity: .25; }
  50% { transform: translate(-8px, 10px) scale(1.15); opacity: .95; }
}

@keyframes dexOrb3 {
  0%, 100% { transform: translate(0, 0) scale(.8); opacity: .32; }
  50% { transform: translate(7px, -12px) scale(1.1); opacity: .88; }
}

/* SHINY SHOWCASE LAYOUT FIX */

.dex-detail > .dex-detail__shiny-showcase {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  max-width: none !important;
  margin: 4px 18px 22px !important;
  box-sizing: border-box;
  z-index: 4;
}

.dex-detail.is-shiny .dex-detail__identity {
  position: relative;
  z-index: 3;
  margin-top: 0;
}

.dex-detail.is-shiny .dex-detail__identity h2 {
  position: relative;
  z-index: 3;
}


/* =========================================================
   BOOM POKEDEX NEW V4C
   ========================================================= */

.dex-entry__new-signal {
  padding: 4px 7px;
  border:
    1px solid
    rgba(255,86,110,.78);
  border-radius: 999px;
  background:
    rgba(87,16,30,.94);
  color: #ff8295;
  font-size: .45rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .11em;
  box-shadow:
    0 0 14px
    rgba(255,73,104,.22);
}

.dex-entry.is-new {
  border-color:
    color-mix(
      in srgb,
      #ff5975 56%,
      var(--border)
    );
}

.dex-entry.is-new::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(255,75,106,.10),
      transparent 42%
    );
}

.dex-entry.is-new > * {
  position: relative;
  z-index: 1;
}

.dex-entry.is-new
.dex-entry__signals {
  z-index: 7;
}

.dex-region-card__new {
  align-self: flex-start;
  margin: 5px 0 3px;
  padding: 4px 7px;
  border:
    1px solid
    rgba(255,86,110,.58);
  border-radius: 999px;
  background:
    rgba(85,17,31,.86);
  color: #ff8295;
  font-size: .48rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .08em;
  box-shadow:
    0 0 12px
    rgba(255,73,104,.14);
}

@media (
  prefers-reduced-motion:
  no-preference
) {
  .dex-entry.is-new
  .dex-entry__new-signal {
    animation:
      boomDexNewPulse
      1.8s
      ease-in-out
      infinite;
  }
}

@keyframes boomDexNewPulse {
  0%,
  100% {
    box-shadow:
      0 0 10px
      rgba(255,73,104,.16);
  }

  50% {
    box-shadow:
      0 0 19px
      rgba(255,73,104,.42);
  }
}


/* =========================================================
   BOOM POKEDEX NEW FILTER VISUAL V1B
   ========================================================= */

.dex-filter-row
[data-dex-filter="new"] {
  position: relative;
  border-color:
    rgba(77,255,182,.55);
  background:
    rgba(20,78,57,.24);
  color: #6effbe;
}

.dex-filter-row
[data-dex-filter="new"][aria-pressed="true"] {
  border-color: #55ffb4;
  background:
    linear-gradient(
      135deg,
      rgba(35,143,101,.48),
      rgba(8,57,42,.88)
    );
  color: #effff8;
  box-shadow:
    0 0 10px rgba(74,255,181,.28),
    0 0 24px rgba(74,255,181,.17),
    inset 0 0 14px rgba(74,255,181,.08);
}


/* NEW Pokémon should be impossible to overlook */

.dex-entry.is-new {
  border-color:
    #55ffb4 !important;

  box-shadow:
    0 0 0 1px rgba(85,255,180,.18),
    0 0 18px rgba(85,255,180,.28),
    inset 0 0 22px rgba(85,255,180,.045) !important;
}

.dex-entry.is-new::before {
  background:
    radial-gradient(
      circle at 88% 5%,
      rgba(85,255,180,.22),
      transparent 46%
    ) !important;
}


/* NEW badge */

.dex-entry__new-signal {
  padding: 5px 8px !important;

  border:
    1px solid
    rgba(108,255,199,.92) !important;

  border-radius: 999px;

  background:
    rgba(8,76,53,.97) !important;

  color:
    #91ffd1 !important;

  font-size:
    .49rem !important;

  font-weight:
    1000 !important;

  letter-spacing:
    .10em;

  text-shadow:
    0 0 7px
    rgba(91,255,192,.62);

  box-shadow:
    0 0 9px rgba(74,255,183,.42),
    0 0 20px rgba(74,255,183,.20) !important;
}


/* tiny discovery beacon */

.dex-entry.is-new::after {
  content: "";

  position: absolute;

  left: 8px;
  top: 8px;

  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: #55ffb4;

  box-shadow:
    0 0 6px rgba(85,255,180,.95),
    0 0 15px rgba(85,255,180,.64);

  pointer-events: none;
}


/*
 * A shiny that is also NEW keeps
 * both visual identities.
 */

.dex-entry.is-new.is-shiny {
  border-color:
    #66ffc0 !important;

  box-shadow:
    0 0 18px rgba(85,255,180,.30),
    0 0 30px rgba(255,221,73,.11) !important;
}


@media (
  prefers-reduced-motion:
  no-preference
) {

  .dex-entry.is-new {
    animation:
      boomDexNewUnreadV1B
      1.7s
      ease-in-out
      infinite;
  }

  .dex-filter-row
  [data-dex-filter="new"]
  [aria-pressed="true"] {
    animation:
      boomDexNewFilterV1B
      1.7s
      ease-in-out
      infinite;
  }
}


@keyframes boomDexNewUnreadV1B {

  0%,
  100% {
    box-shadow:
      0 0 0 1px
        rgba(85,255,180,.12),
      0 0 13px
        rgba(85,255,180,.18);
  }

  50% {
    box-shadow:
      0 0 0 1px
        rgba(85,255,180,.26),
      0 0 27px
        rgba(85,255,180,.43);
  }
}


@keyframes boomDexNewFilterV1B {

  0%,
  100% {
    box-shadow:
      0 0 9px
        rgba(74,255,181,.20);
  }

  50% {
    box-shadow:
      0 0 22px
        rgba(74,255,181,.42);
  }
}


/* =========================================================
   BOOM POKEDEX NEW VISIBILITY V4
   ========================================================= */

/*
 * NEW Pokémon must be immediately distinguishable
 * from ordinary caught species.
 */

.dex-entry.is-new {
  border:
    2px solid rgba(57, 255, 183, .95) !important;

  background:
    linear-gradient(
      145deg,
      rgba(20, 121, 84, .19),
      rgba(7, 26, 24, .96) 50%,
      rgba(8, 20, 24, .98)
    ) !important;

  box-shadow:
    0 0 0 1px rgba(65, 255, 190, .15),
    0 0 18px rgba(41, 255, 174, .28),
    inset 0 0 24px rgba(31, 255, 170, .06) !important;
}


/*
 * The NEW badge lives in the same signal stack as
 * SHINY and LEGENDARY, so combinations are supported.
 */

.dex-entry__new-signal {
  display:
    inline-flex !important;

  position:
    relative !important;

  z-index:
    20 !important;

  align-items:
    center !important;

  justify-content:
    center !important;

  min-width:
    46px !important;

  min-height:
    22px !important;

  padding:
    4px 8px !important;

  border:
    1px solid rgba(121, 255, 208, .95) !important;

  border-radius:
    999px !important;

  background:
    linear-gradient(
      135deg,
      #19f6a5,
      #72ffd0
    ) !important;

  color:
    #04150f !important;

  font-size:
    .48rem !important;

  line-height:
    1 !important;

  font-weight:
    1000 !important;

  letter-spacing:
    .08em !important;

  text-shadow:
    none !important;

  box-shadow:
    0 0 12px rgba(55, 255, 183, .55),
    0 0 24px rgba(55, 255, 183, .18) !important;
}


/*
 * Ensure signal container is always above Pokémon artwork.
 */

.dex-entry__signals {
  z-index:
    30 !important;
}


/*
 * Make the Pokédex number green too.
 */

.dex-entry.is-new
.dex-entry__number {
  color:
    #64ffc4 !important;

  font-weight:
    950 !important;
}


/*
 * Species name gets a subtle NEW tint.
 */

.dex-entry.is-new
strong {
  color:
    #baffdf !important;

  text-shadow:
    0 0 10px rgba(54, 255, 182, .18);
}


/*
 * Selected NEW card gets extra scanner intensity.
 */

.dex-entry.is-new[aria-selected="true"] {
  border-color:
    #7affd1 !important;

  box-shadow:
    0 0 0 2px rgba(99, 255, 207, .18),
    0 0 25px rgba(43, 255, 177, .42),
    inset 0 0 30px rgba(41, 255, 174, .08) !important;
}


/*
 * NEW + SHINY.
 * Keep BOTH identities visible.
 */

.dex-entry.is-new.is-shiny {
  border-color:
    #63ffc8 !important;

  box-shadow:
    0 0 0 1px rgba(94, 255, 200, .25),
    0 0 20px rgba(40, 255, 177, .35),
    0 0 32px rgba(255, 213, 80, .14),
    inset 0 0 25px rgba(38, 255, 174, .06) !important;
}


.dex-entry.is-new.is-shiny
.dex-entry__new-signal,

.dex-entry.is-new.is-shiny
.dex-entry__shiny-signal {
  position:
    static !important;
}


/*
 * NEW filter itself should also be unmistakable.
 */

.dex-filter-row
[data-dex-filter="new"] {
  border-color:
    rgba(64, 255, 188, .5) !important;
}


.dex-filter-row
[data-dex-filter="new"][aria-pressed="true"] {
  background:
    linear-gradient(
      135deg,
      rgba(23, 244, 160, .25),
      rgba(20, 98, 78, .35)
    ) !important;

  border-color:
    #55ffc1 !important;

  color:
    #9effd8 !important;

  box-shadow:
    0 0 16px rgba(49, 255, 179, .22) !important;
}

