:root {
  --bg: #11161c;
  --panel: rgba(21, 28, 37, 0.95);
  --line: #3f4c5d;
  --text: #d9e2f1;
  --accent: #3aa675;
  --danger: #d94848;
  --mana: #4e8df8;
  --hud-side-space: 300px;
  --bottom-hud-space: 184px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #2a3340 0%, var(--bg) 60%);
  color: var(--text);
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
  cursor: crosshair;
}

#entryOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    linear-gradient(rgba(8, 12, 18, 0.16), rgba(8, 12, 18, 0.22)),
    url("./assets/fundos/LogoRiseOfRealms.png") center center / 100% 100% no-repeat;
}

#entryOverlay.hidden {
  display: none;
}

.entryCard {
  width: min(480px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid rgba(130, 164, 201, 0.55);
  border-radius: 12px;
  padding: 14px;
  background: rgba(10, 16, 25, 0.92);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
  margin-top: 7vh;
}

.entryCard h1 {
  margin: 0 0 6px;
  font-size: 24px;
  color: #e6f3ff;
}

.entryCard p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #b6cee8;
}

.classChoiceEntryCard {
  width: min(860px, 96vw);
  overflow: hidden;
}

.entryForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entryForm.inline {
  margin-top: 10px;
}

.entryForm input {
  border: 1px solid rgba(120, 152, 186, 0.72);
  border-radius: 8px;
  background: rgba(7, 11, 17, 0.9);
  color: #e7f3ff;
  padding: 10px;
}

.entryForm .ghost {
  background: transparent;
  border-color: rgba(120, 152, 186, 0.62);
}

.entryStatus {
  min-height: 18px;
  font-size: 12px;
  color: #b9d2ec;
}

.serverList,
.characterList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.serverCard,
.characterCard {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(124, 157, 191, 0.58);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(34, 49, 66, 0.9), rgba(20, 31, 44, 0.9));
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.serverCard strong {
  font-size: 15px;
}

.characterCard strong {
  font-size: 15px;
  color: #e8f4ff;
}

.characterCard span {
  font-size: 12px;
  color: #aecdff;
}

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

.classChoiceCard {
  min-width: 0;
  padding: 8px;
  gap: 4px;
  text-align: left;
}

.classChoiceCard canvas {
  width: 44px;
  height: 56px;
  margin: 0 auto 4px;
}

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

.classChoiceCard span,
.classChoiceCard small {
  font-size: 11px;
  line-height: 1.25;
  color: #b7d4f1;
}

#entryOverlay.characterSelectOverlay {
  align-items: stretch;
  justify-content: stretch;
  padding: clamp(14px, 2.4vw, 30px);
  background: #05080b;
  overflow: hidden;
  isolation: isolate;
}

#entryOverlay.characterSelectOverlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2, 5, 8, 0.88) 0%, rgba(2, 5, 8, 0.34) 44%, rgba(2, 5, 8, 0.72) 100%),
    linear-gradient(180deg, rgba(2, 5, 8, 0.2) 0%, rgba(2, 5, 8, 0.86) 100%);
}

.characterSelectBg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: brightness(0.56) contrast(1.08) saturate(1.08);
  pointer-events: none;
}

.characterSelectShell {
  position: relative;
  z-index: 2;
  width: min(1440px, 100%);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 342px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 44px);
  align-items: center;
}

.characterSelectPanel {
  width: 100%;
  max-height: min(760px, calc(100vh - 56px));
  min-height: min(560px, calc(100vh - 56px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(177, 152, 96, 0.48);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(19, 25, 29, 0.93), rgba(8, 12, 15, 0.91));
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(255, 244, 210, 0.08);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.characterSelectPanelHead {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(177, 152, 96, 0.26);
}

.characterSelectPanelHead strong {
  color: #f0e5c9;
  font-size: 18px;
}

.characterSelectPanelHead span {
  max-width: 100%;
  color: #aebdcc;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.characterSelectList {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding-right: 3px;
}

.characterSelectCard {
  min-height: 74px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-color: rgba(141, 155, 168, 0.48);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(30, 43, 47, 0.92), rgba(14, 20, 24, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.characterSelectCard.active {
  border-color: rgba(230, 194, 112, 0.95);
  background: linear-gradient(180deg, rgba(64, 55, 33, 0.95), rgba(25, 24, 18, 0.96));
  box-shadow: 0 0 0 1px rgba(230, 194, 112, 0.18), 0 10px 26px rgba(0, 0, 0, 0.28);
}

.characterSelectAvatar {
  width: 44px;
  height: 56px;
  image-rendering: pixelated;
}

.characterSelectCardText {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.characterSelectCardText strong {
  color: #f4ead0;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.characterSelectCardText span {
  color: #9fd0bd;
  font-size: 12px;
}

.emptyCharacterList {
  border: 1px dashed rgba(177, 152, 96, 0.42);
  border-radius: 8px;
  padding: 12px;
  color: #b7c4cf;
  font-size: 13px;
  text-align: center;
}

.characterCreateForm {
  padding-top: 10px;
  border-top: 1px solid rgba(177, 152, 96, 0.22);
}

.characterCreateForm input {
  border-color: rgba(177, 152, 96, 0.5);
  background: rgba(3, 6, 8, 0.78);
}

.characterSelectStage {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vh, 18px);
}

.templeStage {
  position: relative;
  width: min(70vh, 680px, 84vw);
  max-height: min(70vh, 680px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 30px 34px rgba(0, 0, 0, 0.56));
}

.templeImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.templeCharacterPreview {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(96px, 11vw, 150px);
  height: clamp(122px, 14vw, 190px);
  image-rendering: pixelated;
  transform: translate(-50%, calc(-24% - 25px));
}

.characterSelectionBadge {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  min-width: min(280px, 72%);
  max-width: 82%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid rgba(230, 194, 112, 0.42);
  border-radius: 8px;
  background: rgba(7, 10, 12, 0.68);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
}

.characterSelectionBadge strong {
  max-width: 100%;
  color: #f6e7be;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.characterSelectionBadge span {
  color: #b8d8c7;
  font-size: 12px;
}

.characterSelectionActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 180px));
  gap: 12px;
}

.characterSelectionActions button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0;
}

