:root {
  color-scheme: dark;
  --panel: rgba(20, 24, 27, 0.88);
  --panel-strong: rgba(16, 18, 20, 0.96);
  --line: rgba(236, 220, 180, 0.18);
  --text: #f4ead6;
  --muted: #b8aa90;
  --gold: #d7a94a;
  --gold-soft: rgba(215, 169, 74, 0.24);
  --green: #7fb06a;
  --red: #d06a4f;
  --blue: #6fa7c8;
  --shadow: rgba(0, 0, 0, 0.68);
  --side-panel-width: 630px;
  --left-panel-width: 340px;
  --chat-panel-height: 360px;
  --toolbar-left: 360px;
  --toolbar-right: 260px;
  --directions-width: 238px;
  --entity-dock-left: 360px;
  --target-panel-right: 12px;
  --target-panel-bottom: 372px;
  --floating-width: 430px;
  --floating-max-height: 440px;
  --sheet-window-width: 390px;
  --map-window-width: 500px;
  --inventory-window-width: 700px;
  --top-controls-top: 66px;
}

body[data-ui-density="compact"] {
  --side-panel-width: 540px;
  --left-panel-width: 300px;
  --chat-panel-height: 300px;
  --toolbar-left: 320px;
  --toolbar-right: 230px;
  --directions-width: 210px;
  --entity-dock-left: 320px;
  --target-panel-bottom: 344px;
}

body[data-ui-density="wide"] {
  --side-panel-width: 690px;
  --left-panel-width: 380px;
  --chat-panel-height: 420px;
  --toolbar-left: 400px;
  --toolbar-right: 276px;
  --directions-width: 254px;
  --entity-dock-left: 400px;
  --target-panel-bottom: 392px;
}

@media (max-width: 1500px) and (min-width: 1101px) {
  :root {
    --side-panel-width: 100%;
    --left-panel-width: 340px;
    --chat-panel-height: 300px;
    --toolbar-left: 360px;
    --toolbar-right: 260px;
    --directions-width: 238px;
    --entity-dock-left: 360px;
    --target-panel-right: 10px;
    --target-panel-bottom: 372px;
  }
}

body[data-window-size="small"] {
  --floating-width: 360px;
  --floating-max-height: 360px;
  --sheet-window-width: 340px;
  --map-window-width: 390px;
  --inventory-window-width: 580px;
}

body[data-window-size="large"] {
  --floating-width: 520px;
  --floating-max-height: 540px;
  --sheet-window-width: 470px;
  --map-window-width: 640px;
  --inventory-window-width: 800px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #121416;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-panel-width);
  width: 100vw;
  height: 100vh;
  min-height: 0;
}

body.auth-mode .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.scene-shell {
  position: relative;
  container-type: inline-size;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 34%, rgba(215, 169, 74, 0.16), transparent 28%),
    linear-gradient(135deg, #111514, #08090a 62%, #15100c);
}

#scene {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.scene-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transform: scale(1.001);
  transition: opacity 180ms ease;
  pointer-events: none;
}

.scene-backdrop.is-visible {
  opacity: 1;
}

.scene-vignette {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.64)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.5)),
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.48) 100%);
}

body.auth-mode .scene-vignette {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.12) 32%, rgba(0, 0, 0, 0.78)),
    radial-gradient(circle at center, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.66) 100%);
}

.login-panel {
  position: absolute;
  z-index: 95;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
}

body.auth-mode .login-panel {
  display: grid;
}

.login-card {
  display: grid;
  gap: 11px;
  width: min(380px, calc(100vw - 36px));
  border: 1px solid rgba(215, 169, 74, 0.42);
  background:
    linear-gradient(180deg, rgba(18, 18, 16, 0.94), rgba(7, 8, 8, 0.96)),
    rgba(10, 12, 14, 0.94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.74);
  padding: 22px;
}

.login-brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.login-brand span {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  border: 1px solid rgba(127, 176, 106, 0.46);
  background: rgba(31, 54, 32, 0.58);
  color: #bfe1a7;
  font-weight: 800;
}

.login-brand h1 {
  font-size: 22px;
}

.login-card label {
  color: var(--muted);
  font-size: 13px;
}

.login-card input {
  border-radius: 0;
  background: rgba(255, 255, 255, 0.07);
}

.login-card button {
  min-height: 42px;
  border-radius: 0;
  margin-top: 4px;
}

.login-status {
  min-height: 18px;
  margin: 0;
  color: #e6c271;
  font-size: 12px;
}

body.discord-activity-login .login-card {
  justify-items: center;
  text-align: center;
}

body.discord-activity-login .login-card label,
body.discord-activity-login .login-card input,
body.discord-activity-login .login-card button {
  display: none;
}

body.discord-activity-login .login-status {
  min-height: 22px;
  font-size: 14px;
}

body.discord-activity-login .login-card::after {
  content: "";
  width: 30px;
  aspect-ratio: 1;
  border: 2px solid rgba(215, 169, 74, 0.18);
  border-top-color: rgba(244, 209, 138, 0.88);
  border-radius: 50%;
  animation: discord-auth-spin 900ms linear infinite;
}

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

.character-lobby-panel {
  position: absolute;
  z-index: 82;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  pointer-events: none;
}

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

.character-lobby-card {
  width: min(920px, calc(100% - 34px));
  height: min(760px, calc(100dvh - 42px));
  max-height: calc(100dvh - 42px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid rgba(215, 169, 74, 0.36);
  background: linear-gradient(180deg, rgba(16, 17, 16, 0.94), rgba(7, 8, 8, 0.92));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72);
  padding: 18px;
  pointer-events: auto;
}

.character-lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(215, 169, 74, 0.18);
  padding-bottom: 12px;
}

.character-lobby-header h2,
.lobby-section h3,
.creation-title-row h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: #fff7e8;
}

.character-lobby-header h2 {
  font-size: 24px;
}

.lobby-account {
  display: block;
  margin-bottom: 2px;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
}

.lobby-columns {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  gap: 14px;
}

.lobby-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(215, 169, 74, 0.22);
  background: rgba(4, 5, 5, 0.34);
  padding: 12px;
  overflow: hidden;
}

.lobby-section[aria-label="Creacion guiada"] {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.lobby-character-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
}

.lobby-character,
.creation-choice {
  width: 100%;
  min-width: 0;
  border-radius: 0;
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(215, 169, 74, 0.24);
}

.lobby-character {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
}

.lobby-character:hover,
.creation-choice:hover {
  border-color: rgba(244, 209, 138, 0.68);
  background: rgba(215, 169, 74, 0.1);
}

.lobby-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  border: 1px solid rgba(127, 176, 106, 0.38);
  background: rgba(31, 54, 32, 0.54);
  color: #d9efc8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 800;
}

.lobby-character-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.lobby-character-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff7e8;
}

.lobby-character-main small,
.creation-choice span,
.creation-help,
.lobby-empty,
.lobby-status {
  color: var(--muted);
  font-size: 12px;
}

.lobby-level {
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
}

.creation-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.creation-help {
  min-height: 34px;
  max-height: 58px;
  margin: 0;
  overflow-y: auto;
  line-height: 1.35;
}

.creation-option-grid {
  min-height: 0;
  max-height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.creation-choice {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 9px;
}

.creation-choice strong {
  color: #f4d18a;
}

.creation-choice span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.creation-name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.creation-name-form[hidden] {
  display: none;
}

.creation-name-form textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.35;
}

.creation-name-form textarea:not([hidden]) {
  grid-column: 1 / -1;
}

.creation-name-form textarea:not([hidden]) + button {
  grid-column: 2;
}

.lobby-status {
  min-height: 18px;
  margin: 0;
  color: #e6c271;
}

