:root {
  color-scheme: light;
  --ink: #0d0f0e;
  --stone-1: #121515;
  --stone-2: #1b201f;
  --stone-3: #242725;
  --panel: rgba(13, 17, 18, 0.86);
  --panel-2: rgba(20, 24, 25, 0.9);
  --panel-edge: rgba(212, 176, 96, 0.25);
  --panel-glow: rgba(226, 179, 90, 0.15);
  --accent: #d9b26b;
  --accent-2: #7fbfa3;
  --accent-3: #c77b45;
  --text: #f3ead4;
  --muted: #b6a88b;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --slot-size: 32px;
  --title-font: "Iowan Old Style", "Goudy Old Style", "Garamond", "Palatino Linotype", serif;
  --ui-font: "Avenir Next", "Lucida Bright", "Goudy Old Style", "Garamond", serif;
  --ui-skin-url: url("./assets/ui-skin.png");
  --ui-skin-width: 352px;
  --ui-skin-height: 288px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ui-font);
  color: var(--text);
  background:
    linear-gradient(rgba(5, 7, 8, 0.45), rgba(5, 7, 8, 0.45)),
    url("./assets/tibia-splashscreen.jpg") center / cover no-repeat fixed,
    linear-gradient(145deg, var(--stone-1), var(--stone-2) 50%, var(--stone-3));
  overflow-x: hidden;
}

.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.boot-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.boot-loader-text {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: clamp(42px, 8vw, 96px);
  font-weight: 700;
  line-height: 1;
  color: #f0f0f0;
  text-shadow:
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    0 0 8px rgba(0, 0, 0, 0.8);
  animation: boot-loader-pulse 1.3s ease-in-out infinite;
}

.boot-loader-dots {
  display: inline-flex;
  min-width: 1.2em;
}

.boot-loader-dots span {
  display: inline-block;
  width: 0.4em;
  text-align: center;
  animation: boot-loader-dot 1.1s ease-in-out infinite;
}

.boot-loader-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.boot-loader-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes boot-loader-pulse {
  0%,
  100% {
    transform: translateY(0);
    filter: brightness(1);
  }
  50% {
    transform: translateY(-2px);
    filter: brightness(1.12);
  }
}

@keyframes boot-loader-dot {
  0%,
  60%,
  100% {
    opacity: 0.2;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

body.in-game {
  background:
    linear-gradient(rgba(32, 34, 36, 0.72), rgba(24, 26, 28, 0.8)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.045) 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 7px
    ),
    linear-gradient(145deg, #3d4246, #2e3337 50%, #252a2e);
}

body.use-with-mode #render-canvas,
body.use-with-mode .battle-row {
  cursor: crosshair;
}

body.use-with-mode .battle-row * {
  cursor: inherit;
}

body.use-with-mode,
body.use-with-mode * {
  cursor: crosshair !important;
}

body.is-dragging #render-canvas,
body.is-dragging .slot,
body.is-dragging .action-slot,
body.is-dragging .battle-row {
  cursor: grabbing;
}

.backdrop {
  display: none;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -12px, 0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

#app {
  position: relative;
  max-width: 1400px;
  padding: 44px 20px 80px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.eyebrow {
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 10px;
  font-size: 12px;
}

h1,
h2,
h3 {
  font-family: var(--title-font);
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(30px, 4.6vw, 48px);
  margin: 0 0 8px;
}

.subtitle {
  color: var(--muted);
  margin: 0;
  max-width: 540px;
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

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

body.in-game .workspace.full {
  align-items: start;
}

.control-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  animation: rise 0.7s ease both;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.game-window {
  display: none;
  position: relative;
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(15, 19, 20, 0.98), rgba(8, 10, 10, 0.98)),
    linear-gradient(120deg, rgba(226, 179, 90, 0.1), rgba(0, 0, 0, 0));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-edge);
  animation: rise 0.8s ease both;
}

body.in-game #app {
  max-width: none;
  padding: 0 10px 12px;
  gap: 8px;
}

body.in-game .game-window {
  display: block;
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  animation: none;
}

body.in-game .game-window::before {
  display: none;
}

body.in-game .game-layout {
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 10px;
  align-items: start;
}

body.in-game .game-sidebar {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
}

body.in-game .viewport-column {
  gap: 0;
  min-width: 0;
}

body.in-game .viewport-shell {
  border-radius: 8px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #353535;
}

body.in-game .viewport-frame {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  max-height: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: #454545;
  background-image: var(--ot-panel-bg);
  background-repeat: repeat;
}

body.in-game #render-canvas {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  background: transparent;
}

.game-window::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.game-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#ui-lock {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 10px;
}

.game-eyebrow {
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--accent-2);
  margin: 0 0 6px;
}

.game-title {
  margin: 0;
  font-size: 26px;
}