.characterSelectionActions .primary {
  border-color: rgba(232, 195, 102, 0.85);
  background: linear-gradient(180deg, #8f6a28, #4f3516);
  color: #fff6dc;
}

.characterSelectionActions .ghost {
  border-color: rgba(159, 179, 188, 0.54);
  background: rgba(7, 11, 14, 0.76);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.25);
}

@media (max-width: 900px) {
  .classChoiceGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #entryOverlay.characterSelectOverlay {
    padding: 12px;
    overflow-y: auto;
  }

  .characterSelectShell {
    min-height: 100%;
    grid-template-columns: 1fr;
    gap: 12px;
    align-content: start;
  }

  .characterSelectPanel {
    min-height: 0;
    max-height: 42vh;
    order: 2;
  }

  .characterSelectStage {
    min-height: 0;
    height: auto;
    order: 1;
  }

  .templeStage {
    width: min(62vh, 92vw);
    max-height: 48vh;
  }

  .characterSelectionActions {
    width: min(420px, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.serverName {
  color: #ffb347;
}

.serverStatus {
  color: #67e08a;
  font-weight: 700;
}

.serverPing {
  color: #67e08a;
  font-weight: 700;
}

#chatBox {
  position: fixed;
  left: 12px;
  bottom: 12px;
  width: min(440px, 65vw);
  background: rgba(9, 12, 16, 0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(2px);
  padding: 8px;
  z-index: 25;
}

#chatLog {
  max-height: 150px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 8px;
}

#chatLog .msg {
  margin: 2px 0;
}

#chatLog .sys {
  color: #a9c4ff;
}

#chatLog .danger {
  color: #ff6868;
}

#chatInput {
  width: 100%;
  border: 1px solid #59667a;
  background: rgba(5, 7, 10, 0.85);
  color: #f0f6ff;
  padding: 8px;
  border-radius: 6px;
  outline: none;
}

#mapEditor {
  position: fixed;
  top: 12px;
  right: 242px;
  width: min(430px, calc(100vw - 24px));
  height: min(78vh, 760px);
  min-width: 320px;
  min-height: 280px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
  resize: both;
  z-index: 30;
}

#mapEditor.hidden {
  display: none;
}

.editorHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.editorHeader:active {
  cursor: grabbing;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

button {
  border: 1px solid #5e6d82;
  background: #2f3b4b;
  color: #eff6ff;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

.layerBtn.active {
  border-color: #9ed1ff;
  background: #3e526a;
}

.toggleBtn.active {
  border-color: #7adca9;
  background: #2d5c45;
}

#editorInfo {
  font-size: 12px;
  color: #c3cedd;
}

.animEditor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid #59667a;
  border-radius: 6px;
  background: rgba(7, 10, 14, 0.58);
}

.animToggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #d7e3f7;
}

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

.animInputs input,
.animSpeedRow select,
.animSpeedRow input {
  width: 100%;
  border: 1px solid #59667a;
  background: rgba(5, 7, 10, 0.9);
  color: #eff6ff;
  border-radius: 4px;
  padding: 6px;
  font-size: 12px;
}

.animSpeedRow {
  display: grid;
  grid-template-columns: 1fr 110px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #d7e3f7;
}

#tilesetIdHint {
  font-size: 12px;
  color: #b4c8e8;
}

#tilesetScroller {
  border: 1px solid #59667a;
  border-radius: 6px;
  flex: 1 1 auto;
  min-height: 120px;
  overflow: auto;
  background: #0c0f13;
}

#tilesetCanvas {
  display: block;
  image-rendering: pixelated;
}

.tips {
  font-size: 12px;
  color: #c5d2e5;
}

#uiDock {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 218px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#miniMapCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.94);
  padding: 8px;
}

.miniMapHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}

.miniMapControls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.miniMapControls button {
  width: 29px;
  height: 29px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

#miniMapZoomLabel {
  min-width: 32px;
  text-align: center;
  font-size: 14px;
  color: #cddcf1;
}

#miniMapCanvas {
  display: block;
  width: 166px;
  height: 166px;
  border: 1px solid #59667a;
  border-radius: 4px;
  background: #090d13;
  image-rendering: pixelated;
}

