#team-dialog {
  width: min(900px, calc(100vw - 24px));
  padding: 22px;
  background: #f8f5dd;
}
#team-dialog h2 {
  margin: 4px 0 10px;
}
.party-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid #a1afa5;
  flex-wrap: wrap;
}
.party-tabs button {
  min-height: 44px;
  padding: 6px 18px;
}
.party-tabs [aria-pressed='true'] {
  background: #427789;
  color: #fffce5;
  box-shadow: inset 0 -3px #305c6b;
}
.party-tabs #party-heal {
  margin-left: auto;
}
#party-caption {
  font-size: 17px;
  line-height: 1.3;
  margin: 12px 0;
}
.party-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
}
#party-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.party-member {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
  border: 2px solid #7d9b90;
  background: #dfebd2;
  border-radius: 7px 2px 7px 2px;
  box-shadow: inset 0 -4px #c1d1b5;
  min-height: 91px;
}
.party-member.selected {
  outline: 2px solid #ad4a35;
  outline-offset: 1px;
  background: #fff1b8;
  box-shadow: inset 0 -4px #e4d291;
}
.party-member.fainted {
  background: #e2d5d0;
}
.party-member img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  image-rendering: pixelated;
}
.party-member strong,
.party-member small {
  display: block;
  line-height: 1.05;
}
.party-member strong {
  font-size: 24px;
  font-weight: normal;
}
.party-member small {
  font-size: 16px;
  margin-top: 4px;
}
.party-number {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 13px;
  color: #526b63;
}
.party-hp,
.experience-track {
  display: block;
  height: 7px;
  margin-top: 6px;
  background: #b8bba4;
  border-radius: 4px;
  overflow: hidden;
}
.party-hp i,
.experience-track i {
  height: 100%;
  display: block;
  background: #59a361;
}
#party-summary {
  border: 2px solid #97aca2;
  background: #fffce9;
  padding: 14px;
  min-width: 0;
}
.summary-heading {
  display: flex;
  gap: 14px;
  align-items: center;
}
.summary-heading img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  image-rendering: pixelated;
}
.summary-heading h3 {
  font-size: 28px;
  font-weight: normal;
  margin: 4px 0;
}
.summary-heading h3 small {
  font-size: 19px;
  white-space: nowrap;
}
.summary-heading p {
  margin: 6px 0;
}
.summary-heading small {
  font-size: 17px;
}
.summary-heading .training-bonus {
  display: block;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 7px;
  border: 1px solid #789167;
  background: #e5efcf;
  color: #36552f;
}
.summary-heading .training-bonus.muted {
  border-color: #a9aaa0;
  background: #eeeede;
  color: #6a6b64;
}
.training-level-label {
  text-transform: lowercase;
}
.pokemon-type {
  display: inline-block;
  background: #5b7866;
  color: #fffce5;
  border: 1px solid #3b5545;
  padding: 0 8px;
  font-size: 16px;
  text-transform: uppercase;
}
.pokemon-type[data-type='poison'] {
  background: #9b679b;
}
.pokemon-type[data-type='fire'] {
  background: #b05e3e;
}
.pokemon-type[data-type='water'] {
  background: #487caf;
}
.pokemon-type[data-type='electric'] {
  background: #9b812d;
}
.party-experience {
  margin: 15px 0;
  font-size: 19px;
}
.party-experience small {
  display: block;
  font-size: 16px;
  margin-top: 3px;
}
.experience-track i {
  background: #5488af;
}
.pokemon-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 12px 0;
}
.pokemon-stats div {
  flex: 1 0 50px;
  background: #ecedd7;
  padding: 4px;
  text-align: center;
}
.pokemon-stats dt {
  font-size: 15px;
  white-space: nowrap;
}
.pokemon-stats dd {
  font-size: 22px;
  margin: 0;
}
#party-summary h4 {
  font-size: 18px;
  font-weight: normal;
  margin: 14px 0 7px;
  color: #60776e;
}
.known-moves {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.known-moves details,
.unknown-move {
  border: 1px solid #9aaba1;
  padding: 8px;
  background: #f2f0d8;
  min-height: 56px;
}
.known-moves summary {
  cursor: pointer;
  font-size: 20px;
  line-height: 1.1;
}
.known-moves small {
  display: block;
  font-size: 15px;
  margin-top: 5px;
}
.known-moves p {
  font-size: 17px;
  line-height: 1.3;
  margin: 8px 0 0;
}
.unknown-move {
  display: grid;
  place-content: center;
  color: #8b9a8d;
}
.party-actions,
.party-swap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.party-actions button,
.party-swap button {
  min-height: 44px;
  font-size: 18px;
  padding: 7px 12px;
}
.party-empty {
  padding: 20px;
  font-size: 20px;
  line-height: 1.4;
  text-align: center;
  color: #6a7d72;
}
.party-empty > span {
  font-size: 70px;
}
#party-growth {
  margin: 16px 0;
  padding: 18px;
  border: 3px double #c99649;
  background: #fff0ba;
}
#party-growth h3 {
  font-size: 26px;
  font-weight: normal;
  margin: 8px 0;
}
#party-growth p {
  font-size: 18px;
  line-height: 1.35;
  margin: 8px 0;
}
.growth-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.growth-options button {
  min-height: 46px;
  padding: 8px;
  font-size: 19px;
}
.evolution-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.evolution-pair img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  image-rendering: pixelated;
}
@media (max-width: 650px) {
  #team-dialog {
    padding: 14px;
  }
  .party-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  #party-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .party-member {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 8px 5px;
    gap: 4px;
    min-height: 86px;
  }
  .party-member img {
    width: 44px;
    height: 50px;
  }
  .party-member strong {
    font-size: 19px;
  }
  .party-member small {
    font-size: 14px;
  }
  .party-tabs {
    gap: 5px;
  }
  .party-tabs button {
    padding: 5px 10px;
    font-size: 18px;
  }
  #party-summary {
    padding: 10px;
  }
  .summary-heading {
    gap: 8px;
  }
  .summary-heading img {
    width: 72px;
    height: 72px;
  }
  .summary-heading h3 {
    font-size: 26px;
  }
  #party-growth {
    padding: 12px;
  }
  .growth-options {
    grid-template-columns: 1fr;
  }
}

