@font-face {
  font-family: Barlow;
  src: url("/assets/barlow.ttf");
}
@font-face {
  font-family: Baskervville;
  src: url("/assets/baskervville.ttf");
}
[hidden] {
  display: none !important;
}
:root {
  --bg: #151e1b;
  --panel: #1e2924;
  --panel2: #26342c;
  --border: #3b493c;
  --ink: #eee7d4;
  --muted: #a4af9d;
  --gold: #d8b779;
  --green: #8eb69b;
  --red: #c36f60;
  font-family:
    Barlow,
    Segoe UI,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  background: #2a372e;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 5px;
  text-decoration: none;
  transition:
    background 0.16s,
    border-color 0.16s;
}
button:hover,
.button:hover {
  background: #3c4b3c;
  border-color: #91a083;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.primary {
  background: var(--gold);
  color: #263025;
  border-color: var(--gold);
  font-weight: 600;
}
.primary:hover {
  background: #efcf95;
  color: #17231c;
}
.primary span {
  float: right;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
  line-height: 1.65;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 600;
  color: var(--gold);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-family: Baskervville, Georgia, serif;
  font-weight: 400;
}
h3 {
  font-size: 16px;
}
input,
select {
  display: block;
  width: 100%;
  background: #18221d;
  border: 1px solid #4a5646;
  padding: 13px 14px;
  border-radius: 4px;
  color: var(--ink);
  margin-top: 8px;
}
label {
  display: block;
  color: #d6d9ca;
  font-size: 13px;
  margin-bottom: 19px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 29px;
  text-decoration: none;
  color: var(--gold);
}
.brand span {
  font-family: Baskervville, Georgia, serif;
  letter-spacing: 4px;
  font-size: 21px;
}
.error {
  font-size: 13px;
  color: #f1a396;
  min-height: 18px;
}
.welcome {
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 390px;
  column-gap: 8vw;
  align-items: center;
  padding: 100px 8vw 90px;
}
.welcome > canvas,
.welcome-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.welcome > canvas {
  filter: saturate(0.7) brightness(0.6);
}
.welcome-shade {
  background: linear-gradient(
    90deg,
    #101c15d9 0%,
    #14241ba6 50%,
    #101911d9 100%
  );
}
.landing-header,
.landing-footer {
  position: absolute;
  left: 8vw;
  right: 8vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}