#dockActionRow {
  display: grid;
  grid-template-columns: 36px 50px 1fr 44px;
  gap: 6px;
  align-items: center;
}

#dockActionRow button {
  height: 36px;
  padding: 0 6px;
  font-size: 15px;
}

#settingsToggleBtn,
#huntAnalyzerBtn,
#hubToggleBtn {
  padding: 0;
}

#settingsPanel {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(560px, 90vw);
  height: min(520px, 78vh);
  transform: translate(-50%, -50%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  border: 1px solid rgba(89, 102, 122, 0.4);
  border-radius: 10px;
  background: rgba(12, 16, 22, 0.96);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 90;
}

#settingsPanel.expanded {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
  border-color: var(--line);
}

#settingsPanel .panelTitle {
  padding: 14px 16px;
  font-size: 14px;
  color: #c9d8ef;
}

#rightHubPanel {
  width: 218px;
  height: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.92);
  transition: height 180ms ease, border-color 180ms ease;
  position: relative;
  z-index: 3;
}

#rightHubPanel.expanded {
  height: calc(100vh - 286px);
  border-color: var(--line);
  overflow-y: auto;
  padding: 8px;
}

.hubInventoryHeader {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  padding: 6px 8px 2px;
  border-bottom: 1px solid rgba(136, 164, 198, 0.34);
}

.hubCollapseBtn {
  margin-left: auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(126, 157, 192, 0.65);
  border-radius: 5px;
  background: rgba(26, 35, 46, 0.9);
  color: #dcecff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 140ms ease, filter 140ms ease;
}

.hubCollapseBtn.collapsed {
  transform: rotate(0deg);
}

.hubSlotsSection.collapsed .hubSlotsGrid {
  display: none;
}

.hubSkillsSection.collapsed .hubSkillsBody {
  display: none;
}

.hubSlotsSection {
  border: 1px solid rgba(116, 144, 176, 0.36);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34, 45, 58, 0.72), rgba(21, 29, 39, 0.72));
  padding: 6px 8px 8px;
  position: relative;
  min-width: 178px;
  min-height: 128px;
  max-width: min(520px, 86vw);
  max-height: 72vh;
  resize: both;
  overflow: auto;
}

.hubSlotsSection::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 12px;
  height: 12px;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 44%, rgba(183, 214, 246, 0.7) 46%, rgba(183, 214, 246, 0.7) 54%, transparent 56%) center center / 100% 100% no-repeat;
}

.hubSlotsSection.collapsed {
  min-height: 0;
  resize: none;
  overflow: hidden;
}

.monsterBagSection {
  margin-top: 10px;
}

.monsterBagIcon {
  background: linear-gradient(180deg, #7b6a55, #4e3f32);
  border-color: #c3a783;
}

.hubSkillsSection {
  margin-top: 10px;
  border: 1px solid rgba(116, 144, 176, 0.36);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34, 45, 58, 0.72), rgba(21, 29, 39, 0.72));
  padding: 6px 8px 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 360px;
  min-height: 230px;
  max-height: 72vh;
  resize: vertical;
  overflow: hidden;
}

.hubSkillsSection::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 12px;
  height: 12px;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 44%, rgba(183, 214, 246, 0.7) 46%, rgba(183, 214, 246, 0.7) 54%, transparent 56%) center center / 100% 100% no-repeat;
}

.hubSkillsSection.collapsed {
  height: auto;
  min-height: 0;
  resize: none;
}

.hubBagIcon {
  width: 24px;
  height: 24px;
  border: 1px solid #9fb8d4;
  border-radius: 5px;
  background: linear-gradient(180deg, #738ca8, #4f657d);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(220, 236, 255, 0.2);
}

.hubBagIcon::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 6px;
  left: 50%;
  transform: translateX(-50%);
  top: -5px;
  border: 1px solid #9fb8d4;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.hubSkillsIcon {
  width: 24px;
  height: 24px;
  border: 1px solid #9fb8d4;
  border-radius: 5px;
  background: linear-gradient(180deg, #6f89a7, #4d6480);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(220, 236, 255, 0.2);
}

.hubSkillsIcon::before,
.hubSkillsIcon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 2px;
  left: 6px;
  top: 11px;
  background: rgba(230, 242, 255, 0.9);
  border-radius: 2px;
}

.hubSkillsIcon::before {
  transform: rotate(45deg);
}

.hubSkillsIcon::after {
  transform: rotate(-45deg);
}

.hubBagTitle {
  font-size: 15px;
  font-weight: 700;
  color: #ddeaff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.hubHungerLabel {
  font-size: 11px;
  color: #d5e4f8;
  margin-bottom: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(130, 160, 194, 0.36);
  border-radius: 7px;
  background: rgba(35, 47, 62, 0.54);
}

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

.hubSlot {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid #4c647d;
  border-radius: 6px;
  background: linear-gradient(180deg, #111a24, #090f16);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.28);
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease;
}

.hubSlot:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  border-color: #7592b3;
}

.hubSlot.dragging {
  transform: scale(0.96);
  filter: brightness(1.2);
  border-color: #8fc2ff;
  box-shadow:
    inset 0 0 0 1px rgba(184, 224, 255, 0.45),
    0 0 0 2px rgba(93, 153, 222, 0.34),
    0 8px 20px rgba(5, 14, 26, 0.42);
}

