* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
:root {
  font-family: "Malgun Gothic", "맑은 고딕", serif;
  color: #ded8c5;
  background: #0b100d;
  font-synthesis: none;
  --gold: #c4a56a;
  --edge: #665a3c;
  --panel: #171e17;
  --muted: #9aa38b;
}
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 50% 0, #293024, #10160f 60%, #090e0b);
  color: #ded8c5;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  color: #e5ddc4;
  border: 1px solid #776441;
  background: linear-gradient(#39402f, #1b2419);
  padding: 7px 11px;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
}
button:hover {
  border-color: #d6b36d;
  background: linear-gradient(#53573c, #293322);
  color: #fff0c3;
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #edca80;
  outline-offset: 2px;
}
a {
  color: #c1b18b;
  text-decoration: none;
}
input,
select {
  background: #0b120d;
  border: 1px solid #5d644a;
  color: #f0e6cb;
  padding: 7px 9px;
  min-width: 0;
  border-radius: 2px;
}
select {
  cursor: pointer;
}
input[type="number"] {
  width: 72px;
}
.page-header {
  max-width: 1600px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 61px;
  padding: 8px 20px;
  font-size: 12px;
}
.page-header h1 {
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 8px;
  margin: 0 auto;
  color: #e3d4aa;
  text-shadow: 0 2px 4px #000;
}
.build-label {
  border: 1px solid #635536;
  padding: 4px 7px;
  color: #b9aa82;
  font-size: 11px;
}
main {
  max-width: 1600px;
  margin: auto;
  padding: 0 16px 15px;
}
#login {
  max-width: 1010px;
  margin: 36px auto;
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(270px, 1fr);
  background: #192017;
  border: 1px solid #685b3d;
  box-shadow: 0 12px 70px #000b;
}
.login-art {
  position: relative;
  display: flex;
  align-items: center;
  background: #141911;
  overflow: hidden;
}
.login-art img {
  display: block;
  width: 100%;
  image-rendering: pixelated;
}
.login-caption {
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  text-align: center;
  letter-spacing: 5px;
  font-size: 12px;
  color: #d7bf8b;
  text-shadow: 0 2px 5px #000;
}
.auth-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  border-left: 1px solid #625434;
}
.auth-panel h2 {
  font-size: 21px;
  font-weight: 400;
  color: #d9be84;
  margin: 7px 0 0;
}
.auth-panel p {
  font-size: 12px;
  color: #a9b49a;
  line-height: 1.7;
  margin: 0;
}
.auth-panel label {
  font-size: 12px;
  display: grid;
  gap: 5px;
}
.auth-panel input {
  height: 39px;
}
.auth-tabs {
  display: flex;
  gap: 5px;
}
.auth-tabs button {
  flex: 1;
  font-size: 11px;
  padding: 7px 5px;
}
.auth-tabs .active {
  color: #e8c682;
  border-color: #c3a362;
  background: #48452a;
}
.primary {
  background: linear-gradient(#887044, #55472b);
  border-color: #c3a56b;
  padding: 11px;
}
.auth-panel small {
  font-size: 11px;
  line-height: 1.8;
  color: #899980;
}
.auth-panel #auth-error {
  color: #e8a18a;
  min-height: 18px;
}
.game-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 7px 11px;
  background: linear-gradient(#252d20, #161d14);
  border: 1px solid #736141;
  font-size: 12px;
}
.location {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-right: auto;
}
.location b {
  font-weight: 500;
  color: #e8d5a3;
}
#coordinates {
  font-size: 11px;
  color: #9daa8c;
}
#connection {
  font-size: 11px;
  color: #b7caa4;
  white-space: nowrap;
}
.compact-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #aab599;
  font-size: 11px;
}
.compact-label select {
  font-size: 11px;
  padding: 3px 5px;
}
.game-toolbar button {
  font-size: 11px;
  padding: 5px 8px;
}
.game-shell {
  border: 1px solid #77603c;
  border-top: 0;
  box-shadow: 0 14px 55px #0008;
  background: #0c130c;
}
.stage {
  position: relative;
  height: clamp(450px, calc(100svh - 255px), 900px);
  min-width: 0;
  background: #10190c;
  overflow: hidden;
  isolation: isolate;
}
#world {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: 0;
  image-rendering: pixelated;
}
.loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #11180ff2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  color: #d9c18b;
  font-size: 13px;
}
.loader-mark {
  font-family: serif;
  font-size: 62px;
  color: #9b865d;
}
.vitals {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 207px;
  background: linear-gradient(120deg, #10190fe8, #182013c9);
  border: 1px solid #8c794d;
  box-shadow: 0 2px 12px #0007;
  padding: 9px 11px;
  pointer-events: none;
  font-size: 11px;
  text-shadow: 0 1px #000;
}
.vitals-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #f0dca3;
}
.vitals-name > span {
  font-size: 13px;
}
.vitals-name button {
  pointer-events: auto;
  font-size: 10px;
  padding: 1px 5px;
  border-color: #7b724c;
}
.vitals label {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 19px;
  white-space: nowrap;
}
.vitals output {
  width: 34px;
  text-align: right;
  font-size: 10px;
}
meter {
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 7px;
  background: #242c20;
  border: 0;
}
meter::-webkit-meter-bar {
  background: #252b1e;
  border: 0;
  border-radius: 0;
}
meter::-webkit-meter-optimum-value {
  background: linear-gradient(90deg, #782e25, #d1664c);
  border-radius: 0;
}
#stamina::-webkit-meter-optimum-value {
  background: linear-gradient(90deg, #8b7732, #d8bf66);
}
#inner::-webkit-meter-optimum-value {
  background: linear-gradient(90deg, #30598d, #71a4cf);
}
.vitals-foot {
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #b7bd9c;
}
.world-overview {
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  gap: 3px;
  background: #0c130dbb;
  border: 1px solid #7a6f49;
  padding: 4px;
  pointer-events: none;
}
.world-overview canvas {
  width: 160px;
  height: 120px;
  image-rendering: pixelated;
}
.world-overview span {
  font-size: 12px;
  color: #a1b18e;
  text-align: right;
}
.target-card {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: #10180fe8;
  border: 1px solid #958455;
  width: 220px;
  padding: 7px 10px;
  text-align: center;
  font-size: 12px;
  z-index: 3;
}
.target-card meter {
  display: block;
  width: 100%;
  margin: 5px 0;
}
.target-card div {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.target-card button {
  font-size: 10px;
  padding: 2px 8px;
}
.toast {
  position: absolute;
  top: 32%;
  left: 18%;
  right: 18%;
  text-align: center;
  color: #ffe5a4;
  font-size: 14px;
  text-shadow:
    0 1px 4px #000,
    0 1px 5px #000;
  pointer-events: none;
  z-index: 8;
}
.quick-skills {
  position: absolute;
  bottom: 13px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid #b0975a66;
  background: #0b120b99;
  z-index: 3;
}
.quick-skill {
  position: relative;
  width: 52px;
  height: 52px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #7e754e;
  background: #1c2918d9;
}
.quick-skill .hotkey {
  position: absolute;
  left: 3px;
  top: 1px;
  z-index: 1;
  font-size: 10px;
  text-shadow: 0 1px 2px #000;
  color: #f6e5b9;
}
.quick-skill .skill-label {
  position: absolute;
  bottom: 1px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 8px;
  background: #10180cb8;
  padding: 1px;
  overflow: hidden;
  white-space: nowrap;
}
.quick-skill.active {
  border-color: #ffe09a;
  box-shadow: 0 0 8px #b8a25c66;
}
.quick-skill.on-cooldown {
  filter: brightness(0.55);
}
.hud-shell {
  min-height: 118px;
  display: grid;
  grid-template-columns: 205px minmax(200px, 1fr) 280px;
  gap: 12px;
  padding: 10px 12px;
  background: #151c12 url("assets/ui/forms/Client.exe/TFRMBOTTOM-000352.png")
    center/auto 100% no-repeat;
  border-top: 2px ridge #9b865b;
}
.hud-left {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: center;
  gap: 5px;
}
.hud-left button {
  font-size: 11px;
  padding: 7px 3px;
  background: #1b2416e8;
}
.hud-left #pickup {
  grid-column: 1/-1;
  padding: 4px;
}
.hud-left button[aria-pressed="true"] {
  color: #ffb78d;
  border-color: #c66f4a;
}
.chat {
  display: grid;
  grid-template-rows: minmax(45px, 1fr) 30px;
  min-width: 0;
  max-height: 100px;
}
.chat ol {
  list-style: none;
  padding: 3px 7px;
  margin: 0;
  background: #070d0799;
  overflow: auto;
  color: #d0d8be;
  font-size: 11px;
  scrollbar-width: thin;
}
.chat li {
  padding: 1px 0;
  overflow-wrap: anywhere;
  text-shadow: 0 1px #000;
}
.chat li.shout {
  color: #edda91;
}
.chat form {
  display: flex;
  min-width: 0;
  border: 1px solid #6d704b;
  background: #0a120ae8;
}
.chat input {
  flex: 1;
  width: 0;
  border: 0;
  background: transparent;
  padding: 4px 7px;
  font-size: 12px;
}
.chat button {
  font-size: 11px;
  border: 0;
  background: #39432b;
  padding: 4px 8px;
}
.native-menu {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  align-items: center;
}
.native-menu button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  height: 71px;
  font-size: 10px;
  background: linear-gradient(#3c3923ee, #1e2418ee);
  border: 1px ridge #b49a5a;
}
.native-menu span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: serif;
  font-size: 24px;
  color: #d9b46d;
  text-shadow: 0 1px #000;
  width: 34px;
  height: 35px;
  border: 1px solid #746445;
  background: radial-gradient(#48452b, #222b1b);
}
.native-menu button.active {
  border-color: #ffe1a5;
  color: #ffe2a0;
}
.game-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #675b3c;
  border-top: 0;
  background: #181f14;
  padding: 7px 10px;
  color: #a8b394;
  font-size: 11px;
  min-height: 36px;
}
.game-footer > span:first-child {
  margin-right: auto;
}
.game-footer button {
  font-size: 10px;
  padding: 4px 7px;
}
.game-footer a {
  font-size: 10px;
  white-space: nowrap;
}
.provenance {
  font-size: 11px;
  line-height: 1.8;
  color: #8e9d80;
  padding: 9px 4px;
}
.provenance summary {
  cursor: pointer;
}
.provenance p {
  max-width: 950px;
}
.drawer {
  position: absolute;
  right: 9px;
  top: 9px;
  bottom: 9px;
  width: min(380px, calc(100% - 18px));
  z-index: 7;
  background: linear-gradient(140deg, #242c20fa, #111b12fa);
  border: 2px ridge #b09b63;
  box-shadow: 0 5px 28px #000b;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  font-size: 12px;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #675d3e;
  background: linear-gradient(#3e422c, #242e1d);
  padding: 8px 12px;
}
.drawer-header h2 {
  font-weight: 400;
  color: #f0d7a0;
  font-size: 16px;
  letter-spacing: 2px;
  margin: 0;
}
.drawer-header button {
  padding: 0 6px;
  font-size: 22px;
  background: none;
  border: 0;
}
.drawer #drawer-content {
  padding: 12px;
  overflow: auto;
  scrollbar-width: thin;
}
.drawer p {
  line-height: 1.6;
  margin: 5px 0 12px;
}
.drawer .note {
  font-size: 10px;
  color: #929f83;
  line-height: 1.7;
}
.panel-tabs {
  display: flex;
  gap: 5px;
  margin: 0 0 10px;
  flex-wrap: wrap;
}
.panel-tabs button {
  font-size: 10px;
  padding: 4px 8px;
}
.panel-tabs .active {
  color: #ffdc99;
  border-color: #c4a56a;
}
.section-title {
  font-size: 12px;
  color: #d2be8d;
  margin: 15px 0 7px;
  font-weight: 400;
}
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.item-slot {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  padding: 2px;
  background: linear-gradient(135deg, #202e1b, #0b150c);
  border: 1px ridge #777452;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.item-slot.empty {
  opacity: 0.55;
}
.item-slot.selected {
  border-color: #ffdf90;
  box-shadow: inset 0 0 10px #c7ab6044;
}
.item-slot .count {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 10px;
  color: #f5e7b7;
  text-shadow: 0 1px #000;
}
.item-slot .slot-number {
  position: absolute;
  left: 2px;
  top: 0;
  font-size: 8px;
  color: #7b8c6c;
}
.item-icon {
  display: block;
  image-rendering: pixelated;
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
}
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.equipment-slot {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 3px;
  min-height: 42px;
  white-space: normal;
  background: #182414;
}
.equipment-slot .item-icon {
  width: 30px !important;
  height: 30px !important;
  flex-shrink: 0;
}
.equipment-slot .slot-caption {
  line-height: 1.4;
  text-align: left;
}
.avatar-preview {
  width: 100px;
  height: 140px;
  display: block;
  margin: 0 auto;
  background: radial-gradient(#343e26, #121b12);
  border: 1px solid #5e6341;
  image-rendering: pixelated;
}
.paperdoll-row {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  margin-bottom: 10px;
}
.item-detail {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #676445;
  background: #101a10;
  min-height: 90px;
}
.item-detail h3 {
  font-weight: 400;
  font-size: 14px;
  color: #e2c88d;
  margin: 0 0 5px;
}
.item-detail p {
  font-size: 11px;
  margin: 3px 0 7px;
  color: #aeb99b;
}
.item-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}
.item-actions button {
  font-size: 10px;
  padding: 5px 7px;
}
.item-actions label {
  font-size: 10px;
}
.item-actions input {
  padding: 4px;
  font-size: 11px;
  width: 52px;
}
.empty-hint {
  font-size: 11px;
  line-height: 1.8;
  color: #9aa88c;
}
.skill-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.skill-cell {
  position: relative;
  aspect-ratio: 1.1;
  min-width: 0;
  padding: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  background: #172313;
  border: 1px ridge #78754e;
}
.skill-cell canvas {
  width: 34px !important;
  height: 34px !important;
}
.skill-cell.active {
  border-color: #f5d188;
}
.skill-cell.locked {
  opacity: 0.48;
}
.skill-cell .mastery {
  font-size: 8px;
  color: #adba93;
}
.skill-cell .cell-name {
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  max-width: 100%;
  max-height: 22px;
}
.bindings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin: 10px 0;
}
.bindings button {
  font-size: 10px;
  padding: 5px;
}
.bindings .active {
  border-color: #e9c776;
  color: #f6dda5;
}
.stat-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  margin: 8px 0;
  font-size: 12px;
}
.stat-list dd {
  margin: 0;
  color: #e9d29d;
  text-align: right;
}
.body-gauges {
  display: grid;
  gap: 6px;
}
.body-gauges label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.body-gauges output {
  width: 28px;
  text-align: right;
}
.attribute-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #4f573d55;
  padding: 6px 0;
  font-size: 11px;
}
.attribute-row button {
  padding: 1px 7px;
  font-size: 12px;
}
.profession-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.profession-grid button {
  font-size: 11px;
  white-space: normal;
  text-align: left;
  line-height: 1.6;
}
.profession-grid .active {
  border-color: #e2c381;
}
.recipe {
  padding: 9px 0;
  border-bottom: 1px solid #61634466;
  font-size: 11px;
}
.recipe p {
  margin: 4px 0 7px;
}
.recipe button {
  font-size: 10px;
  padding: 4px 8px;
}
.recipe-head {
  display: flex;
  gap: 6px;
  align-items: center;
}
.recipe-head canvas {
  width: 34px !important;
  height: 34px !important;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.shop-item {
  min-width: 0;
  padding: 5px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  white-space: normal;
  line-height: 1.3;
}
.shop-item canvas {
  width: 42px !important;
  height: 42px !important;
}
.shop-item.selected {
  border-color: #e2c17b;
}
.shop-item .price {
  color: #d7c28d;
  font-size: 10px;
}
.character-list {
  display: grid;
  gap: 7px;
}
.character-card {
  border: 1px solid #62674b;
  background: #101b11;
  padding: 9px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.character-card.active {
  border-color: #d2b572;
}
.character-card.deleted {
  opacity: 0.6;
}
.character-card canvas {
  width: 60px;
  height: 85px;
  image-rendering: pixelated;
}
.character-card h3 {
  font-size: 12px;
  color: #e6d09a;
  margin: 0 0 3px;
  font-weight: 400;
}
.character-card small {
  font-size: 10px;
  color: #97a587;
  display: block;
  margin: 3px 0;
}
.character-card button {
  font-size: 10px;
  padding: 4px 6px;
}
.character-card .row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.panel-form {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.panel-form label {
  display: grid;
  gap: 4px;
  font-size: 11px;
}
.panel-form button {
  font-size: 11px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  font-size: 11px;
}
.setting-row select {
  font-size: 11px;
  max-width: 170px;
}
.world-card {
  border-bottom: 1px solid #576041;
  padding: 9px 0;
}
.world-card h3 {
  font-size: 13px;
  font-weight: 400;
  color: #d9c08e;
  margin: 0 0 5px;
}
.world-card small {
  font-size: 10px;
  color: #9aaa89;
}
.world-card button {
  font-size: 10px;
  margin: 3px;
  padding: 4px 6px;
}
.joystick,
.touch-actions {
  display: none;
}
.joystick {
  position: absolute;
  left: 22px;
  bottom: 30px;
  width: 100px;
  height: 100px;
  border: 1px solid #c8d4ad88;
  border-radius: 50%;
  background: #1d2b1666;
  touch-action: none;
  z-index: 4;
}
.joystick span {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  position: absolute;
  left: 30px;
  top: 30px;
  background: #879b6b99;
  border: 1px solid #d1ddbaa0;
  pointer-events: none;
}
.touch-actions {
  position: absolute;
  right: 16px;
  bottom: 24px;
  gap: 6px;
  align-items: flex-end;
  z-index: 4;
}
.touch-actions button {
  border-radius: 50%;
  width: 62px;
  height: 62px;
  font-size: 11px;
  padding: 4px;
  background: #27391bd4;
  white-space: normal;
}
.touch-actions #touch-attack {
  width: 76px;
  height: 76px;
  background: #603d22d9;
  color: #ffdbac;
}
.touch-actions #touch-pickup {
  width: 47px;
  height: 47px;
}
dialog {
  width: min(700px, 94vw);
  background: linear-gradient(#2d3527, #131d13);
  color: #dce0c9;
  border: 2px ridge #c4aa70;
  padding: 24px;
  font-size: 13px;
  line-height: 1.7;
}
dialog::backdrop {
  background: #000c;
}
.dialog-close {
  position: absolute;
  right: 6px;
  top: 3px;
  border: 0;
  background: none;
  font-size: 22px;
  padding: 0 7px;
}
dialog h2 {
  font-weight: 400;
  color: #e4c98f;
  margin: 0 0 15px;
  font-size: 21px;
}
.help-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
dialog dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 9px;
}
dialog dd {
  margin: 0;
  color: #aebe9d;
}
.muted {
  color: #9aa88d;
  font-size: 11px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
#fatal {
  color: #f2b5a0;
  padding: 20px;
  border: 1px solid #a4684d;
}
body.classic #game {
  max-width: 960px;
  margin: auto;
}
body.classic .stage {
  height: auto;
  aspect-ratio: 640/363;
  min-height: 0;
}
body.embed .page-header,
body.embed .provenance {
  display: none;
}
body.embed main {
  max-width: none;
  padding: 0;
}
body.embed .stage {
  height: calc(100svh - 200px);
  min-height: 300px;
}
body.expanded .page-header,
body.expanded .provenance {
  display: none;
}
body.expanded main {
  max-width: none;
  padding: 0;
}
body.expanded .stage {
  height: calc(100svh - 200px);
  min-height: 300px;
}
#game-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 118px;
}
#game-shell:fullscreen .stage {
  height: 100%;
  min-height: 0;
}
@media (pointer: coarse) {
  .joystick,
  .touch-actions {
    display: flex;
  }
}
@media (max-width: 1000px) {
  .hud-shell {
    grid-template-columns: 145px minmax(180px, 1fr) 235px;
    gap: 7px;
    padding: 8px;
  }
  .native-menu button {
    height: 65px;
    font-size: 12px;
  }
  .native-menu span {
    width: 29px;
    height: 30px;
    font-size: 21px;
  }
  .hud-left button {
    font-size: 10px;
  }
  .game-footer {
    gap: 6px;
  }
  .game-footer a {
    display: none;
  }
  .game-toolbar {
    gap: 7px;
  }
  .vitals {
    width: 190px;
  }
}
@media (max-width: 700px) {
  main {
    padding: 0 3px 12px;
  }
  .page-header {
    height: 46px;
    padding: 6px 9px;
    gap: 6px;
  }
  .page-header h1 {
    font-size: 16px;
    letter-spacing: 4px;
  }
  .page-header a {
    font-size: 10px;
  }
  .build-label {
    font-size: 12px;
    padding: 3px 5px;
  }
  #login {
    display: flex;
    flex-direction: column;
    max-width: 420px;
    margin: 12px auto;
  }
  .login-art {
    max-height: 240px;
  }
  .auth-panel {
    padding: 20px;
    border-left: 0;
    border-top: 1px solid #675a3e;
  }
  .game-toolbar {
    min-height: 40px;
    padding: 5px;
    gap: 5px;
    flex-wrap: wrap;
  }
  .location {
    gap: 7px;
    font-size: 11px;
  }
  .compact-label {
    font-size: 0;
  }
  .compact-label select {
    font-size: 10px;
    max-width: 98px;
  }
  .game-toolbar button {
    font-size: 10px;
    padding: 4px 6px;
  }
  #connection {
    font-size: 12px;
  }
  .stage {
    height: clamp(420px, calc(100svh - 265px), 850px);
  }
  .vitals {
    top: 7px;
    left: 7px;
    width: 154px;
    padding: 6px 8px;
    font-size: 10px;
  }
  .vitals-name > span {
    font-size: 11px;
  }
  .vitals label {
    gap: 5px;
    height: 16px;
  }
  .vitals output {
    font-size: 12px;
    width: 26px;
  }
  .vitals-foot {
    font-size: 8px;
  }
  .vitals-name button {
    font-size: 12px;
  }
  .world-overview {
    right: 7px;
    top: 7px;
    padding: 2px;
  }
  .world-overview canvas {
    width: 93px;
    height: 70px;
  }
  .world-overview span {
    font-size: 7px;
  }
  .target-card {
    top: 113px;
    width: 165px;
    font-size: 10px;
    padding: 5px;
  }
  .target-card button {
    font-size: 12px;
  }
  .toast {
    top: 35%;
    left: 12%;
    right: 12%;
    font-size: 12px;
  }
  .quick-skills {
    bottom: 8px;
    gap: 4px;
    padding: 3px;
  }
  .quick-skill {
    width: 40px;
    height: 42px;
  }
  .quick-skill .skill-label {
    font-size: 7px;
  }
  .quick-skill .hotkey {
    font-size: 8px;
  }
  .joystick,
  .touch-actions {
    display: flex;
  }
  .joystick {
    left: 14px;
    bottom: 60px;
    width: 83px;
    height: 83px;
  }
  .joystick span {
    width: 32px;
    height: 32px;
    left: 24px;
    top: 24px;
  }
  .touch-actions {
    right: 8px;
    bottom: 65px;
    gap: 4px;
  }
  .touch-actions button {
    width: 47px;
    height: 47px;
    font-size: 12px;
  }
  .touch-actions #touch-attack {
    width: 58px;
    height: 58px;
  }
  .touch-actions #touch-pickup {
    width: 40px;
    height: 40px;
  }
  .hud-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 74px 39px;
    gap: 5px;
    min-height: 0;
    padding: 7px;
    background-size: auto 100%;
  }
  .hud-left {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  .chat {
    grid-row: 1;
    grid-template-rows: minmax(34px, 1fr) 30px;
    max-height: 74px;
  }
  .chat ol {
    font-size: 10px;
  }
  .chat input {
    font-size: 12px;
  }
  .native-menu {
    grid-row: 2;
    gap: 5px;
  }
  .native-menu button {
    height: 35px;
    flex-direction: row;
    justify-content: center;
    font-size: 10px;
    gap: 5px;
    padding: 3px;
  }
  .native-menu span {
    border: 0;
    background: none;
    width: auto;
    height: auto;
    font-size: 17px;
  }
  .game-footer {
    font-size: 12px;
    gap: 5px;
    flex-wrap: wrap;
    padding: 6px;
  }
  .game-footer > span:first-child {
    flex-basis: 62%;
    margin-right: auto;
  }
  #account-button {
    display: none;
  }
  .game-footer button {
    font-size: 12px;
    padding: 4px 6px;
  }
  .drawer {
    width: min(350px, calc(100% - 14px));
    top: 7px;
    right: 7px;
    bottom: 7px;
  }
  .drawer #drawer-content {
    padding: 10px;
  }
  .drawer-header {
    padding: 7px 10px;
  }
  .drawer-header h2 {
    font-size: 14px;
  }
  .item-slot {
    min-height: 49px;
  }
  .equipment-slot {
    min-height: 38px;
    font-size: 12px;
  }
  .help-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }
  dialog dl {
    font-size: 11px;
    grid-template-columns: 100px 1fr;
  }
  .provenance {
    font-size: 10px;
  }
  body.embed .stage,
  body.expanded .stage {
    height: calc(100svh - 220px);
    min-height: 320px;
  }
}
@media (max-width: 420px) {
  .compact-label select {
    max-width: 82px;
  }
  .game-toolbar {
    gap: 3px;
  }
  .game-toolbar #fullscreen {
    font-size: 12px;
  }
  .game-toolbar #help-button {
    font-size: 12px;
  }
  .location {
    gap: 4px;
  }
  .game-footer {
    gap: 4px;
  }
  .vitals {
    width: 144px;
  }
  .inventory-grid {
    gap: 4px;
  }
  .native-menu button {
    font-size: 12px;
  }
}

.exit-fullscreen {
  display: none;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
}
#game-shell:fullscreen .exit-fullscreen,
body.expanded .exit-fullscreen {
  display: block;
}