.top-menu {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(10, 14, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

body:not(.debug-active) .game-topbar,
body:not(.debug-active) .hud,
body:not(.debug-active) .top-menu {
  display: none !important;
}

.launcher-menu {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 120;
  display: grid;
  gap: 8px;
}

body.in-game .launcher-menu {
  display: none;
}

.launcher-releases {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 120;
  width: 190px;
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #7a7a7a;
  border-radius: 0;
  background: #5a5a5a;
  color: #f3f3f3;
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 12px;
}

body.in-game .launcher-releases {
  display: none;
}

.launcher-releases h3 {
  margin: 0 0 2px;
  font-size: 13px;
  font-family: "Verdana", "Geneva", sans-serif;
  font-weight: 700;
}

.launcher-releases a {
  color: #f3f3f3;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.12);
  padding: 6px 8px;
  display: block;
}

.launcher-releases a:hover {
  background: rgba(255, 255, 255, 0.14);
}

.launcher-menu button {
  width: 96px;
  padding: 8px 10px;
  border: 1px solid #7a7a7a;
  border-radius: 0;
  background: #5a5a5a;
  color: #f3f3f3;
  font-size: 13px;
  text-align: center;
}

.launcher-menu button:hover {
  background: #696969;
}

.active-server-indicator {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 120;
  padding: 6px 10px;
  border: 1px solid rgba(240, 240, 0, 0.38);
  background: rgba(20, 20, 20, 0.68);
  color: #f0f000;
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

body.in-game .active-server-indicator {
  display: none;
}

.server-load-notice {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 6px);
  z-index: 121;
  padding: 6px 12px;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 12, 12, 0.88);
  color: #ffffff;
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.server-load-notice.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.in-game .server-load-notice {
  display: none;
}

.players-online-indicator {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 121;
  padding: 2px 8px;
  color: #ffffff;
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
  pointer-events: none;
}

body.in-game .players-online-indicator {
  display: none;
}

.menu-brand {
  font-family: var(--title-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent-2);
}

.menu {
  position: relative;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 8px;
  background: rgba(12, 16, 17, 0.98);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 1000;
}

.menu-panel.is-open {
  display: flex;
}

.menu-panel button {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 12px;
}

.menu-panel button:hover {
  transform: translateY(0);
  box-shadow: none;
}

.status {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(226, 179, 90, 0.15);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.game-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 18px;
}

.viewport-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.viewport-shell {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(7, 9, 9, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.hud {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(7, 10, 10, 0.65);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hud-row.meters {
  gap: 16px;
}

.hide-status-bars .hud-row.meters {
  display: none;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.hud-stat .protocol-issue {
  color: #ffb26f;
  font-weight: 600;
}

.hud-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.meter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}

.meter-label {
  font-size: 12px;
  color: var(--muted);
  width: 40px;
}

.meter-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.meter-fill.health {
  background: #e05d4f;
}

.meter-fill.mana {
  background: #4b7bd9;
}

.meter-text {
  font-size: 12px;
  min-width: 42px;
  text-align: right;
}

.canvas-wrap {
  padding: 0;
  background: linear-gradient(180deg, rgba(10, 13, 14, 0.86), rgba(7, 9, 9, 0.9));
}

body.in-game .canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #353535;
}

.viewport-frame {
  position: relative;
  width: 94%;
  margin: 0 auto;
}

#render-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #0b1416;
  image-rendering: pixelated;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.45);
}

.onscreen-messages {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.onscreen-message {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(295px, 90%);
  text-align: center;
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #bebebe;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.9);
}

.onscreen-message.message-look {
  color: #00f000;
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.onscreen-message.message-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.onscreen-message.speech-positioned {
  max-width: 220px;
  transform: translate(-50%, -100%);
}

.onscreen-message.message-bottom {
  top: auto;
}

.onscreen-message.speech-say {
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #f0f000;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.onscreen-message.speech-whisper {
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #f0f000;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.onscreen-message.speech-yell {
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #f0f000;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.onscreen-message.speech-npc {
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.onscreen-message.speech-bark {
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #ff8c00;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.onscreen-message .speech-header,
.onscreen-message .speech-body {
  display: block;
}

.debug-overlay {
  display: none;
  position: absolute;
  left: 16px;
  top: 16px;
  max-width: 360px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(8, 12, 14, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.25;
  color: #d0d6db;
  white-space: pre;
  pointer-events: none;
}

.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 240px;
  min-width: 240px;
  max-width: 240px;
}

@media (min-width: 1101px) {
  body:not(.debug-active) {
    overflow-y: hidden;
  }

  .viewport-column {
    position: sticky;
    top: 0;
    align-self: start;
  }

  .game-sidebar {
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: hidden;
    min-height: 0;
    padding-right: 4px;
  }
}

.flash-sidebar {
  gap: 0;
}

.flash-panel {
  background: rgba(14, 16, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(226, 179, 90, 0.08);
}

.flash-row {
  display: grid;
  grid-template-columns: 160px 70px;
  gap: 6px;
  align-items: stretch;
}

.flash-inventory-column {
  display: grid;
  gap: 4px;
}

.flash-minimap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.flash-minimap-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.compass-icon {
  width: 43px;
  height: 43px;
  background-image: var(--ui-skin-url);
  background-repeat: no-repeat;
  background-size: var(--ui-skin-width) var(--ui-skin-height);
  background-position: -131px -138px;
}

.minimap-control-grid {
  display: grid;
  grid-template-columns: repeat(2, 22px);
  gap: 6px;
}

.minimap-center {
  grid-column: 1 / -1;
}

.flash-stats {
  display: grid;
  gap: 4px;
}

.flash-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 0;
}

.flash-condition {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  padding: 2px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
}

.flash-condition-icon {
  width: 9px;
  height: 9px;
  display: block;
  image-rendering: pixelated;
}

.flash-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.flash-icon {
  width: 12px;
  height: 11px;
  background-image: var(--ui-skin-url);
  background-repeat: no-repeat;
  background-size: var(--ui-skin-width) var(--ui-skin-height);
  background-position: 0 0;
}

.hp-icon {
  background-position: -220px -76px;
}

.mana-icon {
  background-position: -220px -87px;
}

.flash-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.flash-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.2s ease;
}

.flash-bar-fill.hp {
  background: linear-gradient(90deg, #5f1b1b, #c85a4d);
}

.flash-bar-fill.mana {
  background: linear-gradient(90deg, #153b75, #4c7ed1);
}

.flash-bar-text {
  font-size: 11px;
  color: var(--text);
  min-width: 54px;
  text-align: right;
}

.flash-inventory-panel {
  position: relative;
  padding: 1px 2px 2px;
  min-height: 166px;
  overflow: hidden;
}

.flash-inventory-panel.is-collapsed .inventory-scale {
  display: none;
}

.inventory-scale {
  width: 122px;
  height: 142px;
  margin-top: 0;
}

.flash-inventory-panel .inventory-grid {
  width: 122px;
  height: 142px;
}

.inventory-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.inventory-grid {
  z-index: 1;
}

.logout-block {
  position: absolute;
  right: 8px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border-radius: 0;
  border: 1px solid #7d3f3f;
  background: #3a2222;
  color: transparent;
  font-size: 0;
  display: none;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
}

.logout-block::before {
  content: "";
  width: 10px;
  height: 10px;
  background-image: var(--ui-skin-url);
  background-repeat: no-repeat;
  background-size: var(--ui-skin-width) var(--ui-skin-height);
  background-position: -315px -32px;
  image-rendering: pixelated;
}

.logout-block.is-active {
  display: flex;
}

.inventory-stat-box {
  position: absolute;
  bottom: 8px;
  text-align: right;
  font-size: 9px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  padding: 2px 4px;
  line-height: 1.1;
}

.inventory-cap-label {
  display: block;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.inventory-soul {
  left: 8px;
  right: auto;
  bottom: 22px;
  min-width: 32px;
}

.inventory-capacity {
  right: 8px;
  left: auto;
  bottom: 22px;
  min-width: 36px;
}

.inventory-overlay .flash-conditions {
  position: absolute;
  left: 8px;
  right: auto;
  bottom: 2px;
  display: grid;
  grid-template-columns: repeat(2, 15px);
  gap: 2px;
}

.flash-combat {
  display: grid;
  gap: 4px;
  align-items: start;
  align-content: start;
  justify-items: center;
  height: 100%;
}

.combat-matrix {
  display: grid;
  grid-template-columns: repeat(2, 20px);
  grid-template-rows: repeat(3, 20px);
  gap: 4px;
}

.combat-icon {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 5px;
  background-color: rgba(20, 22, 24, 0.9);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0;
  position: relative;
}

.combat-icon.is-active {
  background-color: rgba(226, 179, 90, 0.3);
  border-color: rgba(226, 179, 90, 0.8);
  color: #f8e7b7;
}

.ui-icon {
  background-image: var(--ui-skin-url);
  background-repeat: no-repeat;
  background-size: var(--ui-skin-width) var(--ui-skin-height);
  background-position: 0 0;
}

.ui-zoom-in {
  background-position: -2px -98px;
}

.ui-zoom-in:hover {
  background-position: -2px -118px;
}

.ui-zoom-out {
  background-position: -22px -98px;
}

.ui-zoom-out:hover {
  background-position: -22px -118px;
}

.ui-arrow-up {
  background-position: -42px -98px;
}

.ui-arrow-up:hover {
  background-position: -42px -118px;
}

.ui-arrow-down {
  background-position: -62px -98px;
}

.ui-arrow-down:hover {
  background-position: -62px -118px;
}

.ui-combat-offensive {
  background-position: -82px -98px;
}

.ui-combat-offensive:hover {
  background-position: -82px -118px;
}

.combat-icon.is-active.ui-combat-offensive {
  background-position: -82px -118px;
}

.ui-combat-balanced {
  background-position: -102px -98px;
}

.ui-combat-balanced:hover {
  background-position: -102px -118px;
}

.combat-icon.is-active.ui-combat-balanced {
  background-position: -102px -118px;
}

.ui-combat-defensive {
  background-position: -122px -98px;
}

.ui-combat-defensive:hover {
  background-position: -122px -118px;
}

.combat-icon.is-active.ui-combat-defensive {
  background-position: -122px -118px;
}

.ui-combat-stand {
  background-position: -142px -98px;
}

.ui-combat-stand:hover {
  background-position: -142px -118px;
}

.combat-icon.is-active.ui-combat-stand {
  background-position: -142px -118px;
}

.ui-combat-follow {
  background-position: -162px -98px;
}

.ui-combat-follow:hover {
  background-position: -162px -118px;
}

.combat-icon.is-active.ui-combat-follow {
  background-position: -162px -118px;
}

.ui-combat-secure {
  background-position: -182px -98px;
}

.ui-combat-secure:hover {
  background-position: -182px -118px;
}

.combat-icon.is-active.ui-combat-secure {
  background-position: -182px -118px;
}

.ui-help-mini {
  background-position: -202px -98px;
}

.ui-help-mini:hover {
  background-position: -202px -118px;
}

.ui-chat-close {
  background-position: -208px -146px;
}

.ui-chat-open {
  background-position: -224px -146px;
}

.ui-chat-question {
  background-position: -240px -146px;
}

.ui-chat-mute {
  background-position: -256px -146px;
}

.ui-chat-ignore {
  background-position: -288px -146px;
}

.ui-widget-close {
  background-position: -223px -99px;
}

.ui-widget-minimize {
  background-position: -234px -99px;
}

.ui-widget-previous {
  background-position: -245px -99px;
}

.ui-options-mini {
  background-position: -312px -128px;
}

.ui-options-mini:hover {
  background-position: -332px -128px;
}

.icon-button {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 5px;
  font-size: 0;
}

.combat-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 20px);
  gap: 4px;
}

.combat-quick-actions button {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  justify-content: center;
}

.combat-quick-actions .icon-button {
  width: 20px;
  height: 20px;
}

.combat-quick-actions .combat-stop {
  grid-column: 1 / -1;
  width: 44px;
  height: 13px;
  min-height: 13px;
  font-size: 10px;
  line-height: 1;
  padding: 0;
}

.combat-quick-actions button#combat-classic,
.combat-quick-actions button#combat-hotkeys {
  grid-column: 1 / -1;
  width: 44px;
  min-width: 44px;
  height: 13px;
  min-height: 13px;
  box-sizing: border-box;
  padding: 0;
  justify-self: center;
  font-size: 9px;
  line-height: 1;
  color: #ffffff;
}

.combat-quick-actions button#combat-classic.is-active,
.combat-quick-actions button#combat-classic[aria-pressed="true"],
.combat-quick-actions button#combat-hotkeys.is-active,
.combat-quick-actions button#combat-hotkeys[aria-pressed="true"] {
  color: #5fd36a;
}

.flash-quickbar {
  display: grid;
  grid-template-columns: repeat(2, 64px);
  grid-template-rows: repeat(2, 24px);
  gap: 2px;
  justify-content: start;
  align-content: start;
  width: 100%;
  background-image: var(--ot-panel-bg);
  background-repeat: repeat;
  background-color: #3b3b3b;
}

.flash-panel.flash-quickbar {
  padding: 2px;
}

.flash-quickbar button {
  width: 64px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  font-size: 0;
  border-radius: 0;
  border: 1px solid #606060;
  background-color: #454545;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 56px 20px;
  image-rendering: pixelated;
}

.sidebar-card {
  background: rgba(24, 24, 24, 0.9);
  border-radius: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
  animation: rise 0.6s ease both;
}

.dock-widget {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 104px;
}

.dock-widget.is-hidden {
  display: none;
}

.dock-widget.is-collapsed {
  min-height: 0;
  flex: 0 0 auto;
  height: auto !important;
  padding-bottom: 0;
}

.dock-widget.is-collapsed .sidebar-header {
  margin-bottom: 0;
  min-height: 20px;
}

.dock-header {
  cursor: grab;
}

body.dock-locked .dock-header {
  cursor: default;
}

.dock-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.container-tools {
  display: inline-flex;
  gap: 4px;
}

.container-tool {
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 12px;
  border-radius: 6px;
}

.dock-collapse {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.dock-close {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.dock-body {
  display: block;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.dock-widget.is-collapsed .dock-body {
  display: none;
}

.dock-widget.is-collapsed .dock-resize {
  display: none;
}

.dock-resize {
  height: 8px;
  margin-top: 8px;
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  cursor: ns-resize;
  opacity: 0.6;
}

body.dock-locked .dock-resize {
  display: none;
}

.dock-widget.is-dragging {
  opacity: 0.6;
}

.dock-widget.is-drag-over {
  border-color: rgba(226, 179, 90, 0.6);
  box-shadow: 0 0 0 2px rgba(226, 179, 90, 0.25);
}

.sidebar-card:nth-child(1) {
  animation-delay: 0.05s;
}

.sidebar-card:nth-child(2) {
  animation-delay: 0.1s;
}

.sidebar-card:nth-child(3) {
  animation-delay: 0.15s;
}

.sidebar-card:nth-child(4) {
  animation-delay: 0.2s;
}

.sidebar-card:nth-child(5) {
  animation-delay: 0.25s;
}

.sidebar-card:nth-child(6) {
  animation-delay: 0.3s;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1px;
  padding: 1px 2px;
  background: #3b3b3b;
  border: 1px solid #2f2f2f;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}

.minimap-controls {
  display: flex;
  gap: 6px;
}

.minimap-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.minimap-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
}

.minimap-center {
  width: 43px;
  height: 20px;
  border-radius: 4px;
  background-color: transparent;
  background-image: var(--ui-skin-url);
  background-repeat: no-repeat;
  background-size: var(--ui-skin-width) var(--ui-skin-height);
  background-position: -2px -138px;
  border: none;
  font-size: 10px;
  font-weight: 600;
  color: #f7e6bf;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

.minimap-center:hover {
  background-position: -2px -158px;
}

.minimap-wrap {
  padding: 10px;
  border-radius: 12px;
  background: rgba(5, 8, 9, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#minimap-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #0a1013;
  image-rendering: pixelated;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}

.sidebar-card.battle.dock-widget {
  min-height: 0;
  padding: 2px 3px 3px;
}

.sidebar-card.battle.dock-widget .dock-body {
  min-height: 0;
}

.sidebar-card.buddy.dock-widget {
  padding: 2px 3px 3px;
}

.sidebar-card.battle.dock-widget.is-collapsed {
  min-height: 0;
  height: auto !important;
}

.sidebar-card.battle.dock-widget.is-collapsed .dock-body {
  min-height: 0;
}

.sidebar-card.skills.dock-widget {
  min-height: 0;
}

.skills-body {
  padding-right: 2px;
}

.skills-list {
  display: grid;
  gap: 4px;
}

.sidebar-skill-row {
  display: grid;
  gap: 3px;
}

.sidebar-skill-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  line-height: 1.1;
  color: #c0c0c0;
}

.sidebar-skill-row.with-icon .sidebar-skill-main {
  grid-template-columns: auto 1fr auto;
}

.sidebar-skill-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-skill-icon {
  width: 9px;
  height: 9px;
  image-rendering: pixelated;
  filter: saturate(1.1) brightness(1.06);
}

.sidebar-skill-percent-bar {
  position: relative;
  width: 100%;
  height: 5px;
  border: 1px solid #343434;
  background: #1a1a1a;
  overflow: hidden;
}

.sidebar-skill-percent-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(to right, #2f8f39, #56bb58);
}

.sidebar-skill-percent-fill.red {
  background: linear-gradient(to right, #8e2a2a, #cd4d4d);
}

#battle-list {
  min-height: 0;
  overflow: auto;
  padding-right: 1px;
}

#buddy-list {
  min-height: 0;
  overflow: auto;
  padding-right: 1px;
}

.queue-status {
  font-size: 11px;
  color: var(--muted);
}

.request-queue-list {
  max-height: 280px;
  overflow: auto;
}

.request-queue-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.request-queue-entry.is-finished {
  border-color: rgba(127, 191, 163, 0.8);
  background: rgba(127, 191, 163, 0.18);
}

.request-queue-entry.is-deleted {
  border-color: rgba(201, 127, 127, 0.65);
  background: rgba(201, 127, 127, 0.16);
  opacity: 0.85;
}

.request-queue-empty {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.buddy-controls {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 4px;
}

.buddy-controls input {
  flex: 1;
}

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

.party-controls input {
  width: 100%;
}

.party-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.party-actions button {
  padding: 6px 10px;
  font-size: 12px;
}

.party-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.shop-controls,
.trade-controls {
  display: grid;
  gap: 8px;
}

.shop-status {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.shop-window {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.shop-list {
  display: grid;
  gap: 6px;
  max-height: 160px;
  overflow: auto;
}

.shop-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.shop-item.is-selected {
  border-color: rgba(226, 179, 90, 0.8);
  background: rgba(84, 62, 22, 0.7);
}

.shop-item-name {
  font-size: 12px;
  font-weight: 600;
}

.shop-item-meta {
  font-size: 11px;
  color: var(--muted);
}

.shop-detail {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.shop-detail-name {
  font-weight: 600;
}

.shop-detail-meta {
  color: var(--muted);
  font-size: 11px;
}

.shop-detail-desc {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  max-height: 70px;
  overflow: auto;
}

.shop-empty {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.shop-fields,
.trade-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}

.shop-controls label,
.trade-controls label {
  font-size: 12px;
  gap: 6px;
}

.shop-controls input,
.trade-controls input,
.shop-controls select,
.trade-controls select {
  padding: 6px 8px;
  font-size: 12px;
}

.shop-actions,
.trade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-actions button,
.trade-actions button {
  padding: 6px 10px;
  font-size: 12px;
}

.shop-toggles,
.trade-look {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.trade-hint {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}

.trade-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.trade-offers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.trade-offer {
  padding: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.trade-offer-title {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.trade-offer-name {
  color: var(--text);
  font-weight: 600;
}

.trade-grid {
  display: grid;
  grid-template-columns: repeat(4, var(--slot-size));
  gap: 4px;
}

.slot.trade-slot {
  width: var(--slot-size);
  height: var(--slot-size);
  min-height: var(--slot-size);
  padding: 2px;
  border-radius: 6px;
  font-size: 10px;
}

.trade-empty {
  grid-column: 1 / -1;
  padding: 6px;
  font-size: 11px;
  text-align: center;
  color: var(--muted);
}

.list-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.list-item.battle-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 4px;
  align-items: center;
  transition: background-color 0.12s ease;
  padding: 1px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.list-item.battle-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.list-item.battle-row.is-target {
  background: rgba(217, 178, 107, 0.2);
  box-shadow: inset 2px 0 0 rgba(217, 178, 107, 0.9);
}

.list-item.battle-row.is-follow {
  background: rgba(127, 191, 163, 0.2);
  box-shadow: inset 2px 0 0 rgba(127, 191, 163, 0.9);
}

.list-item.battle-row.is-offscreen {
  opacity: 0.75;
}

.battle-avatar {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.battle-avatar .battle-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.battle-fallback {
  font-size: 9px;
  font-weight: 600;
  color: var(--text);
}

.battle-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.battle-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}

.battle-name {
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-markers {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.battle-marker {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 2px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.battle-marker.attack {
  background: rgba(217, 178, 107, 0.35);
  border: 1px solid rgba(217, 178, 107, 0.7);
}

.battle-marker.follow {
  background: rgba(127, 191, 163, 0.35);
  border: 1px solid rgba(127, 191, 163, 0.7);
}

.battle-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  font-size: 8px;
  color: var(--muted);
}

.battle-flags {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.battle-flag {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 2px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.battle-flag.skull-yellow {
  background: rgba(217, 178, 107, 0.3);
  border-color: rgba(217, 178, 107, 0.7);
}

.battle-flag.skull-green {
  background: rgba(127, 191, 163, 0.3);
  border-color: rgba(127, 191, 163, 0.7);
}

.battle-flag.skull-white {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.7);
}

.battle-flag.skull-red {
  background: rgba(204, 96, 96, 0.35);
  border-color: rgba(204, 96, 96, 0.8);
}

.battle-flag.skull-black {
  background: rgba(32, 32, 32, 0.6);
  border-color: rgba(0, 0, 0, 0.8);
}

.battle-flag.skull-orange {
  background: rgba(225, 155, 68, 0.32);
  border-color: rgba(225, 155, 68, 0.8);
}

.battle-flag.battle-flag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12px;
  height: 12px;
  padding: 1px;
  line-height: 1;
}

.battle-flag-skull-icon {
  width: 8px;
  height: 8px;
  display: block;
  image-rendering: pixelated;
}

.battle-flag.party-invite {
  background: rgba(120, 160, 220, 0.3);
  border-color: rgba(120, 160, 220, 0.7);
}

.battle-flag.party-member {
  background: rgba(127, 191, 163, 0.3);
  border-color: rgba(127, 191, 163, 0.7);
}

.battle-flag.party-leader {
  background: rgba(217, 178, 107, 0.3);
  border-color: rgba(217, 178, 107, 0.7);
}

.battle-flag.party-share {
  background: rgba(142, 186, 220, 0.28);
  border-color: rgba(142, 186, 220, 0.7);
}

.battle-distance {
  font-size: 8px;
  color: var(--muted);
}

.battle-hp {
  height: 4px;
  border-radius: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.battle-hp-fill {
  height: 100%;
}

.combat-panel {
  display: grid;
  gap: 10px;
}

.combat-panel.compact {
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.combat-group {
  display: grid;
  gap: 6px;
}

.combat-panel.compact .combat-group {
  gap: 4px;
}

.combat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.combat-panel.compact .combat-label {
  font-size: 9px;
  letter-spacing: 0.1em;
}

.combat-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.combat-panel.compact .combat-buttons {
  gap: 4px;
}

.combat-btn,
.combat-toggle {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.combat-panel.compact .combat-btn,
.combat-panel.compact .combat-toggle {
  min-height: 24px;
  padding: 4px 6px;
  font-size: 10px;
  border-radius: 6px;
}

.combat-panel.compact .combat-btn {
  min-width: 28px;
}

.combat-btn.is-active,
.combat-toggle.is-active {
  background: rgba(226, 179, 90, 0.3);
  border-color: rgba(226, 179, 90, 0.8);
  color: #f8e7b7;
}

.combat-stop {
  align-self: flex-start;
  padding: 6px 12px;
  font-size: 12px;
}

.combat-panel.compact .combat-stop {
  grid-column: 1 / -1;
  padding: 4px 8px;
  font-size: 10px;
}

#spell-search {
  width: 100%;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
}

.spell-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.spell-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spell-name {
  font-size: 12px;
  font-weight: 600;
}

.spell-words {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-family: "Courier New", ui-monospace, monospace;
}

.spell-meta {
  font-size: 11px;
  color: var(--muted);
}

.spell-cast {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 8px;
}

.buddy-item {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: space-between;
  padding: 1px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.buddy-item.is-online {
  background: rgba(127, 191, 163, 0.14);
}

.buddy-item.is-offline {
  opacity: 0.75;
}

.buddy-name {
  flex: 1;
  font-size: 11px;
  line-height: 1.05;
}

.buddy-status {
  font-size: 9px;
  color: var(--muted);
}

.buddy-remove {
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.buddy-remove:hover {
  transform: none;
  box-shadow: none;
}

.list-item.is-target {
  border-color: rgba(217, 178, 107, 0.8);
  background: rgba(217, 178, 107, 0.18);
  box-shadow: 0 0 12px rgba(217, 178, 107, 0.25);
}

.list-item.is-follow {
  border-color: rgba(127, 191, 163, 0.8);
  background: rgba(127, 191, 163, 0.18);
  box-shadow: 0 0 12px rgba(127, 191, 163, 0.25);
}

.inventory-panel {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.inventory-grid {
  position: relative;
  width: 168px;
  height: 208px;
  margin: 0 auto;
}

.inventory-grid::before {
  content: "";
  position: absolute;
  inset: 10px 28px 24px;
  border-radius: 18px 18px 26px 26px;
  border: 1px dashed rgba(226, 179, 90, 0.2);
  background:
    radial-gradient(circle at 50% 18%, rgba(226, 179, 90, 0.18), transparent 45%),
    radial-gradient(circle at 50% 55%, rgba(125, 180, 140, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(10, 12, 18, 0.25), rgba(5, 6, 10, 0.1));
  pointer-events: none;
  z-index: 0;
}

.inventory-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.inventory-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--text);
}

.inventory-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.slot {
  min-height: 50px;
  border-radius: 10px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
}

.slot.inventory-slot {
  position: absolute;
  left: var(--slot-x);
  top: var(--slot-y);
  width: var(--slot-size);
  height: var(--slot-size);
  min-height: var(--slot-size);
  padding: 2px;
  border-radius: 6px;
  background: rgba(8, 8, 10, 0.8);
  border: 1px solid rgba(210, 175, 100, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 1;
  overflow: hidden;
}

.slot.inventory-slot.has-placeholder::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background-image: var(--ui-skin-url);
  background-repeat: no-repeat;
  background-size: var(--ui-skin-width) var(--ui-skin-height);
  background-position: var(--placeholder-bg-x, 0) var(--placeholder-bg-y, 0);
  image-rendering: pixelated;
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
}

.slot.inventory-slot > * {
  position: relative;
  z-index: 1;
}

.slot.container-slot {
  width: var(--container-slot-size, var(--slot-size));
  height: var(--container-slot-size, var(--slot-size));
  min-height: var(--container-slot-size, var(--slot-size));
  padding: 2px;
  border-radius: 6px;
  font-size: 10px;
}

.slot.drag-target {
  border-color: var(--accent-2);
}

.item-chip {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--text);
  font-size: 10px;
  text-align: center;
  cursor: grab;
  user-select: none;
}

.item-chip:active {
  cursor: grabbing;
}

.item-icon {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.item-count {
  position: absolute;
  bottom: 1px;
  right: 1px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #f0f0f0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-shadow: none;
  z-index: 2;
}

.action-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(40px, 1fr));
  gap: 8px;
}

.dock-widget[data-widget-id="hotkeys"] .action-bar {
  grid-template-columns: repeat(5, 34px);
  gap: 4px;
  justify-content: center;
}

.action-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-sets {
  display: flex;
  gap: 4px;
}

.action-set,
.action-hotkeys {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.action-set.is-active {
  border-color: rgba(217, 178, 107, 0.7);
  background: rgba(217, 178, 107, 0.16);
  color: var(--text);
}

.action-slot {
  min-height: 44px;
  border-radius: 10px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
}

.dock-widget[data-widget-id="hotkeys"] .action-slot {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 2px;
  border-radius: 8px;
}

.action-slot .item-chip {
  cursor: pointer;
}

.action-slot.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(226, 179, 90, 0.4);
}

.action-count {
  position: absolute;
  bottom: 4px;
  right: 4px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--accent);
  font-size: 10px;
}

.action-count[data-kind="charges"] {
  color: var(--accent-2);
}

.action-cooldown {
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  pointer-events: none;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--text);
}

.action-cooldown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100% * var(--cooldown));
  background: rgba(0, 0, 0, 0.6);
  border-radius: inherit;
}

.action-cooldown-label {
  position: relative;
  z-index: 1;
}

.action-label {
  font-size: 11px;
  color: var(--text);
}

.action-text-label {
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%) scaleX(1.22);
  transform-origin: center bottom;
  max-width: calc(100% - 4px);
  padding: 0;
  color: var(--text);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  text-align: center;
  pointer-events: none;
}

.key-hint {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 10px;
  color: var(--muted);
}

.dock-widget[data-widget-id="hotkeys"] .key-hint {
  top: 2px;
  left: 4px;
  font-size: 9px;
}

.dock-widget[data-widget-id="hotkeys"] .dock-body {
  overflow: hidden;
}

.dock-widget[data-widget-id="hotkeys"] .dock-resize {
  display: none !important;
}

.cooldown-panel {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cooldown-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.cooldown-list {
  font-size: 12px;
  color: var(--text);
  white-space: pre-line;
  min-height: 16px;
}

.mail-panel {
  display: grid;
  gap: 8px;
}

.mail-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

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

.mail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.mail-row-title {
  color: var(--accent-2);
}

.containers {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.container-window {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 2px 4px 12px;
  border-radius: 0;
  background: rgba(24, 24, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
  overflow: hidden;
  min-height: 0;
}

.container-window.is-collapsed .container-grid {
  display: none;
}

.container-window.is-collapsed .container-footer {
  display: none;
}

.container-window.is-collapsed .container-resize {
  display: none;
}

.container-window.is-collapsed {
  height: auto !important;
  min-height: 0;
  padding-bottom: 0;
}

.container-window.is-collapsed .container-header {
  margin-bottom: 0;
}

.container-window.is-mail {
  border-color: rgba(127, 191, 163, 0.7);
  box-shadow: 0 0 0 1px rgba(127, 191, 163, 0.35);
}

.container-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 1px;
  padding: 1px 2px;
  background: #3b3b3b;
  border: 1px solid #2f2f2f;
  cursor: grab;
}

.container-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.container-icon {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: rgba(8, 8, 10, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--muted);
  font-size: 10px;
  flex: 0 0 auto;
}

.container-icon canvas {
  width: 8px;
  height: 8px;
  image-rendering: pixelated;
}

.container-icon.drag-target {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(242, 208, 122, 0.35);
}

.container-icon.is-disabled {
  opacity: 0.5;
}

.container-title {
  font-size: 13px;
  color: var(--accent);
  margin: 0;
}

.container-controls {
  display: flex;
  gap: 4px;
}

button.container-btn {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

button.container-btn:disabled {
  opacity: 0.4;
}

.ui-container-close {
  background-position: -223px -99px;
}

.ui-container-close:hover {
  background-position: -223px -99px;
}

.ui-container-minimize {
  background-position: -234px -99px;
}

.ui-container-minimize:hover {
  background-position: -234px -99px;
}

.ui-container-up {
  background-position: -245px -99px;
}

.ui-container-up:hover {
  background-position: -245px -99px;
}

.container-grid {
  --container-slot-size: 52px;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, var(--container-slot-size));
  grid-auto-rows: var(--container-slot-size);
  gap: 0;
  padding: 3px 2px 3px 3px;
  max-height: none;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #b8b8b8 #2f2f2f;
}

.container-grid::-webkit-scrollbar {
  width: 10px;
}

.container-grid::-webkit-scrollbar-track {
  background: #2f2f2f;
  border-left: 1px solid #1f1f1f;
}

.container-grid::-webkit-scrollbar-thumb {
  background: #b8b8b8;
  border: 1px solid #6a6a6a;
}

.container-grid::-webkit-scrollbar-thumb:hover {
  background: #cfcfcf;
}

.flash-panel.flash-inventory {
  padding: 1px 2px 2px;
}

.container-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.container-page-label {
  flex: 1;
  text-align: center;
}

button.container-page-btn {
  min-width: 28px;
}

.container-resize {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 8px;
  bottom: 6px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.28);
  cursor: ns-resize;
  opacity: 0.7;
}

.game-chat {
  padding: 3px 4px 4px;
  border-top: 1px solid rgba(42, 42, 42, 0.25);
  background: #454545;
  color: #e7ebef;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 3px;
}

body.in-game .game-chat {
  flex: 0 0 260px;
  min-height: 260px;
  max-height: 260px;
  overflow: hidden;
  position: relative;
  z-index: 2;
  margin-top: 0;
}

.chat-dock-bar {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
  align-items: center;
  min-height: 22px;
}

.chat-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 0;
  scrollbar-width: thin;
  flex: 1 1 auto;
  align-items: flex-end;
}

.chat-tab-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin-left: auto;
}

.chat-control-button {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  image-rendering: pixelated;
  box-shadow: none;
  transform: none;
  filter: none;
}

.chat-control-button:hover {
  transform: none;
  box-shadow: none;
  filter: brightness(1.06);
}

.chat-control-button:focus-visible {
  outline: 1px solid #b8b8b8;
  outline-offset: 1px;
}

.chat-control-button.is-alert {
  filter: brightness(1) saturate(1.9) sepia(0.85) hue-rotate(-14deg);
}

.chat-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 1px;
  border-radius: 3px 3px 0 0;
  border: 2px ridge #7a7a7a;
  border-bottom: 0;
  background: #454545;
  color: #555555;
  font-size: 11px;
  line-height: 1;
  min-height: 18px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  transform: none;
}

.chat-tab.is-active {
  background: #454545;
  border-color: #9b9b9b;
  color: #939393;
}

.chat-tab.is-unread {
  color: #aaaaaa;
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  width: 100%;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.chat-form #chat-type {
  display: none;
}

.chat-form select {
  min-width: 88px;
}

.chat-form #chat-target {
  display: none !important;
}

.chat-form #chat-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #8d949b;
  border-radius: 1px;
  background: #454545;
  color: #eef3f6;
  padding: 4px 6px;
}

.chat-form #chat-input::placeholder {
  color: #cfcfcf;
  opacity: 1;
}

.chat-dock-details {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
}

.chat-dock-details-content {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
  margin-top: 0;
}

.channel-empty {
  font-size: 12px;
  color: var(--muted);
}

.chat-log {
  background: #454545;
  color: #edf2f5;
  border: 1px solid #92989e;
  border-radius: 4px;
  padding: 10px 12px;
  min-height: 0;
  max-height: none;
  height: 100%;
  flex: 1 1 auto;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

.channel-select-list {
  display: grid;
  gap: 4px;
  min-height: 120px;
  max-height: 240px;
  padding: 6px;
  overflow: auto;
  border: 1px solid #6a6a6a;
  background: rgba(37, 37, 37, 0.9);
}

.channel-select-item {
  border: 1px solid #5e5e5e;
  background: rgba(69, 69, 69, 0.9);
  color: #d2d2d2;
  font-size: 13px;
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
}

.channel-select-item:hover {
  background: rgba(86, 86, 86, 0.96);
  transform: none;
  box-shadow: none;
}

.channel-select-item.is-selected {
  border-color: #9b9b9b;
  background: rgba(98, 98, 98, 0.95);
  color: #f1f1f1;
}

.chat-dialog-panel {
  width: 520px;
  min-height: 360px;
  max-width: 94vw;
  background: rgba(59, 59, 59, 0.9);
  border: 1px solid #616161;
  border-radius: 0;
  box-shadow: none;
}

.spellbook-panel {
  width: 520px;
  min-height: 360px;
  max-width: 94vw;
  background: rgba(59, 59, 59, 0.9);
  border: 1px solid #616161;
  border-radius: 0;
  box-shadow: none;
}

.spellbook-content {
  min-height: 250px;
}

.spellbook-content .spell-list {
  max-height: 300px;
}

.chat-dialog-section {
  display: grid;
  gap: 6px;
}

.chat-dialog-label {
  font-size: 14px;
  color: #f1f1f1;
}

.chat-list-editor-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.chat-dialog-toggle {
  color: #d6d6d6;
}

.chat-entry {
  margin-bottom: 6px;
}

.chat-entry .speaker {
  color: #f2f6f9;
  font-weight: 600;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.chat-entry .meta {
  color: #cfd7de;
  margin-right: 6px;
}

.chat-entry .text {
  white-space: pre-line;
}

.log {
  font-family: "Courier New", ui-monospace, monospace;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 12px;
  min-height: 160px;
  max-height: 280px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
}

.debug-trace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.debug-trace-header h2 {
  margin: 0;
}

.debug-trace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.debug-trace {
  width: 100%;
  min-height: 220px;
  max-height: 420px;
  resize: vertical;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.45);
  color: #d9ecf2;
  font: 12px/1.45 "Courier New", ui-monospace, monospace;
  box-sizing: border-box;
  white-space: pre;
}

.render-status {
  font-size: 13px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

input,
select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 20, 20, 0.7);
  color: var(--text);
  font-family: inherit;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

button {
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #2b1f10;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.25);
}

button.ghost {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

button.hud-button {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 7, 8, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

#login-modal {
  background: transparent;
}

#split-stack-modal {
  background: transparent;
}

.modal-panel {
  width: min(520px, 92vw);
  background: var(--panel-2);
  border-radius: 18px;
  border: 1px solid var(--panel-edge);
  box-shadow: var(--shadow);
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-panel {
  width: 520px;
  min-height: 310px;
  max-width: 94vw;
  position: relative;
  background: rgba(59, 59, 59, 0.82);
  border: 1px solid #616161;
  border-radius: 0;
  box-shadow: none;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.overlay-close {
  font-size: 18px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 10px;
}

.login-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.login-save {
  align-items: center;
  gap: 10px;
  flex-direction: row;
  color: var(--muted);
  font-size: 13px;
}

.character-tag.active {
  border-color: #caa451;
  background: #6b5630;
  color: #f5efe1;
}

.login-section {
  display: grid;
  gap: 12px;
}

.login-section[hidden] {
  display: none;
}

.login-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
}

.login-row label {
  font-size: 14px;
  color: #f1f1f1;
}

.login-row input {
  width: 100%;
}

.login-recovery-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e0e0e0;
  font-size: 13px;
}

.login-characters-section {
  gap: 8px;
}

.login-characters-title {
  font-size: 14px;
  color: #f1f1f1;
}

.character-list {
  display: grid;
  gap: 6px;
  max-height: 170px;
  overflow-y: auto;
  border: 1px solid #5a5a5a;
  background: #2f2f2f;
  padding: 6px;
}

.character-tag {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: 0;
  border: 1px solid transparent;
  background: #444444;
  color: #f1f1f1;
  font-size: 13px;
  cursor: pointer;
}

.server-list-panel {
  width: min(760px, 95vw);
  min-height: 360px;
}

.server-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.server-list-column {
  display: grid;
  gap: 8px;
}

.server-entry-list {
  max-height: 230px;
}

.server-entry-tag {
  display: grid;
  gap: 4px;
}

.server-entry-name {
  font-weight: 700;
}

.server-entry-meta {
  color: #d8ca8f;
  font-size: 12px;
  font-weight: 500;
}

.server-entry-tag.is-loaded {
  border-color: #bfa730;
}

.server-transfer-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.server-transfer-controls button {
  width: 52px;
  min-width: 52px;
  padding: 8px 6px;
  font-size: 16px;
  line-height: 1;
}

.server-input-grid {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px 12px;
  align-content: start;
}

.server-input-grid label {
  align-self: center;
  color: #f1f1f1;
  font-size: 14px;
}

.server-input-grid input {
  width: 100%;
}

.gameworld-connect-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(28, 28, 28, 0.7);
  pointer-events: auto;
  z-index: 3;
}

.gameworld-connect-overlay[hidden] {
  display: none;
}

.gameworld-connect-card {
  width: min(340px, calc(100% - 40px));
  padding: 16px 18px;
  border: 1px solid #7a7a7a;
  background: #4b4b4b;
  color: #f1f1f1;
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.gameworld-connect-text {
  min-height: 36px;
}

.gameworld-connect-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.gameworld-connect-actions button {
  min-width: 84px;
}

.character-tag:hover {
  border-color: #7a7a7a;
}

.account-modal-panel {
  min-height: 260px;
}

.credentials-preview {
  margin: 0;
  padding: 10px;
  border: 1px solid #5a5a5a;
  background: #2f2f2f;
  color: #f1f1f1;
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.account-manage-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.account-manage-actions-inline input {
  flex: 1 1 auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.login-active .hero,
body.login-active .workspace,
body.login-active .panel,
body.login-active .top-menu {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

body.prelogin .hero,
body.prelogin .workspace,
body.prelogin .panel,
body.prelogin .top-menu {
  display: none;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
}

.modal-meta {
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}

.modal textarea {
  min-height: 180px;
  width: 100%;
  resize: vertical;
  background: rgba(9, 12, 12, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text);
  padding: 12px;
  font-family: var(--ui-font);
  line-height: 1.5;
}

.modal textarea[readonly] {
  opacity: 0.85;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.profile-panel {
  width: min(640px, 92vw);
}

.about-panel {
  width: min(480px, 92vw);
}

.about-copy {
  display: grid;
  gap: 10px;
}

.about-copy p {
  margin: 0;
  line-height: 1.45;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.profile-stat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.profile-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: var(--muted);
}

.profile-section h4 {
  margin: 6px 0 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.profile-skills {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.profile-skill {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.profile-skill-name {
  font-weight: 600;
}

.hotkey-grid {
  display: grid;
  gap: 8px;
}

.hotkey-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hotkey-row.is-capture {
  border-color: rgba(217, 178, 107, 0.7);
  box-shadow: 0 0 0 1px rgba(217, 178, 107, 0.35);
}

.hotkey-slot {
  font-size: 12px;
  color: var(--muted);
}

.hotkey-bind,
.hotkey-clear {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 8px;
  min-width: 74px;
}

.hotkey-bind.is-empty {
  color: var(--muted);
}

.split-stack-controls {
  display: grid;
  gap: 12px;
}

.split-stack-controls input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  border: 1px solid #6a6a6a;
  background: linear-gradient(
    to right,
    #a6a6a6 0,
    #a6a6a6 var(--split-stack-progress, 100%),
    #343434 var(--split-stack-progress, 100%),
    #343434 100%
  );
}

.split-stack-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
}

.split-stack-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4px;
  border: 1px solid #6d6d6d;
  background: #c7c7c7;
  border-radius: 2px;
}

.split-stack-controls input[type="range"]::-moz-range-track {
  height: 8px;
  background: transparent;
}

.split-stack-controls input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid #6d6d6d;
  background: #c7c7c7;
  border-radius: 2px;
}

.outfit-panel {
  width: min(560px, 94vw);
}

.outfit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.outfit-picker {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.outfit-preview-wrap {
  width: 100px;
  height: 100px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 12, 16, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

#outfit-preview {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
}

.outfit-picker-controls {
  display: grid;
  gap: 10px;
}

.outfit-cycle-row {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
}

.outfit-current-label {
  text-align: center;
  color: var(--text);
  font-size: 13px;
}

.outfit-colors {
  display: grid;
  gap: 12px;
}

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

.outfit-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.outfit-color-row input[type="range"] {
  flex: 1;
}

.outfit-swatch {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #000;
}

.outfit-value {
  min-width: 24px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .outfit-picker {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.context-menu {
  position: fixed;
  min-width: 180px;
  background: rgba(7, 10, 12, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
}

.context-menu.is-open {
  display: block;
}

.context-menu button {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 6px 8px;
  font-size: 12px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
}

.context-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.context-menu button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.context-separator {
  height: 1px;
  margin: 6px 6px;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  body.in-game .game-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 8px;
  }

  .viewport-column {
    position: static;
    top: auto;
  }

  .game-sidebar {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  body.in-game .game-sidebar {
    max-height: 100vh;
    overflow-y: hidden;
    min-height: 0;
    width: 240px;
    min-width: 240px;
    max-width: 240px;
  }

  .chat-dock-bar {
    gap: 6px;
  }

  .server-list-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .server-transfer-controls {
    flex-direction: row;
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  #app {
    padding-top: 32px;
  }

  .chat-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-form #chat-target {
    width: 100%;
  }

  .chat-form #chat-input {
    width: 100%;
  }

  #chat-send {
    width: 100%;
  }

  .game-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

}

:root {
  --ot-window-image: url("./assets/ui/window.png");
  --ot-popup-image: url("./assets/ui/popupwindow.png");
  --ot-button-image: url("./assets/ui/buttons.png");
  --ot-panel-bg: url("./assets/ui/background_dark.png");
}

body {
  font-family: "Verdana", "Geneva", sans-serif;
  background: url("./assets/tibia-splashscreen.jpg") center / cover no-repeat fixed;
}

body.in-game {
  background: #2f2f2f;
}

.top-menu,
.game-chat,
.chat-log,
.flash-panel,
.sidebar-card,
.container-window,
.hud,
.viewport-shell {
  border-radius: 0;
  box-shadow: none;
  background-color: #454545;
  background-image: var(--ot-panel-bg);
  background-repeat: repeat;
  border: 1px solid #6b6b6b;
}

.flash-panel,
.sidebar-card,
.container-window {
  border-color: #838383;
}

button:not(.ui-icon):not(.chat-control-button):not(.container-btn) {
  border: 1px solid #1f1f1f;
  border-radius: 0;
  min-height: 20px;
  padding: 2px 10px 1px;
  color: #dfdfdf;
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
  background-image: var(--ot-button-image);
  background-repeat: no-repeat;
  background-size: 100% 200%;
  background-position: 0 0;
  box-shadow: none;
  transform: none;
}

button:not(.ui-icon):not(.chat-control-button):not(.container-btn):hover {
  filter: brightness(1.06);
  box-shadow: none;
  transform: none;
}

button:not(.ui-icon):not(.chat-control-button):not(.container-btn):active,
button:not(.ui-icon):not(.chat-control-button):not(.container-btn).is-active,
button:not(.ui-icon):not(.chat-control-button):not(.container-btn)[aria-pressed="true"] {
  background-position: 0 100%;
  padding-top: 3px;
  padding-bottom: 0;
}

button.ghost:not(.ui-icon):not(.chat-control-button):not(.container-btn) {
  color: #dfdfdf;
  background-image: var(--ot-button-image);
  background-color: transparent;
}

.modal-panel,
.chat-dialog-panel,
.spellbook-panel,
.login-panel {
  border-style: solid;
  border-color: transparent;
  border-width: 27px 6px 6px;
  border-image-source: var(--ot-window-image);
  border-image-slice: 27 6 6 fill;
  border-image-width: 27px 6px 6px;
  border-image-repeat: stretch;
  border-radius: 0;
  box-shadow: none;
  background-color: #484848;
  background-image: none;
  padding-top: 8px;
}

.modal-header h3 {
  color: #d0d0d0;
  font-size: 12px;
  font-family: "Verdana", "Geneva", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.statistics-panel {
  width: min(700px, calc(100vw - 40px));
  max-height: min(640px, calc(100vh - 60px));
}

.statistics-content {
  margin-top: 6px;
  border: 1px solid #707070;
  background: #3f3f3f;
  min-height: 200px;
  max-height: min(460px, calc(100vh - 260px));
  overflow: auto;
  padding: 6px;
  font-size: 11px;
  line-height: 1.25;
}

.statistics-section-title {
  margin: 8px 0 4px;
  color: #f0f0f0;
  font-size: 11px;
  font-weight: 700;
}

.statistics-section-title:first-child {
  margin-top: 0;
}

.statistics-row {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 2px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.statistics-row:last-child {
  border-bottom: 0;
}

.statistics-row .rank {
  color: #d8d8d8;
}

.statistics-row .name {
  color: #ffffff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-row .meta,
.statistics-row .value {
  color: #e5e5e5;
}

input,
select,
textarea,
.chat-form #chat-input {
  border-radius: 0;
  border: 1px solid #8d949b;
  background: #454545;
  color: #eef3f6;
  font-family: "Verdana", "Geneva", sans-serif;
  font-size: 11px;
}

.status {
  border-radius: 0;
  border: 1px solid #8d949b;
  padding: 3px 8px 3px 28px;
  min-height: 21px;
  font-size: 11px;
  text-transform: capitalize;
  background: #454545;
  color: #dfdfdf;
  position: relative;
}

.status::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 1px;
  width: 17px;
  height: 17px;
  image-rendering: pixelated;
  background: url("./assets/ui/high_ping.png") center / contain no-repeat;
}

.status.status-connecting::before {
  background-image: url("./assets/ui/medium_ping.png");
}

.status.status-connected::before {
  background-image: url("./assets/ui/low_ping.png");
}

.status.status-disconnected::before,
.status.status-error::before,
.status.status-protocol_error::before {
  background-image: url("./assets/ui/high_ping.png");
}

.flash-icon {
  background-image: none;
}

.hp-icon {
  width: 12px;
  height: 11px;
  background: url("./assets/healthmana/hitpoints_symbol.png") center / contain no-repeat;
}

.mana-icon {
  width: 12px;
  height: 11px;
  background: url("./assets/healthmana/mana_symbol.png") center / contain no-repeat;
}

.flash-bar-track {
  height: 11px;
  border: none;
  border-radius: 0;
  background: url("./assets/healthmana/hitpoints_manapoints_bar_border.png") center / 100% 100% no-repeat;
}

.flash-bar-fill.hp {
  background: url("./assets/healthmana/hitpoints_bar_filled.png") left center / 100% 100% no-repeat;
}

.flash-bar-fill.mana {
  background: url("./assets/healthmana/mana_bar_filled.png") left center / 100% 100% no-repeat;
}

.flash-condition {
  border-radius: 0;
  border-color: #8b8b8b;
  background: rgba(0, 0, 0, 0.55);
}

.flash-quickbar button {
  border-radius: 0;
  border: 1px solid #606060;
  min-height: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  background-size: 56px 20px;
}

.flash-quickbar .ot-top-button {
  display: block;
  line-height: 1;
}

.flash-quickbar .ot-top-button::before {
  display: none;
}

.flash-quickbar .ot-top-skills {
  background-image: url("./assets/options/button_skills.png");
}

.flash-quickbar .ot-top-battle {
  background-image: url("./assets/options/button_battlelist.png");
}

.flash-quickbar .ot-top-vip {
  background-image: url("./assets/options/button_vip.png");
}

.flash-quickbar .ot-top-logout {
  background-image: url("./assets/options/button_logout.png");
}

.chat-control-button,
.container-btn,
.dock-collapse,
.dock-close,
.minimap-btn,
.combat-icon,
.icon-button {
  border-radius: 0;
  border: 1px solid #727272;
  background-color: #454545;
}

/* Keep character/server list selection clearly visible. */
.character-tag {
  background-image: none;
  background-color: #444;
  border: 1px solid #5f5f5f;
  color: #efefef;
  text-shadow: none;
}

.character-tag:hover {
  background-color: #545454;
  border-color: #7a7a7a;
}

.character-tag.active {
  background-image: none;
  background-color: #6b5630;
  border-color: #caa451;
  color: #f5efe1;
}

.character-tag.active,
.character-tag[aria-selected="true"] {
  background-image: none !important;
  background-color: #6b5630 !important;
  border-color: #e3bf62 !important;
  color: #fff7df !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 229, 156, 0.4),
    0 0 0 1px rgba(43, 28, 8, 0.75);
}

.character-tag:focus-visible {
  outline: 1px solid #f1d07c;
  outline-offset: 0;
}

.server-entry-tag.is-loaded:not(.active) {
  border-color: #bfa730;
  box-shadow: inset 0 0 0 1px rgba(191, 167, 48, 0.3);
}

.server-entry-tag {
  text-align: left;
}

.server-entry-tag .server-entry-name {
  color: #efefef;
}

.server-entry-tag .server-entry-meta {
  color: #cbbd90;
}

.server-entry-tag.active,
.server-entry-tag[aria-selected="true"] {
  background-color: #6a5430 !important;
  border-color: #f1cb6b !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 234, 168, 0.48),
    0 0 0 1px rgba(33, 21, 7, 0.8);
}

.server-entry-tag.active .server-entry-name,
.server-entry-tag[aria-selected="true"] .server-entry-name {
  color: #fff6df;
}

.server-entry-tag.active .server-entry-meta,
.server-entry-tag[aria-selected="true"] .server-entry-meta {
  color: #ffe3a5;
}

.server-entry-tag.is-loaded:not(.active):not([aria-selected="true"]) {
  background-color: #4f4930;
}