.hubSlot.drag-over-inventory {
  transform: translateY(-1px);
  border-color: #a6d7ff;
  box-shadow:
    inset 0 0 0 1px rgba(187, 228, 255, 0.5),
    0 0 0 2px rgba(113, 182, 255, 0.34),
    0 8px 22px rgba(9, 23, 40, 0.45);
}

.hotbarSlot.drag-over-inventory {
  border-color: #a6d7ff;
  box-shadow:
    inset 0 0 0 1px rgba(187, 228, 255, 0.5),
    0 0 0 2px rgba(113, 182, 255, 0.34);
}

.hubSlot.empty {
  background: linear-gradient(180deg, #0e151d, #070b11);
  border-style: dashed;
  border-color: rgba(76, 100, 125, 0.82);
  box-shadow: none;
}

.hubSlot::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.hubSlot canvas {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
  position: relative;
  z-index: 1;
}

.hubSlotQty {
  position: absolute;
  right: 3px;
  bottom: 2px;
  font-size: 11px;
  color: #e7f2ff;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(132, 182, 237, 0.48);
  font-weight: 700;
  z-index: 2;
}

.hubSkillsBody {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
}

.hubSkillsBody::-webkit-scrollbar {
  width: 8px;
}

.hubSkillsBody::-webkit-scrollbar-track {
  background: rgba(10, 15, 22, 0.8);
  border-radius: 999px;
}

.hubSkillsBody::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7ca8d6, #4d6f95);
  border-radius: 999px;
  border: 1px solid rgba(190, 219, 248, 0.35);
}

.hubSkillsBody::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8ebbe7, #5d82aa);
}

.skillRow {
  border: 1px solid rgba(90, 116, 145, 0.5);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(16, 24, 34, 0.92), rgba(10, 16, 24, 0.92));
  padding: 6px;
}

.skillTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 5px;
  gap: 8px;
}

.skillName {
  color: #dcecff;
  font-weight: 700;
}

.skillLevel {
  color: #aecdff;
  font-weight: 700;
  min-width: 48px;
  text-align: right;
  font-size: 10px;
}

.skillBar {
  width: 100%;
  height: 8px;
  border: 1px solid rgba(88, 115, 145, 0.62);
  border-radius: 999px;
  background: rgba(6, 10, 16, 0.9);
  overflow: hidden;
}

.skillFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6ea8e9, #96cbff);
  box-shadow: 0 0 8px rgba(110, 168, 233, 0.45);
  transition: width 220ms ease;
}

