/* Native widgets keep their original canvases and transparent hit surfaces. */
.native-interface .native-learned-spells {
  position: relative;
  width: 822px;
  height: 230px;
  min-width: 822px;
  padding: 0;
  margin: 0;
  background: none;
  pointer-events: none;
}
.native-interface .native-learned-spells .native-spell-choice {
  position: absolute;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  pointer-events: auto;
}
.native-spell-icon {
  display: block;
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}
.native-spell-hover {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  pointer-events: none;
  visibility: hidden;
}
.native-spell-choice:hover .native-spell-hover,
.native-spell-choice:focus-visible .native-spell-hover {
  visibility: visible;
}
.native-interface .game-panel[data-native-panel="magic"] {
  padding: 0;
  background: none;
  box-shadow: none;
  border: 0;
  pointer-events: none;
}
.native-interface .game-panel[data-native-panel="magic"] .game-panel-close {
  display: none;
}
@media (min-width: 951px) {
  .native-interface .game-panel[data-native-layout] {
    position: fixed;
    inset: auto;
    left: calc(
      (100vw - var(--native-stage-css-width)) / 2 + var(--native-popup-x) *
        var(--native-ui-scale, 1) * 1px
    );
    top: calc(
      (100dvh - var(--native-stage-css-height)) / 2 + var(--native-popup-y) *
        var(--native-ui-scale, 1) * 1px
    );
    width: calc(var(--native-popup-width) * 1px);
    height: calc(var(--native-popup-height) * 1px);
    max-width: none;
    max-height: none;
    margin: 0;
    transform: scale(var(--native-ui-scale, 1));
    transform-origin: top left;
  }
  .native-interface .game-panel[data-native-layout="magic"] {
    overflow: visible;
  }
  .native-interface .game-panel[data-native-panel="magic"] .game-panel-content {
    width: calc(var(--native-popup-width, 822) * 1px);
    height: 230px;
    max-height: none;
    overflow: visible;
  }
}
.native-interface .game-panel .game-panel-close {
  display: none;
}
/* Touch-only web escape. It is fixed to the viewport so neither the original
   wide canvas nor a scrolled dialog can move the close target out of reach.
   Reserve the first row for the independent map/hunting launchers (z45): a
   child z-index cannot escape its native window's intentionally lower stack.
   No source image, frame, source RECT or desktop window layout is changed. */
