:root {
  color-scheme: dark;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: #11130f;
  color: #ecefe7;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #11130f;
}

.auth-gate {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: auto;
  background: #11130f;
  padding: 24px;
}

.auth-gate[hidden],
.auth-view[hidden],
.app-shell[hidden],
.account-summary[hidden],
.account-admin-badge[hidden] {
  display: none;
}

.auth-panel {
  width: min(420px, 100%);
  border: 1px solid #464a40;
  border-radius: 6px;
  background: #1c1f19;
  box-shadow: 0 16px 40px rgb(0 0 0 / 35%);
}

.auth-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #3b3d36;
  padding: 16px;
}

.auth-heading h1,
.auth-view h2,
.auth-heading p,
.auth-view p {
  margin: 0;
}

.auth-heading h1 {
  color: #f2e7bf;
  font-family: Georgia, "Malgun Gothic", serif;
  font-size: 18px;
  letter-spacing: 0;
}

.auth-heading p,
.auth-view p {
  margin-top: 4px;
  color: #aeb4a8;
  font-size: 12px;
  line-height: 1.55;
}

.auth-view {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.auth-view[data-auth-view="checking"] {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  min-height: 112px;
  color: #d8ddd3;
  font-size: 13px;
}

.auth-view h2 {
  color: #f0f2eb;
  font-size: 16px;
  letter-spacing: 0;
}

.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #4a4e45;
  border-top-color: #d4bb70;
  border-radius: 50%;
  animation: auth-spin 800ms linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.google-login-button,
.character-form button {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #667068;
  border-radius: 4px;
  background: #edf0eb;
  color: #20231f;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.google-login-button:hover,
.character-form button:hover:not(:disabled) {
  border-color: #d4bb70;
  background: #fff;
}

.google-login-button:focus-visible,
.character-form input:focus-visible,
.character-form button:focus-visible,
.account-logout:focus-visible {
  outline: 2px solid #d4bb70;
  outline-offset: 2px;
}

.google-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #b7bdb6;
  border-radius: 50%;
  background: #fff;
  color: #315048;
  font-family: Arial, sans-serif;
  font-size: 13px;
}

.character-form {
  display: grid;
  gap: 8px;
}

.character-form label {
  color: #d8ddd3;
  font-size: 12px;
  font-weight: 700;
}

.character-form input {
  width: 100%;
  height: 40px;
  border: 1px solid #555a50;
  border-radius: 4px;
  background: #11130f;
  color: #f0f2eb;
  padding: 0 10px;
}

.character-form button {
  margin-top: 6px;
  background: #315048;
  color: #f2f6f2;
}

.character-form button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.auth-error {
  border-left: 3px solid #b65f55;
  background: rgb(80 27 23 / 42%);
  color: #f0b5ad !important;
  padding: 8px 10px;
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 28px;
  width: 100%;
  height: 100%;
}

.toolbar {
  z-index: 3;
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #3b3d36;
  background: #1c1f19;
  box-shadow: 0 2px 10px rgb(0 0 0 / 28%);
}

.account-summary {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  border-left: 1px solid #3b3d36;
  padding-left: 12px;
}

.account-identity {
  display: grid;
  min-width: 0;
  gap: 2px;
  text-align: right;
}

.account-character-line {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.account-character-line strong,
.account-name {
  overflow: hidden;
  max-width: 150px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-character-line strong {
  color: #f0f2eb;
  font-size: 12px;
}

.account-name {
  color: #969d91;
  font-size: 10px;
}

.account-session-error {
  max-width: 260px;
  color: #efaaa2;
  font-size: 10px;
  white-space: normal;
}

.account-admin-badge {
  border: 1px solid #8e793e;
  border-radius: 3px;
  background: #292519;
  color: #e2ca7c;
  padding: 1px 4px;
  font-size: 9px;
}

.account-logout {
  height: 28px;
  border: 1px solid #50544b;
  border-radius: 3px;
  background: #242720;
  color: #c9cec4;
  padding: 0 8px;
  font-size: 11px;
  cursor: pointer;
}

.account-logout:hover {
  border-color: #7b6a3e;
  color: #f2e7bf;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  flex: 0 0 auto;
  border: 1px solid #464a40;
  border-radius: 4px;
  background: #12140f;
  padding: 2px;
}

.view-tab {
  min-width: 58px;
  height: 28px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #aeb4a8;
  padding: 0 9px;
  font-size: 12px;
  cursor: pointer;
}

.view-tab:hover {
  color: #f0f2eb;
}

.view-tab.is-active {
  background: #315048;
  color: #f2f6f2;
}

.world-toolbar {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 18px;
}

.world-toolbar[hidden],
.game-viewport[hidden],
.catalog-view[hidden] {
  display: none;
}

.brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: #f2e7bf;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #9c8140;
  background: #28251b;
  color: #e8ca75;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
}

.brand strong {
  font-family: Georgia, "Malgun Gothic", serif;
  font-size: 15px;
}

.field {
  display: flex;
  min-width: 155px;
  align-items: center;
  gap: 7px;
  color: #afb5a7;
  font-size: 12px;
}

.map-field {
  min-width: 220px;
}

.class-field {
  min-width: 118px;
}

.appearance-field {
  min-width: 250px;
}

.profession-field {
  min-width: 176px;
}

.field select:disabled {
  border-color: #34382f;
  color: #777e74;
  cursor: not-allowed;
}

select {
  min-width: 0;
  height: 32px;
  flex: 1;
  border: 1px solid #4a4e43;
  border-radius: 4px;
  outline: none;
  background: #12140f;
  color: #f0f2eb;
  padding: 0 28px 0 9px;
}

select:focus-visible,
button:focus-visible,
canvas:focus-visible,
input:focus-visible {
  outline: 2px solid #d4b24f;
  outline-offset: 2px;
}

.layer-controls {
  display: flex;
  min-width: max-content;
  align-items: center;
  gap: 12px;
  color: #c9cec1;
  font-size: 12px;
}

.layer-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.layer-controls input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #b4943b;
}

.zoom-controls {
  display: grid;
  grid-template-columns: 30px 52px 30px;
  height: 32px;
  margin-left: auto;
  align-items: stretch;
}

.zoom-controls button {
  border: 1px solid #4a4e43;
  border-radius: 4px;
  background: #292d25;
  color: #f4f5f0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.zoom-controls button:hover {
  border-color: #807146;
  background: #34382f;
}

.zoom-controls output {
  display: grid;
  place-items: center;
  color: #bbc0b4;
  font-size: 11px;
}

.game-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #080a07;
}

