.pokemon-details-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
  box-sizing: border-box;
}

.pokemon-details-modal.open {
  display: flex;
}

.pokemon-details-dialog {
  width: min(1060px, 96vw);
  max-height: min(760px, 86dvh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(27, 34, 46, 0.98), rgba(9, 12, 18, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  color: #f5f7fb;
  font-family: "Oxanium", Arial, sans-serif;
}

body.league-light-mode .pokemon-details-dialog {
  background: linear-gradient(145deg, rgba(248, 250, 252, 0.98), rgba(220, 226, 234, 0.98));
  border-color: rgba(34, 45, 59, 0.14);
  color: #182231;
}

#pokemonDetailsShell {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.pokemon-details-header {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  min-height: 98px;
  box-sizing: border-box;
}

.pokemon-details-header img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.pokemon-details-header h2 {
  margin: 0;
  color: inherit;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.pokemon-details-header p {
  margin: 5px 0 0;
  color: rgba(226, 232, 240, 0.66);
  font-size: 12px;
  font-weight: 800;
}

body.league-light-mode .pokemon-details-header p {
  color: rgba(27, 37, 49, 0.62);
}

.pokemon-details-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

body.league-light-mode .pokemon-details-close {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(34, 45, 59, 0.12);
}

.pokemon-details-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.38fr) minmax(0, 0.62fr);
  gap: 12px;
  padding: 12px 14px 14px;
  overflow: hidden;
  box-sizing: border-box;
}

.pokemon-details-side {
  min-height: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  overflow: auto;
  padding-right: 2px;
}

.pokemon-details-section {
  padding: 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-sizing: border-box;
}

body.league-light-mode .pokemon-details-section {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(34, 45, 59, 0.12);
}

.pokemon-details-section h3 {
  margin: 0 0 10px;
  color: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.pokemon-details-note {
  margin: 0;
  color: rgba(226, 232, 240, 0.66);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

body.league-light-mode .pokemon-details-note {
  color: rgba(27, 37, 49, 0.62);
}

.pokemon-details-list {
  display: grid;
  gap: 8px;
}

.pokemon-details-pill,
.pokemon-move-row {
  padding: 9px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(245, 247, 251, 0.90);
  font-size: 12px;
  font-weight: 900;
}

body.league-light-mode .pokemon-details-pill,
body.league-light-mode .pokemon-move-row {
  background: rgba(255, 255, 255, 0.68);
  color: rgba(27, 37, 49, 0.84);
}

.pokemon-details-pill small,
.pokemon-move-row small {
  display: block;
  margin-top: 4px;
  color: rgba(226, 232, 240, 0.62);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

body.league-light-mode .pokemon-details-pill small,
body.league-light-mode .pokemon-move-row small {
  color: rgba(27, 37, 49, 0.58);
}

.pokemon-details-moves-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.pokemon-details-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pokemon-details-count {
  color: rgba(226, 232, 240, 0.62);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

body.league-light-mode .pokemon-details-count {
  color: rgba(27, 37, 49, 0.58);
}

.pokemon-move-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 140px;
  gap: 9px;
  margin-bottom: 10px;
}

.pokemon-move-tools input,
.pokemon-move-tools select {
  min-height: 40px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.94);
  color: #182231;
  font-family: "Oxanium", Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  box-sizing: border-box;
}

.pokemon-move-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 2px;
}

.pokemon-move-row {
  --move-type-color: #9ca3aa;
  --move-type-soft: rgba(156, 163, 170, 0.15);
  border-left: 5px solid var(--move-type-color);
  background:
    linear-gradient(90deg, var(--move-type-soft), rgba(255, 255, 255, 0.07) 54%),
    rgba(255, 255, 255, 0.08);
}

body.league-light-mode .pokemon-move-row {
  background:
    linear-gradient(90deg, var(--move-type-soft), rgba(255, 255, 255, 0.68) 54%),
    rgba(255, 255, 255, 0.68);
}

.pokemon-move-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pokemon-move-row strong {
  display: block;
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.pokemon-move-type-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--move-type-color);
  color: #111827;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.pokemon-move-row p {
  margin: 6px 0 0;
  color: rgba(226, 232, 240, 0.72);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

body.league-light-mode .pokemon-move-row p {
  color: rgba(27, 37, 49, 0.68);
}

.pokemon-move-type-normal { --move-type-color: #a8a77a; --move-type-soft: rgba(168, 167, 122, 0.18); }
.pokemon-move-type-fire { --move-type-color: #ee8130; --move-type-soft: rgba(238, 129, 48, 0.20); }
.pokemon-move-type-water { --move-type-color: #6390f0; --move-type-soft: rgba(99, 144, 240, 0.20); }
.pokemon-move-type-electric { --move-type-color: #f7d02c; --move-type-soft: rgba(247, 208, 44, 0.20); }
.pokemon-move-type-grass { --move-type-color: #7ac74c; --move-type-soft: rgba(122, 199, 76, 0.20); }
.pokemon-move-type-ice { --move-type-color: #96d9d6; --move-type-soft: rgba(150, 217, 214, 0.20); }
.pokemon-move-type-fighting { --move-type-color: #c22e28; --move-type-soft: rgba(194, 46, 40, 0.20); }
.pokemon-move-type-poison { --move-type-color: #a33ea1; --move-type-soft: rgba(163, 62, 161, 0.20); }
.pokemon-move-type-ground { --move-type-color: #e2bf65; --move-type-soft: rgba(226, 191, 101, 0.20); }
.pokemon-move-type-flying { --move-type-color: #a98ff3; --move-type-soft: rgba(169, 143, 243, 0.20); }
.pokemon-move-type-psychic { --move-type-color: #f95587; --move-type-soft: rgba(249, 85, 135, 0.20); }
.pokemon-move-type-bug { --move-type-color: #a6b91a; --move-type-soft: rgba(166, 185, 26, 0.20); }
.pokemon-move-type-rock { --move-type-color: #b6a136; --move-type-soft: rgba(182, 161, 54, 0.20); }
.pokemon-move-type-ghost { --move-type-color: #735797; --move-type-soft: rgba(115, 87, 151, 0.20); }
.pokemon-move-type-dragon { --move-type-color: #6f35fc; --move-type-soft: rgba(111, 53, 252, 0.20); }
.pokemon-move-type-dark { --move-type-color: #705746; --move-type-soft: rgba(112, 87, 70, 0.22); }
.pokemon-move-type-steel { --move-type-color: #b7b7ce; --move-type-soft: rgba(183, 183, 206, 0.20); }
.pokemon-move-type-fairy { --move-type-color: #d685ad; --move-type-soft: rgba(214, 133, 173, 0.20); }

@media (max-width: 760px) {
  .pokemon-details-modal {
    padding: 10px;
  }

  .pokemon-details-dialog {
    max-height: 92dvh;
  }

  .pokemon-details-header {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    min-height: 82px;
    padding: 12px;
  }

  .pokemon-details-header img {
    width: 56px;
    height: 56px;
  }

  .pokemon-details-header h2 {
    font-size: 21px;
  }

  .pokemon-details-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .pokemon-details-side,
  .pokemon-move-list {
    overflow: visible;
  }

  .pokemon-move-tools {
    grid-template-columns: 1fr;
  }
}