body.auth-mode .mmo-topbar,
body.auth-mode .visual-toolbar,
body.auth-mode .visual-chat-panel,
body.auth-mode .character-card,
body.auth-mode .directions-panel,
body.auth-mode .room-stage,
body.auth-mode .combat-event-layer,
body.auth-mode .target-panel,
body.auth-mode .combat-command-bar,
body.auth-mode .entity-dock,
body.auth-mode .floating-window,
body.auth-mode .side-panel,
body.auth-mode .floating-label {
  display: none;
}

body.no-character-mode .mmo-topbar,
body.no-character-mode .visual-toolbar,
body.no-character-mode .visual-chat-panel,
body.no-character-mode .character-card,
body.no-character-mode .directions-panel,
body.no-character-mode .room-stage,
body.no-character-mode .combat-event-layer,
body.no-character-mode .target-panel,
body.no-character-mode .combat-command-bar,
body.no-character-mode .entity-dock,
body.no-character-mode .floating-window,
body.no-character-mode .floating-label {
  display: none;
}

.mmo-topbar {
  position: absolute;
  z-index: 20;
  top: 10px;
  left: 10px;
  right: 10px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto minmax(180px, auto);
  gap: 8px;
  align-items: stretch;
  pointer-events: none;
}

.hud-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(215, 169, 74, 0.28);
  background: linear-gradient(180deg, rgba(18, 15, 10, 0.92), rgba(8, 9, 9, 0.9));
  box-shadow: 0 8px 22px var(--shadow);
  color: #ead9b6;
  padding: 5px 11px;
  font-size: 13px;
}

.hud-chip:not(.room-chip) {
  white-space: nowrap;
}

.room-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  align-items: start;
  pointer-events: auto;
  cursor: pointer;
}

.room-chip:hover,
.room-chip:focus-visible {
  border-color: rgba(244, 209, 138, 0.72);
  background: linear-gradient(180deg, rgba(31, 25, 14, 0.96), rgba(12, 12, 10, 0.92));
}

.room-chip:focus-visible {
  outline: 1px solid rgba(244, 209, 138, 0.72);
  outline-offset: 2px;
}

.room-title {
  min-width: 0;
}

.hud-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  border: 1px solid rgba(127, 176, 106, 0.45);
  background: rgba(31, 54, 32, 0.56);
  color: #bfe1a7;
  font-size: 11px;
  font-weight: 800;
}

.visual-toolbar {
  position: absolute;
  z-index: 70;
  top: var(--top-controls-top);
  left: var(--toolbar-left);
  right: var(--toolbar-right);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  pointer-events: auto;
}

.visual-toolbar button {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 66px;
  min-height: 62px;
  padding: 5px 6px;
  border-radius: 0;
  border-color: rgba(215, 169, 74, 0.32);
  background: rgba(9, 10, 9, 0.72);
  color: #ead9b6;
  box-shadow: 0 8px 20px var(--shadow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
}

.visual-toolbar button span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(215, 169, 74, 0.58);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 169, 74, 0.18), rgba(10, 12, 14, 0.9));
  color: #f4d18a;
  font-weight: 800;
}

.eyebrow,
.panel-label {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  max-width: 100%;
  margin: 0;
  color: #fff7e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.1;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vitals {
  display: grid;
  gap: 7px;
}

.vitals span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  border: 1px solid rgba(244, 234, 214, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.visual-chat-panel,
.character-card,
.directions-panel,
.floating-window,
.entity-strip {
  border: 1px solid rgba(215, 169, 74, 0.3);
  background: linear-gradient(180deg, rgba(12, 13, 12, 0.9), rgba(7, 8, 8, 0.84));
  box-shadow: 0 10px 28px var(--shadow);
}

.visual-chat-panel {
  position: absolute;
  z-index: 20;
  top: var(--top-controls-top);
  left: 10px;
  width: min(var(--left-panel-width), calc(100% - 34px));
  height: min(var(--chat-panel-height), calc(100% - 350px));
  min-height: 220px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.visual-chat-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid rgba(215, 169, 74, 0.22);
}

.visual-chat-tabs button {
  position: relative;
  min-height: 32px;
  border: 0;
  border-right: 1px solid rgba(215, 169, 74, 0.16);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.035);
  color: #b8aa90;
  padding: 0 5px;
  font-size: 11px;
}

.visual-chat-tabs button.active {
  color: #f4d18a;
  background: rgba(215, 169, 74, 0.14);
}

.visual-chat-tabs button.has-unread::after {
  content: attr(data-unread);
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 15px;
  height: 15px;
  border: 1px solid rgba(7, 8, 8, 0.72);
  background: var(--red);
  color: #fff7e8;
  padding: 0 3px;
  font: 9px/13px Consolas, "Cascadia Mono", monospace;
}

.visual-chat-log {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.32;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.visual-chat-line {
  margin: 0 0 8px;
  color: #dbcaa6;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.visual-chat-line.system {
  color: #a9d684;
}

.visual-chat-line.general {
  color: #7fb8d8;
}

.visual-chat-line.group,
.visual-chat-line.guild {
  color: #c7a7e6;
}

.visual-chat-line.combat {
  color: #e2a66f;
}

.visual-chat-line.error {
  color: #e18870;
}

.log-line .ansi-bright,
.visual-chat-line .ansi-bright {
  font-weight: 800;
}

.log-line .ansi-dim,
.visual-chat-line .ansi-dim {
  opacity: 0.78;
}

.log-line .ansi-fg-black,
.visual-chat-line .ansi-fg-black {
  color: #8b8375;
}

.log-line .ansi-fg-red,
.visual-chat-line .ansi-fg-red {
  color: #ff8068;
}

.log-line .ansi-fg-green,
.visual-chat-line .ansi-fg-green {
  color: #8fe26b;
}

.log-line .ansi-fg-yellow,
.visual-chat-line .ansi-fg-yellow {
  color: #f1c45f;
}

.log-line .ansi-fg-blue,
.visual-chat-line .ansi-fg-blue {
  color: #79b7ff;
}

.log-line .ansi-fg-magenta,
.visual-chat-line .ansi-fg-magenta {
  color: #ef9edc;
}

.log-line .ansi-fg-cyan,
.visual-chat-line .ansi-fg-cyan {
  color: #77d9ef;
}

.log-line .ansi-fg-white,
.visual-chat-line .ansi-fg-white {
  color: #fff1d3;
}

.visual-chat-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgba(215, 169, 74, 0.18);
  padding: 6px 8px;
}