.catalog-view {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  background: #11140f;
}

.catalog-toolbar {
  z-index: 2;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #34382f;
  background: #181b16;
  padding: 8px 10px;
}

.catalog-categories {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.catalog-sources {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  border-right: 1px solid #3a3e37;
  padding-right: 10px;
}

.catalog-source-tab {
  width: 40px;
  height: 30px;
  border: 1px solid #454a42;
  border-radius: 3px;
  background: #11140f;
  color: #90988e;
  padding: 0;
  font: 10px Consolas, monospace;
  cursor: pointer;
}

.catalog-source-tab:hover {
  border-color: #647068;
  color: #eef1eb;
}

.catalog-source-tab.is-active {
  border-color: #a88d46;
  background: #312b1a;
  color: #eadb9e;
}

.catalog-category-tab {
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #aeb5a9;
  padding: 0 9px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.catalog-category-tab:hover {
  border-color: #495149;
  color: #eef1eb;
}

.catalog-category-tab.is-active {
  border-color: #668d82;
  background: #263d37;
  color: #f0f5f2;
}

.catalog-search {
  width: min(260px, 30vw);
  flex: 0 0 auto;
}

.catalog-search input {
  width: 100%;
  height: 32px;
  border: 1px solid #495047;
  border-radius: 4px;
  outline: none;
  background: #0f120e;
  color: #edf1ec;
  padding: 0 10px;
  font-size: 12px;
}

.catalog-search input::placeholder {
  color: #737c72;
}

.catalog-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
}

.catalog-browser {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 42px minmax(0, 1fr);
}

.catalog-results-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #30342e;
  padding: 0 12px;
}

.catalog-results-header strong {
  overflow: hidden;
  color: #c5cbc1;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-pager {
  display: grid;
  grid-template-columns: 28px 56px 28px;
  align-items: center;
}

.catalog-pager button,
.catalog-icon-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #464d44;
  border-radius: 3px;
  background: #242923;
  color: #eff2ed;
  padding: 0;
  cursor: pointer;
}

.catalog-pager button {
  font-size: 20px;
}

.catalog-pager button:hover:not(:disabled),
.catalog-icon-button:hover:not(:disabled) {
  border-color: #6f9a8d;
  background: #2c3833;
}