.skillFill.stamina-bonus {
  background: linear-gradient(90deg, #47d072, #9bf2b4);
  box-shadow: 0 0 8px rgba(71, 208, 114, 0.5);
}

.skillFill.stamina-yellow {
  background: linear-gradient(90deg, #e3c54f, #ffeb96);
  box-shadow: 0 0 8px rgba(227, 197, 79, 0.5);
}

.skillFill.stamina-orange {
  background: linear-gradient(90deg, #dc8e39, #ffbe7a);
  box-shadow: 0 0 8px rgba(220, 142, 57, 0.5);
}

.skillFill.stamina-red {
  background: linear-gradient(90deg, #d44a4a, #ff9a9a);
  box-shadow: 0 0 8px rgba(212, 74, 74, 0.5);
}

.merchantRow {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  column-gap: 10px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(120, 149, 181, 0.42);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 29, 40, 0.96), rgba(12, 19, 28, 0.96));
  box-shadow: inset 0 0 0 1px rgba(187, 214, 241, 0.08);
}

.merchantIcon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(141, 171, 206, 0.62);
  border-radius: 7px;
  background: rgba(8, 12, 18, 0.74);
  padding: 2px;
  image-rendering: pixelated;
}

.merchantLabel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.merchantLabel strong {
  font-size: 13px;
  color: #e6f2ff;
}

.merchantLabel span {
  font-size: 11px;
  color: #bcd3ec;
}

.merchantBuyBtn {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(124, 173, 227, 0.72);
  border-radius: 8px;
  background: linear-gradient(180deg, #3f6591, #304f74);
  color: #eaf4ff;
}

.merchantBuyBtn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.itemContextMenu {
  position: fixed;
  z-index: 100;
  min-width: 132px;
  background: rgba(9, 13, 20, 0.96);
  border: 1px solid #647792;
  border-radius: 6px;
  padding: 6px;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.itemContextMenu.open {
  display: block;
}

.itemContextMenu button {
  width: 100%;
  margin: 0;
  height: 30px;
  text-align: left;
  font-size: 12px;
}

.itemContextMenu button + button {
  margin-top: 4px;
}

.itemHoverTooltip {
  position: fixed;
  z-index: 140;
  display: none;
  max-width: min(420px, 46vw);
  padding: 10px 12px;
  border: 1px solid rgba(132, 166, 204, 0.62);
  border-radius: 10px;
  background:
    radial-gradient(circle at top left, rgba(102, 149, 205, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(13, 20, 30, 0.98), rgba(7, 12, 19, 0.98));
  color: #e8f3ff;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.itemHoverTooltip.open {
  display: block;
}

.merchantModal {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(5, 9, 14, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.merchantModal.open {
  display: flex;
}

.merchantModalCard {
  width: min(500px, 94vw);
  max-height: 82vh;
  overflow-y: auto;
  border: 1px solid rgba(118, 150, 186, 0.62);
  border-radius: 12px;
  background:
    radial-gradient(circle at 14% 10%, rgba(106, 152, 208, 0.13), transparent 36%),
    linear-gradient(180deg, rgba(16, 24, 35, 0.98), rgba(9, 15, 23, 0.98));
  padding: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.46);
}

.merchantModalHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid rgba(123, 156, 192, 0.38);
}

.merchantModalHeadText {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.merchantModalTitle {
  color: #e9f3ff;
  font-size: 16px;
  font-weight: 700;
}

.merchantModalSubtitle {
  color: #b8d1ec;
  font-size: 11px;
}

.merchantModalClose {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(128, 159, 194, 0.62);
  border-radius: 8px;
  background: linear-gradient(180deg, #2b3c52, #1f2d40);
  font-weight: 700;
}

.merchantModalBody {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.marketModalCard {
  width: min(1120px, 96vw);
  max-height: 90vh;
}

.marketTabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.marketTabBtn {
  min-width: 124px;
  font-weight: 700;
}

.marketTabBtn.active {
  border-color: rgba(159, 201, 247, 0.86);
  background: linear-gradient(180deg, rgba(65, 95, 127, 0.95), rgba(43, 68, 95, 0.95));
}

.marketPanel {
  display: none;
}

.marketPanel.active {
  display: block;
}

.marketBoard {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 10px;
}

.marketLeft {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.marketSearch {
  border: 1px solid rgba(120, 152, 186, 0.72);
  border-radius: 8px;
  background: rgba(7, 11, 17, 0.9);
  color: #e7f3ff;
  padding: 8px 10px;
}

.marketItemList {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: 49vh;
  overflow-y: auto;
  border: 1px solid rgba(111, 145, 182, 0.46);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 29, 40, 0.9), rgba(12, 19, 28, 0.9));
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.marketItemBtn {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(109, 142, 178, 0.56);
  border-radius: 7px;
  background: rgba(28, 40, 56, 0.8);
  font-size: 12px;
  padding: 7px 8px;
}

.marketItemBtn.active {
  border-color: rgba(152, 198, 244, 0.9);
  background: linear-gradient(180deg, rgba(63, 93, 124, 0.88), rgba(44, 69, 97, 0.88));
}

.marketItemDetail {
  border: 1px solid rgba(113, 146, 182, 0.52);
  border-radius: 10px;
  background: rgba(13, 20, 30, 0.9);
  padding: 8px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: start;
}

.marketItemDetail canvas {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(141, 171, 206, 0.62);
  border-radius: 6px;
  background: rgba(8, 12, 18, 0.74);
}

.marketItemDetailText {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.marketItemDetailText strong {
  font-size: 13px;
  color: #e6f2ff;
}

.marketItemDetailText span {
  font-size: 11px;
  color: #b8d1ec;
  line-height: 1.25;
}

.marketRight {
  display: grid;
  grid-template-rows: minmax(180px, 1fr) minmax(180px, 1fr) minmax(130px, 0.8fr);
  gap: 10px;
  min-height: 0;
}

.marketSection {
  border: 1px solid rgba(120, 149, 181, 0.42);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 29, 40, 0.96), rgba(12, 19, 28, 0.96));
  box-shadow: inset 0 0 0 1px rgba(187, 214, 241, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 8px;
  gap: 7px;
}

.marketSectionHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.marketSectionHead strong {
  font-size: 13px;
  color: #e6f2ff;
}

.marketSectionHead span {
  font-size: 10px;
  color: #9bbada;
}

.marketRows {
  min-height: 100px;
  max-height: 22vh;
  overflow-y: auto;
  border: 1px solid rgba(99, 128, 160, 0.44);
  border-radius: 8px;
  background: rgba(8, 13, 20, 0.68);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.marketTradeRow {
  border: 1px solid rgba(100, 130, 162, 0.45);
  border-radius: 7px;
  background: rgba(19, 28, 40, 0.9);
  padding: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.marketTradeInfo {
  font-size: 11px;
  color: #d4e6fb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marketActionBtn {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.marketPostRow {
  display: grid;
  grid-template-columns: 1fr 80px auto;
  gap: 6px;
}

.marketPriceInput,
.marketQtyInput {
  border: 1px solid rgba(120, 152, 186, 0.72);
  border-radius: 8px;
  background: rgba(7, 11, 17, 0.9);
  color: #e7f3ff;
  padding: 7px 8px;
  font-size: 12px;
}

.marketEmpty {
  font-size: 11px;
  color: #9ebddb;
  padding: 5px 6px;
}

.marketHistoryRow {
  border: 1px solid rgba(96, 124, 155, 0.45);
  border-radius: 6px;
  background: rgba(15, 22, 33, 0.82);
  padding: 6px;
  font-size: 11px;
  color: #cbe0f7;
  line-height: 1.25;
}

.rorModalCard {
  width: min(960px, 95vw);
  max-height: 88vh;
}

.rorSubtitle {
  color: #c9dbef;
  font-size: 12px;
}

.rorPackages {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
}

.rorPackage {
  border: 1px solid rgba(117, 148, 181, 0.55);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(25, 36, 51, 0.95), rgba(13, 21, 31, 0.95));
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
  overflow: hidden;
}

.rorPackage::before {
  content: "";
  position: absolute;
  inset: -40% 55% auto -20%;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 214, 92, 0.34), transparent 70%);
  pointer-events: none;
}

.rorPackHead {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rorPackHead img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}

.rorPackHead strong {
  font-size: 15px;
  color: #f0f7ff;
}

.rorPackPrice {
  font-size: 14px;
  color: #ffd786;
  font-weight: 700;
}

.rorPackBonus {
  font-size: 12px;
  color: #9bd0ff;
}

.rorPayWrap {
  margin-top: 10px;
  border: 1px solid rgba(115, 149, 186, 0.5);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(19, 29, 42, 0.95), rgba(11, 18, 27, 0.95));
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rorPayText {
  font-size: 12px;
  color: #c8dcf2;
}

.rorCopyBtn {
  min-width: 140px;
  font-weight: 700;
}

.skinShopCoins {
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(121, 163, 210, 0.5);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 31, 44, 0.85), rgba(12, 20, 30, 0.85));
  color: #e3f0ff;
  font-size: 13px;
  font-weight: 700;
}

.skinShopList {
  max-height: min(56vh, 560px);
  overflow-y: auto;
  padding-right: 4px;
}

.skinShopList::-webkit-scrollbar {
  width: 8px;
}

.skinShopList::-webkit-scrollbar-thumb {
  background: rgba(132, 168, 208, 0.5);
  border-radius: 8px;
}

.skinShopDefaultRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(111, 145, 182, 0.46);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 29, 40, 0.96), rgba(12, 19, 28, 0.96));
}

.skinShopDefaultLabel {
  color: #d5e7fb;
  font-size: 12px;
  font-weight: 700;
}

.skinShopRow {
  display: grid;
  grid-template-columns: 66px 1fr auto;
  align-items: center;
  column-gap: 10px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(120, 149, 181, 0.42);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 29, 40, 0.96), rgba(12, 19, 28, 0.96));
  box-shadow: inset 0 0 0 1px rgba(187, 214, 241, 0.08);
}