.landing-header {
  top: 35px;
}
.edition,
.landing-footer {
  font-size: 10px;
  letter-spacing: 2px;
  color: #bbc5ad;
}
.landing-footer {
  bottom: 30px;
  border-top: 1px solid #84937b44;
  padding-top: 22px;
}
.welcome-copy,
.auth-panel {
  z-index: 1;
  position: relative;
}
.welcome-copy h1 {
  font-size: clamp(40px, 4.5vw, 72px);
  line-height: 1.1;
  margin: 25px 0 28px;
}
.welcome-copy h1 em {
  color: #d8b779;
  font-weight: 400;
  font-size: 0.82em;
}
.welcome-copy > p {
  max-width: 420px;
  color: #c2cbb8;
  line-height: 1.8;
  font-size: 16px;
}
.world-note {
  margin-top: 32px;
  color: #c1cbb6;
  font-size: 12px;
}
.world-note i,
.connection i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #93c3a0;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 10px #93c3a044;
}
.auth-panel {
  padding: 34px;
  background: #1c2923ed;
  border: 1px solid #65755877;
  box-shadow: 0 20px 80px #0005;
  border-radius: 8px;
}
.auth-panel h2 {
  font-size: 28px;
  margin: 16px 0 22px;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 25px;
}
.auth-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 12px 0;
  color: var(--muted);
}
.auth-tabs .active {
  border-bottom: 2px solid var(--gold);
  color: var(--gold);
}
.auth-panel .primary {
  width: 100%;
  padding: 15px;
}
.auth-panel .small {
  margin: 20px 0 0;
  text-align: center;
}
.page-header {
  display: flex;
  justify-content: space-between;
  padding: 25px 5vw;
  border-bottom: 1px solid var(--border);
}
.selection {
  max-width: 1150px;
  margin: 40px auto;
  padding: 0 30px;
}
.selection > h1 {
  font-size: 42px;
  margin: 10px 0 30px;
}
.create-layout {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 35px;
}
.class-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.class-card {
  text-align: left;
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 19px;
  background: var(--panel);
}
.class-card.active {
  border-color: var(--gold);
  background: #303b2d;
}
.class-card canvas {
  image-rendering: pixelated;
  width: 48px;
  height: 48px;
}
.class-card strong {
  font-family: Baskervville, Georgia, serif;
  font-size: 24px;
  display: block;
}
.class-card small {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.4;
}
.create-panel {
  background: var(--panel);
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.create-panel > canvas {
  display: block;
  margin: -10px auto 0;
  image-rendering: pixelated;
}
.create-panel h2 {
  text-align: center;
  font-size: 30px;
  margin-bottom: 10px;
}
.create-panel p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}
.create-panel .primary {
  width: 100%;
}
.saved-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 14px;
}
.saved-card button {
  margin-left: auto;
}
.saved-card small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
#saved-characters:not(:empty) {
  margin-bottom: 28px;
}
.game {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.game-header {
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: #1b2520;
}
.game-header .brand {
  margin-right: 22px;
}
.game-header .brand span {
  font-size: 18px;
}
.game-header button,
.game-header .button {
  font-size: 12px;
  padding: 8px 12px;
}
.location {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.location strong {
  font-weight: 500;
  font-size: 14px;
}
.location > span {
  font-size: 11px;
  color: var(--muted);
}
.connection {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.game-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 292px;
  gap: 0;
}
.world-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #2b4436;
  border: 8px solid #121b16;
  border-right: 1px solid var(--border);
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  touch-action: none;
  outline: none;
}
.world-top {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.world-top > span {
  background: #19261cce;
  color: #cdd1b7;
  padding: 9px 13px;
  font-size: 10px;
  letter-spacing: 1.4px;
  border: 1px solid #a2ad7944;
  border-radius: 3px;
}
.world-top button {
  pointer-events: auto;
  font-size: 11px;
  background: #19261cce;
}
.world-bottom {
  position: absolute;
  bottom: 15px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.world-bottom > span {
  background: #142019b9;
  padding: 8px 10px;
  font-size: 11px;
  color: #d7dbc9;
  border-radius: 3px;
}
.world-bottom button {
  pointer-events: auto;
  font-size: 12px;
}
.sidebar {
  background: #1b251f;
  overflow: auto;
  scrollbar-width: thin;
}
.player-card {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.player-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}
.player-heading canvas {
  image-rendering: pixelated;
  background: #2f3b2d;
  border-radius: 4px;
}
.player-heading h2 {
  font-size: 21px;
  margin-bottom: 3px;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-heading span {
  font-size: 11px;
  color: var(--muted);
}
.level-circle {
  margin-left: auto;
  border: 1px solid #b59c6e;
  border-radius: 50%;
  width: 33px;
  height: 33px;
  display: grid;
  place-content: center;
  color: var(--gold);
  font-size: 13px;
}
.meter {
  height: 21px;
  background: #101c16;
  border-radius: 3px;
  position: relative;
  margin-bottom: 7px;
  overflow: hidden;
  border: 1px solid #ffffff12;
}
.meter > div {
  height: 100%;
  transition: width 0.2s;
}
.health > div {
  background: linear-gradient(90deg, #7c3e39, #bd7966);
}
.mana > div {
  background: linear-gradient(90deg, #315663, #618b9d);
}
.meter > span {
  position: absolute;
  inset: 0;
  text-align: center;
  line-height: 19px;
  font-size: 11px;
  text-shadow: 0 1px 2px #000;
}
.experience {
  height: 3px;
  background: #111d15;
  margin: 14px 0 8px;
}
.experience div {
  height: 100%;
  background: var(--gold);
}
.player-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.player-meta strong {
  font-size: 12px;
  color: var(--gold);
}
.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.panel-tabs button {
  flex: 1;
  border: 0;
  border-radius: 0;
  padding: 12px 8px;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
}
.panel-tabs .active {
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
}
.side-content {
  padding: 17px;
  min-height: 220px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 12px;
}
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.item-slot {
  aspect-ratio: 1;
  min-width: 0;
  padding: 3px;
  position: relative;
  background: #26342a;
}
.item-slot canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}
.item-slot .qty {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 10px;
  text-shadow: 1px 1px #000;
}
.item-slot.empty {
  border: 1px solid #344335;
  background: #1c2b21;
}
.equipment {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 11px;
}
.equipment .item-slot {
  width: 40px;
}
.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #334030;
}
.stat-line strong {
  margin-left: auto;
  margin-right: 12px;
  color: var(--gold);
}
.stat-line button {
  padding: 2px 7px;
}
.skill-line {
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 9px;
  gap: 5px;
}
.skill-line button {
  padding: 3px 8px;
}
.quest-title {
  font-family: Baskervville, Georgia, serif;
  font-size: 22px;
  color: var(--gold);
}
.quest-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}
.quest-count {
  font-size: 12px;
  padding: 12px;
  background: #2d3a2d;
  border-radius: 4px;
}
.minimap-card {
  padding: 17px;
  border-top: 1px solid var(--border);
}
#minimap {
  width: 100%;
  image-rendering: pixelated;
  background: #101c15;
  border: 1px solid #46573c;
}
.map-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #b7c1a7;
  margin-top: 8px;
}
.game-bottom {
  height: 153px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(240px, 31%) 1fr;
  border-top: 1px solid var(--border);
  background: #1b251f;
}
.chat {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#chat-log {
  height: 110px;
  overflow-y: auto;
  padding: 10px 15px;
  font-size: 11px;
  line-height: 1.5;
  scrollbar-width: thin;
}
#chat-log p {
  margin: 2px 0;
  overflow-wrap: anywhere;
}
#chat-log b {
  color: var(--gold);
}
.system {
  color: #a6b89d;
}
.chat form {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-top: 1px solid #334032;
  height: 40px;
}
.chat form > span {
  font-size: 10px;
  color: var(--gold);
  margin-right: 8px;
}
.chat input {
  margin: 0;
  padding: 6px 0;
  border: none;
  font-size: 11px;
  background: transparent;
  min-width: 0;
}
.chat form button {
  background: transparent;
  border: 0;
  padding: 4px;
  color: var(--gold);
}
.action-area {
  padding: 12px 24px 7px;
}
.action-title {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 9px;
}
.hotbar {
  display: flex;
  gap: 8px;
}
.hotkey {
  position: relative;
  flex: 1;
  height: 70px;
  padding: 0;
  background: #28362b;
  border-color: #4b5843;
  overflow: hidden;
  max-width: 93px;
}
.hotkey .key {
  position: absolute;
  left: 5px;
  top: 4px;
  font-size: 10px;
  color: #e8d5a9;
  z-index: 2;
}
.hotkey .glyph {
  display: block;
  font-size: 26px;
  line-height: 42px;
  color: #e4c58e;
}
.hotkey .ability-name {
  display: block;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  padding: 0 3px;
  position: relative;
  z-index: 2;
}
.hotkey.locked {
  opacity: 0.4;
}
.hotkey .cooldown {
  position: absolute;
  inset: 0;
  background: #121b16cb;
  display: grid;
  place-content: center;
  font-size: 22px;
  color: var(--gold);
  z-index: 3;
}
.key-help {
  font-size: 10px;
  color: #899780;
  margin-top: 8px;
}
.target-card {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  background: #1b211bde;
  border: 1px solid #a4855c;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
}
.target-card > div {
  margin-top: 7px;
  height: 4px;
  background: #342620;
}
.target-card i {
  display: block;
  height: 100%;
  background: #c47e65;
}
.toast {
  position: absolute;
  bottom: 75px;
  left: 50%;
  transform: translateX(-50%);
  background: #15251deb;
  border: 1px solid var(--gold);
  padding: 12px 20px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 13px;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}