.catalog-pager button:disabled,
.catalog-icon-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.catalog-pager output {
  color: #929a90;
  font: 10px Consolas, monospace;
  text-align: center;
}

.catalog-grid {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 10px;
}

.catalog-card {
  position: relative;
  display: grid;
  height: 126px;
  min-width: 0;
  grid-template-rows: 78px 20px 16px;
  align-items: center;
  border: 1px solid #343a33;
  border-radius: 4px;
  background: #191c18;
  color: #d8ddd5;
  padding: 5px;
  text-align: left;
  cursor: pointer;
}

.catalog-card:hover {
  border-color: #5d746b;
  background: #1e241f;
}

.catalog-card.is-selected {
  border-color: #79a99a;
  background: #22332e;
  box-shadow: inset 0 0 0 1px rgb(121 169 154 / 24%);
}

.catalog-card canvas {
  display: block;
  width: 100%;
  height: 78px;
  border-radius: 2px;
  background: #0d100c;
  image-rendering: pixelated;
}

.catalog-card strong,
.catalog-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-card strong {
  padding: 2px 3px 0;
  font: 600 11px Consolas, "Malgun Gothic", monospace;
}

.catalog-card small {
  padding: 0 3px;
  color: #899187;
  font: 9px Consolas, monospace;
}

.catalog-empty,
.catalog-error {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: calc(100% - 32px);
  transform: translate(-50%, -50%);
  color: #90988d;
  font-size: 12px;
  text-align: center;
}

.catalog-error {
  color: #ffb8ad;
}

.catalog-empty[hidden],
.catalog-error[hidden] {
  display: none;
}

.catalog-inspector {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border-left: 1px solid #3a3e37;
  background: #161915;
  padding: 14px;
}

.catalog-inspector-heading {
  display: flex;
  min-height: 46px;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.catalog-detail-category {
  display: block;
  margin-bottom: 3px;
  color: #7fa99d;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.catalog-inspector h2 {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: #f0f2ed;
  font: 600 17px Consolas, "Malgun Gothic", monospace;
}

.catalog-source {
  flex: 0 0 auto;
  border-left: 2px solid #a88d46;
  color: #bba968;
  padding-left: 6px;
  font: 9px Consolas, monospace;
}

.catalog-card-source {
  position: absolute;
  top: 7px;
  right: 7px;
  border: 1px solid rgb(168 141 70 / 65%);
  border-radius: 2px;
  background: rgb(13 15 12 / 88%);
  color: #d4c17e;
  padding: 2px 4px;
  font: 8px Consolas, monospace;
  pointer-events: none;
}

.catalog-preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid #353b34;
  border-radius: 4px;
  background: #0b0e0b;
}

#catalog-preview {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.catalog-preview-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #90978e;
  font-size: 11px;
  pointer-events: none;
}

.catalog-preview-loading[hidden] {
  display: none;
}

.catalog-playback {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 54px 72px;
  align-items: center;
  gap: 8px;
  padding: 10px 0 12px;
}

.catalog-icon-button {
  font-size: 11px;
}

.catalog-frame-control {
  display: grid;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  color: #8f978d;
  font-size: 10px;
}

.catalog-frame-control input {
  width: 100%;
  min-width: 0;
  accent-color: #6c9c8e;
}

#catalog-frame-value {
  color: #bac2b8;
  font: 10px Consolas, monospace;
  text-align: center;
}

.catalog-speed-control select {
  width: 100%;
  height: 28px;
  padding-left: 7px;
  font-size: 10px;
}

.catalog-metadata {
  margin: 0;
  border-top: 1px solid #33372f;
}

.catalog-metadata > div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid #292d27;
  padding: 7px 2px;
}

.catalog-metadata dt {
  color: #7f877d;
  font-size: 10px;
}

.catalog-metadata dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #c8cdc5;
  font: 10px Consolas, "Malgun Gothic", monospace;
}

.catalog-evidence {
  margin: 11px 2px 0;
  color: #858c82;
  font-size: 10px;
  line-height: 1.6;
}

.catalog-structured {
  margin-top: 12px;
  border: 1px solid #343a33;
  border-radius: 4px;
  background: #10130f;
}

.catalog-structured[hidden] {
  display: none;
}

.catalog-structured-heading {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #30352f;
  padding: 0 9px;
}

.catalog-structured-heading h3 {
  margin: 0;
  color: #cfd5cc;
  font-size: 11px;
  font-weight: 600;
}