.skinShopPreview {
  width: 64px;
  height: 82px;
  border: 1px solid rgba(141, 171, 206, 0.62);
  border-radius: 7px;
  background: rgba(8, 12, 18, 0.74);
  image-rendering: pixelated;
}

.skinShopLabel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.skinShopLabel strong {
  color: #e6f2ff;
  font-size: 13px;
}

.skinShopLabel span {
  color: #b8d1ec;
  font-size: 11px;
}

.skinShopStatus {
  color: #8fd1ff;
  font-size: 11px;
  font-weight: 700;
}

.npcModal {
  position: fixed;
  inset: 0;
  z-index: 96;
  background: rgba(5, 9, 14, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.npcModal.open {
  display: flex;
}

.npcModalCard {
  width: min(500px, 94vw);
  max-height: 82vh;
}

.npcModalBody {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.npcActionList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.npcActionRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.npcBankGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 7px;
  border: 1px solid rgba(111, 145, 182, 0.42);
  border-radius: 10px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(14, 22, 32, 0.9), rgba(10, 16, 24, 0.9));
  max-height: 340px;
  overflow-y: auto;
  align-content: start;
}

.npcBankGrid::-webkit-scrollbar {
  width: 9px;
}

.npcBankGrid::-webkit-scrollbar-track {
  background: rgba(9, 14, 20, 0.9);
  border-radius: 999px;
}

.npcBankGrid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7ca8d6, #4d6f95);
  border-radius: 999px;
  border: 1px solid rgba(190, 219, 248, 0.35);
}

.npcBankGrid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8ebbe7, #5d82aa);
}

.npcBankSlot {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(108, 139, 173, 0.66);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(16, 23, 33, 0.96), rgba(8, 13, 20, 0.96));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.28);
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease;
}

.npcBankSlot:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  border-color: #7592b3;
}

.npcBankSlot.empty {
  border-style: dashed;
  border-color: rgba(95, 123, 153, 0.72);
  box-shadow: none;
}

.npcBankSlot canvas {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
}

.npcBankSlot.dragging {
  transform: scale(0.96);
  filter: brightness(1.2);
  border-color: #8fc2ff;
}

.npcBankSlot.drag-over-inventory {
  transform: translateY(-1px);
  border-color: #a6d7ff;
  box-shadow:
    inset 0 0 0 1px rgba(187, 228, 255, 0.5),
    0 0 0 2px rgba(113, 182, 255, 0.34),
    0 8px 22px rgba(9, 23, 40, 0.45);
}

.npcBankSlotQty {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 10px;
  color: #e7f2ff;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
}

.npcBankTip {
  margin-bottom: 2px;
}

.banqueiroModal {
  pointer-events: none;
  background: transparent;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 16px 238px 16px 16px;
}

.banqueiroModal .merchantModalCard {
  pointer-events: auto;
  width: min(520px, 92vw);
  margin-top: 56px;
}

