#items-dialog,
#wager-dialog {
  width: min(94vw, 620px);
}
#shop-dialog {
  width: min(94vw, 760px);
}
.challenge-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.challenge-mode-options button {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  text-align: left;
  line-height: 1.5;
}
.challenge-mode-options strong {
  font-size: 16px;
}
.challenge-mode-options span,
.challenge-mode-options small {
  font-size: 12px;
}
.challenge-mode-options button[aria-pressed='true'] {
  outline: 3px solid #405b77;
  outline-offset: -3px;
  background: #e0edf5;
  color: #1c344d;
}
.challenge-mode-terms {
  padding: 12px;
  border: 2px solid #405b77;
  background: #e0edf5;
  color: #1c344d;
  line-height: 1.6;
}
#wager-mode-summary {
  line-height: 1.5;
  font-size: 12px;
}
@media (max-width: 540px) {
  .challenge-mode-options {
    grid-template-columns: 1fr;
  }
}
.shop-wallet {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}
.shop-wallet span {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid var(--line);
  background: #f4f0d7;
}
.shop-wallet strong {
  float: right;
}
.shop-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 54dvh;
  overflow-y: auto;
  margin: 12px 0;
  padding: 4px;
}
.shop-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding: 11px;
  text-align: left;
}
.shop-list button span {
  display: grid;
  gap: 5px;
}
.shop-list button b {
  flex: 0 0 auto;
  color: #73521f;
}
.shop-list small {
  line-height: 1.35;
}
#wager-money {
  margin: 14px 0;
  padding: 12px;
  border: 2px solid #b38b42;
  background: #fff8df;
}
.bag-pockets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 10px;
  padding: 7px;
  border: 3px double var(--line);
  background: #d4d8c5;
}
.bag-pockets button {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 72px;
  padding: 8px 4px;
  border-width: 2px;
  background: #f4f0d7;
  font-size: 11px;
}
.bag-pockets button[aria-pressed='true'] {
  translate: 0 -3px;
  outline: 3px solid #596d70;
  background: #fff9da;
  color: #23334b;
}
.bag-pocket-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid currentColor;
  background: #d8a94f;
  color: #463619;
  font-size: 14px;
  line-height: 1;
}
[data-item-pocket='medicine'] .bag-pocket-icon {
  background: #a8cb86;
  color: #284223;
}
[data-item-pocket='tm'] .bag-pocket-icon {
  background: #91bcd1;
  color: #243f58;
}
.items-list {
  display: grid;
  gap: 8px;
  max-height: 45dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
}
.items-list button {
  display: grid;
  gap: 5px;
  padding: 12px;
  min-height: 56px;
  text-align: left;
}
.items-list small {
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.82;
}
.item-stack-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}
.item-stack-title b {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid currentColor;
  background: #e4dfbf;
  font-size: 14px;
}
.items-empty {
  display: grid;
  gap: 8px;
  min-height: 116px;
  margin: 0;
  padding: 18px;
  align-content: center;
  border: 2px dashed #8d927f;
  text-align: center;
}
.items-empty span {
  font-size: 12px;
  line-height: 1.55;
}
.item-quantity {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px 12px;
  border: 3px double var(--line);
  background: #f4f0d7;
  text-align: center;
}
.item-quantity-picker {
  display: grid;
  grid-template-columns: 58px minmax(80px, 1fr) 58px;
  gap: 8px;
  width: min(100%, 260px);
  align-items: stretch;
}
.items-list .item-quantity-picker button {
  display: grid;
  min-height: 54px;
  padding: 6px;
  place-items: center;
  text-align: center;
  font-size: 26px;
}
.item-quantity-picker output {
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 3px solid var(--line);
  background: #fffdf0;
  font-size: 24px;
  font-weight: 700;
}
.item-quantity p {
  margin: 0;
}
.items-list .item-quantity > button {
  width: min(100%, 360px);
  text-align: center;
}
.items-list button[aria-pressed='true'] {
  outline: 3px solid #647d31;
  background: #f1edc4;
  color: #253116;
}
.wager-terms {
  padding: 12px;
  border: 2px solid #b38b42;
  background: #fff2ca;
  color: #322815;
  line-height: 1.6;
}
.wager-stake {
  margin: 12px 0;
  padding-top: 10px;
  border-top: 1px solid #b38b42;
}
.wager-stake-picker {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.wager-stake-picker button {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 9px;
  text-align: left;
}
.wager-stake-picker button[aria-pressed='true'] {
  outline: 3px solid #647d31;
  background: #f1edc4;
  color: #253116;
}
#wager-chat {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid var(--line);
}
#wager-chat h3 {
  margin: 0 0 4px;
}
#wager-chat-log {
  display: grid;
  gap: 7px;
  max-height: 150px;
  overflow-y: auto;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid var(--line);
  background: #ece8cf;
}
.wager-chat-message {
  display: grid;
  gap: 2px;
  width: fit-content;
  max-width: 88%;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid #8e8368;
  background: #fffaf0;
  overflow-wrap: anywhere;
}
.wager-chat-message.mine {
  justify-self: end;
  background: #e7efd0;
}
.wager-chat-message strong {
  font-size: 11px;
  text-transform: uppercase;
}
.wager-chat-empty {
  margin: 0;
  opacity: 0.75;
}
.wager-chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}
.wager-chat-compose input,
.wager-chat-compose button {
  min-height: 44px;
}
#bag-items-help {
  line-height: 1.6;
}
#wager-send {
  margin-top: 12px;
}
@media (max-width: 410px), (max-height: 500px) {
  .shop-list {
    grid-template-columns: 1fr;
    max-height: 48dvh;
  }
  .bag-pockets button {
    min-height: 62px;
    font-size: 9px;
  }
  .bag-pocket-icon {
    width: 21px;
    height: 21px;
  }
  #items-dialog .items-list {
    max-height: 38dvh;
  }
  .item-quantity {
    gap: 9px;
    padding: 10px 8px;
  }
}
