/* Pokedex — a sub-page in the game's UI (the same window textures as the Ewolucje section). */
.dex-page {
  background: #0a0c14;
}

.dex-page .pk-nav {
  translate: none;
  opacity: 1;
}

.pk-nav-wing a.is-on {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 10px rgba(255, 200, 100, 0.6));
}

.pk-nav-wing a.is-on::after {
  width: 100%;
}

.dex {
  position: relative;
  min-height: 100vh;
  padding: 150px 20px 80px;
  overflow: hidden;
  isolation: isolate;
}

.dex-world,
.dex-world > * {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dex-world {
  z-index: -1;
}

.dex-sky {
  background:
    radial-gradient(60% 50% at 75% 10%, rgba(255, 246, 210, 0.55), transparent 60%),
    linear-gradient(180deg, #2c5f9e 0%, #5a93cf 34%, #9cc6e8 62%, #d7e6ef 80%);
}

.dex-clouds {
  background-repeat: repeat-x;
  background-size: auto 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 40%, transparent 85%);
}

.dex-clouds.is-far {
  bottom: 40%;
  background-image: url("../assets/evo/clouds-far.webp?v=1");
  opacity: 0.6;
  animation: dex-drift 200s linear infinite;
}

.dex-clouds.is-near {
  top: 6%;
  bottom: 50%;
  background-image: url("../assets/evo/clouds-near.webp?v=1");
  opacity: 0.55;
  animation: dex-drift 120s linear infinite;
}

@keyframes dex-drift {
  to { background-position: -2400px 0; }
}

.dex-palace {
  top: auto;
  width: 100%;
  height: auto;
  max-width: none;
  min-height: 46%;
  object-fit: cover;
  object-position: 50% 100%;
}

.dex-shade {
  background:
    radial-gradient(70% 60% at 50% 55%, rgba(6, 8, 14, 0.15), rgba(6, 8, 14, 0.62) 100%),
    linear-gradient(180deg, rgba(10, 12, 20, 0.55) 0%, rgba(10, 12, 20, 0.15) 24%, rgba(10, 12, 20, 0.35) 70%, #0a0c14 100%);
}

.dex-head {
  max-width: 760px;
  margin: 0 auto 34px;
  text-align: center;
}

.dex-title {
  margin: 6px 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(42px, 5vw, 76px);
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fffbe8 0%, #ffe39a 38%, #e1a53c 62%, #8a5414 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 rgba(50, 24, 0, 0.85)) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.6));
}

.dex-lede {
  margin: 0 0 14px;
  color: #f4ecd8;
  font-size: 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.dex-count {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 18px 8px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f3e3bd;
  background: rgba(10, 6, 3, 0.75);
  box-shadow: 0 0 0 1px rgba(240, 189, 76, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.dex-count i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 2.6px, #1a0e06 3px 5px, transparent 5.5px),
    linear-gradient(180deg, transparent 45%, #1a0e06 45% 55%, transparent 55%),
    linear-gradient(180deg, #e3302f 50%, #f4f5f8 50%);
  box-shadow: 0 0 0 1.5px #1a0e06;
}

.dex-count b {
  color: #fff;
}

/* the two windows */
.dex-wrap {
  display: grid;
  grid-template-columns: minmax(0, 27em) minmax(0, 31em);
  justify-content: center;
  align-items: start;
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

.dex .m2-win {
  --ui: 14px;
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  width: auto;
}

.dex .m2-bar h2 {
  flex: 1;
  margin: 0;
  padding-right: 1.4em;
  font: inherit;
  text-align: center;
  color: #efe8dc;
}

.dex-search input {
  width: 100%;
  height: 2.2em;
  justify-content: flex-start;
  font: inherit;
  text-align: left;
  outline: none;
}

.dex-search input::placeholder {
  color: #8f8a7e;
}

.dex-search input:focus {
  border-color: #3a3a3a #f0c060 #f0c060 #3a3a3a;
}

.dex-filters {
  margin: 0.6em 0;
}

.dex-filters .m2-tab {
  font-family: Tahoma, Verdana, sans-serif;
  font-size: 0.92em;
}

.dex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35em;
  margin: 0;
  padding: 0.6em;
  list-style: none;
}

.dex-cell {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.25em;
  width: 100%;
  padding: 0.45em 0.2em 0.4em;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.dex-cell .m2-slot {
  width: 5.4em;
  height: 5.4em;
}

.dex-cell .m2-slot img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(.3, 1.5, .5, 1);
}

.dex-cell b {
  font-size: 0.92em;
  color: rgba(236, 230, 215, 0.85);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dex-cell small {
  color: rgba(236, 230, 215, 0.45);
  font-variant-numeric: tabular-nums;
}

.dex-cell:hover {
  background: rgba(255, 255, 255, 0.04);
}

.dex-cell:hover .m2-slot img {
  transform: scale(1.12) translateY(-3%);
}

.dex-cell.is-on {
  background: linear-gradient(180deg, rgba(255, 198, 88, 0.2), rgba(255, 198, 88, 0.03));
  border-color: rgba(255, 198, 88, 0.55);
}

.dex-cell.is-on .m2-slot {
  box-shadow: 0 0 0 1px rgba(255, 198, 88, 0.85), 0 0 14px rgba(255, 198, 88, 0.6);
}

.dex-cell.is-on b {
  color: #fff;
}

.dex-cell.is-unknown .m2-slot img {
  filter: brightness(0) drop-shadow(0 0 2px rgba(120, 140, 200, 0.55));
}

.dex-cell .dex-ball {
  position: absolute;
  top: 0.35em;
  right: 0.45em;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 14%, #1a0e06 16% 26%, transparent 28%),
    linear-gradient(180deg, transparent 45%, #1a0e06 45% 55%, transparent 55%),
    linear-gradient(180deg, #e3302f 50%, #f4f5f8 50%);
  box-shadow: 0 0 0 1px #1a0e06, 0 0 6px rgba(255, 100, 80, 0.6);
}

.dex-empty {
  margin: 0.6em 0 0;
  text-align: center;
  color: #b9b2a2;
}

/* the entry */
.dex-stage {
  position: relative;
  height: 17em;
  margin: -0.2em -0.2em 0.7em;
  overflow: hidden;
  background: #070605 url("../assets/evo/ui/cell.webp?v=1") 0 0 / 3.1em 3.1em repeat;
  border: 1px solid;
  border-color: #1d1d1c #6f6c66 #6f6c66 #1d1d1c;
}

.dex-stage-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(48% 52% at 50% 58%, rgba(var(--tc, 255, 198, 88), 0.5), rgba(var(--tc, 255, 198, 88), 0.1) 55%, transparent 75%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55));
  transition: background 0.5s ease;
}

.dex-runes {
  position: absolute;
  left: 50%;
  bottom: 0.6em;
  width: 15em;
  translate: -50% 0;
  transform: perspective(500px) rotateX(70deg);
  overflow: visible;
  opacity: 0.8;
}

.dex-runes circle {
  fill: none;
  stroke: rgb(var(--tc, 255, 198, 88));
  stroke-width: 3;
  stroke-dasharray: 8 10;
  filter: drop-shadow(0 0 6px rgb(var(--tc, 255, 198, 88)));
}

.dex-runes circle.t {
  stroke-dasharray: none;
  stroke-width: 1.5;
}

.dex-runes text {
  fill: rgb(var(--tc, 255, 198, 88));
  font: 700 20px var(--font-display);
  letter-spacing: 6px;
}

.dex-runes {
  animation: dex-runes 26s linear infinite;
}

@keyframes dex-runes {
  to { transform: perspective(500px) rotateX(70deg) rotateZ(360deg); }
}

.dex-art {
  position: absolute;
  left: 50%;
  bottom: 2.2em;
  width: auto;
  height: 13em;
  max-width: 80%;
  object-fit: contain;
  translate: -50% 0;
  filter: drop-shadow(0 14px 12px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px rgba(var(--tc, 255, 198, 88), 0.35));
  animation: dex-float 4.6s ease-in-out infinite;
}

.dex-art.is-swap {
  animation: dex-in 0.55s cubic-bezier(.3, 1.4, .5, 1), dex-float 4.6s ease-in-out infinite 0.55s;
}

.dex-art.is-unknown {
  filter: brightness(0) drop-shadow(0 0 8px rgba(140, 160, 255, 0.7));
}

@keyframes dex-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.5em); }
}

@keyframes dex-in {
  from { opacity: 0; transform: scale(0.6) translateY(1em); filter: brightness(3); }
  to { opacity: 1; transform: none; }
}

.dex-no {
  position: absolute;
  left: 0.6em;
  top: 0.4em;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 1.7em;
  letter-spacing: 0.04em;
  color: rgba(255, 240, 210, 0.85);
  text-shadow: 0 2px 6px #000;
}

.dex-badge {
  position: absolute;
  right: 0.6em;
  top: 0.65em;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.6em 0.25em 0.35em;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 198, 88, 0.7);
  color: #ffe3a0;
  font-weight: 700;
}

.dex-badge::before {
  content: "";
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 14%, #1a0e06 16% 26%, transparent 28%),
    linear-gradient(180deg, transparent 45%, #1a0e06 45% 55%, transparent 55%),
    linear-gradient(180deg, #e3302f 50%, #f4f5f8 50%);
}

.dex-id {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 0.5em;
}

.dex-id > div {
  display: grid;
  gap: 0.2em;
}

.dex-types {
  display: flex;
  justify-content: center;
  gap: 0.3em;
}

.dex-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75em;
  padding: 0 0.6em;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 0.2em;
  background: linear-gradient(180deg, rgba(var(--c), 0.95), rgba(var(--c), 0.6));
  color: #fff;
  font-weight: 700;
  font-size: 0.92em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dex-stats {
  display: grid;
  gap: 0.35em;
  margin: 0;
}

.dex-stats div {
  display: grid;
  grid-template-columns: 5.6em 1fr;
  align-items: center;
  gap: 0.5em;
}

.dex-stats dt {
  color: #d6d0c2;
}

.dex-stats dd {
  display: grid;
  grid-template-columns: 2.6em 1fr;
  align-items: center;
  gap: 0.5em;
  margin: 0;
  justify-content: stretch;
}

.dex-stats dd b {
  font-weight: 400;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dex-bar {
  position: relative;
  height: 0.6em;
  overflow: hidden;
  background: #151412;
  border: 1px solid #000;
}

.dex-bar i {
  position: absolute;
  inset: 0;
  width: var(--w, 0%);
  background: linear-gradient(180deg, rgba(var(--tc, 255, 198, 88), 1), rgba(var(--tc, 255, 198, 88), 0.55));
  box-shadow: 0 0 8px rgba(var(--tc, 255, 198, 88), 0.6);
  transition: width 0.7s cubic-bezier(.2, .8, .2, 1);
}

.dex-text {
  margin: 0;
  color: #e3ddcf;
  line-height: 1.45;
}

.dex-evo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dex-evo li {
  display: grid;
  justify-items: center;
  gap: 0.2em;
  font-size: 0.9em;
  color: #d6d0c2;
}

.dex-evo li + li::before {
  content: "▶";
  position: absolute;
  margin: 1.6em 0 0 -1.6em;
  color: rgba(var(--tc, 255, 198, 88), 0.9);
  font-size: 0.8em;
}

.dex-evo li {
  position: relative;
  padding: 0 0.6em;
}

.dex-evo .m2-slot {
  width: 3.8em;
  height: 3.8em;
}

.dex-evo .m2-slot img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.dex-evo .is-solo {
  color: #a39d90;
  font-style: italic;
}

.dex-where {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.6em;
  margin: 0.8em 0 0.7em;
}

.dex-where b {
  color: #f0a23a;
}

.dex-where .m2-field {
  justify-content: flex-start;
}

.dex-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 0.4em;
}

.dex-actions .m2-btn {
  width: 100%;
  height: 2.3em;
  text-decoration: none;
  white-space: nowrap;
}

.dex-go {
  font-weight: 700;
  color: #fff3d0;
}

.dex-foot {
  margin-top: 0;
}

@media (max-width: 980px) {
  .dex {
    padding-top: 120px;
  }

  .dex-wrap {
    grid-template-columns: minmax(0, 32em);
  }

  .dex-card {
    order: -1;
  }
}

@media (max-width: 560px) {
  .dex {
    padding: 104px 10px 50px;
  }

  .dex .m2-win {
    --ui: 3.3vw;
  }

  .dex-lede {
    font-size: 14px;
  }

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

  .dex .m2-slot,
  .dex .m2-btn {
    border-width: 0.45em;
  }

  .dex .m2-tab {
    border-width: 0.4em;
    height: 2.2em;
  }
}

@media (max-width: 560px) {
  .dex-actions {
    grid-template-columns: 1fr 1fr 1fr;
    font-size: 0.88em;
  }

  .dex-actions .m2-btn {
    padding: 0 0.4em;
  }
}