.catalog-structured-heading span {
  overflow: hidden;
  color: #7f897f;
  font: 9px Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-structured-content {
  max-height: 330px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 5px 8px 8px;
  scrollbar-color: #596159 #171a16;
  scrollbar-width: thin;
}

.catalog-structured-content > .catalog-structured-list {
  margin: 0;
}

.catalog-structured-list {
  margin: 4px 0 4px 10px;
}

.catalog-structured-list > div {
  display: grid;
  grid-template-columns: minmax(72px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
  border-bottom: 1px solid rgb(53 59 52 / 55%);
  padding: 4px 2px;
}

.catalog-structured-list dt,
.catalog-structured-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font: 9px/1.45 Consolas, "Malgun Gothic", monospace;
}

.catalog-structured-list dt {
  color: #7f8a80;
}

.catalog-structured-list dd {
  color: #c9cec6;
  user-select: text;
}

.catalog-structured-group {
  border-bottom: 1px solid #292e28;
  padding: 3px 0;
}

.catalog-structured-group > summary,
.catalog-payload > summary {
  color: #9ca69c;
  font: 10px/1.6 Consolas, "Malgun Gothic", monospace;
  cursor: pointer;
  user-select: none;
}

.catalog-payload {
  margin-top: 7px;
  border-top: 1px solid #30352f;
  padding-top: 5px;
}

.catalog-payload pre {
  max-height: 300px;
  overflow: auto;
  margin: 5px 0 0;
  background: #090b09;
  color: #bfc7bd;
  padding: 8px;
  font: 9px/1.45 Consolas, monospace;
  tab-size: 2;
  user-select: text;
  white-space: pre;
}

.catalog-media-list {
  margin-top: 8px;
  border-top: 1px solid #30352f;
  padding-top: 7px;
}

.catalog-media-list h4 {
  margin: 0 0 6px;
  color: #aeb7ad;
  font-size: 10px;
  font-weight: 600;
}

.catalog-media-list > div {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid #292e28;
  padding: 5px 0 8px;
}

.catalog-media-list span {
  overflow-wrap: anywhere;
  color: #89938a;
  font: 9px/1.4 Consolas, "Malgun Gothic", monospace;
}

.catalog-media-list audio {
  width: 100%;
  height: 30px;
}

.catalog-string-tools {
  position: sticky;
  z-index: 1;
  top: -5px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  background: #10130f;
  padding: 5px 0 7px;
}

.catalog-string-tools input[type="search"] {
  min-width: 0;
  height: 28px;
  border: 1px solid #41483f;
  border-radius: 3px;
  outline: none;
  background: #0a0d0a;
  color: #d9ded6;
  padding: 0 7px;
  font-size: 10px;
}

.catalog-string-tools label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #9ba39a;
  font-size: 9px;
  white-space: nowrap;
}

.catalog-string-result-header {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #30352f;
  color: #899289;
  font: 9px Consolas, monospace;
}

.catalog-string-pager {
  display: flex;
  align-items: center;
  gap: 5px;
}

.catalog-string-pager button {
  width: 24px;
  height: 22px;
  border: 1px solid #41483f;
  border-radius: 2px;
  background: #1d221d;
  color: #cbd1c8;
  padding: 0;
  cursor: pointer;
}

.catalog-string-pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

.catalog-string-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog-string-list li {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid #292e28;
  padding: 6px 2px;
}

.catalog-string-list code {
  color: #829c91;
  font: 8px Consolas, monospace;
}

.catalog-string-list span {
  overflow-wrap: anywhere;
  color: #d0d5cd;
  font: 10px/1.45 Consolas, "Malgun Gothic", monospace;
  user-select: text;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
}

.loading,
.error-panel {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 50%;
  max-width: min(540px, calc(100% - 32px));
  transform: translateX(-50%);
  border: 1px solid #5a5b50;
  border-radius: 4px;
  background: rgb(18 20 15 / 94%);
  padding: 9px 14px;
  color: #e8e9e4;
  font-size: 12px;
  box-shadow: 0 6px 22px rgb(0 0 0 / 35%);
}

.loading[hidden],
.error-panel[hidden] {
  display: none;
}

.error-panel {
  border-color: #965044;
  color: #ffcbc3;
}

.legacy-ui-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  --legacy-ui-scale: 1;
  --legacy-ui-margin: 10px;
}

.legacy-window {
  position: absolute;
  overflow: visible;
  outline: none;
  pointer-events: auto;
  touch-action: none;
  transform: scale(var(--legacy-ui-scale));
  transform-origin: top left;
  user-select: none;
}