.visual-chat-tools span {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-chat-tools button {
  min-height: 26px;
  border-radius: 0;
  padding: 0 8px;
  font-size: 11px;
}

.character-card {
  position: absolute;
  z-index: 20;
  left: 10px;
  bottom: 10px;
  width: min(var(--left-panel-width), calc(100% - 34px));
  padding: 8px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -2px 0 8px;
  color: #f0d7a1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.panel-title button,
.floating-window header button {
  min-width: 28px;
  min-height: 26px;
  padding: 0;
  border-radius: 0;
}

.character-summary {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  align-items: center;
}

.character-portrait {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid rgba(215, 169, 74, 0.34);
  background:
    radial-gradient(circle at 45% 34%, rgba(111, 167, 200, 0.4), transparent 22%),
    linear-gradient(135deg, rgba(52, 70, 54, 0.85), rgba(17, 13, 11, 0.95));
  color: #f4d18a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  overflow: hidden;
}

.portrait-image {
  position: absolute;
  inset: 4px;
  z-index: 0;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
}

.portrait-initials {
  position: relative;
  z-index: 1;
}

.character-portrait.has-image .portrait-initials,
.inventory-paperdoll-portrait.has-image .portrait-initials {
  opacity: 0;
}

.character-summary h2 {
  margin: 0 0 4px;
  color: #fff3d8;
  font-size: 16px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.character-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 10px 0 0;
  font-size: 12px;
}

.character-stats div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.character-stats dt {
  color: var(--muted);
}

.character-stats dd {
  margin: 0;
  color: #f1ddb4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directions-panel {
  position: absolute;
  z-index: 20;
  top: var(--top-controls-top);
  right: 10px;
  width: var(--directions-width);
  padding: 9px;
}

.directions-panel .panel-label {
  text-align: center;
  color: #f0d7a1;
  font-family: Georgia, "Times New Roman", serif;
  text-transform: none;
  font-size: 15px;
}

.direction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.direction-grid button {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 54px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.055);
  color: #d8c6a1;
  padding: 4px;
  font-size: 11px;
}

.direction-grid button span {
  color: #f4d18a;
  font-size: 14px;
  font-weight: 800;
}

.direction-grid button.available {
  border-color: rgba(127, 176, 106, 0.48);
  background: rgba(55, 80, 42, 0.24);
}

.direction-grid button.blocked {
  border-color: rgba(142, 118, 72, 0.24);
  background: rgba(88, 70, 38, 0.12);
  color: #766d5f;
  cursor: not-allowed;
  opacity: 0.58;
}

.direction-grid button.blocked span {
  color: #8b7b60;
}

.direction-grid button.unavailable,
.direction-grid button:disabled {
  border-color: rgba(244, 234, 214, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: #6f6758;
  cursor: not-allowed;
  opacity: 0.52;
}

.direction-grid button.unavailable span,
.direction-grid button:disabled span {
  color: #7a705d;
}

.direction-grid button.blocked:disabled {
  border-color: rgba(142, 118, 72, 0.24);
  background: rgba(88, 70, 38, 0.12);
  color: #766d5f;
  opacity: 0.58;
}

.direction-grid button.blocked:disabled span {
  color: #8b7b60;
}

.room-description {
  margin: 3px 0 0;
  color: rgba(244, 234, 214, 0.86);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.room-stage {
  position: absolute;
  z-index: 12;
  inset: 94px 18px 250px 18px;
  pointer-events: none;
}

.stage-token {
  --stage-color: #f4ead6;
  --stage-shadow: rgba(0, 0, 0, 0.64);
  --stage-token-width: 108px;
  --stage-token-height: 124px;
  --stage-portrait-width: 62px;
  --stage-portrait-height: 74px;
  --stage-portrait-bottom: 34px;
  --stage-label-bottom: 11px;
  --stage-health-bottom: 4px;
  position: absolute;
  display: block;
  width: var(--stage-token-width);
  height: var(--stage-token-height);
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--stage-color);
  padding: 0;
  text-align: center;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  isolation: isolate;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.54));
  transition:
    filter 140ms ease,
    transform 140ms ease;
}

.stage-token::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 10px;
  width: 70px;
  height: 17px;
  border: 1px solid rgba(244, 209, 138, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--stage-color) 38%, transparent), transparent 65%),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0.72), transparent 74%);
  opacity: 0.6;
  transform: translateX(-50%);
}

.stage-token::after {
  content: "";
  position: absolute;
  z-index: -2;
  left: 50%;
  bottom: 0;
  width: 90px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--stage-shadow), transparent 68%);
  opacity: 0.88;
  transform: translateX(-50%);
}

.stage-token:hover,
.stage-token:focus,
.stage-token.selected {
  outline: 0;
  filter:
    drop-shadow(0 15px 20px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 14px color-mix(in srgb, var(--stage-color) 36%, transparent));
  transform: translate(-50%, calc(-100% - 4px));
}

.stage-token:hover .stage-token-portrait,
.stage-token:focus .stage-token-portrait,
.stage-token.selected .stage-token-portrait {
  border-color: rgba(244, 209, 138, 0.86);
  box-shadow:
    0 0 0 2px rgba(7, 8, 8, 0.72),
    0 0 24px rgba(215, 169, 74, 0.5);
}

.stage-token.self {
  --stage-color: #a9d8ff;
}

.stage-token.player {
  --stage-color: #8fc4f2;
}

.stage-token.npc.hostile,
.stage-token.hostile {
  --stage-color: #ff9b82;
}

.stage-token.npc:not(.hostile) {
  --stage-color: #d7caa7;
}

.stage-token.item,
.stage-token.corpse {
  --stage-color: #e2c175;
}

.stage-token.in-combat .stage-token-portrait {
  border-color: rgba(221, 73, 44, 0.78);
}

.stage-token.event-source .stage-token-portrait {
  animation: stage-source-pulse 620ms ease-out;
}

.stage-token.event-target .stage-token-portrait {
  animation: stage-target-hit 560ms ease-out;
}

.stage-token-portrait {
  position: absolute;
  left: 50%;
  bottom: var(--stage-portrait-bottom);
  transform: translateX(-50%);
  transform-origin: center bottom;
  display: grid;
  place-items: center;
  width: var(--stage-portrait-width);
  height: var(--stage-portrait-height);
  border: 1px solid rgba(215, 169, 74, 0.38);
  border-bottom-color: color-mix(in srgb, var(--stage-color) 48%, rgba(215, 169, 74, 0.34));
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 240, 190, 0.08), rgba(255, 240, 190, 0) 38%),
    radial-gradient(ellipse at 50% 78%, color-mix(in srgb, var(--stage-color) 18%, transparent), transparent 52%),
    linear-gradient(145deg, rgba(21, 25, 23, 0.82), rgba(5, 6, 6, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 216, 0.06),
    inset 0 -14px 18px rgba(0, 0, 0, 0.26),
    0 8px 22px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.stage-token-portrait img {
  position: absolute;
  inset: 4px 4px 7px;
  width: calc(100% - 8px);
  height: calc(100% - 11px);
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 7px 6px rgba(0, 0, 0, 0.62))
    saturate(1.04);
}

.stage-token-portrait.has-image .stage-token-initials {
  opacity: 0;
}

.stage-token-initials {
  position: relative;
  z-index: 1;
  color: var(--stage-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.stage-token-kind {
  position: absolute;
  z-index: 2;
  left: 4px;
  top: 4px;
  min-width: 18px;
  border: 1px solid color-mix(in srgb, var(--stage-color) 44%, rgba(244, 209, 138, 0.24));
  background: rgba(5, 6, 6, 0.84);
  color: #f4d18a;
  padding: 2px 3px 1px;
  font: 8px/1 Consolas, "Cascadia Mono", monospace;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.62);
}

.stage-token-label {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: var(--stage-label-bottom);
  transform: translateX(-50%);
  display: block;
  width: max-content;
  min-width: 60px;
  max-width: 118px;
  border: 1px solid rgba(215, 169, 74, 0.24);
  border-top-color: color-mix(in srgb, var(--stage-color) 48%, rgba(215, 169, 74, 0.24));
  background:
    linear-gradient(180deg, rgba(20, 22, 20, 0.86), rgba(5, 6, 6, 0.82));
  color: var(--stage-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  line-height: 1.1;
  padding: 3px 6px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(2px);
}

.stage-token-health {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: var(--stage-health-bottom);
  transform: translateX(-50%);
  display: block;
  width: 64px;
  height: 5px;
  border: 1px solid rgba(6, 7, 7, 0.78);
  background: rgba(0, 0, 0, 0.58);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.42);
}

.stage-token-health i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #aa2e25, #d9a653);
}

.stage-overflow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 38px;
  min-height: 36px;
  border: 1px solid rgba(215, 169, 74, 0.36);
  background: rgba(8, 9, 9, 0.82);
  color: #f4d18a;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.stage-overflow::before,
.stage-overflow::after {
  display: none;
}

