#chat-heading {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--paper);
  font: 600 11px var(--read);
}
#chat-close {
  display: none;
}
#chat-address {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  min-height: 30px;
  margin-top: 4px;
  padding: 3px 8px;
  box-sizing: border-box;
  background: rgba(6, 18, 11, 0.5);
  border: 2px solid rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  corner-shape: bevel;
  color: #cdbf9f;
  font: 700 13px var(--read);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
#chat-address label {
  white-space: nowrap;
}
#chat-address[hidden],
#chat-new[hidden],
#chat-status[hidden] {
  display: none;
}
#chat-recipient {
  flex: 0 1 10em;
  width: auto;
  min-width: 5em;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;
  color: #ffbcd8;
  font: 800 13px var(--read);
  text-shadow: none;
  caret-color: #ffbcd8;
}
#chat-recipient:focus-visible {
  outline: 0;
}
#chat-recipient::placeholder {
  color: rgba(255, 188, 216, 0.5);
  font-weight: 600;
}
#chat-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  margin-left: auto;
}
#chat-partners[hidden] {
  display: none;
}
#chat-partners .partner {
  position: relative;
  max-width: 120px;
  min-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  padding: 1px 9px;
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: 5px;
  background: rgba(255, 188, 216, 0.1);
  box-shadow: none;
  color: #ffbcd8;
  font: 800 11px var(--read);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