@media (max-width: 950px) {
  .native-interface #game-panel-close,
  .native-interface .game-panel[data-native-window] .game-panel-close {
    display: grid;
    place-items: center;
    position: fixed;
    inset: calc(max(6px, env(safe-area-inset-top)) + 90px)
      max(6px, env(safe-area-inset-right)) auto auto;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    border: 1px solid #b8a276;
    border-radius: 50%;
    background: #171710ed;
    color: #f3e4ba;
    font: 26px/1 sans-serif;
    box-shadow: 0 2px 6px #0008;
    z-index: 6;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .native-interface #game-panel-close:hover,
  .native-interface .game-panel[data-native-window] .game-panel-close:hover {
    background: #352c1fed;
  }
  .native-interface #game-panel-close:active,
  .native-interface .game-panel[data-native-window] .game-panel-close:active {
    background: #51412bed;
  }
}
/* Short landscape hides the separate portal strip. Keep the touch escape
   below the44px toolbar/launcher row and above the lower action controls. */
@media (max-width: 950px) and (max-height: 430px) and (orientation: landscape) {
  .native-interface #game-panel-close,
  .native-interface .game-panel[data-native-window] .game-panel-close {
    top: calc(max(6px, env(safe-area-inset-top)) + 58px);
  }
}
.native-interface .game-panel {
  /* Nonmodal dialog.show() otherwise uses the UA's absolute static position.
     Centre only the outer browser placement; source canvases never reflow. */
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  background: transparent;
  box-shadow: none;
}
.native-interface .native-character-sheet {
  background: transparent;
}
.native-window-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}
.native-menu-window {
  position: relative;
  width: 455px;
  height: 334px;
}
.native-interface .original-help {
  width: 455px;
  height: 428px;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
.native-window-title,
.native-menu-table,
.native-shop-list-frame {
  position: absolute;
  pointer-events: none;
  image-rendering: pixelated;
}
.native-window-heading {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d2d2c8;
  font:
    20px/1 "DotumChe",
    "돋움체",
    monospace;
  text-shadow: 2px 2px #0a0a0a;
  pointer-events: none;
}
.native-interface .native-source-button,
.native-quantity-dialog .native-source-button,
.native-message-dialog .native-source-button {
  position: absolute;
  display: block;
  padding: 0;
  margin: 0;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #d2d2c8;
  overflow: visible;
  font:
    12px/1 "DotumChe",
    "돋움체",
    monospace;
  cursor: pointer;
}
.native-source-button .native-button-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}
.native-source-button .native-button-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-shadow: 2px 2px #0a0a0a;
  pointer-events: none;
}
.native-source-button[data-native-button-subtype="0"] {
  color: #bebe8c;
}
.native-source-button[data-native-button-subtype="0"] .native-button-label {
  left: -10px;
  right: -10px;
  bottom: 4px;
  align-items: flex-end;
}
.native-interface .native-source-button[data-native-button-subtype="0"]:hover {
  color: #dcdc96;
}
.native-interface .native-source-button[data-native-button-subtype="0"]:active {
  color: #969664;
}
.native-source-button[data-native-button-subtype="0"]:active
  .native-button-label {
  bottom: 2px;
}
.native-source-button[data-native-button-subtype="1"] .native-button-label {
  top: -12px;
  bottom: 0;
  left: -10px;
  right: -10px;
}
.native-source-button[data-native-button-subtype="1"]:hover
  .native-button-label {
  top: -14px;
}
.native-source-button[data-native-button-subtype="1"]:active
  .native-button-label {
  top: -10px;
}
.native-source-button[data-native-button-subtype="1"]:active {
  color: #969678;
}
.native-interface .native-source-button:hover,
.native-message-dialog .native-source-button:hover,
.native-quantity-dialog .native-source-button:hover {
  background: none;
  border: 0;
  color: #fafafa;
}
.native-interface .native-source-text {
  font-size: 20px;
}
.native-source-text .native-button-label {
  top: -12px;
  bottom: 0;
  left: -10px;
  right: -10px;
}
.native-source-text:hover .native-button-label {
  top: -14px;
  bottom: 0;
}
.native-source-text:active .native-button-label {
  top: -10px;
  bottom: 0;
  color: #969678;
}
.native-quantity-dialog,
.native-message-dialog {
  width: 305px;
  height: 198px;
  min-width: 305px;
  min-height: 198px;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  overflow: visible;
  box-shadow: none;
  position: fixed;
  color: #c0e0ff;
  font:
    12px/1.4 "DotumChe",
    "돋움체",
    monospace;
}
.native-message-dialog::backdrop,
.native-quantity-dialog::backdrop {
  background: transparent;
}
.native-quantity-title,
.native-message-title,
.native-message-copy {
  position: absolute;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.native-message-title {
  color: #fff;
}
.native-message-copy {
  color: #c0e0ff;
}
.native-quantity-input {
  position: absolute;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid #aaa;
  outline: 0;
  background: #000;
  color: #c0e0ff;
  font:
    12px/12px "DotumChe",
    "돋움체",
    monospace;
  box-sizing: content-box;
}
.native-interface .native-sheet-items {
  display: block;
  position: absolute;
  left: 34px;
  top: 234px;
  width: 388px;
  height: 190px;
  overflow: hidden;
}
.native-interface .native-sheet-items[hidden],
.native-interface .native-sheet-wide-items[hidden] {
  display: none;
}
.native-sheet-wide-items {
  position: absolute;
  left: 34px;
  top: 234px;
  width: 388px;
  height: 190px;
  overflow: hidden;
}
.native-interface .game-panel-content .native-wide-item,
.native-interface .game-panel-content .native-inventory-mode {
  position: absolute;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.native-wide-item img {
  position: absolute;
  image-rendering: pixelated;
}
.native-interface .game-panel-content .native-wide-item:hover,
.native-interface .game-panel-content .native-inventory-mode:hover {
  background: none;
}
.native-interface .game-panel-content .native-item-slot {
  position: absolute;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}
.native-interface .game-panel-content .native-item-slot:hover {
  background: none;
}
.native-interface .native-item-slot img.native-inventory-icon {
  width: 32px;
  height: 32px;
  object-fit: fill;
}
.native-interface .native-item-slot img.native-inventory-digit {
  position: absolute;
  width: 8px;
  height: 12px;
}
.native-paperdoll {
  position: absolute;
  left: 0;
  top: 0;
  width: 148px;
  height: 228px;
  overflow: hidden;
}
.native-paperdoll-layer {
  position: absolute;
  max-width: none;
  image-rendering: pixelated;
}
.native-interface .game-panel-content .native-stat-plus {
  position: absolute;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.native-stat-plus-art {
  width: 48px;
  height: 32px;
  image-rendering: pixelated;
}
.native-interface .native-store-window {
  position: relative;
  width: 455px;
  height: 334px;
  margin: 0;
  padding: 0;
  background: none;
}
.native-shop-text-list {
  position: absolute;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: auto;
  scrollbar-color: #716649 #15120e;
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    calc(100% - 17px) 100%,
    calc(100% - 17px) 130px,
    0 130px
  );
}
.native-shop-text-list::-webkit-scrollbar {
  width: 17px;
}
.native-shop-text-list::-webkit-scrollbar-track {
  background: #15120e;
}
.native-shop-text-list::-webkit-scrollbar-thumb {
  border: 2px outset #8e835e;
  background: #514931;
}
.native-interface .native-shop-text-row {
  display: flex;
  width: 278px;
  height: 13px;
  min-height: 13px;
  padding: 0;
  margin: 0;
  line-height: 13px;
  border: 0;
  background: none;
  box-shadow: none;
  color: #d2d2c8;
  text-align: left;
  font:
    12px/13px "DotumChe",
    "돋움체",
    monospace;
}
.native-interface .native-shop-text-row:hover {
  background: none;
  color: #7fff7f;
  text-shadow: 1px 1px #000;
}
.native-shop-item-name {
  width: 141px;
  overflow: hidden;
  white-space: nowrap;
}
.native-shop-price {
  width: 61px;
  text-align: right;
}
.native-shop-status {
  margin-left: 6px;
  white-space: nowrap;
}
@media (max-width: 950px) {
  .native-interface .game-panel[data-native-panel="magic"] .game-panel-content {
    pointer-events: auto;
    overflow: auto;
  }
}
