.mobile-controls {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.mobile-controls[hidden] {
  display: none !important;
}
html[data-mobile-controls="true"] .mobile-controls {
  display: block;
}
.thumbstick {
  --thumb-x: 0px;
  --thumb-y: 0px;
  position: absolute;
  bottom: calc(var(--controls-height, 160px) + 14px);
  width: 116px;
  height: 116px;
  padding: 0;
  border: 2px solid #a38b5ca8;
  border-radius: 50%;
  color: #f1deaf;
  background: radial-gradient(
    circle,
    #31483bd9 0 43%,
    #162921c9 44% 64%,
    #786441a8 65% 68%,
    #192c24d9 69%
  );
  box-shadow:
    inset 0 0 0 5px #101c1866,
    0 3px 12px #0005;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: contain;
  outline-offset: 3px;
}
.movement-thumbstick {
  left: max(14px, env(safe-area-inset-left));
}
.attack-thumbstick {
  right: max(14px, env(safe-area-inset-right));
  background: radial-gradient(
    circle,
    #514638d9 0 43%,
    #2a241fc9 44% 64%,
    #99794ca8 65% 68%,
    #302b23d9 69%
  );
}
.thumbstick:before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  opacity: 0.45;
  background:
    linear-gradient(0deg, transparent 49%, #d7c28c 49% 51%, transparent 51%),
    linear-gradient(90deg, transparent 49%, #d7c28c 49% 51%, transparent 51%);
  pointer-events: none;
}
.thumbstick:after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed #d6bf8b66;
  border-radius: 50%;
  transform: rotate(45deg);
  pointer-events: none;
}
.thumbstick-knob {
  position: absolute;
  left: calc(50% - 22px);
  top: calc(50% - 22px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  transform: translate(var(--thumb-x), var(--thumb-y));
  border: 2px solid #b9a16e;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #657258, #263e30 80%);
  box-shadow:
    inset 0 0 0 3px #14251d88,
    0 2px 8px #0008;
  font: 23px Georgia;
  pointer-events: none;
}
.attack-thumbstick .thumbstick-knob {
  background: radial-gradient(circle at 36% 30%, #99805c, #4a3727 80%);
}
.thumbstick[data-active="true"] {
  border-color: #e3cb8c;
}
.thumbstick-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  font:
    10px Georgia,
    serif;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}
.thumbstick:disabled {
  opacity: 0.4;
}
html[data-mobile-controls="true"] .chat-window {
  bottom: calc(var(--controls-height, 160px) + 144px);
  max-height: 130px;
}
html[data-mobile-controls="true"] #combat-block.offhand-control {
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(var(--controls-height, 160px) + 140px);
  min-height: 40px;
}
@media (min-width: 761px) {
  html[data-mobile-controls="true"] .thumbstick {
    bottom: max(18px, env(safe-area-inset-bottom));
  }
  html[data-mobile-controls="true"] .chat-window {
    bottom: calc(var(--controls-height, 100px) + 18px);
  }
  html[data-mobile-controls="true"] #combat-block.offhand-control {
    bottom: 146px;
  }
}
@media (max-width: 360px), (max-height: 420px) {
  .thumbstick {
    width: 100px;
    height: 100px;
  }
  .thumbstick-knob {
    width: 40px;
    height: 40px;
    left: calc(50% - 20px);
    top: calc(50% - 20px);
  }
  html[data-mobile-controls="true"] .chat-window {
    max-height: 94px;
  }
  html[data-mobile-controls="true"] #combat-block.offhand-control {
    bottom: calc(var(--controls-height, 160px) + 124px);
  }
}
html[data-mobile-controls="true"] #gameCanvas {
  bottom: calc(var(--controls-height, 100px) + 12px);
  height: max(
    1px,
    calc(
      100% - var(--topline-height, 50px) - var(--controls-height, 100px) - 12px
    )
  );
}
html[data-mobile-controls="true"] .world-card {
  top: calc(var(--topline-height, 50px) + 10px);
  left: 12px;
  transform: none;
  max-height: max(
    84px,
    calc(
      100% - var(--topline-height, 50px) - var(--controls-height, 100px) - 150px
    )
  );
}
/* Keep the landscape dock between the two thumbs, with real touch targets. */
@media (min-width: 761px) {
  html[data-mobile-controls="true"] .game-toolbar.blood-hud {
    flex: 0 0 auto;
    width: calc(100% - 260px);
    height: 100px;
    aspect-ratio: auto;
    transform: none;
    zoom: 1;
    background: #24190fe8;
    border: 1px solid #97794d;
    overflow: visible;
  }
  html[data-mobile-controls="true"] .blood-hud .hud-art {
    opacity: 0.35;
  }
  html[data-mobile-controls="true"] .blood-hud .blood-vessel {
    left: 10px;
    top: 22px;
    width: 30px;
    height: 42px;
  }
  html[data-mobile-controls="true"] .blood-hud .blood-mouth {
    display: none;
  }
  html[data-mobile-controls="true"] .blood-hud #hud-health-value {
    left: 4px;
    top: 0;
    width: 44px;
    padding: 1px;
    font-size: 12px;
  }
  html[data-mobile-controls="true"] .blood-hud #stamina,
  html[data-mobile-controls="true"] .blood-hud #mana {
    left: 55px;
    width: 40%;
    height: 7px;
  }
  html[data-mobile-controls="true"] .blood-hud #stamina {
    top: 15px;
  }
  html[data-mobile-controls="true"] .blood-hud #mana {
    top: 29px;
  }
  html[data-mobile-controls="true"] .blood-hud label[for="stamina"],
  html[data-mobile-controls="true"] .blood-hud label[for="mana"] {
    left: 55px;
    width: 40%;
    height: 9px;
  }
  html[data-mobile-controls="true"] .blood-hud label[for="stamina"] {
    top: 14px;
  }
  html[data-mobile-controls="true"] .blood-hud label[for="mana"] {
    top: 28px;
  }
  html[data-mobile-controls="true"] .blood-hud label span {
    font-size: 7px;
  }
  html[data-mobile-controls="true"] .blood-hud #hotbar {
    left: 55px;
    top: 43px;
    width: calc(100% - 65px);
    height: 28px;
    gap: 3px;
  }
  html[data-mobile-controls="true"] .blood-hud #hotbar .attack-slot {
    border: 1px solid #a48a58;
    background: #1a170ee8;
  }
  html[data-mobile-controls="true"] .blood-hud #hotbar kbd {
    display: none;
  }
  html[data-mobile-controls="true"] .blood-hud .panel-buttons button {
    top: 77px;
    width: 22%;
    height: 21px;
    padding: 0;
    align-items: center;
    font-size: 10px;
    background: #291c11;
    border: 1px solid #8f7549;
    border-radius: 2px;
  }
  html[data-mobile-controls="true"] .blood-hud #open-inventory {
    left: 2%;
  }
  html[data-mobile-controls="true"] .blood-hud #open-skills {
    left: 26.5%;
  }
  html[data-mobile-controls="true"] .blood-hud #open-equipment {
    left: 51%;
  }
  html[data-mobile-controls="true"] .blood-hud #open-quests {
    left: 75.5%;
  }
  html[data-mobile-controls="true"] .blood-hud #combat-status {
    left: 0;
    top: -20px;
    width: 100%;
    height: auto;
    font-size: 9px;
    background: #17271ed9;
  }
  html[data-mobile-controls="true"] .blood-hud .hud-player-xp {
    left: 55px;
    top: 1px;
    width: 40%;
    height: 8px;
  }
  html[data-mobile-controls="true"] .blood-hud .hud-player-xp-text {
    left: 56px;
    top: 1px;
    height: 8px;
    font-size: 7px;
  }
  html[data-mobile-controls="true"] .blood-hud .gold-hud {
    left: auto;
    right: 6px;
    top: 24px;
    width: 30%;
    height: 12px;
    font-size: 9px;
  }
  html[data-mobile-controls="true"] .blood-hud .gold-coin {
    width: 12px;
    height: 12px;
    flex-basis: 12px;
  }
  html[data-mobile-controls="true"] .blood-hud .attack-tray-toggle {
    left: auto;
    right: 6px;
    top: 1px;
    bottom: auto;
    font-size: 9px;
    padding: 3px 7px;
  }
  html[data-mobile-controls="true"] .blood-hud .attack-tray {
    left: 0;
    width: 100%;
    bottom: 105px;
    max-height: 55vh;
    overflow: auto;
  }
}
