/* Menus share the world's pixel palette and keep every action visible on touch screens. */
.menu-help {
  font-size: 17px;
  line-height: 1.2;
  color: #556980;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}
.classic-menu .menu-help {
  border-top: 2px solid #bac3c9;
  padding: 12px 8px 0;
  max-width: 270px;
}
button:focus-visible {
  outline: 3px solid #bc643e;
  outline-offset: 3px;
}
.battle-commands button {
  position: relative;
  border: 2px solid #87968d;
  box-shadow:
    inset 0 0 0 2px #fffbea,
    0 3px #c6c8ad;
  background: #eef0d9;
  font-size: 25px;
  padding: 10px 9px;
  min-height: 76px;
  transition:
    background 100ms,
    transform 100ms,
    box-shadow 100ms;
}
.battle-commands button small {
  display: block;
  font-size: 16px;
  margin-top: 5px;
  color: #526477;
}
.battle-commands button > span {
  color: #b75a3c;
}
.battle-commands button:nth-child(2) > span {
  color: #b08a2f;
}
.battle-commands button:nth-child(3) > span {
  color: #508957;
}
.battle-commands button:nth-child(4) > span {
  color: #467e96;
}
.battle-commands button:is(:hover, :focus-visible):not(:disabled),
.move-buttons button:is(:hover, :focus-visible):not(:disabled) {
  background: #fff0b6;
  border-color: #9f583a;
  transform: translateY(-2px);
}
.battle-commands button:active:not(:disabled),
.move-buttons button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: none;
}
.move-buttons button {
  border-left: 6px solid var(--move-color, #87968d);
  min-height: 68px;
  text-align: left;
  transition:
    transform 100ms,
    background 100ms;
}
[data-type='grass'] {
  --move-color: #73a959;
}
[data-type='fire'] {
  --move-color: #cf7148;
}
[data-type='water'],
[data-type='ice'] {
  --move-color: #579fbe;
}
[data-type='electric'] {
  --move-color: #c8a932;
}
[data-type='poison'],
[data-type='psychic'] {
  --move-color: #a77eae;
}
[data-type='ground'],
[data-type='rock'] {
  --move-color: #ad8b66;
}
#battle-help {
  min-height: 42px;
}
#battle-question {
  min-height: 28px;
  margin: 0 0 12px;
}
.hp-track i {
  transition:
    width 300ms ease-out,
    background-color 300ms;
}
#battle-back {
  width: 100%;
}
#battle-finish {
  margin: 12px;
  width: calc(100% - 24px);
}
#trainer-dialog {
  width: min(820px, calc(100% - 24px));
  max-width: min(820px, calc(100% - 24px));
}
#dialogue-form {
  padding-block: 16px 20px;
  margin-bottom: 20px;
  border-block: 2px solid #b4bec5;
}
#dialogue-form h3 {
  margin-top: 0;
}
.dialogue-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}
.dialogue-fields label {
  display: block;
  margin: 0;
  font-size: 21px;
}
.dialogue-fields textarea {
  display: block;
  width: 100%;
  font:
    21px / 1.15 'Comarca Pixel',
    monospace;
  color: #303b52;
  background: #fffef1;
  border: 2px solid #849497;
  border-radius: 2px;
  padding: 8px;
  resize: vertical;
  min-height: 76px;
  margin-top: 5px;
}
.dialogue-fields textarea:focus {
  outline: 3px solid #c39256;
  outline-offset: 1px;
}
.dialogue-fields small {
  display: block;
  text-align: right;
  color: #556980;
  font-size: 16px;
}
.speech-preview {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
  margin-top: 14px;
  background: #fffbea;
  border: 4px double #657896;
  min-height: 90px;
}
.speech-preview > div {
  min-width: 0;
}
.speech-preview p {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}
.speech-preview strong {
  font-size: 18px;
  color: #a55a36;
}
.dialogue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.dialogue-actions button {
  font-size: 18px;
}
.talk-dialog {
  width: min(560px, calc(100% - 24px));
}
.talk-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-block: 10px 18px;
}
.talk-heading h2 {
  margin: 0;
}
.speech-box {
  position: relative;
  width: 100%;
  min-height: 150px;
  padding: 20px 24px 30px 18px;
  text-align: left;
  font-size: 27px;
  line-height: 1.25;
  background: #fffbea;
  border: 5px double #657896;
  overflow-wrap: anywhere;
}
.speech-box:hover {
  background: #fffbea;
}
.speech-arrow {
  position: absolute;
  bottom: 6px;
  right: 10px;
  color: #a55a36;
  font-size: 19px;
  animation: speech-nudge 1s steps(2) infinite;
}
.talk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
#talk-page {
  margin-right: auto;
  color: #556980;
}
.player-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.player-actions button {
  padding: 4px 9px;
  font-size: 18px;
}
.invite-box blockquote {
  margin: 8px 0;
  padding-left: 10px;
  border-left: 3px solid #c39256;
  overflow-wrap: anywhere;
}
.avatar-crop.guide {
  background-image: url('/assets/guide.png');
}
.avatar-crop.sign {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  color: #fff8db;
  background: #536474;
  border: 2px solid #2d3d4d;
  font:
    23px 'Comarca Pixel',
    monospace;
}
.avatar-crop.sign::before {
  content: '↗';
}
@keyframes speech-nudge {
  50% {
    transform: translateY(3px);
  }
}
@media (max-width: 540px) {
  .dialogue-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .battle-commands button {
    font-size: 23px;
    min-height: 65px;
    padding: 7px;
  }
  .battle-commands button small {
    font-size: 15px;
  }
  #battle-help {
    font-size: 16px;
    min-height: 36px;
  }
  .speech-box {
    font-size: 25px;
  }
  .talk-actions button {
    font-size: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .speech-arrow {
    animation: none;
  }
  .hp-track i,
  .battle-commands button,
  .move-buttons button {
    transition: none;
  }
}
.speech-preview .avatar-crop,
.talk-heading .avatar-crop {
  flex: 0 0 32px;
  width: 32px;
  height: 64px;
  background-size: auto 64px;
}
/* Connection banner: visible without covering the map, on every screen size. */
.connection-cover {
  inset: auto 0 56px 0;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 0 auto;
  display: block;
  padding: 8px 14px;
  background: #fffbea;
  color: #303b52;
  border: 3px solid #586b83;
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 2px #f7fbff,
    inset 0 0 0 4px #aab6c9,
    3px 3px #526378;
  font:
    19px 'Comarca Pixel',
    monospace;
  pointer-events: none;
  z-index: 3;
}
/* A challenge that the equity rule flagged: the trainer accepts knowingly. */
.invite-warning {
  background: #f5e4a6;
  border: 3px double #957335;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: 18px !important;
  color: #5b4416 !important;
}
/* RANKING panel */
.ranking-position {
  font-size: 22px !important;
  margin: 4px 0 0;
}
.ranking-rows {
  display: flex;
  flex-direction: column;
  margin: 12px 0;
  max-height: 52dvh;
  overflow: auto;
}
.ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-top: 1px solid #c9d0c2;
}
.ranking-row > div {
  min-width: 0;
}
.ranking-row.me {
  background: #e2edc5;
  border: 3px double #527656;
}
.ranking-pos {
  flex: 0 0 34px;
  font-size: 24px;
  color: #a45238;
}
.ranking-row.me .ranking-pos {
  color: #386040;
}
.ranking-row .avatar-crop {
  flex: 0 0 16px;
}
.ranking-row strong {
  display: block;
  font-size: 22px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.ranking-row small {
  display: block;
  font-size: 17px;
  color: #4f6174;
}
.ranking-rating {
  margin-left: auto;
  font-size: 22px;
  font-weight: 400;
  white-space: nowrap;
}
.ranking-duels {
  margin: 12px 0;
  max-height: 52dvh;
  overflow: auto;
}
.duel-row {
  padding: 10px 12px;
  margin-top: 8px;
  background: #eef2db;
  border-left: 4px solid #6e8860;
}
.duel-row.lost {
  background: #f3e6dc;
  border-left-color: #b24532;
}
.duel-row strong {
  display: block;
  font-size: 22px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.duel-row small {
  font-size: 17px;
  color: #4f6174;
}
/* Station dialog */
.travel-dialog {
  width: min(520px, calc(100% - 24px));
}
.travel-destinations {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.travel-destination {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
}
.travel-destination > span:last-child {
  min-width: 0;
}
.travel-order {
  flex: 0 0 auto;
  min-width: 38px;
  text-align: center;
  font-size: 24px;
  color: #a45238;
  border: 2px solid #8090a3;
  padding: 2px 4px;
}
.travel-destination.visited .travel-order {
  color: #386040;
}
.travel-destination.locked {
  border-style: dashed;
}
.travel-destination strong {
  display: block;
  font-size: 22px;
  font-weight: 400;
}
.travel-destination small {
  display: block;
  font-size: 17px;
  color: #4f6174;
}
@media (max-width: 540px) {
  .connection-cover {
    inset: auto 0 12px 0;
    font-size: 16px;
    padding: 6px 10px;
  }
  .ranking-row {
    gap: 8px;
    padding: 8px 6px;
  }
  .ranking-row strong,
  .ranking-rating,
  .duel-row strong,
  .travel-destination strong {
    font-size: 19px;
  }
}
.player-actions {
  margin-left: auto;
}
dialog .menu-help {
  font-size: 17px;
  color: #556980;
}