.toast.show {
  opacity: 1;
}
.touch-pad {
  display: none;
}
.connection-overlay {
  position: absolute;
  inset: 0;
  background: #102018de;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  z-index: 10;
}
.connection-overlay h2 {
  font-size: 32px;
  margin: 0;
}
.connection-overlay p {
  margin: 0;
  color: var(--muted);
}
dialog {
  width: min(720px, 94vw);
  max-height: 85dvh;
  overflow: auto;
  background: #1e2b23;
  color: var(--ink);
  border: 1px solid #697958;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 20px 100px #0008;
}
dialog::backdrop {
  background: #07100bd1;
  backdrop-filter: blur(3px);
}
.modal-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.modal-top h2 {
  font-size: 30px;
  margin: 8px 0 0;
}
.modal-top > button {
  font-size: 24px;
  padding: 0 10px;
}
.dialog-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.dialog-tabs button.active {
  border-color: var(--gold);
  color: var(--gold);
}
.shop-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.shop-row canvas {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
}
.shop-row .info {
  flex: 1;
}
.shop-row .info small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.shop-row button {
  font-size: 12px;
  padding: 8px 10px;
}
.shop-row strong {
  font-size: 14px;
  font-weight: 500;
}
.notice-box {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #29392b;
  line-height: 1.6;
  font-size: 13px;
  margin-bottom: 15px;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.market-form {
  display: grid;
  grid-template-columns: 1fr 100px auto;
  gap: 10px;
  align-items: end;
  margin: 18px 0;
}
.market-form label {
  margin: 0;
}
.modal-status {
  color: var(--gold);
  font-size: 13px;
  min-height: 20px;
  margin: 12px 0 0;
}
@media (min-width: 1500px) {
  .game-layout {
    grid-template-columns: 1fr 320px;
  }
  .game-bottom {
    height: 165px;
  }
  .hotkey {
    height: 77px;
    max-width: 110px;
  }
  .action-area {
    padding: 16px 30px;
  }
  .game-header {
    height: 74px;
  }
}
@media (max-width: 1000px) {
  .welcome {
    padding: 100px 5vw 80px;
    gap: 35px;
    grid-template-columns: 1fr 350px;
  }
  .landing-header,
  .landing-footer {
    left: 5vw;
    right: 5vw;
  }
  .welcome-copy h1 {
    font-size: 45px;
  }
  .game-header {
    padding: 0 12px;
    gap: 10px;
  }
  .game-header .brand span {
    font-size: 14px;
    letter-spacing: 2px;
  }
  .game-header .brand {
    margin-right: 5px;
  }
  .game-layout {
    grid-template-columns: 1fr 255px;
  }
  .game-bottom {
    grid-template-columns: 240px 1fr;
  }
  .action-area {
    padding: 12px;
  }
  .hotbar {
    gap: 4px;
  }
  .hotkey .ability-name {
    font-size: 8px;
  }
  .game-header #sound {
    display: none;
  }
}
@media (max-width: 700px) {
  .welcome {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 100px 22px 90px;
    gap: 30px;
  }
  .welcome-copy {
    width: 100%;
    max-width: 390px;
  }
  .welcome-copy h1 {
    font-size: 36px;
    margin: 14px 0;
  }
  .welcome-copy > p {
    font-size: 13px;
    margin: 0;
  }
  .world-note {
    display: none;
  }
  .auth-panel {
    width: 100%;
    max-width: 390px;
    padding: 25px;
  }
  .landing-header {
    top: 25px;
  }
  .edition,
  .landing-footer > span:last-child {
    display: none;
  }
  .landing-footer {
    bottom: 20px;
  }
  .create-layout {
    grid-template-columns: 1fr;
  }
  .selection {
    padding: 0 18px;
  }
  .selection > h1 {
    font-size: 32px;
  }
  .class-card {
    padding: 12px;
    gap: 5px;
  }
  .class-card strong {
    font-size: 18px;
  }
  .class-card small {
    font-size: 10px;
  }
  .game-header {
    height: 52px;
    gap: 8px;
  }
  .game-header .brand span {
    display: none;
  }
  .game-header .brand {
    font-size: 26px;
  }
  .location strong {
    font-size: 12px;
  }
  .location > span {
    font-size: 10px;
  }
  .game-header .button {
    padding: 6px;
    font-size: 10px;
  }
  .connection {
    font-size: 10px;
  }
  .game-header button {
    padding: 6px 9px;
  }
  .game-layout {
    display: flex;
    flex-direction: column;
  }
  .world-panel {
    flex: 1;
    min-height: 200px;
    border-width: 3px;
  }
  .sidebar {
    height: 168px;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 150px 1fr;
    grid-template-rows: 38px 130px;
    overflow: hidden;
  }
  .player-card {
    grid-row: 1/3;
    padding: 10px;
  }
  .player-heading {
    gap: 5px;
    margin-bottom: 10px;
  }
  .player-heading canvas {
    width: 28px;
    height: 28px;
  }
  .player-heading h2 {
    font-size: 15px;
    max-width: 70px;
  }
  .player-heading span {
    font-size: 9px;
  }
  .level-circle {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
  .meter {
    height: 17px;
  }
  .meter > span {
    line-height: 15px;
    font-size: 10px;
  }
  .player-meta {
    flex-direction: column;
    gap: 5px;
  }
  .side-content {
    min-height: 0;
    padding: 8px;
    overflow: auto;
  }
  .minimap-card {
    display: none;
  }
  .panel-tabs button {
    padding: 8px 3px;
    font-size: 11px;
  }
  .inventory-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }
  .equipment {
    display: none;
  }
  .game-bottom {
    height: 115px;
    display: block;
  }
  .chat {
    display: none;
  }
  .action-area {
    padding: 7px 10px;
  }
  .action-title {
    margin-bottom: 6px;
    font-size: 8px;
  }
  .hotkey {
    height: 62px;
    max-width: none;
  }
  .hotkey .glyph {
    font-size: 22px;
    line-height: 37px;
  }
  .hotkey .ability-name {
    font-size: 8px;
  }
  .key-help {
    font-size: 8px;
  }
  .world-top {
    top: 10px;
    left: 10px;
    right: 10px;
  }
  .world-top > span {
    font-size: 8px;
    padding: 6px;
  }
  .world-top button {
    font-size: 10px;
    padding: 6px;
  }
  .world-bottom {
    bottom: 10px;
    left: 10px;
    right: 10px;
    justify-content: flex-end;
  }
  .world-bottom > span {
    display: none;
  }
  .world-bottom button {
    font-size: 10px;
    padding: 9px;
  }
  .touch-pad {
    display: block;
    position: absolute;
    bottom: 12px;
    left: 12px;
    text-align: center;
    touch-action: none;
  }
  .touch-pad button {
    padding: 0;
    width: 38px;
    height: 36px;
    background: #1d2d22cb;
    margin: 2px;
    border-color: #8d9a7466;
    font-size: 20px;
  }
  .touch-pad > div {
    display: flex;
  }
  .target-card {
    top: 43px;
    width: 190px;
    font-size: 11px;
    padding: 6px;
  }
  .toast {
    bottom: 110px;
    font-size: 11px;
  }
  .quest-title {
    font-size: 16px;
  }
  .quest-text {
    font-size: 11px;
    margin-bottom: 7px;
  }
  .stat-line {
    padding: 3px;
    font-size: 11px;
  }
  .stat-line button {
    padding: 0 6px;
  }
  .market-form {
    grid-template-columns: 1fr 80px;
  }
  .market-form button {
    grid-column: 1/3;
  }
  dialog {
    padding: 20px;
  }
  .shop-row {
    gap: 8px;
  }
  .shop-row strong {
    font-size: 12px;
  }
  .shop-row button {
    padding: 6px;
    font-size: 11px;
  }
  .saved-card {
    gap: 7px;
    font-size: 13px;
  }
  .saved-card button {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Odrzewie 0.2 — brass, bark and parchment */
.game-header {
  height: 58px;
  background: linear-gradient(180deg, #23342d, #17261f);
  border-bottom: 1px solid #ab906b55;
  box-shadow: 0 2px 15px #0005;
  z-index: 2;
}
.game-header .brand {
  color: #dfc18c;
}
.game-header .brand span {
  font-size: 16px;
  letter-spacing: 3px;
}
.game-layout {
  grid-template-columns: 238px minmax(0, 1fr) 238px;
  grid-template-areas: "character world inventory";
  gap: 0;
}
.character-sidebar {
  grid-area: character;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  background: linear-gradient(110deg, #1a2923, #223129 65%, #17241e);
  border-right: 1px solid #a88c5c55;
  position: relative;
}
.sidebar {
  grid-area: inventory;
  border-left: 1px solid #a88c5c55;
  background: linear-gradient(110deg, #1c2922, #202d25);
}
.world-panel {
  grid-area: world;
  border: 5px solid #111d18;
  box-shadow: inset 0 0 0 1px #bc9e5d55;
  background: #1d3426;
}
.player-card {
  padding: 17px 16px 14px;
  background: linear-gradient(180deg, #ffffff05, transparent);
  border-bottom: 1px solid #a88c5c33;
}
.player-heading {
  gap: 8px;
  margin-bottom: 12px;
}
.player-heading h2 {
  font-size: 23px;
  max-width: 122px;
}
.player-heading canvas {
  width: 38px;
  height: 38px;
  background: #18271f;
  border: 1px solid #c8aa6c44;
  box-shadow: inset 0 0 15px #0004;
}
.level-circle {
  min-width: 29px;
  width: 29px;
  height: 29px;
  border-radius: 4px;
  background: #a2874633;
  color: #f3d99f;
  font-weight: 500;
}
.meter {
  height: 17px;
  border-radius: 2px;
  box-shadow: inset 0 0 6px #0005;
}
.meter > span {
  line-height: 15px;
  font-size: 10px;
}
.health > div {
  background: linear-gradient(90deg, #813d34, #d37d64);
}
.mana > div {
  background: linear-gradient(90deg, #315d70, #78adb9);
}
.experience {
  height: 4px;
  margin-top: 12px;
}
.experience div {
  box-shadow: 0 0 8px #e1bb6655;
}
.paperdoll-heading {
  padding: 16px 16px 10px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #bdc4a8;
}
.paperdoll-heading span:last-child {
  letter-spacing: 0;
  color: #d8be87;
}
.paperdoll {
  position: relative;
  height: 276px;
  margin: 0 16px;
  background: radial-gradient(ellipse at 50% 48%, #77916a20 0, transparent 65%);
}
#character-portrait {
  position: absolute;
  left: 50%;
  top: 60px;
  width: 112px;
  height: 150px;
  transform: translateX(-50%);
  image-rendering: pixelated;
  pointer-events: none;
}
.gear-slot {
  position: absolute;
  width: 46px;
  height: 46px;
  padding: 4px;
  background: linear-gradient(145deg, #17241e, #2b3b2e);
  border: 1px solid #6c735647;
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 2px #0e191633,
    0 2px 5px #0004;
  overflow: visible;
}
.gear-slot.filled {
  border-color: #ad956c88;
  background: linear-gradient(145deg, #3e4732, #243329);
}
.gear-slot:before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid #bda56518;
  pointer-events: none;
}
.gear-slot canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}
.gear-slot small {
  position: absolute;
  left: -7px;
  right: -7px;
  bottom: -15px;
  font-size: 9px;
  color: #a6b39a;
  white-space: nowrap;
  font-weight: 400;
}
.slot-symbol {
  font-size: 25px;
  color: #77816a77;
  line-height: 30px;
}
.gear-head {
  left: calc(50% - 23px);
  top: 0;
}
.gear-neck {
  left: 0;
  top: 38px;
}
.gear-weapon {
  left: 0;
  top: 108px;
}
.gear-ring {
  left: 0;
  top: 178px;
}
.gear-offhand {
  right: 0;
  top: 38px;
}
.gear-armor {
  right: 0;
  top: 108px;
}
.gear-legs {
  right: 0;
  top: 178px;
}
.gear-feet {
  left: calc(50% - 23px);
  top: 214px;
}
.equip-help {
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
  color: #8f9d86;
  margin: 9px 12px 14px;
}
.team-button {
  margin: 0 16px;
  width: calc(100% - 32px);
  text-align: left;
  display: flex;
  justify-content: space-between;
  border-color: #536047;
  background: #2b3a2a;
  font-size: 12px;
  padding: 10px;
}
.team-button span {
  color: #d4b77b;
  font-size: 11px;
}
.team-members {
  font-size: 11px;
  color: #a9b69b;
  padding: 10px 17px;
  line-height: 1.5;
}
.character-footer {
  text-align: center;
  border-top: 1px solid #bd9a5c22;
  padding: 16px;
  color: #bfa373;
  font-family: Baskervville, Georgia, serif;
  letter-spacing: 3px;
  font-size: 12px;
}
.character-footer small {
  display: block;
  font:
    9px Barlow,
    sans-serif;
  letter-spacing: 1px;
  color: #84947e;
  margin-top: 6px;
}
.panel-tabs {
  padding-top: 4px;
  background: #ffffff03;
}
.panel-tabs button {
  font-size: 11px;
  padding: 13px 6px;
}
.side-content {
  padding: 14px;
  min-height: 230px;
}
.section-title {
  font-size: 9px;
  letter-spacing: 1.2px;
}
.inventory-grid {
  gap: 5px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 3px;
  margin: -3px;
}
.item-slot {
  border: 1px solid #77816270;
  background: linear-gradient(135deg, #3a4833, #243428);
  box-shadow: inset 0 0 0 2px #16271e66;
  border-radius: 3px;
  cursor: grab;
}
.item-slot.empty {
  background: linear-gradient(145deg, #17271d, #1e2e23);
  border-color: #4b5e3f66;
  box-shadow: inset 0 2px 7px #0003;
}
.item-slot:hover,
.gear-slot:hover {
  border-color: #d8b979;
  box-shadow: 0 0 10px #c7ae5320;
}
.item-slot .qty {
  font-size: 10px;
  color: #f4e6be;
}
.bag-help {
  font-size: 10px;
  color: #91a087;
  line-height: 1.6;
  margin-top: 14px;
}
.dragging-item [draggable="true"] {
  cursor: grabbing;
}
.drop-ready {
  outline: 2px solid #b5d281 !important;
  background-color: #739d4933 !important;
}
.drop-invalid {
  outline: 2px solid #c8725b !important;
}
.gear-slot:focus-visible,
.item-slot:focus-visible {
  outline: 2px solid #e8cc89;
  outline-offset: 2px;
}
.minimap-card {
  padding: 14px;
}
.minimap-card canvas {
  max-height: 150px;
  object-fit: fill;
  box-shadow: inset 0 0 15px #0008;
}
.map-legend {
  font-size: 9px;
}
.game-bottom {
  height: 180px;
  grid-template-columns: minmax(330px, 36%) minmax(0, 1fr);
  background: linear-gradient(180deg, #233129, #16261e);
  border-top: 1px solid #ad90654d;
}
.chat {
  min-height: 0;
}
.chat-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #b39d6340;
  background: #121f18;
  flex-shrink: 0;
}
.chat-tabs button {
  min-width: 0;
  flex: 1;
  padding: 10px 5px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #87987d;
  font-size: 11px;
  white-space: nowrap;
}
.chat-tabs button.active {
  background: linear-gradient(180deg, #293829, #263327);
  color: #e5ca91;
  box-shadow: inset 0 2px #b99957;
}
.chat-tabs button:hover {
  color: #eee3c5;
}
#chat-log {
  flex: 1;
  height: auto;
  min-height: 0;
  padding: 9px 13px;
  font-size: 11px;
  line-height: 1.55;
}
#chat-log time {
  color: #74876d;
  font-size: 9px;
}
#chat-log b {
  font-weight: 500;
  color: #d5bb82;
}
#chat-log .system {
  color: #abbc9d;
}
.chat form {
  height: 35px;
  flex-shrink: 0;
  border-top: 1px solid #c1a36425;
  padding: 0 12px;
}
.chat input {
  width: 100%;
  font-size: 11px;
}
.chat form button {
  font-size: 20px;
}
.chat input:disabled {
  color: #718368;
}
.action-area {
  padding: 20px 22px 12px;
  min-width: 0;
}
.action-title {
  margin-bottom: 12px;
  font-size: 9px;
}
.hotbar {
  gap: 7px;
}
.hotkey {
  height: 78px;
  max-width: none;
  border-color: #86734f77;
  background: linear-gradient(150deg, #3f4932, #202f24);
  box-shadow:
    inset 0 0 0 3px #14251b88,
    0 3px 7px #0005;
  border-radius: 4px;
}
.hotkey .glyph {
  font-size: 30px;
  line-height: 49px;
  text-shadow: 0 0 14px #efca6a55;
}
.hotkey .ability-name {
  font-size: 9px;
  color: #d8d9bd;
}
.hotkey.locked {
  opacity: 0.35;
}
.key-help {
  margin-top: 12px;
  font-size: 10px;
  color: #93a086;
}
.world-top {
  top: 14px;
  left: 14px;
  right: 14px;
}
.world-top > span {
  font-size: 9px;
  letter-spacing: 1.6px;
  padding: 8px 11px;
  backdrop-filter: blur(5px);
  border-color: #c5ad6d44;
}
.target-card {
  top: 54px;
  background: #172219ec;
  box-shadow: 0 5px 20px #0004;
  width: 210px;
  border-color: #d4b27388;
}
.world-bottom {
  left: 14px;
  right: 14px;
}
.world-bottom > span {
  font-size: 10px;
}
.world-bottom button {
  font-size: 11px;
}
.mobile-panel-toggle {
  display: none;
}
#invite-form {
  margin-top: 18px;
}
#invite-form label {
  display: block;
  font-size: 12px;
}
@media (min-width: 1600px) {
  .game-layout {
    grid-template-columns: 260px minmax(0, 1fr) 260px;
  }
  .paperdoll {
    margin: 0 24px;
  }
  .game-bottom {
    height: 184px;
  }
}
@media (max-width: 1150px) and (min-width: 801px) {
  .game-layout {
    grid-template-columns: 210px minmax(0, 1fr) 210px;
  }
  .player-heading canvas {
    display: none;
  }
  .paperdoll {
    margin: 0 10px;
  }
  .side-content {
    padding: 10px;
  }
  .game-bottom {
    grid-template-columns: 330px minmax(0, 1fr);
  }
  .action-area {
    padding: 17px 12px;
  }
  .hotbar {
    gap: 4px;
  }
  .hotkey .ability-name {
    font-size: 8px;
  }
  .game-header .brand span {
    font-size: 13px;
  }
  .character-footer {
    display: none;
  }
}
@media (max-width: 800px) {
  .game-header {
    height: 52px;
    padding: 0 10px;
    gap: 7px;
  }
  .game-header .brand {
    margin: 0;
  }
  .game-header .brand span,
  .game-header #sound,
  .game-header #editor-link {
    display: none;
  }
  .game-header .brand {
    font-size: 23px;
  }
  .game-header .location {
    margin-right: auto;
  }
  .game-header .location strong {
    font-size: 12px;
  }
  .game-header .location > span {
    font-size: 9px;
  }
  .game-header button {
    padding: 7px 8px;
    font-size: 10px;
  }
  .game-header .connection {
    display: none;
  }
  .mobile-panel-toggle {
    display: block;
  }
  .game-layout {
    display: flex;
    flex-direction: column;
    position: relative;
  }
  .world-panel {
    flex: 1;
    min-height: 180px;
    border: 3px solid #101d17;
  }
  .character-sidebar,
  .sidebar {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(290px, 85vw);
    height: auto;
    z-index: 9;
    box-shadow: 0 10px 35px #0008;
    border: 1px solid #b89c6355;
    overflow: auto;
  }
  .character-sidebar {
    left: 0;
  }
  .sidebar {
    right: 0;
  }
  .character-sidebar.show-sheet,
  .sidebar.show-sheet {
    display: block;
  }
  .player-card {
    padding: 16px;
  }
  .player-heading canvas {
    width: 38px;
    height: 38px;
  }
  .player-heading h2 {
    font-size: 23px;
    max-width: none;
  }
  .player-heading span {
    font-size: 11px;
  }
  .player-meta {
    flex-direction: row;
  }
  .paperdoll {
    margin: 0 25px;
  }
  .side-content {
    min-height: 230px;
    padding: 15px;
    overflow: visible;
  }
  .inventory-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .minimap-card {
    display: block;
    padding: 15px;
  }
  .minimap-card canvas {
    max-height: 140px;
  }
  .character-footer {
    display: none;
  }
  .game-bottom {
    display: flex;
    flex-direction: column;
    height: 218px;
  }
  .action-area {
    order: 0;
    height: 91px;
    box-sizing: border-box;
    padding: 6px 9px;
  }
  .action-title {
    font-size: 8px;
    margin-bottom: 5px;
  }
  .hotbar {
    gap: 4px;
  }
  .hotkey {
    height: 62px;
  }
  .hotkey .glyph {
    font-size: 24px;
    line-height: 38px;
  }
  .hotkey .ability-name {
    font-size: 8px;
  }
  .key-help {
    display: none;
  }
  .chat {
    display: flex;
    order: 1;
    height: 127px;
    border-top: 1px solid #baa26844;
  }
  .chat-tabs button {
    padding: 6px 4px;
    font-size: 10px;
  }
  .chat form {
    height: 30px;
  }
  .chat input {
    font-size: 12px;
  }
  #chat-log {
    padding: 5px 10px;
    font-size: 10px;
  }
  .chat form > span {
    font-size: 9px;
  }
  .touch-pad {
    display: block;
  }
  .world-top {
    top: 9px;
    left: 9px;
    right: 9px;
  }
  .world-top > span {
    font-size: 8px;
    letter-spacing: 1px;
    padding: 6px;
  }
  .world-top button {
    font-size: 9px;
    padding: 6px;
  }
  .world-bottom {
    bottom: 9px;
    right: 9px;
  }
  .world-bottom > span {
    display: none;
  }
  .world-bottom button {
    font-size: 10px;
  }
  .target-card {
    top: 40px;
    width: 170px;
    font-size: 10px;
    padding: 5px;
  }
  .toast {
    font-size: 11px;
    bottom: 95px;
  }
}
.mobile-vitals {
  display: none;
}
@media (max-width: 800px) {
  .mobile-vitals {
    display: flex;
    position: absolute;
    top: 41px;
    left: 10px;
    gap: 3px;
    flex-direction: column;
    pointer-events: none;
    font-size: 10px;
    font-weight: 500;
    text-shadow: 0 1px 2px #07100b;
  }
  .mobile-vitals span {
    padding: 3px 6px;
    background: #17251cce;
    border-radius: 2px;
  }
  .mobile-vitals span:first-child {
    color: #f0b79c;
  }
  .mobile-vitals span:last-child {
    color: #a6d5e2;
  }
}

/* v0.3: editable action rows and in-world containers */
.game-bottom {
  height: 208px;
  grid-template-columns: minmax(280px, 0.8fr) minmax(600px, 1.7fr);
}
.action-area {
  min-width: 0;
  padding: 10px 14px;
}
.action-title {
  margin-bottom: 7px;
}
.action-title button {
  padding: 3px 9px;
  font-size: 12px;
  color: #e9d7a5;
}
.hotbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hotbar-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 5px;
}
.hotbar-row.row-1 {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}
.hotkey {
  height: 62px;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}
.hotkey .key {
  font-size: 10px;
  left: 5px;
  top: 3px;
}
.hotkey .glyph {
  font-size: 22px;
  line-height: 36px;
  height: 36px;
  display: block;
}
.hotkey .ability-name {
  display: block;
  font-size: 9px;
  line-height: 10px;
  max-height: 20px;
  padding: 0 2px;
  overflow: hidden;
  white-space: normal;
}
.hotkey.unassigned {
  border-style: dashed;
  opacity: 0.65;
}
.hotkey .cooldown {
  font-size: 20px;
}
.key-help {
  font-size: 10px;
  margin-top: 7px;
}
.context-menu {
  position: fixed;
  z-index: 10000;
  width: 226px;
  padding: 7px;
  background: #172920;
  border: 1px solid #9c855c;
  box-shadow: 0 12px 35px #0009;
  border-radius: 5px;
}
.context-menu strong {
  display: block;
  padding: 8px;
  color: #dfc491;
  font-size: 13px;
  border-bottom: 1px solid #b9a06b33;
  margin-bottom: 4px;
}
.context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 8px;
  font-size: 13px;
}
.context-menu button:hover,
.context-menu button:focus {
  background: #a38a4a38;
}
.loot-window {
  position: absolute;
  right: 12px;
  top: 88px;
  width: 260px;
  z-index: 15;
  padding: 12px;
  background: #17261cf2;
  border: 1px solid #a38c57;
  box-shadow: 0 10px 30px #0007;
  border-radius: 6px;
}
.loot-window header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 10px;
}
.loot-window header strong {
  font-size: 13px;
  color: #edd3a0;
  display: block;
}
.loot-window header small {
  font-size: 10px;
  color: #a9baa5;
  display: block;
  margin-top: 4px;
}
.loot-window header button {
  padding: 1px 7px;
  font-size: 20px;
}
.corpse-items {
  max-height: 160px;
  overflow: auto;
}
.corpse-items button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  font-size: 12px;
  padding: 8px;
  margin-bottom: 4px;
}
.loot-window > .primary {
  width: 100%;
  margin-top: 9px;
  padding: 8px;
  font-size: 12px;
}
.spell-library {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.spell-card {
  border: 1px solid #82906c44;
  background: #12251b;
  padding: 14px;
  border-radius: 5px;
}
.spell-card.locked {
  opacity: 0.6;
}
.spell-card strong,
.spell-card small {
  display: block;
}
.spell-card small {
  color: #bdcaac;
  margin-top: 6px;
  font-size: 11px;
}
.spell-card p {
  font-size: 12px;
  color: #b4c2ae;
  line-height: 1.5;
  min-height: 36px;
}
.spell-card button {
  font-size: 12px;
  padding: 6px 10px;
}
.slot-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.outfit-editor {
  display: grid;
  grid-template-columns: 144px 1fr;
  gap: 24px;
  align-items: center;
}
.setting-list {
  margin: 20px 0;
}
.setting-list label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 13px 0;
}
.setting-list input {
  width: 18px;
  height: 18px;
  accent-color: #c4ae79;
}
.trained-skill {
  margin: 9px 0;
}
.trained-skill > div {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.trained-skill progress {
  width: 100%;
  height: 5px;
  accent-color: #b9c68a;
  display: block;
  margin: 5px 0;
}
.trained-skill small {
  font-size: 10px;
  color: #8fa48e;
}
.depot-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.depot-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0;
  font-size: 12px;
}
.depot-row span {
  flex: 1;
}
.depot-row button {
  padding: 5px;
  font-size: 10px;
}
.gold-storage {
  border-top: 1px solid #8b9b6d44;
  margin-top: 20px;
  padding-top: 12px;
}
.gold-storage input {
  max-width: 180px;
}
.shop-quantity {
  max-width: 220px;
  margin-bottom: 16px;
}
.character-sidebar {
  overflow-y: auto;
}
#ammo-button,
#settings-button {
  margin: 4px 16px;
  font-size: 11px;
  min-height: 30px;
  padding: 5px;
}
#settings-button {
  color: #bfcfb1;
}
@media (min-width: 1600px) {
  .game-bottom {
    grid-template-columns: minmax(320px, 0.8fr) minmax(700px, 1.7fr);
  }
}
@media (max-width: 1150px) and (min-width: 801px) {
  .game-bottom {
    grid-template-columns: 270px minmax(0, 1fr);
  }
  .action-area {
    padding: 9px;
  }
  .hotbar-row {
    gap: 3px;
  }
  .hotkey .ability-name {
    font-size: 8px;
  }
  .hotkey {
    height: 62px;
  }
}
@media (max-width: 800px) {
  .game-bottom {
    height: 270px;
    display: flex;
  }
  .action-area {
    height: 153px;
    padding: 7px 8px;
  }
  .hotbar {
    display: flex;
    gap: 4px;
  }
  .hotbar-row {
    gap: 3px;
  }
  .hotkey {
    height: 49px;
    border-radius: 3px;
  }
  .hotkey .key {
    font-size: 9px;
    left: 3px;
    top: 2px;
  }
  .hotkey .glyph {
    font-size: 18px;
    line-height: 42px;
    height: 42px;
  }
  .hotkey .ability-name {
    display: none;
  }
  .action-title button {
    font-size: 11px;
    padding: 2px 5px;
  }
  .action-title {
    margin-bottom: 5px;
  }
  .chat {
    height: 117px;
  }
  .spell-library,
  .depot-columns {
    grid-template-columns: 1fr;
  }
  .outfit-editor {
    gap: 10px;
    grid-template-columns: 110px 1fr;
  }
  .outfit-editor canvas {
    width: 110px;
  }
  .loot-window {
    width: 218px;
    right: 8px;
    top: 78px;
    padding: 9px;
  }
  .slot-picker {
    grid-template-columns: repeat(4, 1fr);
  }
}