.legacy-window[hidden] {
  display: none;
}

.minimap-panel {
  position: absolute;
  z-index: 10;
  top: 99px;
  right: 20px;
  width: clamp(156px, 16vw, 190px);
  overflow: hidden;
  border: 1px solid #827650;
  border-radius: 3px;
  background: rgb(12 14 10 / 94%);
  box-shadow: 0 4px 14px rgb(0 0 0 / 42%);
  color: #ddd6b5;
  pointer-events: auto;
  user-select: none;
}

.minimap-panel[hidden] {
  display: none;
}

.minimap-handle {
  display: flex;
  height: 24px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #585139;
  background: #28281e;
  padding: 0 3px 0 7px;
  cursor: move;
  touch-action: none;
}

.minimap-handle:active {
  cursor: grabbing;
}

.minimap-handle strong {
  overflow: hidden;
  color: #d9ca91;
  font: 700 10px Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.minimap-toggle {
  position: relative;
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #d9ca91;
  padding: 0;
  cursor: pointer;
}

.minimap-toggle:hover {
  background: #3b3a2a;
}

.minimap-toggle span {
  position: relative;
  display: block;
  width: 10px;
  height: 1px;
  background: currentcolor;
}

.minimap-toggle span::after {
  position: absolute;
  inset: 0;
  display: block;
  width: 10px;
  height: 1px;
  background: currentcolor;
  content: "";
  transform: rotate(90deg);
  opacity: 0;
}

.minimap-content {
  padding: 3px;
}

.minimap-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #37392f;
  background: #090b08;
}

.minimap-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.minimap-loading {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgb(9 11 8 / 78%);
  color: #9e9a7c;
  font: 9px Consolas, monospace;
  pointer-events: none;
}

.minimap-panel[data-minimap-state="loading"] .minimap-loading {
  display: grid;
}

.minimap-panel[data-minimap-state="error"] .minimap-loading {
  display: grid;
  color: #d98b7b;
}

.minimap-panel.is-collapsed,
.minimap-panel[data-collapsed="true"] {
  width: 92px;
}

.minimap-panel.is-collapsed .minimap-content,
.minimap-panel[data-collapsed="true"] .minimap-content {
  display: none;
}

.minimap-panel.is-collapsed .minimap-handle,
.minimap-panel[data-collapsed="true"] .minimap-handle {
  border-bottom: 0;
}

.minimap-panel.is-collapsed .minimap-toggle span::after,
.minimap-panel[data-collapsed="true"] .minimap-toggle span::after,
.minimap-toggle[aria-expanded="false"] span::after {
  opacity: 1;
}

.legacy-window-art {
  position: absolute;
  inset: 0;
  display: block;
  image-rendering: pixelated;
  pointer-events: none;
}

.legacy-buttons {
  position: absolute;
  z-index: 1000;
  right: var(--legacy-ui-margin);
  bottom: var(--legacy-ui-margin);
  width: 184px;
  height: 26px;
  overflow: hidden;
  pointer-events: auto;
  transform: scale(var(--legacy-ui-scale));
  transform-origin: bottom right;
}

.legacy-hitbox {
  position: absolute;
  z-index: 4;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  padding: 0;
  color: transparent;
  cursor: pointer;
}

.legacy-hitbox:focus-visible,
.legacy-hitbox:hover {
  box-shadow: inset 0 0 0 1px rgb(224 197 102 / 78%);
}

.legacy-slot-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.legacy-slot {
  display: contents;
}

.legacy-slot-icon {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  pointer-events: none;
}

.legacy-slot-hitbox {
  pointer-events: auto;
}

.legacy-slot-hitbox[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px #e0c566;
}

.legacy-chat-history {
  position: absolute;
  z-index: 3;
  top: 25px;
  left: 18px;
  width: 473px;
  height: 290px;
  overflow: auto;
  padding: 3px 5px;
  color: #d5d7ce;
  font: 11px/1.45 "Malgun Gothic", sans-serif;
  pointer-events: auto;
  scrollbar-color: #6f704e transparent;
  scrollbar-width: thin;
  user-select: text;
}

.legacy-chat-history p {
  margin: 0 0 2px;
  text-shadow: 1px 1px #000;
}

.player-state-hud {
  width: 176px;
  height: 69px;
}

.resource-track {
  position: absolute;
  z-index: 3;
  left: 50px;
  width: 55px;
  height: 4px;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}