.stage-token.item,
.stage-token.corpse,
.stage-token.stage-object {
  --stage-token-width: 92px;
  --stage-token-height: 88px;
  --stage-portrait-width: 52px;
  --stage-portrait-height: 48px;
  --stage-portrait-bottom: 28px;
  --stage-label-bottom: 6px;
  --stage-health-bottom: 3px;
  min-height: 0;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.48));
}

.stage-token.item::before,
.stage-token.corpse::before,
.stage-token.stage-object::before {
  bottom: 8px;
  width: 56px;
  height: 12px;
  opacity: 0.46;
}

.stage-token.item::after,
.stage-token.corpse::after,
.stage-token.stage-object::after {
  bottom: 0;
  width: 72px;
  height: 18px;
}

.stage-token.item .stage-token-portrait,
.stage-token.corpse .stage-token-portrait,
.stage-token.stage-object .stage-token-portrait {
  width: var(--stage-portrait-width);
  height: var(--stage-portrait-height);
}

.stage-token.item .stage-token-label,
.stage-token.corpse .stage-token-label,
.stage-token.stage-object .stage-token-label {
  min-width: 42px;
  max-width: 72px;
  font-size: 9px;
  padding: 2px 4px 3px;
}

.combat-event-layer {
  position: absolute;
  z-index: 18;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.combat-event-beam {
  position: absolute;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(244, 209, 138, 0), rgba(244, 209, 138, 0.95), rgba(255, 119, 76, 0));
  box-shadow: 0 0 14px rgba(255, 159, 82, 0.72);
  transform-origin: left center;
  animation: combat-beam 620ms ease-out both;
}

.combat-event-beam.heal {
  background: linear-gradient(90deg, rgba(127, 176, 106, 0), rgba(143, 226, 107, 0.95), rgba(127, 176, 106, 0));
  box-shadow: 0 0 14px rgba(143, 226, 107, 0.64);
}

.combat-event-beam.miss {
  background: linear-gradient(90deg, rgba(180, 190, 190, 0), rgba(180, 190, 190, 0.72), rgba(180, 190, 190, 0));
  box-shadow: 0 0 10px rgba(190, 200, 200, 0.38);
}

.combat-event-burst {
  position: absolute;
  width: 78px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 126, 86, 0.82);
  border-radius: 50%;
  box-shadow:
    0 0 18px rgba(255, 93, 64, 0.56),
    inset 0 0 18px rgba(255, 93, 64, 0.18);
  transform: translate(-50%, -50%);
  animation: combat-burst 720ms ease-out both;
}

.combat-event-burst.heal {
  border-color: rgba(143, 226, 107, 0.82);
  box-shadow:
    0 0 18px rgba(143, 226, 107, 0.48),
    inset 0 0 18px rgba(143, 226, 107, 0.16);
}

.combat-event-burst.miss {
  border-color: rgba(220, 220, 210, 0.46);
  box-shadow: 0 0 14px rgba(220, 220, 210, 0.28);
}

.combat-event-float {
  position: absolute;
  min-width: 44px;
  color: #ff8068;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 800;
  text-align: center;
  text-shadow:
    0 2px 0 #050505,
    0 0 16px rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%);
  animation: combat-float 1100ms ease-out both;
}

.combat-event-float.heal {
  color: #8fe26b;
}

.combat-event-float.miss {
  color: #e0dac8;
  font-size: 18px;
}

.combat-event-float.death {
  color: #f4d18a;
  font-size: 18px;
  text-transform: uppercase;
}

.target-panel {
  position: absolute;
  z-index: 24;
  right: var(--target-panel-right);
  bottom: var(--target-panel-bottom);
  width: min(330px, calc(100% - 32px));
  border: 1px solid rgba(215, 169, 74, 0.34);
  background: linear-gradient(180deg, rgba(15, 17, 16, 0.94), rgba(6, 7, 7, 0.92));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.56);
  color: #ead9b6;
  padding: 9px;
}

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

.target-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px 0 8px;
  color: #f0d7a1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}

.target-panel header button {
  min-width: 26px;
  min-height: 24px;
  border-radius: 0;
  padding: 0;
}

.target-body {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.target-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 70px;
  aspect-ratio: 1;
  border: 1px solid rgba(215, 169, 74, 0.34);
  background:
    radial-gradient(circle at 45% 30%, rgba(244, 209, 138, 0.24), transparent 28%),
    linear-gradient(145deg, rgba(25, 28, 25, 0.92), rgba(5, 6, 6, 0.96));
  color: #f4d18a;
  font: 800 22px/1 Georgia, "Times New Roman", serif;
  overflow: hidden;
}

.target-portrait img {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
}

.target-portrait.has-image span {
  opacity: 0;
}

.target-main {
  min-width: 0;
}

.target-main h2 {
  margin: 0 0 3px;
  color: #fff3d8;
  font-size: 16px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-main p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-health {
  display: grid;
  gap: 4px;
}

.target-health span {
  color: #e6c271;
  font-size: 11px;
}

.target-health b {
  display: block;
  height: 7px;
  border: 1px solid rgba(244, 234, 214, 0.12);
  background: rgba(0, 0, 0, 0.52);
  overflow: hidden;
}

.target-health i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #9d2c25, #d5a651);
}

.target-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.target-effects[hidden] {
  display: none;
}

.target-effect {
  border: 1px solid rgba(244, 209, 138, 0.28);
  background: rgba(244, 209, 138, 0.08);
  color: #e8d2a5;
  font: 10px/1.1 Consolas, "Cascadia Mono", monospace;
  padding: 3px 5px;
}

.target-effect.harmful {
  border-color: rgba(221, 73, 44, 0.45);
  background: rgba(221, 73, 44, 0.12);
  color: #ffb59b;
}

.target-effect.beneficial {
  border-color: rgba(127, 176, 106, 0.45);
  background: rgba(127, 176, 106, 0.12);
  color: #b9e3a5;
}

.target-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.target-action,
.combat-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 0;
  font-size: 12px;
}

.target-action span,
.combat-command span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border: 1px solid rgba(244, 209, 138, 0.28);
  color: #f4d18a;
  font: 800 10px/1 Consolas, "Cascadia Mono", monospace;
}

.target-action.danger,
.combat-command.danger {
  border-color: rgba(221, 73, 44, 0.46);
  background: rgba(96, 25, 18, 0.32);
}

.target-action.utility,
.combat-command.utility {
  border-color: rgba(127, 176, 106, 0.36);
  background: rgba(35, 58, 34, 0.22);
}

.target-action.social {
  border-color: rgba(111, 167, 200, 0.38);
  background: rgba(33, 55, 68, 0.24);
}

.target-actions-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.combat-command-bar {
  position: absolute;
  z-index: 22;
  left: var(--entity-dock-left);
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 60px;
  border: 1px solid rgba(215, 169, 74, 0.24);
  background: linear-gradient(180deg, rgba(15, 17, 16, 0.9), rgba(5, 6, 6, 0.9));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  padding: 8px;
  overflow-x: auto;
}

.combat-command-bar[hidden] {
  display: none;
}

.combat-command {
  flex: 0 0 118px;
  color: #ead9b6;
}

@keyframes stage-source-pulse {
  0% {
    transform: translateX(-50%) scale(1);
    filter: brightness(1);
  }
  42% {
    transform: translateX(-50%) scale(1.08);
    filter: brightness(1.45);
  }
  100% {
    transform: translateX(-50%) scale(1);
    filter: brightness(1);
  }
}

@keyframes stage-target-hit {
  0% {
    transform: translateX(-50%);
    filter: brightness(1);
  }
  25% {
    transform: translateX(calc(-50% - 4px));
    filter: brightness(1.6) saturate(1.4);
  }
  50% {
    transform: translateX(calc(-50% + 4px));
  }
  100% {
    transform: translateX(-50%);
    filter: brightness(1);
  }
}