#center-dialog {
  width: min(470px, calc(100vw - 24px));
}
.center-actions {
  display: grid;
  gap: 10px;
}
.center-actions button {
  display: block;
  min-height: 48px;
  text-align: left;
}
.center-actions small {
  display: block;
  font-size: 15px;
  margin-top: 4px;
}
#center-summary {
  min-height: 3em;
}

.evolution-options {
  margin-top: 1rem;
  border-top: 2px solid #7d907e;
  padding-top: 0.75rem;
}
.evolution-options button {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
  min-height: 44px;
}
.evolution-options p {
  font-size: 0.85em;
  line-height: 1.5;
}
#palace-gift-dialog {
  width: min(92vw, 580px);
  max-height: 88dvh;
  overflow-y: auto;
}
#spicy-gift-dialog {
  width: min(92vw, 500px);
  max-height: 88dvh;
  overflow-y: auto;
}
#spicy-gift-jynx {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0.35rem auto;
  object-fit: contain;
  image-rendering: pixelated;
}
#spicy-gift-dialog p {
  line-height: 1.55;
}
#spicy-gift-actions {
  display: grid;
  gap: 0.65rem;
}
#spicy-gift-actions button {
  min-height: 48px;
  white-space: normal;
}
#palace-gift-body p {
  line-height: 1.65;
}
#palace-gift-body a {
  display: inline-block;
  font-size: 0.8em;
  padding: 0.5rem 0;
}
.palace-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.palace-choices button {
  display: grid;
  justify-items: center;
  padding: 0.5rem;
  min-height: 140px;
}
.palace-choices button[aria-pressed='true'] {
  background: #fae5ac;
  outline: 3px solid #bc5c34;
}
.palace-choices img,
.palace-companion {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  object-fit: contain;
}
.palace-choices small {
  font-size: 0.75em;
}
.palace-actions {
  display: grid;
  gap: 0.5rem;
  position: sticky;
  bottom: -1px;
  background: #fffceb;
  padding: 0.65rem 0;
}
.palace-actions button {
  min-height: 44px;
  white-space: normal;
}
.palace-warning {
  font-size: 0.85em;
}
@media (max-height: 450px) {
  .palace-choices img {
    width: 64px;
    height: 64px;
  }
  .palace-choices button {
    min-height: 110px;
  }
}