.hotkeyPromptModal {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(6, 10, 16, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hotkeyPromptModal.open {
  display: flex;
}

.hotkeyPromptCard {
  width: min(360px, 94vw);
  border: 1px solid rgba(130, 160, 194, 0.62);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 30, 42, 0.98), rgba(11, 18, 27, 0.98));
  padding: 14px;
  text-align: center;
}

.hotkeyPromptTitle {
  font-size: 15px;
  font-weight: 700;
  color: #e3f0ff;
  margin-bottom: 6px;
}

.hotkeyPromptLabel {
  font-size: 13px;
  color: #bdd5ef;
  margin-bottom: 8px;
}

.hotkeyPromptHint {
  font-size: 11px;
  color: #97b3d1;
}

.hotbarContextMenu {
  position: fixed;
  z-index: 105;
  min-width: 142px;
  background: rgba(10, 14, 20, 0.96);
  border: 1px solid rgba(116, 144, 176, 0.74);
  border-radius: 7px;
  padding: 6px;
  display: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
}

.hotbarContextMenu.open {
  display: block;
}

.hotbarContextMenu button {
  width: 100%;
  height: 30px;
  margin: 0;
  text-align: left;
  font-size: 12px;
}

.hotbarHub {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 65;
  padding: 5px 7px 7px;
  border: 1px solid rgba(110, 140, 174, 0.52);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% -25%, rgba(150, 188, 227, 0.15), transparent 62%),
    linear-gradient(180deg, rgba(20, 29, 40, 0.96), rgba(11, 17, 25, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.hotbarExpandBtn {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(90deg);
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(126, 157, 192, 0.75);
  border-radius: 7px;
  background: linear-gradient(180deg, #3a516d, #25364a);
  color: #e1efff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.hotbarExpandBtn.expanded {
  transform: translateX(-50%) rotate(-90deg);
}

.hotbarGrid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(var(--hotbar-cols, 32), minmax(0, 1fr));
  gap: 4px;
}

.hotbarSlot {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(108, 139, 173, 0.66);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(16, 23, 33, 0.96), rgba(8, 13, 20, 0.96));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.44);
}

.hotbarSlot.extra {
  display: none;
}

.hotbarHub.expanded .hotbarSlot.extra {
  display: flex;
}

.hotbarSlot.empty {
  border-style: dashed;
  border-color: rgba(95, 123, 153, 0.72);
}

.hotbarSlot canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  border-radius: 5px;
}

.hotbarQty {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 8px;
  color: #e7f2ff;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
}

.hotbarKey {
  position: absolute;
  left: 2px;
  top: 1px;
  font-size: 8px;
  color: #aac8e8;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
}

.hotbarCooldown {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(6, 10, 16, 0.8) 0%,
    rgba(6, 10, 16, 0.8) calc(var(--cdr-progress, 0) * 100%),
    rgba(6, 10, 16, 0.08) calc(var(--cdr-progress, 0) * 100%),
    rgba(6, 10, 16, 0.08) 100%
  );
  opacity: 0;
  transition: opacity 80ms linear;
  z-index: 1;
}

.hotbarCooldown.active {
  opacity: 1;
}

.hotbarCooldownText {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #f1f6ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 2;
}

body.map-editor-dragging {
  user-select: none;
  cursor: move;
}

#gameLayout {
  position: fixed;
  inset: 0 10px var(--bottom-hud-space) 10px;
  z-index: 20;
  pointer-events: none;
}

#playArea {
  position: absolute;
  inset: 0;
}

#gameFrame {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: calc(100vw - (var(--hud-side-space) * 2));
  height: 100%;
  border: 2px solid rgba(123, 153, 190, 0.72);
  border-radius: 10px;
  background: #091019;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  pointer-events: auto;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  cursor: crosshair;
}

#uiDock {
  position: fixed;
  left: 10px;
  top: 0;
  bottom: 0;
  z-index: 85;
  transform: none;
  width: auto;
  height: auto;
  display: flex;
  align-items: stretch;
  gap: 6px;
  pointer-events: auto;
}

#miniMapCanvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

#dockActionRow {
  width: 26px;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

#dockActionRow button {
  width: 26px;
  height: 58px;
  padding: 0;
}

#hubToggleBtn,
#rightPullToggleBtn,
#leftPullToggleBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 58px;
  padding: 0;
  border: 1px solid rgba(126, 157, 192, 0.74);
  border-radius: 8px;
  background: linear-gradient(180deg, #3a516d, #25364a);
  color: #e1efff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

#rightHubPanel {
  height: 100%;
  width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(12, 16, 22, 0.94);
  transition: width 180ms ease, border-color 180ms ease, padding 180ms ease;
}

#rightHubPanel.expanded {
  width: 280px;
  height: 100%;
  padding: 10px;
  border-color: var(--line);
  overflow-y: auto;
}

#rightHubPanel #miniMapCard {
  margin-bottom: 8px;
}

.hubHungerLabel {
  margin-bottom: 8px;
}

#rightPullHub {
  position: fixed;
  right: 10px;
  top: 0;
  bottom: 0;
  z-index: 85;
  transform: none;
  height: auto;
  pointer-events: auto;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

#leftPullHub {
  position: fixed;
  left: 10px;
  top: 0;
  bottom: 0;
  z-index: 85;
  transform: none;
  height: auto;
  pointer-events: auto;
  display: flex;
  flex-direction: row-reverse;
  align-items: stretch;
  gap: 6px;
}

