html, body { overscroll-behavior: none; }
.pauseMenuIcon, .pauseBtn span { display: block; }
.pauseMenuIcon {
  width: 15px; height: 12px; border-block: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}
.pauseBtn span { font: 600 12px/1 system-ui, sans-serif; }
@media (pointer: fine) {
  #hud .pauseBtn span, #hud .pauseMenuIcon { display: none; }
  #hud .pauseBtn::before { content: 'Ⅱ'; }
}
@media (pointer: coarse) {
  #hud .pauseBtn {
    width: auto; min-width: 44px; height: 44px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: #191814e8; border: 1px solid #c8b28b; border-radius: 7px;
  }
  body:not([data-state="play"]) #hud .pauseBtn { visibility: hidden; }
  #world, #stick, #touch button, #hud .pauseBtn { touch-action: none; }
  #touchMoves {
    --primary: clamp(55px, calc(16 * var(--game-vh)), 72px);
    --secondary: clamp(44px, calc(12 * var(--game-vh)), 54px);
    --key-gap: 8px;
    display: grid; justify-items: end;
    grid-template: var(--secondary) var(--primary) / repeat(2, var(--primary));
    gap: var(--key-gap); width: auto; height: auto;
    right: calc(var(--right) + clamp(5px, calc(2 * var(--game-vw)), 16px));
    bottom: calc(var(--bottom) + 12px);
  }
  #touchMoves button { position: static; width: var(--secondary); height: var(--secondary); }
  #touchMoves [data-action="jump"] { grid-area: 1 / 1; }
  #touchMoves [data-action="dodge"] { grid-area: 1 / 2; }
  #touchMoves [data-action="guard"] { grid-area: 2 / 1; background: #2c3540e6; border-color: #a9c4d4; }
  #touchMoves [data-action="attack"] { grid-area: 2 / 2; background: #513629e6; border-color: #ffe2a8; }
  #touchMoves :is([data-action="attack"], [data-action="guard"]) {
    width: var(--primary); height: var(--primary); font-weight: 700;
  }
  #touchMoves button.pressed { background: #a08246; border-color: #ffe5a9; }
  #touchItems { gap: 8px; }
}
@media (pointer: coarse) and (orientation: landscape) {
  body[data-host-immersive] .bossHud { top: calc(var(--top) + 48px); }
}
@media (pointer: coarse) and (orientation: portrait) {
  body[data-host-immersive] .playerHud { left: calc(var(--left) + 48px); }
}

.touchResource { display: none; }
@media (pointer: coarse) {
  .touchResource {
    position: absolute;
    right: calc(var(--right) + 8px);
    top: calc(var(--top) + 52px);
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 3px 6px;
    color: #f3e4c4;
    background: #181a16cd;
    border-radius: 4px;
    font: 500 11px/1.2 system-ui, sans-serif;
    pointer-events: none;
  }
}
