dialog#lightbox {
  width: min(900px, 92vw);
  max-height: 88vh;
  margin: auto;
  padding: 0;
  overflow: visible;
  background: var(--white-soft);
  border: 3px solid var(--blue-dark);
  border-radius: 16px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
  transform: rotateX(-70deg) scale(0.9);
  transform-origin: top;
  transition: transform 180ms ease, box-shadow 180ms ease;
  color: var(--blue-mid);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

@keyframes dialog-open {
  0% {
    transform: rotateX(-70deg) scale(0.9);
  }
  70% {
    transform: rotateX(8deg) scale(1);
  }
  100% {
    transform: rotateX(0deg) scale(1);
  }
}

dialog#lightbox[open] {
  animation: dialog-open 320ms ease-out;
  transform: rotateX(0deg) scale(1);
  transition: transform 3000ms ease;
}

.dialog-img {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: start;
  max-width: 240px;
  width: 70%;
  height: auto;
  padding-top: 16%;
  margin: auto;
}

.dialog-img::after {
  content: "";
  position: absolute;
  inset: -20px;
  border: 3px solid var(--blue-mid);
  border-radius: 50%;
  opacity: 0;
}

@keyframes scanner-ring {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.2);
    opacity: 0.3;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

.dialog-img img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.dialog-shell {
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

#dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

#dialog-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.dialog-nav {
  width: 56px;
  height: 56px;
  cursor: pointer;
  border: none;
  background: transparent;
}

.dialog-nav img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.8;
}

.dialog-nav:hover {
  animation: tab-wobble 220ms ease-out;
  opacity: 1;
}

.dialog-nav.disabled {
  opacity: 0.3;
  cursor: default;
}

dialog[open] .dialog-img::after {
  animation: scanner-ring 600ms ease-out;
}

#dialog-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: white;
  cursor: pointer;
}

#dialog-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.6);
}

#dialog-tabs button[data-tab] {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: white;
}

#dialog-tabs button.is-active {
  font-weight: 700;
  background: var(--white-soft);
}

.evo-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-around;
  gap: 2%;
  width: 100%;
  height: 40%;
  padding-top: 10%;
}

.evo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 25%;
  height: auto;
  text-align: center;
  font-size: 16px;
  font-weight: 300;
}

.evo-stage img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.evo-arrow {
  width: 5%;
  height: auto;
  margin: auto;
  font-size: 28px;
  font-weight: 700;
}

@keyframes tab-wobble {
  0% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(6deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

#dialog-tabs button:hover {
  animation: tab-wobble 220ms ease-out;
}

#dialog-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px;
}

.tab {
  display: none;
}

.tab.is-active {
  display: block;
}

.pokemon-stats {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pokemon-stats li {
  margin-bottom: 8px;
  font-family: monospace;
}

.pokemon-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2%;
  align-items: center;
}

.poke-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 96%;
  height: auto;
  padding: 2%;
  margin-top: 8%;
  gap: 2%;
  border: 0.2em solid var(--yellow-light);
  border-radius: 1em;
  background: var(--yellow-main);
  outline-offset: 0;
}

.poke-info ul {
  padding-top: 5%;
}

.poke-info img {
  width: auto;
  height: 16px;
}

.poke-menu {
  display: flex;
  justify-content: space-around;
  gap: 2%;
  width: 96%;
  height: auto;
  padding: 2%;
  margin: auto;
  border: 0.2em solid var(--yellow-light);
  border-radius: 1em;
  background: var(--yellow-main);
  outline-offset: 0;
}

.poke-menu button {
  height: 32px;
  cursor: pointer;
  border: 0.2em solid var(--white-soft);
  outline: 0.2em solid var(--blue-mid);
  outline-offset: 0;
  border-radius: 1em;
  background: var(--yellow-main);
  color: var(--blue-dark);
  text-transform: capitalize;
  font-weight: 700;
  text-align: center;
  font-family: "Courier New", Courier, monospace;
}

.poke-menu button:hover {
  background-color: var(--yellow-light);
}