#leftPullToggleBtn {
  position: relative;
  z-index: 6;
  flex: 0 0 26px;
}

#rightPullPanel {
  height: 100%;
  width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.94);
  transition: width 180ms ease, border-color 180ms ease, padding 180ms ease;
  padding: 0;
}

#leftPullPanel {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(12, 16, 22, 0.94);
  transition: width 180ms ease, border-color 180ms ease, padding 180ms ease;
  padding: 0;
}

#leftHubContent {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

#rightPullHub.expanded #rightPullPanel {
  width: 280px;
  border-color: var(--line);
  padding: 10px;
}

#leftPullHub.expanded #leftPullPanel {
  width: 280px;
  border-color: var(--line);
  padding: 10px;
}

#rightHubActionRow {
  display: grid;
  grid-template-columns: 40px 52px 1fr;
  gap: 6px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

#rightHubActionRow button {
  height: 40px;
  padding: 0 8px;
  font-size: 14px;
}

#marketBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  background: linear-gradient(180deg, #4c6a2f, #36501f);
  border-color: rgba(186, 220, 135, 0.72);
}

.shopBtnIcon {
  font-size: 16px;
  line-height: 1;
}

.rorBtnIcon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
}

#rightHubContent {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.dockZone {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-height: 100%;
}

.dockZone.drag-over {
  outline: 1px dashed rgba(164, 202, 240, 0.65);
  outline-offset: -2px;
}

.dockItem {
  cursor: grab;
}

.dockItem.hubSlotsSection {
  cursor: auto;
}

.dockItem.hubSlotsSection .hubInventoryHeader {
  cursor: grab;
}

.dockItem.dragging {
  opacity: 0.65;
  cursor: grabbing;
}

.dockZone > .dockItem {
  margin: 0 !important;
}

.equipHubRow {
  display: flex;
  gap: 8px;
  align-items: start;
  width: 100%;
}

.equipHubCard {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid rgba(116, 144, 176, 0.36);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34, 45, 58, 0.72), rgba(21, 29, 39, 0.72));
  padding: 8px;
}

.equipMainGrid {
  display: grid;
  gap: 6px;
}

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

.equipSlot {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(108, 139, 173, 0.66);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(16, 23, 33, 0.96), rgba(8, 13, 20, 0.96));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.44);
  display: flex;
  align-items: center;
  justify-content: center;
}

.equipSlot.empty canvas {
  opacity: 0.74;
  filter: saturate(0.72) brightness(0.88);
}

.equipSlot canvas {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
}

.equipSlotSpacer {
  opacity: 0.35;
}

.equipAuxGrid {
  display: grid;
  grid-template-columns: repeat(2, 21px);
  grid-template-rows: repeat(3, 21px);
  gap: 5px;
  padding-top: 2px;
}

.equipAuxSlot {
  width: 21px;
  height: 21px;
  border: 1px solid rgba(108, 139, 173, 0.62);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(14, 20, 29, 0.95), rgba(9, 13, 19, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
}

.equipAuxSlot canvas {
  width: 17px;
  height: 17px;
  image-rendering: pixelated;
  opacity: 0.72;
  filter: saturate(0.7) brightness(0.86);
}

.rightHubHint {
  margin-top: 6px;
  color: #b6cee8;
  font-size: 12px;
  line-height: 1.3;
}

#bottomHud {
  position: fixed;
  left: var(--hud-side-space);
  right: var(--hud-side-space);
  bottom: 10px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

#hotbarMount,
#chatBox {
  pointer-events: auto;
}

#chatBox {
  position: relative;
  left: auto;
  bottom: auto;
  width: 100%;
  border-radius: 10px;
  padding: 9px;
}

#chatLog {
  max-height: 128px;
}

.hotbarHub {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  padding: 5px;
}

.hotbarExpandBtn {
  display: none;
}

.hotbarGrid {
  grid-template-columns: repeat(var(--hotbar-cols, 32), minmax(0, 1fr));
  justify-content: stretch;
  gap: 4px;
}

.hotbarSlot {
  width: 100%;
  min-width: 0;
}

.hotbarSlot.extra {
  display: flex;
}

#settingsPanel {
  z-index: 95;
}

@media (max-width: 1200px) {
  :root {
    --hud-side-space: 254px;
    --bottom-hud-space: 208px;
  }

  #gameLayout {
    inset: 0 8px var(--bottom-hud-space) 8px;
  }

  #gameFrame {
    width: calc(100vw - (var(--hud-side-space) * 2));
    height: 100%;
  }

  #uiDock {
    width: auto;
  }

  #rightHubPanel.expanded {
    width: 220px;
  }

  #rightPullHub.expanded #rightPullPanel {
    width: 220px;
  }

  #leftPullHub.expanded #leftPullPanel {
    width: 220px;
  }

  #bottomHud {
    left: var(--hud-side-space);
    right: var(--hud-side-space);
  }

  .marketBoard {
    grid-template-columns: 1fr;
  }

  .marketLeft {
    min-height: 0;
  }

  .marketItemList {
    max-height: 220px;
  }

  .marketRight {
    grid-template-rows: auto auto auto;
  }

  .marketRows {
    max-height: 180px;
  }

  .rorPackages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