@keyframes combat-beam {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  18% {
    opacity: 1;
  }
  72% {
    clip-path: inset(0 0 0 0);
  }
  100% {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
  }
}

@keyframes combat-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.35);
  }
}

@keyframes combat-float {
  0% {
    opacity: 0;
    transform: translate(-50%, 2px) scale(0.88);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -42px) scale(1);
  }
}

.entity-dock {
  position: absolute;
  z-index: 20;
  left: var(--entity-dock-left);
  right: 10px;
  bottom: 86px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.entity-strip {
  padding: 7px 8px 8px;
  overflow: hidden;
}

.entity-strip header {
  color: #f0d7a1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  margin-bottom: 6px;
}

.entity-list {
  display: flex;
  gap: 8px;
  min-height: 64px;
  overflow-x: auto;
  overflow-y: hidden;
}

.entity-empty {
  color: var(--muted);
  font-size: 12px;
  align-self: center;
}

.entity-card {
  --entity-color: #fff3d8;
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(96px, 1fr);
  gap: 7px;
  align-items: center;
  flex: 0 0 190px;
  min-height: 76px;
  border: 1px solid rgba(215, 169, 74, 0.22);
  border-radius: 0;
  background: rgba(7, 8, 8, 0.78);
  color: #ead9b6;
  padding: 6px;
  text-align: left;
}

.entity-card.npc {
  --entity-color: #fff1d3;
}

.entity-card:hover,
.entity-card:focus {
  border-color: rgba(244, 209, 138, 0.75);
  background: rgba(215, 169, 74, 0.11);
}

.entity-card.hostile {
  border-color: rgba(208, 106, 79, 0.5);
}

.entity-card.item.rarity-uncommon {
  border-color: rgba(111, 167, 200, 0.5);
}

.entity-card.item.rarity-rare {
  border-color: rgba(199, 167, 230, 0.58);
}

.entity-card.item.rarity-epic {
  border-color: rgba(226, 179, 91, 0.68);
  box-shadow: inset 0 0 0 1px rgba(226, 179, 91, 0.12);
}

.entity-card.item.rarity-legendary {
  border-color: rgba(215, 103, 91, 0.72);
  box-shadow: inset 0 0 0 1px rgba(215, 103, 91, 0.16);
}

.entity-card.in-combat {
  border-color: rgba(221, 73, 44, 0.78);
  box-shadow: inset 0 0 0 1px rgba(221, 73, 44, 0.18);
}

.entity-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  aspect-ratio: 1;
  border: 1px solid rgba(244, 234, 214, 0.18);
  background:
    radial-gradient(circle at 42% 30%, rgba(244, 209, 138, 0.2), transparent 24%),
    linear-gradient(135deg, rgba(37, 50, 40, 0.94), rgba(8, 8, 8, 0.96));
  color: var(--entity-color);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.entity-initials {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.entity-avatar-image {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: contain;
  z-index: 0;
}

.entity-avatar.has-image .entity-initials {
  opacity: 0;
}

.entity-kind-mark,
.entity-combat-mark {
  position: absolute;
  border: 1px solid rgba(244, 209, 138, 0.45);
  background: rgba(6, 8, 8, 0.88);
  color: #f4d18a;
  font-family: "Segoe UI", sans-serif;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 3px;
  z-index: 2;
}

.entity-kind-mark {
  top: 3px;
  left: 3px;
}

.entity-combat-mark {
  right: 3px;
  bottom: 3px;
  border-color: rgba(221, 73, 44, 0.72);
  color: #ffb59b;
}

.entity-info {
  min-width: 0;
}

.entity-name {
  display: block;
  overflow: hidden;
  color: var(--entity-color);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-height: 34px;
  margin-top: 5px;
  overflow: hidden;
}

.entity-effect {
  display: inline-block;
  max-width: 100%;
  min-height: 16px;
  border: 1px solid rgba(244, 209, 138, 0.28);
  background: rgba(244, 209, 138, 0.08);
  color: #e8d2a5;
  font: 9px/1.1 Consolas, "Cascadia Mono", monospace;
  overflow: hidden;
  padding: 2px 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-effect.harmful {
  border-color: rgba(221, 73, 44, 0.45);
  background: rgba(221, 73, 44, 0.12);
  color: #ffb59b;
}

.entity-effect.beneficial {
  border-color: rgba(113, 188, 126, 0.42);
  background: rgba(113, 188, 126, 0.1);
  color: #c7efc8;
}

.entity-effect.more {
  border-color: rgba(158, 184, 214, 0.34);
  color: #c9d7e5;
}

.radial-menu {
  --radial-size: 224px;
  position: fixed;
  z-index: 120;
  width: var(--radial-size);
  height: var(--radial-size);
  margin: calc(var(--radial-size) / -2) 0 0 calc(var(--radial-size) / -2);
  border: 1px solid rgba(215, 169, 74, 0.5);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(18, 19, 18, 0.98) 0 28%, rgba(12, 10, 7, 0.92) 29% 58%, rgba(6, 7, 7, 0.88) 59% 100%);
  box-shadow: 0 14px 34px var(--shadow);
}

.radial-menu[hidden] {
  display: none;
}

.radial-title {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  min-height: 38px;
  transform: translate(-50%, -58%);
  color: #f4d18a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
}

.radial-hint {
  position: absolute;
  left: 50%;
  top: calc(50% + 28px);
  width: 106px;
  transform: translateX(-50%);
  color: var(--muted);
  font: 10px/1.2 Consolas, "Cascadia Mono", monospace;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radial-action {
  position: absolute;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  width: 78px;
  min-height: 42px;
  border-radius: 0;
  border-color: rgba(215, 169, 74, 0.38);
  background: rgba(7, 8, 8, 0.92);
  color: #ead9b6;
  padding: 4px 6px;
  font-size: 10px;
  text-align: left;
}

.radial-action:hover,
.radial-action:focus {
  border-color: rgba(244, 209, 138, 0.78);
  background: rgba(215, 169, 74, 0.18);
}

.radial-action.danger {
  border-color: rgba(208, 106, 79, 0.58);
}

.radial-action.danger .radial-icon {
  color: #f3b197;
}

.radial-action.social .radial-icon {
  color: #c7a7e6;
}

.radial-action.utility .radial-icon {
  color: #a9d684;
}

.radial-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(244, 234, 214, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: #f4d18a;
  font-size: 9px;
  font-weight: 800;
}

.radial-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-window {
  position: absolute;
  z-index: 85;
  top: 230px;
  right: 36px;
  width: min(var(--floating-width), calc(100% - 390px));
  min-width: 310px;
  max-height: min(var(--floating-max-height), calc(100% - 300px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.inventory-window {
  top: 156px;
  width: min(var(--inventory-window-width), calc(100% - 72px));
  max-height: min(660px, calc(100% - 190px));
}

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

.floating-window header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  border-bottom: 1px solid rgba(215, 169, 74, 0.25);
  color: #f0d7a1;
  font-family: Georgia, "Times New Roman", serif;
  padding: 4px 8px;
  cursor: move;
  user-select: none;
  touch-action: none;
}

.floating-window.dragging {
  opacity: 0.96;
}

.floating-window header button {
  cursor: pointer;
}

.inventory-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 10px;
}

.inventory-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid rgba(215, 169, 74, 0.18);
  background:
    radial-gradient(circle at 50% 18%, rgba(215, 169, 74, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.018);
  padding: 10px;
}

.inventory-equipment-panel,
.inventory-bag-panel {
  min-width: 0;
  border: 0;
  background: transparent;
}

.inventory-equipment-panel {
  display: grid;
  min-height: 0;
  gap: 8px;
}

.inventory-character-stage {
  display: grid;
  grid-template-columns: minmax(126px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.inventory-paperdoll,
.inventory-equipment-surface,
.inventory-bag-panel {
  border: 1px solid rgba(215, 169, 74, 0.22);
  background: rgba(255, 255, 255, 0.025);
}

.inventory-paperdoll {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 7px;
  min-height: 214px;
  padding: 12px 10px;
  text-align: center;
}

.inventory-paperdoll-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: min(104px, 100%);
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(215, 169, 74, 0.36);
  background:
    radial-gradient(circle at 50% 34%, rgba(111, 167, 200, 0.34), transparent 22%),
    linear-gradient(180deg, rgba(44, 55, 45, 0.9), rgba(12, 10, 9, 0.96));
  color: #f4d18a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 800;
  overflow: hidden;
}

.inventory-paperdoll-portrait .portrait-image {
  inset: 5px;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
}

.inventory-paperdoll strong,
.inventory-paperdoll span,
.inventory-paperdoll small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-paperdoll strong {
  color: #fff3d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  white-space: nowrap;
}

.inventory-paperdoll span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-paperdoll small {
  color: #d8c6a1;
  font-size: 11px;
  line-height: 1.35;
}

.inventory-bag-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 190px;
  overflow: hidden;
}

.inventory-section-title {
  border-bottom: 1px solid rgba(215, 169, 74, 0.18);
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 9px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
  min-height: 150px;
  overflow-y: auto;
  padding: 10px;
}

.inventory-slot {
  position: relative;
  display: grid;
  grid-template-rows: 28px auto auto;
  gap: 2px;
  place-items: center;
  min-height: 64px;
  border: 1px solid rgba(244, 234, 214, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #e2c479;
  padding: 5px 4px;
  font-size: 10px;
  text-align: center;
  overflow: hidden;
}

.inventory-slot.equipped {
  border-color: rgba(127, 176, 106, 0.55);
}

.inventory-slot.rarity-uncommon {
  border-color: rgba(111, 167, 200, 0.52);
  background: rgba(38, 70, 90, 0.22);
}

.inventory-slot.rarity-rare {
  border-color: rgba(199, 167, 230, 0.6);
  background: rgba(68, 48, 90, 0.24);
}

.inventory-slot.rarity-epic {
  border-color: rgba(226, 179, 91, 0.68);
  background: rgba(94, 71, 35, 0.24);
}

.inventory-slot.rarity-legendary {
  border-color: rgba(215, 103, 91, 0.72);
  background: rgba(96, 45, 40, 0.24);
}

.inventory-slot.empty {
  color: rgba(184, 170, 144, 0.34);
}

.item-icon,
.equipment-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(244, 234, 214, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: #f4d18a;
  font-size: 10px;
  font-weight: 800;
}

.item-weapon {
  color: #f3b197;
}

.item-armor {
  color: #d9c48e;
}

.item-potion {
  color: #a9d684;
}

.item-key {
  color: #e8c86f;
}

.item-trophy {
  color: #c7a7e6;
}

.item-name {
  max-width: 100%;
  overflow: hidden;
  color: #fff3d8;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-meta {
  max-width: 100%;
  min-height: 13px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-empty-mark {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(184, 170, 144, 0.18);
  background: rgba(255, 255, 255, 0.025);
}

.inventory-text {
  max-height: 104px;
  margin: 0;
  border-top: 1px solid rgba(215, 169, 74, 0.22);
  color: #cab996;
  font: 12px/1.35 Consolas, "Cascadia Mono", monospace;
  overflow: auto;
  padding: 8px 10px;
  white-space: pre-wrap;
}

.sheet-window {
  left: var(--toolbar-left);
  right: auto;
  top: 170px;
  width: min(var(--sheet-window-width), calc(100% - 640px));
}

.ability-window {
  top: 246px;
  right: 36px;
  width: min(520px, calc(100% - 390px));
  grid-template-rows: auto minmax(0, 1fr);
}

.skills-window {
  right: calc(var(--directions-width) + 28px);
}

.spells-window {
  top: 310px;
}

.ability-text {
  min-height: 220px;
  margin: 0;
  color: #dfcfaa;
  font: 12px/1.45 Consolas, "Cascadia Mono", monospace;
  overflow: auto;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.map-window {
  top: 382px;
  right: 36px;
  width: min(var(--map-window-width), calc(100% - 390px));
}

.ui-settings-window {
  left: 50%;
  right: auto;
  top: 150px;
  width: min(360px, calc(100% - 390px));
  transform: translateX(-50%);
}

.ui-settings-window[style*="left"] {
  transform: none;
}

.room-info-window {
  left: 22px;
  right: auto;
  top: 54px;
  width: min(460px, calc(100% - 44px));
  grid-template-rows: auto minmax(0, 1fr);
}

.room-info-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 12px;
}

.room-info-body h2,
.room-info-body h3 {
  margin: 0;
  color: #f0d7a1;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.room-info-body h2 {
  font-size: 19px;
}

.room-info-body h3 {
  font-size: 13px;
}

.room-info-body p {
  margin: 0;
  color: #ead9b6;
  font-size: 14px;
  line-height: 1.45;
}

.room-info-section {
  display: grid;
  gap: 8px;
}

.room-info-exits {
  display: grid;
  gap: 6px;
}

.room-info-exit {
  display: grid;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(215, 169, 74, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #d8c6a1;
  padding: 6px 8px;
}

.room-info-exit strong {
  color: #f4d18a;
  font-size: 12px;
  text-transform: capitalize;
}

.room-info-exit.blocked {
  border-color: rgba(142, 118, 72, 0.22);
  background: rgba(82, 62, 33, 0.16);
  color: #9d907a;
}

.room-info-exit.blocked strong {
  color: #b69a62;
}

.room-info-exit span {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.3;
}

.room-info-empty {
  color: var(--muted);
  font-size: 13px;
}

.ui-settings-body {
  display: grid;
  gap: 14px;
  padding: 12px;
}

.ui-settings-body section {
  display: grid;
  gap: 8px;
}

.ui-settings-body h3 {
  margin: 0;
  color: #f0d7a1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.segmented-control button {
  min-height: 34px;
  border-radius: 0;
  color: #d8c6a1;
  background: rgba(255, 255, 255, 0.045);
  padding: 0 6px;
  font-size: 12px;
}

.segmented-control button.active,
.segmented-control button[aria-pressed="true"] {
  border-color: rgba(244, 209, 138, 0.68);
  background: rgba(215, 169, 74, 0.18);
  color: #f4d18a;
}

.toggle-row {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  color: #d8c6a1;
  font-size: 12px;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: #d7a94a;
}

.sound-status {
  display: block;
  margin: -2px 0 7px;
  color: var(--muted);
  font-size: 12px;
}

.sound-settings-row {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) 72px;
  gap: 8px;
  align-items: center;
}

.sound-settings-row label {
  color: var(--muted);
  font-size: 12px;
}

.sound-settings-row input[type="range"] {
  width: 100%;
  accent-color: #d7a94a;
}

.sound-settings-row button {
  min-height: 32px;
  border-radius: 0;
  padding: 0 8px;
  font-size: 12px;
}

.ui-settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ui-settings-actions button {
  min-height: 36px;
  border-radius: 0;
  padding: 0 8px;
  font-size: 12px;
}

.sheet-body {
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.sheet-identity {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.sheet-identity .character-portrait {
  font-size: 24px;
}

.sheet-identity h3 {
  margin: 0 0 4px;
  color: #fff3d8;
  font-size: 18px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sheet-bars {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.sheet-bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(244, 234, 214, 0.14);
  background: rgba(255, 255, 255, 0.035);
  color: #ead9b6;
  padding: 4px 8px;
  overflow: hidden;
}

.sheet-bar span,
.sheet-bar strong {
  position: relative;
  z-index: 1;
  font-size: 12px;
}

.sheet-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(127, 176, 106, 0.28);
}

.sheet-bar.mana i {
  background: rgba(111, 167, 200, 0.28);
}

.sheet-bar.stamina i {
  background: rgba(215, 169, 74, 0.26);
}

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

.sheet-grid div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(244, 234, 214, 0.12);
  background: rgba(255, 255, 255, 0.035);
  padding: 7px 8px;
  min-width: 0;
}

.sheet-grid span {
  color: var(--muted);
  font-size: 12px;
}

.sheet-grid strong {
  color: #f1ddb4;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-effects {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.sheet-section-title {
  border-bottom: 1px solid rgba(215, 169, 74, 0.18);
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  padding-bottom: 5px;
}

.sheet-effect-list {
  display: grid;
  gap: 6px;
}

.sheet-effect {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(244, 234, 214, 0.12);
  background: rgba(255, 255, 255, 0.035);
  padding: 6px 8px;
}

.sheet-effect strong {
  min-width: 0;
  color: #fff3d8;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-effect span,
.sheet-effects-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.sheet-effect.harmful {
  border-color: rgba(205, 91, 75, 0.48);
  background: rgba(98, 33, 31, 0.22);
}

.sheet-effect.beneficial {
  border-color: rgba(127, 176, 106, 0.42);
  background: rgba(42, 77, 42, 0.2);
}

.equipment-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 6px;
  min-height: 0;
  max-height: 190px;
  overflow-y: auto;
  padding: 8px;
}

.equipment-slot {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  min-height: 58px;
  border-radius: 0;
  border-color: rgba(244, 234, 214, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #ead9b6;
  padding: 7px;
  text-align: left;
}

.equipment-slot.filled {
  border-color: rgba(127, 176, 106, 0.48);
  background: rgba(45, 70, 39, 0.22);
}

.equipment-slot.rarity-uncommon {
  border-color: rgba(111, 167, 200, 0.52);
  background: rgba(38, 70, 90, 0.2);
}

.equipment-slot.rarity-rare {
  border-color: rgba(199, 167, 230, 0.6);
  background: rgba(68, 48, 90, 0.22);
}

.equipment-slot.rarity-epic {
  border-color: rgba(226, 179, 91, 0.68);
  background: rgba(94, 71, 35, 0.22);
}

.equipment-slot.rarity-legendary {
  border-color: rgba(215, 103, 91, 0.72);
  background: rgba(96, 45, 40, 0.22);
}

.equipment-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.equipment-slot-name {
  color: var(--gold);
  font-size: 10px;
  text-transform: uppercase;
}

.equipment-slot strong {
  color: #fff3d8;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-slot small {
  color: var(--muted);
  font-size: 10px;
}

.item-bonus-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.item-bonus-row span {
  border: 1px solid rgba(244, 234, 214, 0.13);
  background: rgba(255, 255, 255, 0.045);
  color: #ead9b6;
  padding: 1px 4px;
  font-size: 10px;
}

.equipment-summary {
  border: 1px solid rgba(215, 169, 74, 0.16);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 12px;
  padding: 7px 9px;
}

.map-body {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.map-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.map-tabs button {
  min-height: 30px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.035);
  color: #b8aa90;
  padding: 0 8px;
  font-size: 12px;
}

.map-tabs button.active,
.map-tabs button[aria-selected="true"] {
  border-color: rgba(215, 169, 74, 0.58);
  background: rgba(215, 169, 74, 0.16);
  color: #f4d18a;
}

.map-panel {
  display: grid;
  gap: 10px;
  min-height: 0;
}

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

.map-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.map-room-name {
  color: #f0d7a1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-header button {
  min-height: 28px;
  border-radius: 0;
  padding: 0 8px;
  font-size: 11px;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.map-cell {
  min-height: 34px;
  border-radius: 0;
  border-color: rgba(244, 234, 214, 0.14);
  background: rgba(255, 255, 255, 0.035);
  color: #b8aa90;
  padding: 3px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-cell.current {
  border-color: rgba(215, 169, 74, 0.62);
  background: rgba(215, 169, 74, 0.16);
  color: #f4d18a;
}

.map-cell.visited:not(.current) {
  border-color: rgba(111, 167, 200, 0.46);
  background: rgba(40, 62, 74, 0.22);
  color: #cce6f3;
}

.map-cell.known:not(.visited) {
  border-color: rgba(184, 170, 144, 0.26);
  background: rgba(255, 255, 255, 0.06);
}

.map-cell.available {
  border-color: rgba(127, 176, 106, 0.48);
  background: rgba(55, 80, 42, 0.2);
  color: #dff0c4;
}

.map-exit-list {
  display: grid;
  gap: 6px;
}

.map-exit-list button,
.map-exit-list p {
  min-height: 32px;
  margin: 0;
  border: 1px solid rgba(244, 234, 214, 0.12);
  background: rgba(255, 255, 255, 0.035);
  color: #ead9b6;
  padding: 7px 8px;
  font-size: 12px;
  text-align: left;
}

.map-exit-list button.visited {
  border-color: rgba(111, 167, 200, 0.42);
  color: #cce6f3;
}

.world-map-panel {
  align-content: start;
}

.world-map-frame {
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(215, 169, 74, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.18)),
    rgba(8, 10, 11, 0.72);
}

.world-map-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
}

.world-region-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px;
}

.world-region-card {
  display: grid;
  gap: 3px;
  min-height: 78px;
  align-content: start;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.035);
  color: #ead9b6;
  padding: 8px;
  text-align: left;
}

.world-region-card.good {
  border-color: rgba(111, 167, 200, 0.44);
}

.world-region-card.evil {
  border-color: rgba(208, 106, 79, 0.46);
}

.world-region-card.neutral {
  border-color: rgba(215, 169, 74, 0.34);
}

.world-region-card.current {
  border-color: rgba(244, 209, 138, 0.78);
  background: rgba(215, 169, 74, 0.14);
  box-shadow: inset 0 0 0 1px rgba(244, 209, 138, 0.2);
}

.world-region-title {
  color: #fff3d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.1;
}

.world-region-meta,
.world-region-role {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.world-region-role {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.world-route-list {
  display: grid;
  gap: 6px;
}

.world-route-list h3 {
  margin: 2px 0 0;
  color: #f0d7a1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}

.world-route-card {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(244, 234, 214, 0.12);
  background: rgba(255, 255, 255, 0.035);
  color: #ead9b6;
  padding: 7px 8px;
}

.world-route-card.current {
  border-color: rgba(127, 176, 106, 0.5);
  background: rgba(55, 80, 42, 0.2);
}

.world-route-card strong {
  color: #f4d18a;
  font-size: 12px;
}

.world-route-card span,
.world-route-card small,
.world-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.world-empty {
  margin: 0;
  border: 1px solid rgba(244, 234, 214, 0.12);
  background: rgba(255, 255, 255, 0.035);
  padding: 8px;
}

.side-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--panel-strong);
}

body.discord-session .side-panel {
  grid-template-rows: minmax(0, 1fr) auto;
}

.connection-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

body.discord-session .connection-bar {
  display: none;
}

.connection-bar button[hidden] {
  display: none;
}

.connection-bar label {
  color: var(--muted);
  font-size: 13px;
}

.connection-status {
  grid-column: 2 / 6;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

#accountInput.locked {
  border-color: rgba(244, 209, 138, 0.18);
  background: rgba(255, 255, 255, 0.025);
  color: #f1ddb4;
  cursor: default;
}

.connection-status.online {
  color: #a8d892;
}

.connection-status.warning {
  color: #e6c271;
}

.connection-status.offline {
  color: var(--red);
}

.access-key-panel {
  grid-column: 1 / 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}

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

.access-key-panel label {
  grid-column: 1 / 5;
}

.access-key-panel input {
  height: 36px;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
}

.access-key-panel button {
  min-height: 34px;
  padding: 0 10px;
}

input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid rgba(244, 234, 214, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus {
  border-color: rgba(215, 169, 74, 0.72);
  box-shadow: 0 0 0 3px rgba(215, 169, 74, 0.12);
}

button {
  min-height: 38px;
  border: 1px solid rgba(215, 169, 74, 0.34);
  border-radius: 6px;
  background: rgba(215, 169, 74, 0.12);
  color: #ffe3a3;
  padding: 0 12px;
  cursor: pointer;
}

button:hover {
  background: rgba(215, 169, 74, 0.2);
}

.output-panel {
  min-height: 0;
  overflow: hidden;
}

.output-log {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  color: #eadfc9;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.log-line {
  margin: 0 0 10px;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.log-system {
  color: var(--blue);
}

.log-error {
  color: var(--red);
}

.command-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.floating-label {
  position: absolute;
  z-index: 10;
  transform: translate(-50%, -50%);
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(10, 12, 14, 0.72);
  color: #fff3d8;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

@container (max-width: 1700px) {
  .mmo-topbar {
    top: 8px;
    left: 8px;
    right: 8px;
    grid-template-columns: minmax(240px, 1fr) auto auto minmax(150px, auto);
    gap: 6px;
  }

  .hud-chip {
    min-height: 32px;
    padding: 4px 9px;
    font-size: 12px;
  }

  .room-description {
    max-width: 70ch;
  }

  .visual-toolbar,
  .visual-chat-panel,
  .directions-panel {
    top: 68px;
  }

  .visual-toolbar {
    left: calc(var(--left-panel-width) + 18px);
    right: calc(var(--directions-width) + 18px);
    gap: 7px;
  }

  .visual-toolbar button {
    width: 58px;
    min-height: 56px;
    padding: 4px 5px;
    font-size: 11px;
  }

  .visual-toolbar button span {
    width: 31px;
    height: 31px;
  }

  .visual-chat-panel {
    width: min(var(--left-panel-width), calc(100% - var(--directions-width) - 42px));
    height: min(300px, calc(100% - 350px));
  }

  .directions-panel {
    width: min(var(--directions-width), 220px);
  }
}

@container (max-width: 1240px) {
  .mmo-topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  #worldWeather {
    display: none;
  }

  .visual-toolbar {
    top: 66px;
    left: 8px;
    right: 8px;
    justify-content: center;
  }

  .visual-chat-panel {
    top: 138px;
    width: min(310px, calc(100% - 236px));
    height: 220px;
  }

  .directions-panel {
    top: 138px;
    right: 8px;
    width: 210px;
  }

  .direction-grid {
    gap: 5px;
  }

  .direction-grid button {
    min-height: 48px;
    font-size: 10px;
  }
}

@container (max-width: 760px) {
  .character-lobby-panel {
    padding: 12px;
  }

  .character-lobby-card {
    width: 100%;
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 12px;
  }

  .character-lobby-header {
    align-items: stretch;
    flex-direction: column;
  }

  .lobby-columns {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }

  .creation-option-grid {
    grid-template-columns: 1fr;
  }

  .mmo-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #worldDate,
  #worldWeather {
    display: none;
  }

  .visual-toolbar {
    top: 66px;
    overflow-x: auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .visual-chat-panel {
    top: 136px;
    left: 8px;
    right: 8px;
    width: auto;
    height: 190px;
  }

  .directions-panel {
    top: 338px;
    left: 8px;
    right: 8px;
    width: auto;
  }

  .inventory-character-stage {
    grid-template-columns: 1fr;
  }

  .inventory-paperdoll {
    min-height: 0;
  }
}

@media (max-width: 1500px) and (min-width: 1101px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(1080px, auto) minmax(520px, 50vh);
    height: auto;
    min-height: 100vh;
  }

  body.auth-mode .app-shell {
    grid-template-rows: minmax(100vh, auto);
    height: 100vh;
  }

  .scene-shell {
    min-height: 1080px;
  }

  body.auth-mode .scene-shell {
    min-height: 100vh;
  }

  .side-panel {
    min-height: 520px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .connection-bar {
    gap: 8px;
    padding: 12px;
  }

  .command-form {
    gap: 8px;
    padding: 12px;
  }
}

@media (max-width: 1100px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(2130px, auto) minmax(420px, 44vh);
    height: auto;
    min-height: 100vh;
  }

  body.auth-mode .app-shell {
    grid-template-rows: minmax(100vh, auto);
    height: 100vh;
  }

  .scene-shell {
    min-height: 2130px;
  }

  body.auth-mode .scene-shell {
    min-height: 100vh;
  }

  body.no-character-mode .app-shell {
    grid-template-rows: minmax(900px, auto) minmax(360px, 36vh);
  }

  body.no-character-mode .scene-shell {
    min-height: 900px;
  }

  .side-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  h1 {
    font-size: 15px;
  }

  .mmo-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #worldDate,
  #worldWeather {
    display: none;
  }

  .visual-toolbar {
    top: 90px;
    left: 10px;
    right: 10px;
    transform: none;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .visual-chat-panel {
    top: 236px;
    right: 10px;
    width: auto;
    height: 180px;
    min-height: 0;
  }

  .directions-panel {
    top: 430px;
    left: 10px;
    right: 10px;
    width: auto;
  }

  .room-stage {
    inset: auto 10px auto 10px;
    top: 705px;
    height: 300px;
  }

  .stage-token {
    --stage-token-width: 68px;
    --stage-token-height: 86px;
    --stage-portrait-width: 40px;
    --stage-portrait-height: 50px;
    --stage-portrait-bottom: 26px;
    --stage-label-bottom: 7px;
    --stage-health-bottom: 3px;
  }

  .stage-token::before {
    bottom: 8px;
    width: 56px;
    height: 13px;
  }

  .stage-token::after {
    bottom: 0;
    width: 72px;
    height: 19px;
  }

  .stage-token-portrait {
    width: var(--stage-portrait-width);
    height: var(--stage-portrait-height);
  }

  .stage-token-label {
    min-width: 44px;
    max-width: 70px;
    font-size: 9px;
    padding: 2px 4px 3px;
  }

  .stage-token-health {
    width: 44px;
  }

  .stage-token.item,
  .stage-token.corpse,
  .stage-token.stage-object {
    --stage-token-width: 58px;
    --stage-token-height: 66px;
    --stage-portrait-width: 34px;
    --stage-portrait-height: 32px;
    --stage-portrait-bottom: 23px;
    --stage-label-bottom: 5px;
  }

  .stage-token.item .stage-token-portrait,
  .stage-token.corpse .stage-token-portrait,
  .stage-token.stage-object .stage-token-portrait {
    width: var(--stage-portrait-width);
    height: var(--stage-portrait-height);
  }

  .stage-token.item .stage-token-label,
  .stage-token.corpse .stage-token-label,
  .stage-token.stage-object .stage-token-label {
    max-width: 56px;
  }

  .target-panel {
    top: 1025px;
    left: 10px;
    right: 10px;
    bottom: auto;
    width: auto;
  }

  .character-card {
    top: 1430px;
    left: 10px;
    right: 10px;
    bottom: auto;
    width: auto;
  }

  .entity-dock {
    top: 1785px;
    left: 10px;
    right: 10px;
    bottom: auto;
  }

  .combat-command-bar {
    top: 1275px;
    left: 10px;
    right: 10px;
    bottom: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
    overflow: visible;
  }

  .combat-command {
    flex: none;
    width: 100%;
  }

  .floating-window {
    left: 10px;
    right: 10px;
    width: auto;
    min-width: 0;
  }

  .ui-settings-window {
    transform: none;
  }
}