.hotkey.locked {
  opacity: 0.65;
  filter: saturate(0.65);
}
.spell-card.locked {
  opacity: 0.8;
}
/* v0.4: painted world, compact equipment and explicit combat controls */
canvas {
  image-rendering: auto !important;
}
.action-icon {
  width: 32px;
  height: 32px;
  color: var(--icon-color, #d5bd8a);
  flex: none;
  vertical-align: middle;
  filter: drop-shadow(0 2px 3px #0009);
}
.hotkey .glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 43px;
  padding-top: 6px;
}
.hotkey .glyph svg {
  width: 29px;
  height: 29px;
}
.spell-card > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.spell-card > div:first-child small {
  flex-basis: 100%;
}
.panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  flex: none;
}
.panel-tabs button {
  padding: 9px 3px;
  font-size: 11px;
}
.side-content {
  padding: 12px;
}
.player-card {
  padding: 9px 12px;
}
.player-heading {
  margin-bottom: 7px;
}
.player-heading h2 {
  font-size: 20px;
}
.experience {
  margin-top: 7px;
}
.paperdoll-heading {
  padding: 9px 12px;
}
.paperdoll {
  height: 221px;
  margin: 0 14px;
}
.gear-slot {
  width: 39px;
  height: 39px;
}
.gear-head {
  left: calc(50% - 20px);
  top: 0;
}
.gear-neck {
  top: 16px;
}
.gear-offhand {
  top: 16px;
}
.gear-weapon,
.gear-armor {
  top: 76px;
}
.gear-ring,
.gear-legs {
  top: 136px;
}
.gear-feet {
  top: 175px;
  left: calc(50% - 20px);
}
.gear-backpack {
  right: 0;
  top: 191px;
}
.gear-slot small {
  font-size: 8px;
  bottom: -12px;
}
#character-portrait {
  top: 40px;
  width: 108px;
  height: 144px;
}
.equip-help {
  display: none;
}
.character-footer {
  display: none;
}
#combat-controls {
  padding: 9px 10px 5px;
}
.combat-stances {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.combat-stances button {
  padding: 5px 0;
  font-size: 8px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 3px;
}
.combat-stances svg {
  width: 21px;
  height: 21px;
}
.combat-stances .active,
.combat-toggles .active {
  border-color: #c7af76;
  background: #425039;
}
.combat-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 5px;
}
.combat-toggles button {
  font-size: 9px;
  padding: 7px 3px;
  min-height: 35px;
}
.ammo-slot {
  margin: 5px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  width: calc(100% - 24px);
  padding: 4px 7px;
  font-size: 10px;
}
.ammo-slot b {
  margin-left: auto;
}
.ammo-slot svg {
  width: 26px;
  height: 26px;
}
#ammo-button {
  display: none;
}
.team-members {
  font-size: 10px;
}
.buff-bar {
  position: absolute;
  left: 14px;
  top: 46px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  max-width: calc(100% - 30px);
  pointer-events: none;
}
.buff {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  background: #12251fec;
  border: 1px solid #acbb7a66;
  border-radius: 4px;
  font-size: 11px;
  box-shadow: 0 2px 10px #0005;
}
.buff svg {
  width: 22px;
  height: 22px;
}
.buff strong {
  color: #f3da99;
}
.combat-indicator {
  font-size: 10px;
  background: #402e23c9;
  padding: 6px;
  border-radius: 3px;
  color: #f7bf9c;
}
.target-card {
  top: 86px;
}
.battle-auto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  font-size: 10px;
  padding: 6px;
}
.battle-auto svg {
  width: 22px;
  height: 22px;
}
.battle-list {
  margin-top: 10px;
}
.battle-row {
  display: flex;
  width: 100%;
  gap: 7px;
  align-items: center;
  text-align: left;
  padding: 8px 5px;
  margin: 5px 0;
  background: #17251c;
}
.battle-row > span:last-child {
  min-width: 0;
  flex: 1;
}
.battle-row strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.battle-row small {
  display: block;
  color: #a9b8a0;
  font-size: 10px;
  margin: 3px 0;
}
.battle-row progress {
  width: 100%;
  height: 4px;
  display: block;
  accent-color: #c37a5c;
}
.battle-row.active {
  border-color: #e6af70;
  background: #4d3f29;
}
.friend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #7e956230;
}
.friend-row span {
  flex: 1;
}
.friend-row strong,
.friend-row small {
  display: block;
  font-size: 12px;
}
.friend-row small {
  font-size: 10px;
  color: #a5b09a;
}
.friend-row i {
  width: 7px;
  height: 7px;
  background: #68736a;
  border-radius: 50%;
}
.friend-row i.online {
  background: #9bc980;
  box-shadow: 0 0 8px #9bc98080;
}
.friend-row button {
  padding: 3px 8px;
}
#friends-form input {
  padding: 8px;
  margin: 5px 0;
}
#friends-form button {
  width: 100%;
}
.trained-skill {
  padding: 9px 0;
  border-bottom: 1px solid #a3b38125;
}
.trained-skill > div {
  font-size: 13px;
}
.trained-skill progress {
  height: 8px;
}
.trained-skill small {
  font-size: 11px;
}
.rich-tooltip {
  position: fixed;
  z-index: 10000;
  width: 280px;
  max-width: calc(100vw - 16px);
  padding: 15px;
  background: #13221ff8;
  border: 1px solid #b79b69;
  border-radius: 6px;
  box-shadow: 0 12px 30px #0008;
  color: #d6dfce;
  pointer-events: none;
  font-size: 12px;
  line-height: 1.5;
}
.rich-tooltip strong {
  display: block;
  color: #f0d49c;
  font-size: 15px;
  margin-bottom: 8px;
}
.rich-tooltip p {
  margin: 7px 0;
}
.rich-tooltip small {
  color: #a1b5a6;
  font-size: 10px;
}
.tooltip-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tooltip-stats span {
  background: #b4c68d12;
  border: 1px solid #aabd7c30;
  padding: 3px 6px;
  border-radius: 3px;
  color: #d9cc9d;
}
#modal[open] {
  display: flex;
  flex-direction: column;
  max-height: 88dvh;
  padding: 22px;
  overflow: visible;
}
#modal-body {
  overflow: auto;
  min-height: 0;
  padding-right: 5px;
}
.modal-top {
  flex: none;
}
.modal-status {
  flex: none;
  margin: 0 0 10px;
  padding: 9px 12px;
  background: #39543b;
  border: 1px solid #92b17670;
  color: #e4f0ca;
}
.modal-status:empty {
  display: none;
}
.depot-grid {
  grid-template-columns: repeat(5, 1fr);
  min-height: 180px;
  border: 1px solid #60795655;
  padding: 8px;
  background: #122019;
}
.depot-grid .item-slot {
  min-width: 0;
  aspect-ratio: 1;
  height: auto;
}
.depot-grid .action-icon {
  width: 34px;
  max-width: 100%;
}
.depot-quantity input {
  max-width: 120px;
  padding: 6px;
}
.quantity-presets {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.quantity-presets button {
  padding: 5px 10px;
}
.shop-quantity {
  max-width: 270px;
}
.shop-quantity input {
  padding: 7px;
}
.shop-row button {
  font-size: 11px;
}
.item-slot svg {
  pointer-events: none;
}
@media (min-width: 801px) {
  .game-bottom {
    height: 184px;
  }
  .hotkey {
    height: 57px;
  }
  .action-area {
    padding: 7px 12px;
  }
  .game-layout {
    grid-template-columns: 230px minmax(0, 1fr) 240px;
  }
  .minimap-card {
    flex: none;
  }
  #minimap {
    height: 120px;
    width: 100%;
  }
  .key-help {
    font-size: 9px;
  }
  .chat {
    min-height: 0;
  }
  .character-sidebar {
    scrollbar-gutter: stable;
  }
}
@media (max-width: 800px) {
  #modal[open] {
    padding: 14px;
    max-height: 90dvh;
    width: calc(100vw - 20px);
  }
  .game-layout {
    grid-template-columns: 1fr;
  }
  .buff-bar {
    left: 7px;
    top: 42px;
  }
  .buff {
    font-size: 9px;
    padding: 3px;
  }
  .buff span {
    max-width: 70px;
    overflow: hidden;
    white-space: nowrap;
  }
  .buff svg {
    width: 18px;
    height: 18px;
  }
  .combat-indicator {
    display: none;
  }
  .target-card {
    top: 80px;
  }
  .depot-columns {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .depot-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 4px;
    gap: 4px;
  }
  .shop-row {
    flex-wrap: wrap;
  }
  .shop-row .info {
    min-width: 140px;
  }
  .shop-row button {
    flex: 1;
  }
  .hotkey .glyph svg {
    width: 25px;
    height: 25px;
  }
  .character-sidebar,
  .sidebar {
    padding-bottom: 16px;
  }
  .paperdoll {
    height: 235px;
  }
}
@media (min-width: 801px) {
  .paperdoll {
    height: 196px;
  }
  .gear-neck,
  .gear-offhand {
    top: 12px;
  }
  .gear-weapon,
  .gear-armor {
    top: 64px;
  }
  .gear-ring,
  .gear-legs {
    top: 116px;
  }
  .gear-feet {
    top: 155px;
  }
  .gear-backpack {
    top: 165px;
  }
  #character-portrait {
    top: 34px;
    width: 98px;
    height: 130px;
  }
  .paperdoll-heading {
    padding: 6px 12px;
  }
  .player-card {
    padding: 7px 12px;
  }
  #combat-controls {
    padding-top: 8px;
  }
  .combat-stances button {
    padding: 3px 0;
  }
  .combat-toggles button {
    min-height: 31px;
    padding: 5px 3px;
  }
}
@media (max-width: 800px) {
  .buff-bar {
    left: auto;
    right: 8px;
    top: 47px;
    max-width: 50%;
    justify-content: flex-end;
  }
}