#chat-partners .partner:hover {
  background: rgba(255, 188, 216, 0.22);
}
#chat-partners .partner.unread {
  padding-right: 15px;
}
#chat-partners .partner.unread::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 5px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: #ff7bb0;
  box-shadow: 0 0 0 1px var(--ink);
}
#chat-send,
#chat-close,
#chat-new {
  flex: none;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--raised);
  color: var(--ink);
  font: 800 12px var(--read);
  padding: 4px 8px;
}
#chat-send:disabled {
  opacity: .55;
  cursor: default;
}
#chat-new {
  align-self: center;
  margin: 4px 0 0;
}
#chat-status {
  margin: 5px 2px 0;
  color: #ffe9a0;
  font: 600 12px/1.35 var(--read);
}
#messages .chat-source {
  color: #d8d4ff;
  font-weight: 800;
  white-space: nowrap;
}
#world-unread {
  margin-left: 3px;
  border-radius: 8px;
  background: var(--honey);
  color: var(--ink);
  padding: 0 3px;
}
#world-unread[hidden] {
  display: none;
}
#touch-controls {
  display: none;
}
#move-stick {
  position: absolute;
  width: 112px;
  height: 112px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: rgb(243 232 207 / 65%);
  box-shadow: inset 0 0 0 6px rgb(246 197 49 / 45%), var(--ledge);
  touch-action: none;
  display: grid;
  place-items: center;
}
#move-stick::before {
  content: "✦";
  color: var(--ink);
  opacity: .3;
  font-size: 92px;
  line-height: 1;
}
#move-knob {
  position: absolute;
  width: 46px;
  height: 46px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--raised);
  box-shadow: var(--bevel);
  pointer-events: none;
}
#move-stick.held {
  background: rgb(243 232 207 / 90%);
}
#touch-stop {
  position: absolute;
  left: 32px;
  bottom: 4px;
  height: 44px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--raised);
  color: var(--ink);
  font: 800 12px var(--read);
}
#touch-attack,
#touch-mount {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  bottom: calc(198px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  min-width: 44px;
  min-height: 44px;
  padding: 5px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  corner-shape: bevel;
  background: var(--raised);
  box-shadow: var(--bevel), var(--ledge);
  color: var(--ink);
  font: 800 12px/1 var(--read);
  touch-action: none;
}
#touch-attack > *,
#touch-mount > * {
  pointer-events: none;
}
#touch-attack svg,
#touch-mount svg {
  width: 28px;
  height: 28px;
}
#touch-attack:active,
#touch-mount:active {
  background: linear-gradient(#ffe27a, #f6c531);
  box-shadow: inset 2px 2px 0 rgba(150, 90, 10, .3), 0 2px 0 rgba(43, 29, 14, .4);
  transform: translateY(2px);
}
#touch-attack:focus-visible,
#touch-mount:focus-visible {
  outline: 3px solid var(--honey);
  outline-offset: 3px;
}
#touch-mount {
  right: calc(max(10px, env(safe-area-inset-right)) + 72px);
  font-size: 11px;
  padding-inline: 1px;
}
#touch-mount[hidden] {
  display: none;
}
.touch-help {
  display: none;
}
#btn-menu,
#chat-toggle,
#tabs #btn-view {
  display: none;
}
@media (pointer: coarse), (any-pointer: coarse) and (max-width: 760px) {
  #touch-controls {
    display: block;
    position: absolute;
    left: max(12px, env(safe-area-inset-left));
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: 112px;
    height: 164px;
    z-index: 8;
  }
  .touch-help {
    display: block;
  }
  #view {
    -webkit-touch-callout: none;
  }
}
@media (max-width: 760px), (pointer: coarse) {
  #menu {
    position: fixed;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right));
    top: auto !important;
    bottom: calc(64px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 90px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    width: auto;
  }
  #menu .opt {
    min-height: 44px;
  }
  #menu .opt:last-child {
    position: sticky;
    bottom: -5px;
    background: var(--parchment);
  }
  #menu .menu-back {
    position: sticky;
    top: -5px;
    z-index: 1;
    background: var(--parchment);
    border-bottom: 2px solid var(--line);
    border-radius: 0;
  }
  #menu .menu-back:hover,
  #menu .menu-back:focus-visible,
  #menu .opt:last-child:hover,
  #menu .opt:last-child:focus-visible {
    background: var(--evergreen);
  }
  #game {
    height: 100dvh;
  }
  #hud-left {
    left: max(8px, env(safe-area-inset-left));
    top: max(8px, env(safe-area-inset-top));
    width: calc(100% - 146px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-width: 230px;
    gap: 6px;
  }
  #hud {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 6px;
    align-items: center;
    padding: 6px 8px 7px;
  }
  #hud > .hud-top {
    display: none;
  }
  #hud > .meter {
    margin: 0;
    gap: 4px;
  }
  #hud > .meter.xp,
  #hud > .hud-foot {
    grid-column: 1 / -1;
  }
  #hud .bar:not(.xp) span {
    font-size: 13px;
    padding-right: 5px;
  }
  #hud .bar:not(.xp) span .max {
    font-size: 10px;
  }
  #hud .meter.xp .bar {
    height: 9px;
  }
  #hud .meter.xp .lv,
  #hud .meter.xp #xp-text {
    display: none;
  }
  #hud .hud-foot {
    margin: 0;
    gap: 4px;
  }
  #hud-flags span {
    font-size: 10px;
    padding: 0 4px;
    height: 22px;
  }
  #players-online,
  #net-ping {
    min-height: 22px;
    font-size: 10px;
    padding: 0 6px;
  }
  #players-online .long {
    display: none;
  }
  #players-online .short {
    display: inline;
  }
  #btn-notes {
    height: 26px;
    font-size: 0;
    gap: 0;
    padding: 0 8px;
  }
  #btn-notes.on {
    display: none;
  }
  #journey-card {
    width: min(280px, calc(100vw - 150px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    max-height: min(210px, 32dvh, var(--notes-room, 32dvh));
    overflow-y: auto;
  }
  #journey-card:not(.open) {
    width: auto;
    padding: 5px 38px 5px 10px;
    cursor: pointer;
  }
  #journey-card:not(.open) > :not(h2):not(.close) {
    display: none !important;
  }
  #journey-card:not(.open) h2 {
    margin: 1px 0;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #journey-card:not(.open) h2::after {
    content: " +";
    color: var(--brown);
  }
  #journey-card.fresh {
    animation: note-fresh 1.2s ease-out 2;
  }
  #compass {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    width: 114px;
    height: 114px;
    padding: 5px;
  }
  #minimap {
    width: 98px;
    height: 98px;
  }
  #mm-tools {
    left: 8px;
    bottom: -42px;
    flex-direction: row;
    gap: 6px;
  }
  #mm-tools button {
    width: 42px;
    height: 36px;
  }
  #mm-tools #mm-eye {
    display: none;
  }
  #side {
    top: auto;
    left: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
  #side:not(.menu-open) #tabs > :not([data-tab=inventory]) {
    display: none;
  }
  #side.menu-open #tabs {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    display: grid;
    grid-template-columns: repeat(4, 64px);
    gap: 6px;
    padding: 8px;
    background: var(--parchment);
    border: 3px solid var(--ink);
    border-radius: 12px;
    corner-shape: bevel;
    box-shadow: var(--bevel), var(--ledge);
    max-height: calc(100dvh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  #tabs button[data-tab=inventory] {
    position: fixed;
    right: calc(max(8px, env(safe-area-inset-right)) + 58px);
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
  #side.menu-open,
  body:has(.window:not(.hidden)) #side.front {
    z-index: 17;
  }
  #side.menu-open #tabs {
    z-index: 1;
  }
  #tabs button,
  #btn-menu,
  #chat-toggle {
    width: 52px;
    height: 52px;
    min-width: 0;
    padding: 3px 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1px;
  }
  #side.menu-open #tabs > :not([data-tab=inventory]) {
    width: 64px;
    height: 58px;
  }
  #tabs button .px-icon,
  #btn-menu .px-icon,
  #chat-toggle .px-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
  }
  #tabs button .px-icon canvas,
  #btn-menu .px-icon canvas,
  #chat-toggle .px-icon canvas {
    width: 28px;
    height: 28px;
  }
  #tabs .dock-label,
  #btn-menu .dock-label {
    display: block;
    flex: none;
    max-width: 100%;
    overflow: hidden;
    font-size: 9px;
  }
  #tabs kbd {
    display: none;
  }
  #tabs button:hover:not(.active) {
    transform: none;
  }
  #btn-menu,
  #chat-toggle {
    display: flex;
    position: relative;
    background: var(--raised);
    border: 2px solid var(--ink);
    border-radius: 8px;
    corner-shape: bevel;
    box-shadow:
      inset 0 0 0 1px #d0b580,
      inset 0 2px 0 #fffdf5,
      inset 0 -3px 0 #dec596,
      0 3px 0 rgba(43, 29, 14, .4);
    color: var(--ink);
    font: 800 13px var(--read);
    cursor: pointer;
  }
  #btn-menu[aria-expanded=true],
  #side:has(#tabs > button.active:not([data-tab=inventory])) #btn-menu {
    background: linear-gradient(#e8f2d8, #cadfac);
    color: #24482e;
    box-shadow:
      inset 0 0 0 2px #62905a,
      inset 0 3px 0 #f4f9e9,
      0 3px 0 rgba(43, 29, 14, .4);
  }
  #btn-menu:active,
  #chat-toggle:active {
    transform: translateY(1px);
  }
  #side.menu-open #tabs > #btn-view {
    display: flex;
  }
  #btn-view .eye-icon {
    width: 28px;
    height: 28px;
    margin: 0;
    flex: none;
  }
  #tabs #btn-view.on {
    background: linear-gradient(#fff0a8, var(--honey));
    box-shadow: inset 0 2px 0 rgba(150, 90, 10, 0.32), 0 3px 0 rgba(43, 29, 14, .4);
  }
  body.fp-new #btn-view::after {
    content: "NEW";
    position: absolute;
    top: -8px;
    right: -6px;
    padding: 1px 4px;
    background: var(--honey);
    border: 2px solid var(--ink);
    border-radius: 5px;
    corner-shape: bevel;
    color: var(--ink);
    font: 8px/10px var(--blocks);
    pointer-events: none;
  }
  #side:not(.menu-open):has(#tabs .plot-attention:not([hidden])) #btn-menu::after {
    content: "";
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    background: #f3cd6b;
    border: 2px solid var(--ink);
    border-radius: 50%;
  }
  #panel {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    width: min(360px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 82px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
  #panel .close,
  #panel button,
  #worldmap button {
    min-height: 40px;
  }
  .panel-head .close,
  .window .close {
    width: 40px;
    height: 40px;
    top: 4px;
    right: 5px;
    font-size: 18px;
  }
  .panel-head,
  .window h3 {
    padding-right: 52px;
  }
  #shop > h3,
  #bank > h3 {
    min-height: 52px;
    padding-right: 60px;
  }
  #shop > .close,
  #bank > .close {
    width: 44px;
    height: 44px;
    min-height: 44px;
    top: 4px;
    right: 5px;
    padding: 0;
  }
  #shop > .stock {
    grid-template-columns: repeat(auto-fill, 46px);
  }
  #public-chest > h3 {
    min-height: 52px;
    padding-right: 60px;
  }
  #public-chest > .close {
    width: 44px;
    height: 44px;
    min-height: 44px;
    top: 4px;
    right: 5px;
    padding: 0;
  }
  #chat {
    left: max(8px, env(safe-area-inset-left));
    right: auto;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
  }
  #chat:not(.open) {
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  #chat-toggle .px-icon canvas {
    width: 26px;
    height: 26px;
  }
  #talk-key,
  body.voice-on #talk-key {
    display: none;
  }
  body.voice-on #chat-toggle::after {
    content: "";
    position: absolute;
    left: -6px;
    bottom: -6px;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12' shape-rendering='crispEdges'%3E%3Cpath d='M3 1h4v6H3z' fill='%232b1d0e'/%3E%3Cpath d='M1 5h1v2h6V5h1v3H6v2H4V8H1z' fill='%232b1d0e'/%3E%3C/svg%3E") center / 10px 12px no-repeat;
    border: 2px solid var(--ink);
    border-radius: 50%;
  }
  body.voice-talking #chat-toggle {
    background: linear-gradient(#fff0a8, var(--honey));
  }
  #chat-unread {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: var(--honey);
    border: 2px solid var(--ink);
    border-radius: 11px;
    color: var(--ink);
    font: 800 11px/18px var(--read);
    text-align: center;
    pointer-events: none;
  }
  #chat-unread[hidden],
  #chat:not(.open) #chatline,
  #chat.open #chat-toggle {
    display: none;
  }
  #chat:not(.open) #messages {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    bottom: calc(184px + env(safe-area-inset-bottom));
    width: max-content;
    max-width: min(340px, calc(100vw - 24px));
    height: auto;
    max-height: none;
    overflow: hidden;
    padding: 3px 9px;
    background: rgba(29, 52, 38, 0.78);
    border-radius: 8px;
    corner-shape: bevel;
    -webkit-mask-image: none;
    mask-image: none;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
  }
  #chat:not(.open) #messages > :not(.newest) {
    display: none;
  }
  #chat:not(.open) #chat-tabs {
    display: none;
  }
  #chat.fresh:not(.open) #messages {
    animation: chat-fresh 6s forwards;
  }
  #chat.open {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(var(--chat-keyboard, 0px) + 8px + env(safe-area-inset-bottom));
    z-index: 10;
    width: auto !important;
    height: min(430px, calc(var(--chat-room, 62dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    max-height: calc(var(--chat-room, 70dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    padding: 7px;
    box-sizing: border-box;
  }
  #chat:not(.open) :is(#chat-heading, #chat-address, #chat-new, #chat-status) {
    display: none;
  }
  #chat-heading {
    flex: none;
    min-height: 44px;
    font-size: 12px;
  }
  #chat-close {
    display: block;
    min-height: 44px;
    min-width: 52px;
  }
  #chat-tabs {
    flex: none;
    overflow-x: auto;
    overscroll-behavior: contain;
    margin: 0 0 5px;
    gap: 3px;
  }
  #chat-tabs button {
    min-height: 44px;
    padding: 5px 10px;
    flex: 1 0 auto;
    font-size: 12px;
  }
  #chat.open #messages {
    height: auto !important;
    min-height: 32px;
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 1.5;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  #chatline,
  #chat-address,
  #chat-status {
    flex: none;
  }
  #chat-send,
  #chat-quick,
  #chat-new {
    min-height: 44px;
  }
  #chat:not(.open) {
    display: flex;
    align-items: flex-end;
    gap: 6px;
  }
  #chat:not(.open) #emote-key {
    display: flex;
  }
  #chat:not(.open) #emote-key.no-room {
    display: none;
  }
  #emote-key {
    position: relative;
    width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
    align-items: center;
    background: var(--raised);
    border: 2px solid var(--ink);
    border-radius: 8px;
    corner-shape: bevel;
    box-shadow:
      inset 0 0 0 1px #d0b580,
      inset 0 2px 0 #fffdf5,
      inset 0 -3px 0 #dec596,
      0 3px 0 rgba(43, 29, 14, .4);
    cursor: pointer;
  }
  #emote-key:active {
    transform: translateY(1px);
  }
  #emote-key .px-icon canvas {
    width: 26px;
    height: 26px;
  }
  #chat-emotes {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
  #chat-emotes .em-label,
  #chat-emotes kbd {
    display: none;
  }
  #chat-address {
    min-height: 44px;
    padding: 3px 6px;
  }
  #chat-recipient {
    font-size: 16px;
  }
  #chat-partners .partner {
    min-height: 36px;
    padding: 4px 11px;
    font-size: 12px;
  }
  #chat:not(.open) #messages::before {
    content: none;
  }
  #chat.open.typing {
    height: calc(var(--chat-room, 50dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  #chat.open.compact #chat-tabs {
    display: none;
  }
  #chat.open.compact #messages {
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  #chat.open.compact #chat-status {
    max-height: 2.7em;
    overflow-y: auto;
  }
  #messages {
    height: 110px;
    font-size: 12px;
    padding: 2px 4px;
  }
  #messages:focus {
    outline: none;
  }
  #chatline {
    min-height: 40px;
    padding: 0 6px;
    gap: 5px;
  }
  #chat-prompt {
    display: none;
  }
  #chat-input {
    font-size: 16px;
    width: 100%;
  }
  #bars {
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(70px + env(safe-area-inset-bottom));
    width: auto;
    max-width: calc(100% - 150px - env(safe-area-inset-left) - env(safe-area-inset-right));
    gap: 5px;
  }
  #hotbar,
  #foodbar {
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  #hotbar,
  #foodbar {
    overflow: auto hidden;
    overscroll-behavior: contain;
    touch-action: pan-x;
    scrollbar-width: none;
  }
  #hotbar {
    display: flex;
    max-width: 100%;
    gap: 6px;
  }
  #hotbar .hslot {
    flex: 0 0 46px;
    width: 46px;
    height: 54px;
  }
  #hotbar .hslot.locked {
    display: none;
  }
  #game:not([data-pvl-clean-ui=true]) #bars #hotbar .hslot {
    margin-top: 0;
  }
  #game:not([data-pvl-clean-ui=true]) #bars #hotbar .hslot.group-start-open {
    margin-left: 8px;
  }
  #game:not([data-pvl-clean-ui=true]) #bars #hotbar .hslot > .belt-divider {
    display: none;
  }
  #game:not([data-pvl-clean-ui=true]) #bars #hotbar .hslot.group-start-open > .belt-divider {
    display: block;
    position: absolute;
    left: -10px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    height: auto;
    border-radius: 1px;
    background: rgba(255, 244, 214, .8);
    box-shadow: 0 0 0 1px rgba(43, 29, 14, .35);
    pointer-events: none;
  }
  #foodbar {
    max-width: 100%;
    gap: 6px;
  }
  #foodbar .hslot {
    flex-shrink: 0;
  }
  #foodbar .hslot.empty,
  #foodbar:not(:has(.hslot:not(.empty))) {
    display: none;
  }
  #worldmap {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 80px);
  }
  #worldmap .mapwrap {
    width: min(560px, calc(100vw - 48px), calc(100dvh - 230px));
    height: auto;
    aspect-ratio: 1;
  }
  #bossbar {
    top: max(calc(max(8px, env(safe-area-inset-top)) + 164px), var(--boss-party-top, 0px));
    width: min(460px, calc(100vw - 32px));
    min-width: 0;
  }
  body.px-bossbar-open #game #journey-card {
    width: auto !important;
    max-height: none !important;
    padding: 5px 38px 5px 10px !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
  }
  body.px-bossbar-open #game #journey-card > :not(h2):not(.close) {
    display: none !important;
  }
  body.px-bossbar-open #game #journey-card h2 {
    margin: 1px 0;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #eye-target {
    top: calc(max(8px, env(safe-area-inset-top)) + 164px);
    width: min(320px, calc(100vw - 32px));
  }
}
@media (hover: none) {
  #hint {
    display: none !important;
  }
}
@keyframes chat-fresh {
  0%, 80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes note-fresh {
  0%, 100% {
    box-shadow: var(--ledge);
  }
  40% {
    box-shadow: 0 0 0 3px var(--honey), var(--ledge);
  }
}
@media (prefers-reduced-motion: reduce) {
  #journey-card.fresh {
    animation: none;
  }
}
@media (pointer: coarse), (any-pointer: coarse) and (max-width: 760px) {
  #chat:not(.open) {
    left: calc(132px + env(safe-area-inset-left));
  }
}
@media (pointer: coarse) and (max-height: 500px) {
  #hud-left {
    max-width: 210px;
  }
  #hud .meter.xp {
    display: none;
  }
  #touch-controls {
    width: 96px;
    height: 148px;
    bottom: calc(6px + env(safe-area-inset-bottom));
  }
  #touch-attack,
  #touch-mount {
    bottom: calc(172px + env(safe-area-inset-bottom));
    width: 60px;
    height: 60px;
  }
  #move-stick {
    width: 96px;
    height: 96px;
  }
  #touch-stop {
    left: 24px;
  }
  #bossbar,
  #eye-target {
    left: calc(50% + (max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right)) + 42px) / 2);
    width: min(300px, calc(100vw - 394px - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right))));
    min-width: 0;
  }
  #bossbar {
    top: calc(12px + env(safe-area-inset-top));
  }
  #eye-target {
    top: calc(8px + env(safe-area-inset-top));
  }
  #mm-tools {
    left: auto;
    right: calc(100% + 6px);
    top: 44px;
    bottom: auto;
    flex-direction: column;
    gap: 4px;
  }
  #side {
    bottom: calc(6px + env(safe-area-inset-bottom));
  }
  #tabs button[data-tab=inventory] {
    right: calc(max(8px, env(safe-area-inset-right)) + 52px);
    bottom: calc(6px + env(safe-area-inset-bottom));
  }
  #tabs button,
  #btn-menu,
  #chat-toggle {
    width: 46px;
    height: 46px;
  }
  #tabs .dock-label,
  #btn-menu .dock-label {
    display: none;
  }
  #side.menu-open #tabs > :not([data-tab=inventory]) {
    width: 60px;
    height: 52px;
  }
  #side.menu-open #tabs > :not([data-tab=inventory]) .dock-label {
    display: block;
  }
  #chat:not(.open) {
    left: calc(114px + env(safe-area-inset-left));
    bottom: calc(6px + env(safe-area-inset-bottom));
  }
  #chat:not(.open) #emote-key {
    display: none;
  }
  #chat:not(.open) #messages {
    bottom: calc(162px + env(safe-area-inset-bottom));
    max-width: min(460px, calc(100vw - 260px));
  }
  #chat.open #messages {
    height: 72px;
  }
  #bars {
    bottom: calc(60px + env(safe-area-inset-bottom));
    max-width: calc(100% - 140px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }
  #hotbar .hslot {
    height: 46px;
    padding-top: 0;
    justify-content: center;
  }
  #hotbar .hslot .sp {
    display: none;
  }
  #worldmap {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    column-gap: 12px;
    align-items: start;
  }
  #worldmap > h3 {
    grid-column: 1 / -1;
  }
  #worldmap .mapwrap {
    grid-column: 1;
    grid-row: 2 / -1;
    width: min(calc(100dvh - 140px), calc(100vw - 320px));
    margin: 0 0 4px;
  }
  #worldmap .maptools {
    grid-column: 2;
    grid-row: 2;
    flex-wrap: wrap;
  }
  #worldmap .maplegend {
    grid-column: 2;
    grid-row: 3;
    margin-top: 8px;
  }
  #worldmap .sub {
    grid-column: 2;
    grid-row: 4;
  }
}
#worldmap-canvas {
  touch-action: none;
}
#belt-name {
  position: fixed;
  z-index: 30;
  transform: translate(-50%, -100%);
  padding: 3px 8px;
  background: var(--parchment);
  border: 2px solid var(--ink);
  border-radius: 6px;
  corner-shape: bevel;
  box-shadow: var(--ledge);
  font: 800 12px var(--read);
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
}
#belt-name[hidden] {
  display: none;
}
@media (max-width: 760px) and (min-height: 501px) {
  #shop:not(.pet-shop) {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    top: auto;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-height: calc(46dvh - 12px - env(safe-area-inset-bottom));
    transform: none;
  }
  #shop > .shop-help {
    max-height: max(44px, min(150px, calc(46dvh - 174px - env(safe-area-inset-bottom))));
  }
  body.px-shop-visible.px-shop-uses-bag #game #panel {
    max-height: calc(54dvh - 4px - max(10px, env(safe-area-inset-top))) !important;
  }
}
@media (pointer: coarse) and (max-height: 500px) {
  #shop:not(.pet-shop) {
    left: max(8px, env(safe-area-inset-left));
    right: calc(max(8px, env(safe-area-inset-right)) + 324px);
    top: max(8px, env(safe-area-inset-top));
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-height: none;
    transform: none;
  }
  body.px-shop-visible.px-shop-uses-bag #game #panel {
    width: 316px;
  }
}
@media (max-width: 760px) and (min-height: 501px) {
  body.first-adventure #journey-card.first-steps {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    top: calc(max(8px, env(safe-area-inset-top)) + 164px);
    width: auto;
    max-height: none;
    padding: 7px 10px;
    z-index: 10;
  }
  body.first-adventure #journey-card .journey-eyebrow {
    display: none;
  }
  body.first-adventure #journey-card h2 {
    font-size: 12px;
    margin: 0 34px 10px 0;
  }
  body.first-adventure #journey-card.first-steps .close {
    top: 4px;
    right: 5px;
  }
  body.first-adventure #journey-card p {
    font-size: 11px;
    line-height: 1.35;
  }
  body.first-adventure #first-steps-dismiss {
    padding: 4px 7px;
  }
  body.first-adventure #first-steps-foot {
    bottom: -7px;
    margin: 0 -10px -7px;
    padding: 7px 10px 7px;
  }
}
@media (max-width: 760px) and (min-height: 501px) and (max-height: 680px) {
  body.first-adventure #hud .meter.xp,
  body.first-adventure #hud #hud-flags,
  body.first-adventure #hud #btn-notes,
  body.first-adventure #mm-tools {
    display: none;
  }
  body.first-adventure #journey-card.first-steps {
    top: calc(max(8px, env(safe-area-inset-top)) + 122px);
  }
}
@media (pointer: coarse) and (min-width: 761px) and (min-height: 501px) {
  body.first-adventure #journey-card.first-steps {
    max-height: min(340px, 40dvh);
  }
}
#hold-ring {
  position: fixed;
  left: 0;
  top: 0;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
}
#hold-ring.on {
  visibility: visible;
  animation: hold-show 0s linear 150ms forwards;
}
#hold-ring circle {
  fill: none;
  transform: rotate(-90deg);
  transform-origin: 36px 36px;
}
#hold-ring .rim {
  stroke: rgb(43 29 14 / 55%);
  stroke-width: 10;
}
#hold-ring .fill {
  stroke: var(--honey);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 182.2;
  stroke-dashoffset: 182.2;
}
#hold-ring.on .fill {
  animation: hold-fill 350ms linear 150ms forwards;
}
@keyframes hold-show {
  to {
    opacity: 1;
  }
}
@keyframes hold-fill {
  to {
    stroke-dashoffset: 0;
  }
}
#install-row[hidden],
#btn-install[hidden] {
  display: none !important;
}
#install-row button {
  display: block;
  margin-top: 6px;
}
#touch-eye {
  display: none;
}
@media (pointer: coarse), (any-pointer: coarse) and (max-width: 760px) {
  #touch-stop {
    left: 6px;
  }
  #touch-eye {
    display: block;
    position: absolute;
    left: 62px;
    bottom: 4px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--raised);
  }
  #touch-eye .eye-icon {
    width: 26px;
    height: 26px;
  }
}
@media (pointer: coarse) and (max-height: 500px) {
  #touch-stop {
    left: 0;
  }
  #touch-eye {
    left: 55px;
    width: 44px;
  }
}
@media (pointer: coarse), (any-pointer: coarse) and (max-width: 760px) {
  html,
  body {
    overscroll-behavior: none;
  }
  html {
    touch-action: pan-x pan-y;
  }
  #hud,
  #compass,
  #side,
  #touch-controls,
  #chat-toggle {
    touch-action: none;
  }
  input:not([type=checkbox]):not([type=radio]):not([type=range]),
  textarea,
  select {
    font-size: max(16px, 1em) !important;
  }
}
#settings .settings-picker {
  display: none;
}
@media (max-width: 760px), (pointer: coarse) {
  #settings {
    display: block;
  }
  #settings .settings-navigation {
    display: none;
  }
  #settings .settings-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: -8px;
    z-index: 2;
    margin: -8px -10px 10px;
    padding: 8px 10px;
    background: var(--parchment);
    border-bottom: 2px solid var(--line);
    font: 800 13px var(--read);
  }
  #tab-settings {
    scroll-padding-top: 64px;
  }
  #settings .settings-picker select {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 6px 10px;
    font: 700 16px var(--read);
    background: var(--paper);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 6px;
  }
  #settings .seg button {
    min-height: 44px;
    font-size: 13px;
  }
  #settings label:has(input[type=checkbox]) {
    min-height: 44px;
    box-sizing: border-box;
  }
  #settings select,
  #settings input:not([type=checkbox]):not([type=radio]):not([type=range]) {
    min-height: 44px;
    font-size: 16px;
  }
  #dialog .opt,
  #loot button,
  #make .build-filters button {
    min-height: 44px;
  }
  #panel .tab,
  #make .rows,
  #shop,
  #bank {
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
}
#first-steps-foot > button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 6px;
  font-size: 11px;
}
#journey-journal[hidden] {
  display: none;
}
@media (max-width: 760px), (pointer: coarse) {
  :root {
    --hud-scale: 1;
    --phone-map-size: calc(114px * var(--hud-scale));
    --belt-cell: max(44px, calc(46px * var(--hud-scale)));
    --spell-height: max(44px, calc(54px * var(--hud-scale)));
  }
  #hud-left {
    width: calc(100% - var(--phone-map-size) - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-width: calc(230px * var(--hud-scale));
  }
  #hud-left > * {
    flex-shrink: 0;
  }
  body.px-bossbar-open #game #hud-left:has(#party-hud:not([hidden])) {
    max-height: var(--phone-hud-room, none);
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  #hud {
    zoom: var(--hud-scale);
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(max(60px, calc((100% - 6px) / 2)), 1fr));
  }
  #hud .bar:not(.xp) {
    min-width: 0;
  }
  #compass {
    width: var(--phone-map-size);
    height: var(--phone-map-size);
    padding: calc(5px * var(--hud-scale));
    border-width: calc(3px * var(--hud-scale));
  }
  #minimap {
    width: calc(98px * var(--hud-scale));
    height: calc(98px * var(--hud-scale));
  }
  #compass-ring {
    inset: 14px;
  }
  #mm-tools {
    left: max(0px, calc((var(--phone-map-size) - 90px) / 2));
  }
  #hotbar .hslot {
    flex-basis: var(--belt-cell);
    width: var(--belt-cell);
    height: var(--spell-height);
  }
  #foodbar .hslot {
    width: var(--belt-cell);
    height: var(--belt-cell);
  }
  #hotbar .hslot .spell-icon,
  #foodbar .hslot canvas {
    width: calc(36px * var(--hud-scale));
    height: calc(36px * var(--hud-scale));
  }
  #touch-attack,
  #touch-mount {
    bottom: calc(98px + var(--spell-height) + var(--belt-cell) + env(safe-area-inset-bottom));
  }
  #bossbar {
    top: max(calc(max(8px, env(safe-area-inset-top)) + var(--phone-map-size) + 50px), var(--boss-party-top, 0px));
  }
  #eye-target {
    top: calc(max(8px, env(safe-area-inset-top)) + var(--phone-map-size) + 50px);
  }
}
@media (pointer: coarse) and (max-height: 500px) {
  :root {
    --spell-height: var(--belt-cell);
    --landscape-belt-right: max(148px, calc(var(--phone-map-size) + 20px));
  }
  #hud-left {
    max-width: 210px;
  }
  #hud {
    max-height: calc(max(72px, 100dvh - 238px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / var(--hud-scale));
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  body.px-bossbar-open #game #hud-left:has(#party-hud:not([hidden])) {
    max-height: none;
    overflow: visible;
  }
  #mm-tools {
    left: auto;
  }
  #touch-attack,
  #touch-mount {
    bottom: calc(60px + env(safe-area-inset-bottom));
  }
  #bars {
    flex-direction: row;
    right: calc(var(--landscape-belt-right) + env(safe-area-inset-right));
    max-width: calc(100% - 126px - var(--landscape-belt-right) - env(safe-area-inset-left) - env(safe-area-inset-right));
  }
  #hotbar {
    min-width: var(--belt-cell);
  }
  #foodbar {
    min-width: var(--belt-cell);
    max-width: 40%;
  }
  #party-hud .party-hud-members {
    width: min(210px, calc(100vw - 250px - var(--phone-map-size) - env(safe-area-inset-left) - env(safe-area-inset-right)));
  }
  #bossbar,
  #eye-target {
    left: calc(50% + (max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right)) + 156px - var(--phone-map-size)) / 2);
    width: min(300px, calc(100vw - 280px - var(--phone-map-size) - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right))));
  }
  #bossbar {
    top: calc(12px + env(safe-area-inset-top));
  }
  #eye-target {
    top: calc(8px + env(safe-area-inset-top));
  }
}
@media (max-width: 360px) and (min-height: 501px) {
  #bossbar,
  #bossbar.beacon,
  #bossbar.stormroot {
    left: calc(max(8px, env(safe-area-inset-left)) + (100vw - 92px - env(safe-area-inset-left) - env(safe-area-inset-right)) / 2);
    width: calc(100vw - 92px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }
}
@media (pointer: coarse) and (max-width: 620px) and (max-height: 360px) {
  #bossbar {
    padding: 4px 8px 6px;
  }
  #party-hud {
    width: 104px;
  }
  #party-hud .party-hud-manage {
    padding: 2px;
    font-size: 11px;
  }
  #party-hud .party-hud-members {
    top: 0;
    width: 98px;
    max-height: calc(100dvh - 220px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  #party-hud .party-hud-member {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) and (min-height: 501px) {
  body.first-adventure #journey-card.first-steps {
    top: calc(max(8px, env(safe-area-inset-top)) + var(--phone-map-size) + 50px);
  }
}
@media (max-width: 760px) and (min-height: 501px) and (max-height: 680px) {
  body.first-adventure #journey-card.first-steps {
    top: calc(max(8px, env(safe-area-inset-top)) + var(--phone-map-size) + 8px);
  }
}
@media (pointer: coarse) {
  #bank .bank-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  #bank .bank-collections {
    flex: none;
    min-height: 0;
    overflow: visible;
  }
  #bank .stock {
    max-height: none;
    overflow: visible;
  }
  #bank .bank-pane-switch {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -10px 8px;
    padding: 6px 10px;
    background: #593c26;
    box-shadow: 0 3px 0 rgba(30, 18, 8, 0.35);
  }
  #bank .bank-pane-switch button {
    min-height: 44px;
  }
  #make .opt.rich:has(> .qty) {
    grid-template-columns: 40px minmax(0, 1fr);
    row-gap: 6px;
  }
  #make .opt.rich > .qty {
    grid-column: 1 / -1;
  }
  #make .opt:not(.rich):has(> .qty) {
    flex-wrap: wrap;
  }
  #make .opt:not(.rich) > .qty {
    flex: 1 1 100%;
  }
  #make .opt .qty {
    gap: 6px;
  }
  #make .opt .qty button {
    flex: 1 1 0;
    min-width: 44px;
    min-height: 44px;
    padding: 4px 6px;
    font-size: 13px;
  }
  #journey-card .close::after {
    content: "";
    position: absolute;
    inset: -10px;
  }
  #worldmap {
    width: calc(100vw - 16px - 2 * max(0px, env(safe-area-inset-left) - 8px, env(safe-area-inset-right) - 8px));
  }
  #bank {
    max-width: calc((100vw - 2 * max(0px, env(safe-area-inset-left) - 12px, env(safe-area-inset-right) - 12px)) / var(--ui) - 24px);
  }
}
@media (pointer: coarse) and (min-width: 541px) {
  #bank .bank-collections h4 {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #65462e;
  }
}
@media (pointer: coarse) and (min-height: 501px), (any-pointer: coarse) and (max-width: 760px) and (min-height: 501px) {
  #chat:not(.open) #messages {
    max-width: min(340px, calc(100vw - max(12px, env(safe-area-inset-left)) - max(10px, env(safe-area-inset-right)) - 142px));
  }
}
@media (pointer: coarse) and (max-width: 360px) and (min-height: 501px), (any-pointer: coarse) and (max-width: 360px) and (min-height: 501px) {
  #touch-mount {
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(170px + var(--spell-height) + var(--belt-cell) + env(safe-area-inset-bottom));
  }
}
@media (pointer: coarse) and (max-height: 320px) {
  :root {
    --phone-map-size: min(calc(114px * var(--hud-scale)), calc(100dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    --phone-stick-size: clamp(64px, calc(100dvh - 170px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 80px);
  }
  #minimap {
    width: 100%;
    height: 100%;
  }
  #touch-controls {
    width: 100px;
    height: calc(var(--phone-stick-size) + 52px);
  }
  #move-stick {
    left: calc((100px - var(--phone-stick-size)) / 2);
    width: var(--phone-stick-size);
    height: var(--phone-stick-size);
  }
  #move-stick::before {
    font-size: 64px;
  }
  #move-knob {
    width: calc(var(--phone-stick-size) / 2);
    height: calc(var(--phone-stick-size) / 2);
  }
  #hud {
    max-height: calc((100dvh - var(--phone-stick-size) - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / var(--hud-scale));
  }
  #bars {
    left: calc(174px + env(safe-area-inset-left));
    right: calc(230px + env(safe-area-inset-right));
    bottom: calc(6px + env(safe-area-inset-bottom));
    max-width: none;
  }
  #touch-attack,
  #touch-mount {
    width: 52px;
    height: 46px;
    bottom: calc(6px + env(safe-area-inset-bottom));
    padding: 2px;
    gap: 0;
    font-size: 10px;
  }
  #touch-attack svg,
  #touch-mount svg {
    width: 24px;
    height: 24px;
  }
  #touch-attack {
    right: calc(112px + env(safe-area-inset-right));
  }
  #touch-mount {
    right: calc(172px + env(safe-area-inset-right));
  }
  #chat:not(.open) #messages {
    left: calc(226px + env(safe-area-inset-left));
    right: calc(var(--phone-map-size) + 66px + env(safe-area-inset-right));
    top: calc(8px + env(safe-area-inset-top));
    bottom: auto;
    width: auto;
    max-width: none;
    max-height: 3.9em;
  }
  body.px-bossbar-open #game #chat:not(.open) #messages,
  body:has(#eye-target:not([hidden]):not(.hidden)) #chat:not(.open) #messages {
    display: none;
  }
}
@media (pointer: coarse) and (max-height: 320px) and (max-width: 640px) {
  :root {
    --belt-cell: min(max(44px, calc(46px * var(--hud-scale))), max(44px, calc((100dvh - 108px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / 2)));
  }
  #bars {
    flex-direction: column;
  }
  #foodbar {
    max-width: 100%;
  }
  #hotbar .hslot .spell-icon,
  #foodbar .hslot canvas {
    width: min(calc(36px * var(--hud-scale)), calc(var(--belt-cell) - 8px));
    height: min(calc(36px * var(--hud-scale)), calc(var(--belt-cell) - 8px));
  }
  #chat:not(.open) #messages {
    display: none;
  }
}
@media (pointer: coarse) and (max-height: 320px) {
  #bossbar.beacon .bb-phase,
  #bossbar.stormroot .bb-phase {
    display: none;
  }
  #party-hud {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    width: 132px;
    padding: 4px;
  }
  #party-hud button {
    min-height: 44px;
  }
  #party-hud .party-hud-manage {
    padding: 2px;
    font-size: 11px;
  }
  #party-hud .party-hud-toggle {
    width: 44px;
  }
  #party-hud .party-hud-members {
    left: -2px;
    top: calc(100% + 6px);
    width: 132px;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - env(safe-area-inset-bottom) - 116px);
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  #party-hud .party-hud-member {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
    padding: 3px 5px;
  }
  #party-hud .party-hud-offer {
    position: absolute;
    right: -2px;
    top: calc(100% + 6px);
    width: 132px;
    margin: 0;
  }
  body:has(#party-hud:not([hidden])) #compass {
    top: calc(max(8px, env(safe-area-inset-top)) + 60px);
    width: min(80px, calc(100dvh - max(8px, env(safe-area-inset-top)) - env(safe-area-inset-bottom) - 116px));
    height: min(80px, calc(100dvh - max(8px, env(safe-area-inset-top)) - env(safe-area-inset-bottom) - 116px));
  }
  body:has(#party-hud:not([hidden])) #mm-tools {
    display: none;
  }
  #party-hud .party-hud-members:empty {
    display: none;
  }
  body:has(#party-hud:not([hidden]) .party-hud-toggle:not([hidden])[aria-expanded=true]) #compass,
  body:has(#party-hud:not([hidden]) .party-hud-offer:not([hidden])) #compass {
    visibility: hidden;
  }
}
@media (max-width: 760px), (pointer: coarse) {
  #chat.open.compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  }
  #chat.open.compact #chat-heading {
    grid-column: 2;
    grid-row: 1;
  }
  #chat.open.compact #chat-address {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    margin: 0 4px 0 0;
    flex-wrap: nowrap;
  }
  body #chat.open.compact #chat-tabbar {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    margin-right: 4px;
  }
  #chat.open.compact:has(#chat-address:not([hidden])) #chat-tabbar {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
  }
  #chat.open.compact #chat-tabs {
    display: flex;
    margin: 0;
  }
  #chat.open.compact #messages {
    grid-column: 1 / -1;
    grid-row: 3;
    min-width: 0;
  }
  #chat.open.compact #chat-new {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: end;
    align-self: end;
    z-index: 1;
    margin: 0;
  }
  #chat.open.compact #chatline {
    grid-column: 1 / -1;
    grid-row: 4;
    min-width: 0;
  }
  #chat.open.compact #chat-custom-target {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    margin: 0 4px 0 0;
  }
  #chat.open.compact:has(#chat-custom-target:not([hidden])) #chat-tabbar {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
  }
  #chat.open.compact:has(#chat-custom-target:not([hidden])) #chat-address {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
  }
  #chat.open.compact:has(#chat-custom-target:not([hidden])):has(#chat-address:not([hidden])) #chat-tabbar {
    display: none;
  }
  #chat.open.compact #chat-status {
    grid-column: 1 / -1;
    grid-row: 5;
    margin: 2px 0 0;
  }
  #chat.open.compact.typing:has(#chat-address:not([hidden])) #chat-tabbar,
  #chat.open.compact:has(#chat-status:not([hidden])):has(#chat-address:not([hidden])) #chat-tabbar {
    display: none;
  }
  #chat.open.compact #chat-partners {
    display: none;
  }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) and (min-width: 560px) {
  #side.menu-open #tabs {
    grid-template-columns: repeat(5, 64px);
  }
  #panel {
    top: max(8px, env(safe-area-inset-top));
    width: clamp(360px, calc(100vw - 240px - env(safe-area-inset-left) - env(safe-area-inset-right)), 580px);
    max-height: calc(100dvh - 68px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
  #panel .panel-head {
    min-height: 44px;
  }
  #panel .panel-head .close {
    width: 44px;
    height: 44px;
    min-height: 44px;
    top: 0;
    right: 0;
  }
  #panel .journal-switch {
    margin-bottom: 6px;
  }
  #panel .journal-switch button {
    min-height: 44px;
  }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  #make:is([data-kind=smith], [data-kind=smelt], [data-kind=jewelry], [data-kind=tempering]) {
    width: 620px;
    max-width: calc((100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)) / var(--ui, 1));
    max-height: calc((100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / var(--ui, 1));
  }
}
@media (hover: none), (pointer: coarse) {
  #game[data-pvl-clean-ui=true] #hint {
    display: none !important;
  }
}
@media (pointer: coarse) {
  #game #bank .bank-sort button {
    min-height: calc(44px / var(--ui,1)) !important;
  }
}
@media (pointer: coarse) and (max-width: 600px) {
  #bank .bank-gold-help {
    display: none !important;
  }
}
@media (max-width: 760px) {
  #side:not(.menu-open):has(.friend-request-count:not([hidden])) #btn-menu::after {
    content: attr(data-friend-requests);
    position: absolute;
    right: -6px;
    top: -6px;
    min-width: 19px;
    height: 19px;
    padding: 0 3px;
    box-sizing: border-box;
    border: 1px solid #efc374;
    border-radius: 10px;
    background: #a43e26;
    color: #fff3cd;
    font: 700 12px/17px sans-serif;
    text-align: center;
  }
}