.health-track {
  top: 20px;
}

.mana-track {
  top: 34px;
}

.stamina-track {
  top: 48px;
}

.health-fill,
.mana-fill,
.stamina-fill {
  display: block;
  width: 100%;
  height: 100%;
}

.health-fill {
  background: #a73d35;
}

.mana-fill {
  background: #287ab6;
}

.stamina-fill {
  background: #c5a532;
}

.teleport-status {
  position: absolute;
  z-index: 4;
  top: 11px;
  left: 117px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

#teleport-icon {
  display: block;
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.teleport-status:focus-visible,
.teleport-status:hover {
  box-shadow: inset 0 0 0 1px #e0c566;
}

.teleport-status.is-casting #teleport-icon {
  opacity: 0.62;
}

.teleport-status.is-depleted #teleport-icon {
  filter: grayscale(0.8) brightness(0.7);
}

.coordinate-hud {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  min-width: 160px;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgb(219 204 152 / 35%);
  border-radius: 4px;
  background: rgb(12 14 10 / 82%);
  padding: 6px 9px;
  color: #e3d8b1;
  font-family: Consolas, monospace;
  font-size: 11px;
  pointer-events: none;
}

.statusbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #30332c;
  background: #181a16;
  padding: 0 10px;
  color: #9ea497;
  font-size: 11px;
}

.statusbar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .toolbar {
    flex-wrap: wrap;
    gap: 7px 12px;
  }

  .brand {
    flex: 1 1 auto;
  }

  .world-toolbar {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 7px 12px;
  }

  .field,
  .map-field {
    min-width: min(210px, calc(50% - 6px));
    flex: 1 1 180px;
  }

  .layer-controls {
    flex: 1 1 auto;
  }

  .zoom-controls {
    margin-left: auto;
  }

  .catalog-workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
}

@media (max-width: 720px) {
  .catalog-view {
    display: block;
    overflow: auto;
  }

  .catalog-toolbar {
    position: sticky;
    top: 0;
    flex-wrap: wrap;
  }

  .catalog-categories,
  .catalog-sources,
  .catalog-search {
    width: 100%;
    flex: 1 1 100%;
  }

  .catalog-sources {
    width: auto;
    flex: 0 0 auto;
  }

  .catalog-workspace {
    display: flex;
    min-height: auto;
    flex-direction: column;
  }

  .catalog-inspector {
    overflow: visible;
    border-bottom: 1px solid #3a3e37;
    border-left: 0;
    scroll-margin-top: 104px;
  }

  .catalog-preview-stage {
    min-height: 220px;
    max-height: 360px;
  }

  .catalog-browser {
    display: block;
    min-height: auto;
  }

  .catalog-results-header {
    min-height: 42px;
  }

  .catalog-grid {
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .auth-gate {
    align-items: start;
    padding: 12px;
  }

  .auth-panel {
    margin-top: 8vh;
  }

  .app-shell {
    grid-template-rows: auto minmax(0, 1fr) 24px;
  }

  .toolbar {
    padding: 7px 8px;
  }

  .account-summary {
    order: 3;
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid #30332c;
    border-left: 0;
    padding-top: 6px;
    padding-left: 0;
  }

  .account-identity {
    text-align: left;
  }

  .account-character-line {
    justify-content: flex-start;
  }

  .account-character-line strong,
  .account-name {
    max-width: min(68vw, 300px);
  }

  .world-toolbar {
    order: 4;
  }

  .brand strong {
    font-size: 13px;
  }

  .field,
  .map-field {
    min-width: 100%;
  }

  .view-tab {
    min-width: 54px;
    padding: 0 7px;
    font-size: 11px;
  }

  .layer-controls {
    gap: 8px;
    font-size: 11px;
  }

  .zoom-controls {
    grid-template-columns: 28px 46px 28px;
    margin-left: auto;
  }

  .statusbar {
    font-size: 10px;
  }

  .catalog-toolbar {
    padding: 7px 8px;
  }

  .catalog-category-tab {
    padding: 0 7px;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
  }

  .catalog-inspector {
    padding: 10px;
  }

  .catalog-preview-stage {
    min-height: 190px;
  }

  .catalog-playback {
    grid-template-columns: 30px minmax(0, 1fr) 46px 68px;
    gap: 5px;
  }

  .minimap-panel {
    top: 63px;
    right: 8px;
    width: min(88px, calc(100vw - 16px));
  }
}
