:root {
  color-scheme: dark;
  --ink: #f3e8c8;
  --muted: #b7ad8c;
  --panel: rgba(17, 24, 25, 0.88);
  --panel-edge: #5d4a2b;
  --leaf: #6eac5d;
  --gold: #d6ad45;
  --danger: #d75f45;
  --water: #5da6b9;
}

/* Supplied full-bleed title artwork. The original procedural title remains as a no-image fallback. */
.ui-overlay:has(.title-screen) {
  padding: 0;
  background: #07110c;
}

.title-screen {
  border: 0;
  outline: 0;
  background: #07110c;
  box-shadow: none;
}

.title-art {
  background: #07110c url("assets/title/pickle-and-thisle-title-v3-neutral.png") center center / 100% 100% no-repeat;
}

.title-art > * {
  display: none;
}

.title-copy {
  position: absolute;
  inset: 0;
  display: block;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: linear-gradient(90deg, rgba(4, 10, 7, 0.2), transparent 28%);
  pointer-events: none;
}

.title-kicker,
.title-copy h1,
.title-subtitle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.title-save-line {
  display: none;
  position: absolute;
  left: 5.2%;
  bottom: 34%;
  max-width: min(250px, 24vw);
  margin: 0;
  padding: 5px 8px;
  border: 1px solid rgba(218, 178, 102, 0.72);
  background: rgba(24, 16, 9, 0.84);
  color: #f8e7b6;
  font-size: clamp(10px, 0.9vw, 13px);
  text-align: center;
  box-shadow: 0 3px 0 rgba(8, 5, 3, 0.7);
}

.title-menu-list {
  position: absolute;
  left: 4.8%;
  bottom: 11.5%;
  display: grid;
  gap: 5px;
  width: min(230px, 21vw);
  margin: 0;
  pointer-events: auto;
}

.title-menu-item {
  min-height: 36px;
  padding: 7px 12px;
  border: 2px solid #8d6435;
  background: linear-gradient(180deg, rgba(91, 57, 27, 0.98), rgba(55, 32, 16, 0.98));
  color: #fff1c5;
  font-size: clamp(12px, 1.15vw, 17px);
  text-align: center;
  text-shadow: 0 2px 0 #24150b;
  box-shadow:
    inset 0 0 0 1px rgba(235, 194, 113, 0.2),
    0 4px 0 rgba(18, 11, 6, 0.78);
}

.title-menu-item:hover,
.title-menu-item.selected {
  border-color: #e7c269;
  background: linear-gradient(180deg, rgba(106, 86, 40, 0.98), rgba(58, 55, 24, 0.98));
  color: #ffffff;
}

.title-menu-item.selected::before {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  background: #a8d34f;
}

/* Title submenus keep the player on the supplied home artwork until a trail starts. */
.ui-overlay[data-ui-origin="title"] {
  background:
    linear-gradient(rgba(3, 8, 5, 0.34), rgba(3, 8, 5, 0.52)),
    url("assets/title/pickle-and-thisle-title-v3-neutral.png") center center / 100% 100% no-repeat,
    #07110c;
}

.ui-overlay[data-ui-origin="title"] .ui-panel {
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.72),
    inset 0 0 0 1px rgba(231, 194, 105, 0.12);
}

@media (max-width: 700px) {
  .ui-overlay[data-ui-origin="title"] {
    background-position: center, center top, center;
  }
}

/* Woodland Codex book */
.ui-panel-codex {
  width: min(1180px, calc(100% - 16px));
  max-height: min(94%, 760px);
  border-color: #705731;
  background: #17221d;
}

.ui-panel-codex .ui-panel-header {
  border-bottom-color: #8f7140;
  background: linear-gradient(90deg, #1d3228, #273c31 50%, #1d3228);
}

.ui-panel-codex .ui-panel-body {
  padding: 12px;
  background-color: #101916;
  background-image:
    linear-gradient(rgba(217, 193, 125, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 193, 125, 0.025) 1px, transparent 1px);
  background-size: 16px 16px;
}

.ui-codex-book {
  --codex-ink: #426b5a;
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #28271f;
}

.ui-codex-ribbon {
  display: grid;
  grid-template-columns: minmax(132px, 0.7fr) minmax(0, 2fr) minmax(118px, 0.7fr);
  align-items: center;
  min-height: 42px;
  border: 1px solid #8f7140;
  background: #243a2f;
  color: #d9d2b2;
}

.ui-codex-ribbon button,
.ui-codex-page-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-right: 1px solid rgba(217, 193, 125, 0.38);
  border-radius: 0;
  background: transparent;
  color: #f0dfab;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ui-codex-ribbon button:hover,
.ui-codex-ribbon button:focus-visible,
.ui-codex-page-controls button:hover,
.ui-codex-page-controls button:focus-visible {
  outline: 2px solid #d6ad45;
  outline-offset: -3px;
  background: rgba(214, 173, 69, 0.14);
  color: #fff1bf;
}

.ui-codex-ribbon > div {
  min-width: 0;
  padding: 5px 14px;
  text-align: center;
}

.ui-codex-ribbon > div span {
  display: block;
  color: #b8af8d;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.ui-codex-ribbon > div strong {
  display: block;
  overflow: hidden;
  color: #f0dfab;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-codex-ribbon > em {
  padding: 5px 12px;
  color: #d6bd76;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.ui-codex-ribbon > .ui-codex-ribbon-turns {
  display: grid;
  grid-template-columns: 34px minmax(48px, 1fr) 34px;
  align-items: stretch;
  align-self: stretch;
  padding: 0;
  border-left: 1px solid rgba(217, 193, 125, 0.38);
}

.ui-codex-ribbon-turns button {
  min-height: 40px;
  padding: 0;
  border-right: 1px solid rgba(217, 193, 125, 0.28);
}

.ui-codex-ribbon-turns button:last-child {
  border-right: 0;
  border-left: 1px solid rgba(217, 193, 125, 0.28);
}

.ui-codex-ribbon-turns button:disabled {
  opacity: 0.3;
  cursor: default;
}

.ui-codex-ribbon-turns button:disabled:hover {
  outline: 0;
  background: transparent;
}

.ui-codex-ribbon-turns em {
  align-self: center;
  color: #d6bd76;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.ui-codex-ribbon-turns em span {
  display: inline;
  color: inherit;
  font-size: inherit;
  text-transform: none;
}

.ui-book-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
}

.contents-icon {
  border: 1px solid currentColor;
  box-shadow: inset 5px 0 0 transparent;
}

.contents-icon::after {
  position: absolute;
  left: 5px;
  top: 0;
  width: 1px;
  height: 100%;
  background: currentColor;
  content: "";
}

.previous-icon::before,
.next-icon::before {
  position: absolute;
  top: 2px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: "";
}

.previous-icon::before {
  left: 3px;
  transform: rotate(-45deg);
}

.next-icon::before {
  right: 3px;
  transform: rotate(135deg);
}

.ui-codex-spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  min-width: 0;
  min-height: 526px;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.35));
}

.ui-codex-page {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 526px;
  padding: 22px 26px 20px;
  overflow: hidden;
  border: 1px solid #b0a77f;
  background-color: #d9d4ba;
  background-image:
    linear-gradient(rgba(77, 71, 49, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.22), transparent 32%),
    radial-gradient(circle at 82% 74%, rgba(82, 74, 50, 0.08), transparent 36%);
  background-size: 100% 24px, 100% 100%, 100% 100%;
}

.ui-codex-page-left {
  border-right: 0;
  box-shadow: inset -15px 0 20px rgba(71, 57, 33, 0.13);
}

.ui-codex-page-right {
  border-left: 0;
  box-shadow: inset 15px 0 20px rgba(71, 57, 33, 0.13);
}

.ui-codex-spine {
  z-index: 2;
  background: linear-gradient(90deg, #6c5330, #251d13 45%, #251d13 55%, #755b34);
  box-shadow: inset 0 0 4px #bc9650;
}

.ui-codex-page::before {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(82, 73, 45, 0.23);
  pointer-events: none;
  content: "";
}

.ui-codex-page > footer {
  position: absolute;
  right: 24px;
  bottom: 8px;
  color: #6c634b;
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}

.ui-codex-page-left > footer {
  right: auto;
  left: 24px;
}

.ui-codex-chapter-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--codex-ink);
}

.ui-codex-chapter-head > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--codex-ink);
  color: var(--codex-ink);
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 900;
}

.ui-codex-chapter-head small {
  display: block;
  color: #6d6650;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.ui-codex-chapter-head h2 {
  margin: 2px 0 0;
  color: #292820;
  font-family: Georgia, serif;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1;
}

.ui-codex-chapter-intro {
  position: relative;
  z-index: 1;
  margin: 8px 0 7px;
  color: #514d3e;
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
  line-height: 1.3;
}

.ui-codex-discoveries {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: 0;
}

.ui-codex-discovery {
  display: grid;
  grid-template-columns: minmax(126px, 38%) minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
  padding: 11px 0;
  border-bottom: 1px solid rgba(79, 73, 52, 0.34);
}

.ui-codex-discovery:last-child {
  border-bottom: 0;
}

.ui-codex-discovery figure {
  align-self: start;
  min-width: 0;
  margin: 0;
  border: 4px solid #eee8ce;
  outline: 1px solid #726a50;
  background: #27342f;
  box-shadow: 2px 3px 0 rgba(68, 58, 37, 0.18);
  transform: rotate(-0.5deg);
}

.ui-codex-discovery:nth-child(even) figure {
  transform: rotate(0.6deg);
}

.ui-codex-discovery figure img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  image-rendering: pixelated;
}

.ui-codex-discovery figcaption {
  padding: 3px 5px 2px;
  background: #eee8ce;
  color: #5c5847;
  font-size: 7px;
  font-weight: 900;
  text-align: center;
}

.ui-codex-discovery.locked figure {
  filter: grayscale(0.75) brightness(0.7);
}

.ui-codex-discovery-copy {
  min-width: 0;
}

.ui-codex-discovery-copy > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.ui-codex-discovery-copy > header span,
.ui-codex-discovery-copy > header em {
  color: #716952;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.ui-codex-discovery-copy > header em {
  color: var(--codex-ink);
  text-align: right;
}

.ui-codex-discovery-copy h3 {
  margin: 3px 0 4px;
  overflow-wrap: anywhere;
  color: #24251f;
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1.05;
}

.ui-codex-discovery-copy > p {
  margin: 0 0 5px;
  color: #514e40;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.25;
}

.ui-codex-discovery-copy blockquote {
  margin: 0;
  padding-left: 8px;
  border-left: 2px solid var(--codex-ink);
  color: #38372f;
  font-family: Georgia, serif;
  font-size: 9px;
  font-style: italic;
  line-height: 1.28;
}

.ui-codex-discovery.locked h3,
.ui-codex-discovery.locked blockquote {
  color: #656153;
}

.ui-codex-blank-page {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 190px;
  color: #716b57;
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
  text-align: center;
}

.ui-codex-blank-page span {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(91, 82, 54, 0.42);
  transform: rotate(45deg);
}

.ui-codex-page-controls {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr);
  align-items: center;
  min-height: 38px;
  border: 1px solid #8f7140;
  background: #22372d;
  color: #d5c99e;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.ui-codex-page-controls button:last-child {
  border-right: 0;
  border-left: 1px solid rgba(217, 193, 125, 0.38);
}

.ui-codex-page-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

.ui-codex-page-controls button:disabled:hover {
  outline: 0;
  background: transparent;
}

.ui-codex-cover-page {
  align-items: center;
  justify-content: center;
  padding-right: 48px;
  padding-left: 48px;
  text-align: center;
}

.ui-codex-cover-page .ui-codex-kicker {
  margin: 0 0 8px;
  color: #69705b;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.ui-codex-cover-page h2 {
  margin: 0;
  color: #254333;
  font-family: Georgia, serif;
  font-size: clamp(29px, 3vw, 42px);
  line-height: 0.96;
}

.ui-codex-crest {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 18px auto 13px;
  border: 3px double #6f5e35;
  border-radius: 50%;
}

.ui-codex-crest span {
  position: absolute;
  left: 17px;
  top: 19px;
  width: 36px;
  height: 28px;
  border-radius: 50% 50% 45% 45%;
  background: #385b43;
  transform: rotate(-8deg);
}

.ui-codex-crest span::before {
  position: absolute;
  right: -7px;
  top: 7px;
  width: 12px;
  height: 11px;
  border-radius: 50%;
  background: #385b43;
  content: "";
}

.ui-codex-crest i {
  position: absolute;
  left: 18px;
  top: 10px;
  width: 5px;
  height: 18px;
  background: #6f5e35;
  box-shadow: 9px -4px 0 #6f5e35, 18px 0 0 #6f5e35, 27px 5px 0 #6f5e35;
  transform: rotate(-15deg);
}

.ui-codex-dedication {
  max-width: 360px;
  margin: 0;
  color: #4c4c3d;
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
  line-height: 1.35;
}

.ui-codex-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  margin-top: 18px;
  border-top: 1px solid #8b7c51;
  border-bottom: 1px solid #8b7c51;
}

.ui-codex-totals div {
  padding: 8px 4px;
  border-right: 1px solid rgba(107, 94, 57, 0.42);
}

.ui-codex-totals div:last-child {
  border-right: 0;
}

.ui-codex-totals span,
.ui-codex-totals strong {
  display: block;
}

.ui-codex-totals span {
  color: #6f6955;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.ui-codex-totals strong {
  margin-top: 2px;
  color: #385b43;
  font-family: Georgia, serif;
  font-size: 18px;
}

.ui-codex-hand {
  max-width: 380px;
  margin: 14px 0 0;
  color: #5f604d;
  font-family: Georgia, serif;
  font-size: 10px;
  font-style: italic;
}

.ui-codex-contents-page > header {
  position: relative;
  z-index: 1;
  padding-bottom: 9px;
  border-bottom: 2px solid #426b5a;
}

.ui-codex-contents-page > header span {
  color: #68705c;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.ui-codex-contents-page > header h2 {
  margin: 1px 0 2px;
  color: #283c31;
  font-family: Georgia, serif;
  font-size: 26px;
}

.ui-codex-contents-page > header p {
  margin: 0;
  color: #5d5b4b;
  font-family: Georgia, serif;
  font-size: 10px;
  font-style: italic;
}

.ui-codex-contents-list {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1 1 auto;
  align-content: stretch;
  margin: 9px 0 12px;
}

.ui-codex-contents-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 44px;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 3px 7px;
  border: 0;
  border-bottom: 1px dotted #8e8568;
  border-radius: 0;
  background: transparent;
  color: #33372d;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ui-codex-contents-row:hover,
.ui-codex-contents-row:focus-visible,
.ui-codex-contents-row.selected {
  outline: 2px solid var(--codex-ink, #426b5a);
  outline-offset: -2px;
  background: rgba(66, 107, 90, 0.12);
}

.ui-codex-contents-row > span {
  color: #7a6440;
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 900;
}

.ui-codex-contents-row > strong {
  min-width: 0;
  overflow: hidden;
  color: #34372d;
  font-family: Georgia, serif;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-codex-contents-row > em {
  color: #5d684f;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.contents-controls {
  grid-template-columns: 1fr 1fr;
  padding: 0 14px;
}

.contents-controls strong {
  color: #f0dfab;
  text-align: right;
}

@media (max-width: 760px) {
  .ui-panel-codex {
    max-height: calc(100% - 8px);
  }

  .ui-panel-codex .ui-panel-body {
    padding: 7px;
  }

  .ui-codex-ribbon {
    grid-template-columns: 96px minmax(0, 1fr) 76px;
  }

  .ui-codex-ribbon > em {
    display: none;
  }

  .ui-codex-ribbon > .ui-codex-ribbon-turns {
    grid-template-columns: 37px 0 37px;
  }

  .ui-codex-ribbon-turns em {
    overflow: hidden;
  }

  .ui-codex-spread {
    display: block;
    min-height: 0;
  }

  .ui-codex-spine {
    display: none;
  }

  .ui-codex-page {
    min-height: 500px;
    padding: 20px 18px;
    border: 1px solid #b0a77f;
    box-shadow: none;
  }

  .ui-codex-page-right {
    margin-top: 8px;
  }

  .ui-codex-cover-page {
    padding-right: 28px;
    padding-left: 28px;
  }

  .ui-codex-discovery {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .ui-codex-ribbon > div strong {
    font-size: 11px;
  }

  .ui-codex-discovery {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 9px;
  }

  .ui-codex-discovery-copy h3 {
    font-size: 13px;
  }

  .ui-codex-discovery-copy blockquote,
  .ui-codex-discovery-copy > p {
    font-size: 8px;
  }

  .ui-codex-page-controls {
    grid-template-columns: 92px minmax(0, 1fr) 92px;
  }
}

@media (max-width: 700px) {
  .title-screen {
    overflow: hidden;
  }

  .title-art {
    background-position: center top;
  }

  .title-copy {
    width: auto;
    min-height: 0;
    padding: 0;
    background: linear-gradient(90deg, rgba(4, 10, 7, 0.5), transparent 58%);
  }

  .title-save-line {
    left: 4%;
    bottom: 35%;
    max-width: 44%;
  }

  .title-menu-list {
    left: 4%;
    bottom: 7%;
    width: min(220px, 44%);
    margin: 0;
  }

  .title-menu-item {
    min-height: 32px;
    padding: 5px 8px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, #182423 0%, #0f1517 58%, #1e1715 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

.game-page {
  width: min(100vw, 1100px);
  padding: clamp(12px, 2vw, 28px);
}

.game-shell {
  position: relative;
  width: 100%;
  margin: 0 auto;
  border: 4px solid #2d2419;
  outline: 1px solid #7a6136;
  background: #151d1b;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  aspect-ratio: 16 / 9;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hud {
  position: absolute;
  inset: 10px 10px auto 10px;
  z-index: 5;
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}

.hud-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: clamp(13px, 1.6vw, 19px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.room-name {
  margin-top: 3px;
  color: var(--muted);
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 700;
}

.health {
  display: flex;
  gap: 4px;
  min-height: 15px;
}

.heart {
  width: clamp(12px, 1.8vw, 18px);
  height: clamp(12px, 1.8vw, 18px);
  border: 2px solid #371713;
  background: #3e2b20;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}

.heart.full {
  background: var(--danger);
}

.heart.half {
  background: linear-gradient(90deg, var(--danger) 0 50%, #3e2b20 50% 100%);
}

.meter-wrap {
  width: min(210px, 46vw);
  height: 8px;
  margin-top: 8px;
  border: 2px solid #2a1c14;
  background: #51351e;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}

.meter-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #7bc55d, #d7c05a);
}

.ammo {
  width: fit-content;
  margin-top: 5px;
  padding: 3px 7px;
  border: 2px solid rgba(93, 74, 43, 0.72);
  background: rgba(20, 27, 23, 0.62);
  color: #ffe3a3;
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 900;
  line-height: 1;
}

.quest {
  display: none;
  max-width: min(500px, 72vw);
  margin-top: 8px;
  padding: 6px 8px;
  border: 2px solid rgba(93, 74, 43, 0.8);
  background: rgba(20, 27, 23, 0.62);
  color: #f4e7b3;
  font-size: clamp(10px, 1.05vw, 13px);
  font-weight: 700;
  line-height: 1.25;
}

.ui-quest-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 8px;
  margin-bottom: 12px;
}

.ui-quest-summary > div {
  display: grid;
  gap: 5px;
  min-height: 54px;
  padding: 9px 11px;
  border: 2px solid rgba(139, 107, 57, 0.75);
  background: rgba(18, 31, 31, 0.9);
}

.ui-quest-summary span {
  color: #c9c2a1;
  font-size: clamp(11px, 0.95vw, 13px);
  font-weight: 900;
}

.ui-quest-summary strong {
  color: #ffe3a3;
  font-size: clamp(12px, 1.05vw, 15px);
  line-height: 1.25;
}

.ui-quest-section {
  margin-top: 12px;
  border: 2px solid rgba(93, 74, 43, 0.85);
  background: rgba(12, 18, 18, 0.64);
}

.ui-quest-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(93, 74, 43, 0.65);
  background: rgba(24, 38, 35, 0.78);
}

.ui-quest-section h3 {
  margin: 0;
  color: #ffe3a3;
  font-size: clamp(15px, 1.3vw, 18px);
}

.ui-quest-section header span {
  color: #ffd36f;
  font-weight: 900;
}

.ui-quest-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 9px;
  list-style: none;
}

.ui-quest-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  gap: 12px;
  padding: 10px;
  border: 2px solid rgba(78, 95, 82, 0.78);
  background: rgba(24, 38, 35, 0.78);
}

.ui-quest-entry.complete {
  border-color: rgba(110, 172, 93, 0.9);
  background: rgba(44, 70, 48, 0.76);
}

.ui-quest-main {
  display: grid;
  gap: 4px;
}

.ui-quest-main strong {
  color: #f3e8c8;
  font-size: clamp(14px, 1.15vw, 16px);
}

.ui-quest-main span {
  color: #ffd36f;
  font-size: clamp(11px, 0.95vw, 13px);
  font-weight: 900;
}

.ui-quest-main p {
  margin: 0;
  color: #c9d0b5;
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 800;
  line-height: 1.3;
}

.ui-quest-objectives {
  display: grid;
  gap: 5px;
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-quest-objectives li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 7px;
  align-items: start;
  color: #d9d0ad;
  font-size: clamp(11px, 0.95vw, 13px);
  font-weight: 850;
  line-height: 1.25;
}

.ui-quest-objectives li.done {
  color: #bfe0a4;
}

.ui-quest-entry > em {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 3px 7px;
  border: 1px solid rgba(216, 173, 69, 0.62);
  color: #ffd36f;
  font-size: clamp(11px, 0.95vw, 13px);
  font-style: normal;
  font-weight: 900;
}

.ui-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vw, 22px);
  background: rgba(5, 9, 10, 0.7);
  pointer-events: auto;
}

.ui-overlay[hidden] {
  display: none !important;
}

.title-screen {
  position: relative;
  align-self: stretch;
  justify-self: stretch;
  min-height: 0;
  overflow: hidden;
  border: 3px solid #2d2419;
  outline: 1px solid #8b6b39;
  background: #102421;
  box-shadow: inset 0 0 0 2px rgba(216, 173, 69, 0.16);
  image-rendering: pixelated;
}

.title-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, #243a42 0%, #314d4a 46%, #2d4b36 47%, #183525 100%);
}

.title-sky {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(244, 231, 179, 0.12) 8% 10%, transparent 10% 30%, rgba(148, 214, 255, 0.13) 30% 32%, transparent 32% 100%),
    linear-gradient(180deg, rgba(255, 240, 168, 0.11), transparent 44%);
}

.title-moon {
  position: absolute;
  left: 9%;
  top: 12%;
  width: clamp(28px, 7vw, 72px);
  aspect-ratio: 1;
  background: #f4e7b3;
  box-shadow:
    8px 0 0 rgba(244, 231, 179, 0.28),
    0 8px 0 rgba(244, 231, 179, 0.18);
}

.title-tree,
.title-tree::before,
.title-tree::after {
  position: absolute;
  display: block;
  content: "";
  background: #17331f;
}

.title-tree {
  bottom: 15%;
  width: 26px;
  height: 170px;
  background: #342516;
}

.title-tree::before {
  left: -46px;
  top: -80px;
  width: 118px;
  height: 96px;
  background: #1f4a2a;
  box-shadow:
    28px -24px 0 #255832,
    62px 10px 0 #183c24;
}

.title-tree::after {
  left: -18px;
  top: 44px;
  width: 70px;
  height: 18px;
  background: #5d3f29;
  box-shadow: 38px 28px 0 #5d3f29;
}

.title-tree-left {
  left: 6%;
}

.title-tree-right {
  right: 17%;
  bottom: 12%;
  transform: scale(1.2);
}

.title-village-shadow {
  position: absolute;
  left: 5%;
  right: 4%;
  bottom: 12%;
  height: 18%;
  background:
    linear-gradient(90deg, transparent 0 4%, #2f2118 4% 12%, transparent 12% 18%, #3f2a1b 18% 31%, transparent 31% 38%, #2f2118 38% 48%, transparent 48% 57%, #49301f 57% 66%, transparent 66% 72%, #2f2118 72% 82%, transparent 82%),
    linear-gradient(180deg, transparent 0 42%, #14281d 42% 100%);
}

.title-village-shadow::before {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48%;
  height: 34px;
  content: "";
  background:
    linear-gradient(135deg, transparent 0 46%, #8c3431 46% 55%, transparent 55%) 6% 0 / 110px 34px no-repeat,
    linear-gradient(135deg, transparent 0 46%, #b75a38 46% 55%, transparent 55%) 27% 0 / 130px 34px no-repeat,
    linear-gradient(135deg, transparent 0 46%, #8c3431 46% 55%, transparent 55%) 56% 0 / 120px 34px no-repeat,
    linear-gradient(135deg, transparent 0 46%, #b75a38 46% 55%, transparent 55%) 78% 0 / 100px 34px no-repeat;
}

.title-hedgehog {
  position: absolute;
  left: clamp(72px, 18vw, 210px);
  bottom: clamp(42px, 11vw, 120px);
  width: clamp(92px, 18vw, 180px);
  aspect-ratio: 1.05;
  transform: translateZ(0);
}

.title-hedgehog span,
.title-sword,
.title-leaves {
  position: absolute;
  display: block;
}

.title-hedgehog .spines {
  left: 5%;
  top: 5%;
  width: 72%;
  height: 72%;
  background: #3f2c22;
  box-shadow:
    -8px 14px 0 #2c211a,
    10px -10px 0 #6a4a35,
    36px -4px 0 #6a4a35,
    58px 12px 0 #2c211a,
    18px 52px 0 #6a4a35;
}

.title-hedgehog .face {
  right: 0;
  top: 38%;
  width: 52%;
  height: 40%;
  background: #d7b87e;
  box-shadow: 18px 10px 0 #d7b87e;
}

.title-hedgehog .eye {
  right: 20%;
  top: 48%;
  width: 8%;
  height: 8%;
  background: #171612;
}

.title-hedgehog .nose {
  right: -12%;
  top: 60%;
  width: 15%;
  height: 10%;
  background: #171612;
}

.title-hedgehog .paw {
  bottom: 2%;
  width: 13%;
  height: 18%;
  background: #c89f68;
}

.title-hedgehog .paw-a {
  left: 28%;
}

.title-hedgehog .paw-b {
  left: 56%;
}

.title-sword {
  left: clamp(164px, 36vw, 420px);
  bottom: clamp(52px, 13vw, 136px);
  width: clamp(78px, 15vw, 150px);
  height: 12px;
  background: #f2f0d8;
  box-shadow:
    -12px 4px 0 #d6ad45,
    74px 2px 0 #8bb1c8;
  transform: rotate(-18deg);
}

.title-leaves {
  left: 0;
  right: 0;
  bottom: 0;
  height: 16%;
  background:
    linear-gradient(90deg, #6eac5d 0 12px, transparent 12px 26px) 0 0 / 52px 18px,
    linear-gradient(90deg, transparent 0 18px, #d6ad45 18px 26px, transparent 26px 52px) 0 18px / 58px 22px,
    linear-gradient(180deg, transparent, rgba(6, 13, 10, 0.52));
}

.title-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(430px, 48%);
  min-height: 100%;
  margin-left: auto;
  padding: clamp(22px, 5vw, 58px);
  color: #fff3b8;
  text-shadow: 0 2px 0 #17110b;
}

.title-kicker,
.title-subtitle,
.title-save-line {
  margin: 0;
  font-weight: 900;
  line-height: 1.2;
}

.title-kicker {
  color: #94d6ff;
  font-size: clamp(12px, 1.2vw, 15px);
}

.title-copy h1 {
  margin: 8px 0 4px;
  color: #ffe3a3;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.title-subtitle {
  color: #f4e7b3;
  font-size: clamp(14px, 1.8vw, 22px);
}

.title-save-line {
  margin-top: 14px;
  color: #d9d0ad;
  font-size: clamp(12px, 1.1vw, 15px);
}

.title-menu-list {
  display: grid;
  gap: 9px;
  width: min(300px, 100%);
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.title-menu-item {
  min-height: 42px;
  padding: 9px 12px;
  border: 2px solid rgba(216, 173, 69, 0.72);
  background: rgba(16, 28, 25, 0.82);
  color: #ffe3a3;
  font-size: clamp(14px, 1.25vw, 17px);
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
}

.title-menu-item:hover,
.title-menu-item.selected {
  border-color: #fff09a;
  background: rgba(88, 111, 55, 0.94);
  color: #fff8c9;
}

.title-menu-item.selected::before {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 9px;
  content: "";
  background: #d6ad45;
  box-shadow: 0 0 0 2px rgba(20, 16, 9, 0.65);
  vertical-align: 1px;
}

.ui-panel {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100% - 16px));
  max-height: min(78%, 520px);
  overflow: hidden;
  border: 3px solid var(--panel-edge);
  background: rgba(18, 29, 29, 0.96);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
}

.ui-panel-map {
  width: min(1040px, calc(100% - 16px));
  max-height: min(86%, 640px);
}

.ui-panel-codex {
  width: min(980px, calc(100% - 16px));
  max-height: min(86%, 640px);
}

.ui-panel-inventory,
.ui-panel-character {
  width: min(980px, calc(100% - 16px));
  max-height: min(88%, 680px);
}

.ui-panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px 10px;
  border-bottom: 2px solid rgba(139, 107, 57, 0.8);
}

.ui-panel-title {
  color: #ffe3a3;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.ui-panel-subtitle {
  color: var(--muted);
  font-size: clamp(12px, 1.1vw, 14px);
  font-weight: 800;
}

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

.ui-close {
  min-height: 32px;
  padding: 5px 10px;
  border: 2px solid rgba(139, 107, 57, 0.9);
  background: rgba(24, 38, 35, 0.95);
  color: #ffe3a3;
  font: 900 13px "Trebuchet MS", Verdana, sans-serif;
  cursor: pointer;
}

.ui-close:hover {
  border-color: var(--gold);
  background: rgba(76, 99, 62, 0.95);
}

.ui-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 16px;
  scrollbar-color: var(--gold) rgba(12, 18, 18, 0.6);
  scrollbar-width: thin;
}

.ui-panel-body::-webkit-scrollbar {
  width: 10px;
}

.ui-panel-body::-webkit-scrollbar-track {
  background: rgba(12, 18, 18, 0.68);
}

.ui-panel-body::-webkit-scrollbar-thumb {
  border: 2px solid rgba(12, 18, 18, 0.68);
  background: var(--gold);
}

.ui-menu-list,
.ui-status-list,
.ui-map-list,
.ui-controls-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.ui-load-list {
  grid-template-columns: 1fr;
}

.ui-dev-category > span:first-child {
  display: grid;
  gap: 4px;
}

.ui-dev-category small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.ui-dev-category:hover small,
.ui-dev-category.selected small {
  color: #d9e2bf;
}

.ui-dev-count {
  display: grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  border: 2px solid rgba(214, 173, 69, 0.55);
  color: #ffe3a3;
  font-size: 13px;
  font-weight: 900;
}

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

.ui-menu-item,
.ui-status-item,
.ui-map-item,
.ui-control-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 11px;
  border: 2px solid rgba(78, 95, 82, 0.85);
  background: rgba(24, 38, 35, 0.9);
  color: var(--ink);
  font-size: clamp(13px, 1.15vw, 16px);
  font-weight: 850;
  line-height: 1.15;
}

.ui-menu-item,
.ui-control-item,
.map-region {
  cursor: pointer;
}

.ui-shop-wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 2px solid rgba(214, 173, 69, 0.72);
  background: rgba(49, 54, 34, 0.92);
  color: #d7d0ad;
  font-weight: 800;
}

.ui-shop-wallet strong {
  color: #ffd36f;
  white-space: nowrap;
}

.ui-shop-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-shop-item {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 9px 11px;
  border: 2px solid rgba(78, 95, 82, 0.85);
  background: rgba(24, 38, 35, 0.92);
  color: var(--ink);
  cursor: pointer;
}

.ui-shop-item > div {
  display: grid;
  gap: 3px;
}

.ui-shop-item span,
.ui-shop-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.ui-shop-item em {
  color: #ffd36f;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.ui-shop-item:hover,
.ui-shop-item.selected {
  border-color: var(--gold);
  background: rgba(76, 99, 62, 0.92);
}

.ui-shop-item.sold-out {
  opacity: 0.62;
}

.ui-shop-item.compact {
  min-height: 52px;
}

.ui-control-item {
  min-height: 34px;
}

.ui-menu-item:hover,
.ui-control-item:hover,
.ui-menu-item.selected,
.ui-control-item.selected {
  border-color: var(--gold);
  background: rgba(76, 99, 62, 0.92);
  color: #fff3b8;
}

.ui-menu-item.selected::before,
.ui-control-item.selected::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--gold);
  box-shadow: 0 0 0 2px rgba(20, 16, 9, 0.65);
}

.ui-menu-item span:first-child,
.ui-control-item span:first-child {
  flex: 1;
}

.ui-map-list,
.ui-status-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ui-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.ui-stat-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 11px;
  border: 2px solid rgba(139, 107, 57, 0.7);
  background: rgba(18, 31, 31, 0.9);
  color: var(--ink);
  font-size: clamp(12px, 1.05vw, 14px);
  font-weight: 850;
}

.ui-stat-grid span {
  color: #c9c2a1;
}

.ui-stat-grid strong {
  color: #ffd36f;
  white-space: nowrap;
}

.ui-equipment-tabs {
  display: flex;
  gap: 0;
  margin: -2px 0 12px;
  border-bottom: 2px solid rgba(139, 107, 57, 0.78);
}

.ui-equipment-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-right: 2px solid rgba(78, 95, 82, 0.85);
  background: rgba(13, 24, 23, 0.72);
  color: #aeb49e;
  font: 900 14px "Trebuchet MS", Verdana, sans-serif;
  cursor: pointer;
}

.ui-equipment-tabs button:hover,
.ui-equipment-tabs button.active {
  background: rgba(76, 99, 62, 0.9);
  color: #fff3b8;
}

.ui-equipment-tabs button.active {
  box-shadow: inset 0 -3px 0 #d6ad45;
}

.ui-tab-mark {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.pouch-mark {
  border: 2px solid #d6ad45;
  border-top-width: 4px;
  background: #6b4930;
}

.pouch-mark::before {
  position: absolute;
  left: 3px;
  top: -7px;
  width: 6px;
  height: 4px;
  border: 2px solid #d6ad45;
  border-bottom: 0;
  content: "";
}

.character-mark {
  border: 2px solid #d6ad45;
  border-radius: 50%;
  background: #48734d;
}

.character-mark::after {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -5px;
  height: 6px;
  border: 2px solid #d6ad45;
  background: #35583e;
  content: "";
}

.ui-pouch-strip {
  display: grid;
  grid-template-columns: 0.7fr 0.8fr 1.5fr;
  gap: 1px;
  margin-bottom: 12px;
  border: 2px solid rgba(139, 107, 57, 0.72);
  background: rgba(139, 107, 57, 0.42);
}

.ui-pouch-strip > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 7px 11px;
  background: rgba(18, 31, 31, 0.96);
}

.ui-pouch-strip span {
  color: #bfc5a9;
  font-size: 12px;
  font-weight: 800;
}

.ui-pouch-strip strong {
  min-width: 0;
  color: #ffd36f;
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: right;
}

.ui-inventory-layout {
  display: grid;
  grid-template-columns: minmax(480px, 1.5fr) minmax(230px, 0.72fr);
  gap: 12px;
  align-items: stretch;
}

.ui-item-board {
  min-width: 0;
  border: 2px solid rgba(93, 74, 43, 0.85);
  background: rgba(9, 17, 17, 0.62);
}

.ui-item-board > header,
.ui-character-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 7px 10px;
  border-bottom: 2px solid rgba(93, 74, 43, 0.72);
  background: rgba(24, 38, 35, 0.78);
}

.ui-item-board h3,
.ui-character-section h3 {
  margin: 0;
  color: #ffe3a3;
  font-size: 15px;
  line-height: 1;
}

.ui-item-board header span,
.ui-character-section header > span {
  color: #d6ad45;
  font-size: 12px;
  font-weight: 900;
}

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

.ui-item-slot {
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 92px;
  padding: 7px 5px 5px;
  overflow: hidden;
  border: 2px solid rgba(73, 91, 78, 0.88);
  border-radius: 2px;
  background: linear-gradient(145deg, rgba(35, 52, 45, 0.96), rgba(17, 29, 28, 0.96));
  color: #f1e5c5;
  font: 800 11px "Trebuchet MS", Verdana, sans-serif;
  cursor: pointer;
}

.ui-item-slot:hover,
.ui-item-slot.selected {
  border-color: #e5bd58;
  background: linear-gradient(145deg, rgba(78, 103, 61, 0.98), rgba(42, 63, 48, 0.98));
  box-shadow: inset 0 0 0 2px rgba(255, 240, 154, 0.14);
}

.ui-item-slot.active {
  border-color: #94d6ff;
}

.ui-item-slot.empty {
  min-height: 92px;
  border-style: dashed;
  border-color: rgba(73, 91, 78, 0.34);
  background: rgba(11, 20, 19, 0.46);
}

.ui-item-glyph {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 3px solid rgba(10, 16, 14, 0.72);
  background: var(--item-color, #d6ad45);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.13), 3px 3px 0 rgba(0, 0, 0, 0.22);
  transform: rotate(45deg) scale(0.78);
}

.ui-item-glyph i {
  color: #14201b;
  font: 900 12px "Trebuchet MS", Verdana, sans-serif;
  font-style: normal;
  transform: rotate(-45deg) scale(1.28);
}

.ui-item-glyph.glyph-food {
  border-radius: 50%;
  transform: rotate(0) scale(0.82);
}

.ui-item-glyph.glyph-food i {
  transform: scale(1.22);
}

.ui-item-glyph.glyph-food::before {
  position: absolute;
  right: -2px;
  top: -7px;
  width: 13px;
  height: 8px;
  border: 2px solid #132419;
  border-radius: 8px 1px 8px 1px;
  background: #7fa94e;
  content: "";
  transform: rotate(-24deg);
}

.ui-item-glyph.glyph-ammo {
  width: 34px;
  height: 34px;
  border-radius: 48% 52% 46% 54%;
}

.ui-item-glyph.glyph-tool,
.ui-item-glyph.glyph-utility {
  border-radius: 4px;
}

.ui-item-name {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: #eee3c3;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-item-count,
.ui-item-state {
  position: absolute;
  right: 4px;
  top: 4px;
  padding: 2px 4px;
  background: rgba(7, 14, 13, 0.84);
  color: #fff09a;
  font-size: 10px;
  font-weight: 900;
}

.ui-item-state {
  left: 4px;
  right: auto;
  color: #bfefff;
}

.ui-item-detail,
.ui-weapon-detail {
  min-width: 0;
  padding: 15px;
  border: 2px solid rgba(139, 107, 57, 0.78);
  background: rgba(21, 33, 31, 0.92);
}

.ui-detail-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin-bottom: 14px;
  border: 2px solid rgba(73, 91, 78, 0.9);
  background: rgba(10, 19, 18, 0.62);
}

.ui-detail-icon .ui-item-glyph {
  transform: rotate(45deg) scale(0.9);
}

.ui-detail-icon .ui-item-glyph.glyph-food {
  transform: scale(0.95);
}

.ui-detail-kicker {
  display: block;
  margin-bottom: 5px;
  color: #9ecf57;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ui-item-detail h3,
.ui-weapon-detail h4 {
  margin: 0 0 9px;
  color: #ffe3a3;
  font-size: 19px;
  line-height: 1.1;
}

.ui-item-detail p,
.ui-weapon-detail p {
  margin: 0;
  color: #c7c9ad;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.ui-detail-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 2px solid rgba(78, 95, 82, 0.68);
  color: #bfc5a9;
  font-size: 12px;
  font-weight: 850;
}

.ui-detail-state strong {
  color: #ffd36f;
}

.ui-character-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.56fr) minmax(520px, 1.44fr);
  gap: 12px;
  align-items: start;
}

.ui-character-profile {
  padding: 14px;
  border: 2px solid rgba(139, 107, 57, 0.78);
  background: rgba(13, 24, 23, 0.86);
}

.ui-character-portrait {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin-bottom: 12px;
  border: 2px solid rgba(73, 91, 78, 0.85);
  background: radial-gradient(circle at 50% 62%, rgba(119, 146, 76, 0.34), rgba(12, 22, 21, 0.92) 63%);
}

.ui-character-portrait img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  image-rendering: pixelated;
}

.ui-character-name {
  margin-bottom: 14px;
  text-align: center;
}

.ui-character-name span {
  color: #9ecf57;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ui-character-name h3 {
  margin: 3px 0;
  color: #ffe3a3;
  font-size: 22px;
}

.ui-character-name p {
  margin: 0;
  color: #bfc5a9;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.ui-character-meter {
  margin-top: 10px;
}

.ui-character-meter > div,
.ui-profile-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: #bfc5a9;
  font-size: 11px;
  font-weight: 850;
}

.ui-character-meter strong,
.ui-profile-rank strong {
  color: #ffe3a3;
}

.ui-character-meter > i {
  display: block;
  height: 9px;
  padding: 2px;
  border: 1px solid rgba(8, 14, 13, 0.9);
  background: rgba(4, 10, 9, 0.88);
}

.ui-character-meter b {
  display: block;
  height: 100%;
  background: #c75b4a;
}

.ui-character-meter.stamina b {
  background: #78ad54;
}

.ui-profile-rank {
  margin: 15px 0 0;
  padding-top: 10px;
  border-top: 2px solid rgba(78, 95, 82, 0.64);
}

.ui-character-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.ui-character-section {
  min-width: 0;
  border: 2px solid rgba(93, 74, 43, 0.8);
  background: rgba(9, 17, 17, 0.54);
}

.ui-character-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(78, 95, 82, 0.44);
}

.ui-character-stats > div {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 8px 10px;
  background: rgba(17, 30, 29, 0.97);
}

.ui-character-stats span,
.ui-weapon-numbers span,
.ui-ability-row span {
  color: #afb6a0;
  font-size: 11px;
  font-weight: 800;
}

.ui-character-stats strong,
.ui-weapon-numbers strong,
.ui-ability-row strong {
  color: #ffe3a3;
  font-size: 13px;
}

.ui-weapon-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.86fr) minmax(250px, 1.14fr);
  gap: 10px;
  padding: 10px;
}

.ui-weapon-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
}

.ui-weapon-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 58px;
  padding: 7px;
  border: 2px solid rgba(73, 91, 78, 0.86);
  border-radius: 2px;
  background: rgba(22, 37, 34, 0.94);
  color: #eee3c3;
  text-align: left;
  cursor: pointer;
}

.ui-weapon-card:hover,
.ui-weapon-card.selected {
  border-color: #d6ad45;
  background: rgba(73, 94, 57, 0.94);
}

.ui-weapon-card.equipped {
  box-shadow: inset 3px 0 0 #94d6ff;
}

.ui-weapon-card > span:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ui-weapon-card strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-weapon-card small {
  color: #afb6a0;
  font-size: 10px;
  font-weight: 800;
}

.ui-weapon-glyph {
  position: relative;
  display: block;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border: 2px solid rgba(8, 14, 13, 0.8);
  background: #263c35;
}

.ui-weapon-glyph::before {
  position: absolute;
  left: 4px;
  top: 14px;
  width: 23px;
  height: 4px;
  background: #dce6df;
  box-shadow: -3px 0 0 #d6ad45;
  content: "";
  transform: rotate(-38deg);
}

.ui-weapon-glyph.weapon-maul::before {
  height: 5px;
  background: #805c39;
  box-shadow: 14px -5px 0 3px #aa844f;
}

.ui-weapon-glyph.weapon-thrust::before,
.ui-weapon-glyph.weapon-glaive::before {
  width: 27px;
  height: 3px;
  background: #aa7a42;
  box-shadow: 18px -2px 0 2px #dce6df;
}

.ui-weapon-glyph.weapon-daggers::before {
  width: 18px;
  height: 3px;
  box-shadow: 0 8px 0 #dce6df;
  transform: rotate(-35deg);
}

.ui-weapon-detail {
  padding: 12px;
}

.ui-weapon-detail h4 {
  font-size: 16px;
}

.ui-weapon-detail p {
  min-height: 36px;
  font-size: 11px;
}

.ui-weapon-numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 10px;
  background: rgba(78, 95, 82, 0.42);
}

.ui-weapon-numbers > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px;
  background: rgba(14, 26, 25, 0.97);
}

.ui-weapon-numbers strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.ui-ability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(78, 95, 82, 0.4);
}

.ui-ability-row {
  display: grid;
  gap: 3px;
  padding: 7px 9px;
  background: rgba(17, 30, 29, 0.97);
}

.ui-codex-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.ui-codex-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 11px;
  border: 2px solid rgba(139, 107, 57, 0.7);
  background: rgba(18, 31, 31, 0.9);
  color: var(--ink);
  font-size: clamp(12px, 1.05vw, 14px);
  font-weight: 850;
}

.ui-codex-summary span {
  color: #c9c2a1;
}

.ui-codex-summary strong {
  color: #ffd36f;
  white-space: nowrap;
}

.ui-codex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ui-codex-section {
  border: 2px solid rgba(93, 74, 43, 0.85);
  background: rgba(12, 18, 18, 0.64);
}

.ui-codex-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(93, 74, 43, 0.65);
  background: rgba(24, 38, 35, 0.78);
}

.ui-codex-section h3 {
  margin: 0;
  color: #ffe3a3;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.05;
}

.ui-codex-section header span {
  color: #ffd36f;
  font-weight: 900;
  white-space: nowrap;
}

.ui-codex-section ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px;
  list-style: none;
}

.ui-codex-section > .ui-status-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ui-codex-section .ui-status-item {
  align-items: flex-start;
  min-width: 0;
}

.ui-codex-section .ui-status-item > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ui-codex-section .ui-status-state {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
}

.ui-codex-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 8px 10px;
  border: 2px solid rgba(78, 95, 82, 0.72);
  background: rgba(24, 38, 35, 0.76);
}

.ui-codex-entry.ok {
  border-color: rgba(216, 173, 69, 0.86);
  background: rgba(67, 82, 48, 0.82);
}

.ui-codex-entry div {
  display: grid;
  gap: 3px;
}

.ui-codex-entry strong {
  color: #f3e8c8;
  font-size: clamp(13px, 1.1vw, 15px);
  line-height: 1.1;
}

.ui-codex-entry span {
  color: #bfc5a9;
  font-size: clamp(11px, 0.95vw, 13px);
  font-weight: 750;
  line-height: 1.25;
}

.ui-codex-entry em {
  align-self: start;
  color: #ffd36f;
  font-size: clamp(11px, 0.95vw, 13px);
  font-style: normal;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.ui-map-item.current,
.ui-status-item.ok {
  border-color: var(--gold);
  background: rgba(67, 82, 48, 0.95);
}

.ui-map-item.known {
  border-color: rgba(110, 172, 93, 0.95);
}

.ui-map-status,
.ui-status-state,
.ui-binding {
  color: #ffd36f;
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 900;
  white-space: nowrap;
}

.ui-help {
  margin-top: 13px;
  color: #c9c2a1;
  font-size: clamp(12px, 1.05vw, 14px);
  font-weight: 800;
  line-height: 1.35;
}

.ui-death-copy {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 2px solid rgba(167, 68, 48, 0.85);
  background: rgba(54, 18, 18, 0.42);
  color: #ffe3a3;
  font-size: clamp(13px, 1.15vw, 16px);
  font-weight: 850;
  line-height: 1.35;
}

.ui-death-copy p {
  margin: 0;
}

.ui-two-column {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.ui-map-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.45fr) minmax(250px, 0.8fr);
  gap: 14px;
  align-items: stretch;
}

.ui-map-frame {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  border: 2px solid rgba(158, 120, 57, 0.9);
  background: #162521;
  box-shadow: inset 0 0 0 4px rgba(10, 22, 19, 0.72), inset 0 0 40px rgba(3, 10, 8, 0.58);
  cursor: grab;
}

.ui-map-frame.dragging {
  cursor: grabbing;
}

.ui-world-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 380px;
  touch-action: none;
  user-select: none;
}

.map-ground {
  fill: url(#map-parchment);
}

.map-biome-land {
  stroke-width: 5;
  stroke-linejoin: round;
  filter: url(#map-soft-shadow);
}

.map-biome.known.biome-elderwood .map-biome-land { fill: #355d3f; stroke: #6f9657; }
.map-biome.known.biome-hills .map-biome-land { fill: #736c3e; stroke: #b19a59; }
.map-biome.known.biome-marsh .map-biome-land { fill: #345b55; stroke: #61998b; }
.map-biome.known.biome-canopy .map-biome-land { fill: #5d6534; stroke: #b78f3f; }
.map-biome.known.biome-gloomweb .map-biome-land { fill: #3b3853; stroke: #786d9e; }
.map-biome.known.biome-mines .map-biome-land { fill: #514942; stroke: #9b8064; }
.map-biome.known.biome-frost .map-biome-land { fill: #44666b; stroke: #8fb9b6; }
.map-biome.known.biome-citadel .map-biome-land { fill: #4d3437; stroke: #9b5f57; }

.map-biome.unknown .map-biome-land {
  fill: #26332f;
  stroke: rgba(128, 142, 129, 0.28);
  stroke-dasharray: 14 12;
  filter: none;
}

.map-biome-fog {
  fill: none;
  pointer-events: none;
}

.map-biome.unknown .map-biome-fog {
  fill: url(#map-fog-pattern);
  opacity: 0.9;
}

.map-biome-label {
  fill: #e8d89d;
  font: 900 15px "Trebuchet MS", Verdana, sans-serif;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(9, 18, 16, 0.88);
  stroke-width: 6px;
  text-anchor: middle;
  text-transform: uppercase;
}

.map-biome.unknown .map-biome-label {
  display: none;
}

.map-terrain-ink {
  fill: none;
  stroke: rgba(223, 211, 151, 0.18);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.map-tree-cluster circle,
.map-canopy-rings circle {
  fill: rgba(15, 40, 25, 0.28);
  stroke-width: 4;
}

.map-wetlands path:first-child,
.map-frost-lines path:first-child {
  fill: rgba(76, 151, 150, 0.23);
}

.map-contours path,
.map-canopy-rings path,
.map-web-lines path,
.map-web-lines circle,
.map-rails path,
.map-frost-lines path,
.map-citadel-roots path {
  vector-effect: non-scaling-stroke;
}

.map-river-wide,
.map-river {
  fill: none;
  pointer-events: none;
}

.map-river-wide {
  stroke: rgba(8, 20, 20, 0.72);
  stroke-width: 24;
}

.map-river {
  stroke: #4b8985;
  stroke-width: 15;
  opacity: 0.9;
}

.map-link-shadow,
.map-link {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.map-link-shadow {
  stroke: rgba(7, 14, 12, 0.75);
  stroke-width: 12;
}

.map-link.known {
  stroke: #d0a95e;
  stroke-width: 6;
  stroke-dasharray: 2 5;
}

.map-link.unknown {
  stroke: rgba(126, 139, 128, 0.42);
  stroke-width: 5;
  stroke-dasharray: 11 10;
}

.map-region {
  color: #d5c98e;
  cursor: pointer;
  filter: url(#map-soft-shadow);
}

.map-region.biome-elderwood { color: #a7d375; }
.map-region.biome-hills { color: #ddc16f; }
.map-region.biome-marsh { color: #78c1ad; }
.map-region.biome-canopy { color: #efbd55; }
.map-region.biome-gloomweb { color: #c0a4dc; }
.map-region.biome-mines { color: #c6a17c; }
.map-region.biome-frost { color: #b5e6df; }
.map-region.biome-citadel { color: #dd8b78; }

.map-node-hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.map-node-ring {
  fill: rgba(17, 31, 27, 0.94);
  stroke: currentColor;
  stroke-width: 3;
}

.map-region.focused .map-node-ring {
  stroke: #fff0a0;
  stroke-width: 5;
  r: 24px;
}

.map-region.current .map-node-ring {
  fill: #6f5a2f;
  stroke: #fff3b8;
  stroke-width: 5;
}

.map-node-glyph {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-glyph-cut {
  fill: none;
  stroke: #16221f;
  stroke-width: 3;
}

.map-node-frost,
.map-node-unknown {
  fill: none;
  stroke-width: 3;
}

.map-region.unknown {
  color: #839089;
  filter: none;
}

.map-region.unknown .map-node-ring {
  fill: rgba(33, 45, 42, 0.92);
  stroke-dasharray: 5 4;
}

.map-node-label {
  fill: #f4e7b3;
  font: 900 16px "Trebuchet MS", Verdana, sans-serif;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(5, 9, 10, 0.9);
  stroke-width: 6px;
}

.map-region.unknown .map-node-label {
  fill: #a0aaa2;
}

.map-you-marker {
  fill: #fff09a;
  stroke: #16120a;
  stroke-width: 2;
}

.map-compass circle {
  fill: rgba(18, 31, 28, 0.88);
  stroke: #b98c43;
  stroke-width: 3;
}

.map-compass path {
  fill: #e2c56d;
  stroke: #17120a;
  stroke-width: 1.5;
}

.map-compass text {
  fill: #fff0b1;
  font: 900 13px "Trebuchet MS", Verdana, sans-serif;
  text-anchor: middle;
}

.ui-map-legend {
  position: absolute;
  left: 12px;
  bottom: 10px;
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid rgba(187, 144, 67, 0.72);
  background: rgba(10, 20, 18, 0.88);
  color: #ded4ac;
  font-size: 11px;
  font-weight: 850;
  pointer-events: none;
}

.ui-map-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.ui-map-legend i {
  display: inline-block;
  width: 16px;
  height: 8px;
}

.legend-current {
  border: 2px solid #fff09a;
  background: #6f5a2f;
  border-radius: 50%;
}

.legend-trail {
  height: 0 !important;
  border-top: 3px dotted #d0a95e;
}

.legend-mist {
  border: 1px dashed #8d9991;
  background: rgba(126, 139, 128, 0.2);
}

.ui-location-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 380px;
  padding: 12px;
  border: 2px solid rgba(93, 74, 43, 0.85);
  background: rgba(10, 18, 17, 0.84);
}

.ui-location-kicker {
  margin: 0;
  color: #91a67c;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.ui-location-card h3 {
  margin: 0;
  color: #ffe3a3;
  font-size: clamp(18px, 1.65vw, 22px);
  line-height: 1.05;
}

.ui-mini-map {
  min-height: 176px;
  overflow: hidden;
  border: 2px solid rgba(137, 108, 57, 0.9);
  background: #172622;
  box-shadow: inset 0 0 22px rgba(3, 9, 7, 0.65);
}

.ui-mini-map svg {
  display: block;
  width: 100%;
  height: 176px;
}

.mini-ground {
  stroke: rgba(234, 211, 133, 0.38);
  stroke-width: 4;
  stroke-linejoin: round;
}

.biome-elderwood .mini-ground { fill: #385d42; }
.biome-hills .mini-ground { fill: #72693e; }
.biome-marsh .mini-ground { fill: #315a56; }
.biome-canopy .mini-ground { fill: #596333; }
.biome-gloomweb .mini-ground { fill: #3b3852; }
.biome-mines .mini-ground { fill: #4d4741; }
.biome-frost .mini-ground { fill: #43666c; }
.biome-citadel .mini-ground { fill: #4c3538; }

.mini-grain {
  fill-opacity: 0.65;
  stroke: none;
}

.mini-grain circle {
  fill: rgba(243, 224, 156, 0.12);
}

.mini-grain path {
  fill: none;
  stroke: rgba(10, 24, 20, 0.12);
  stroke-width: 1;
}

.mini-path-shadow,
.mini-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-path-shadow {
  stroke: rgba(8, 16, 13, 0.78);
  stroke-width: 10;
}

.mini-path {
  stroke: #d2ad66;
  stroke-width: 5;
  stroke-dasharray: 2 3;
}

.mini-water {
  fill: rgba(60, 137, 142, 0.68);
  stroke: #76b7b0;
  stroke-width: 2;
}

.mini-tree circle,
.mini-canopy circle {
  fill: rgba(26, 73, 42, 0.8);
  stroke: rgba(136, 179, 86, 0.6);
  stroke-width: 2;
}

.mini-tree path,
.mini-canopy path {
  fill: none;
  stroke: rgba(57, 36, 22, 0.72);
  stroke-width: 6;
  stroke-linecap: round;
}

.mini-contours,
.mini-wind {
  fill: none;
  stroke: rgba(239, 220, 151, 0.24);
  stroke-width: 3;
}

.mini-contours ellipse {
  fill: rgba(35, 27, 18, 0.46);
}

.mini-cliff,
.mini-rocks,
.mini-roots {
  fill: none;
  stroke: rgba(26, 21, 18, 0.62);
  stroke-width: 6;
  stroke-linejoin: round;
}

.mini-reeds,
.mini-web,
.mini-mushrooms,
.mini-rails,
.mini-pines,
.mini-walls {
  fill: none;
  stroke: rgba(227, 215, 158, 0.38);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-sap {
  fill: rgba(236, 162, 49, 0.66);
  stroke: #f1c35c;
  stroke-width: 2;
}

.mini-cave {
  fill: rgba(15, 16, 26, 0.5);
  stroke: rgba(168, 142, 197, 0.42);
  stroke-width: 3;
}

.mini-mushrooms path {
  fill: rgba(152, 206, 158, 0.45);
}

.mini-rocks path {
  fill: rgba(39, 34, 31, 0.4);
}

.mini-rails {
  stroke: rgba(198, 154, 102, 0.62);
}

.mini-ice {
  fill: rgba(152, 211, 216, 0.34);
  stroke: rgba(198, 238, 232, 0.68);
  stroke-width: 3;
}

.mini-pines {
  fill: rgba(35, 80, 66, 0.8);
  stroke: rgba(171, 218, 201, 0.46);
}

.mini-walls {
  stroke: rgba(178, 121, 103, 0.48);
  stroke-width: 5;
}

.mini-arena {
  fill: rgba(97, 40, 34, 0.3);
  stroke: #d38a68;
  stroke-width: 4;
  stroke-dasharray: 9 6;
}

.mini-huts,
.mini-ruin {
  fill: rgba(73, 49, 29, 0.9);
  stroke: #d0ad68;
  stroke-width: 3;
  stroke-linejoin: round;
}

.mini-huts path:last-child,
.mini-ruin path:last-child {
  fill: none;
  stroke: #dec785;
  stroke-width: 3;
}

.mini-landmark circle {
  fill: #d3aa4d;
  stroke: #15110a;
  stroke-width: 3;
}

.mini-landmark path {
  fill: none;
  stroke: #20180b;
  stroke-width: 2;
  stroke-linecap: round;
}

.mini-landmark.landmark-nest circle { fill: #9fd56d; }
.mini-landmark.landmark-danger circle { fill: #d76f55; }
.mini-landmark.landmark-mechanism circle { fill: #73c4c1; }
.mini-landmark.landmark-home circle { fill: #d8bd72; }
.mini-landmark.landmark-reward circle { fill: #c79be1; }

.mini-landmark.landmark-danger path {
  stroke: #fff0c2;
}

.mini-landmark text {
  fill: #fff1bd;
  font: 900 10px "Trebuchet MS", Verdana, sans-serif;
  paint-order: stroke;
  stroke: rgba(7, 14, 12, 0.94);
  stroke-width: 4px;
}

.mini-player circle {
  fill: #fff09a;
  stroke: #1a1409;
  stroke-width: 3;
}

.mini-player path {
  fill: #57431f;
}

.mini-compass circle {
  fill: rgba(13, 25, 22, 0.88);
  stroke: #d1aa5a;
  stroke-width: 2;
}

.mini-compass path {
  fill: #f4d273;
}

.mini-compass text {
  fill: #fff0b1;
  font: 900 9px "Trebuchet MS", Verdana, sans-serif;
  text-anchor: middle;
}

.ui-location-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.ui-location-facts div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  align-items: baseline;
}

.ui-location-facts dt {
  color: #ffd36f;
  font-size: 12px;
  font-weight: 900;
}

.ui-location-facts dd {
  margin: 0;
  color: #f3e8c8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.ui-note {
  padding: 10px 12px;
  border: 2px solid rgba(93, 74, 43, 0.8);
  background: rgba(12, 18, 18, 0.68);
  color: #d9d0ad;
  font-size: clamp(12px, 1.05vw, 14px);
  font-weight: 800;
  line-height: 1.35;
}

.ui-route-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.ui-route-list li {
  margin: 5px 0;
}

.dialogue {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  min-height: 68px;
  padding: 10px 12px;
  border: 3px solid var(--panel-edge);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38);
}

.speaker {
  margin-bottom: 4px;
  color: #ffd36f;
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 800;
}

.dialogue-text {
  max-width: 78ch;
  font-size: clamp(12px, 1.25vw, 16px);
  font-weight: 700;
  line-height: 1.35;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 94px;
  z-index: 40;
  max-width: min(460px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 6px 10px;
  border: 2px solid #3d2d1c;
  background: rgba(16, 19, 20, 0.82);
  color: #ffe3a3;
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 0 #000;
}

@media (max-width: 720px) {
  body {
    overflow: auto;
  }

  .ui-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    width: auto;
    height: auto;
    padding: 8px;
    place-items: center;
    background: rgba(5, 10, 10, 0.92);
  }

  .ui-panel {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 16px);
  }

  .ui-panel-header {
    gap: 8px;
    padding: 11px 10px 9px;
  }

  .ui-panel-title {
    min-width: 0;
    font-size: 17px;
    line-height: 1.1;
  }

  .ui-panel-subtitle {
    display: none;
  }

  .ui-panel-body {
    padding: 10px;
  }

  .ui-shop-wallet {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .ui-shop-item {
    min-width: 0;
  }

  .ui-shop-item > div {
    min-width: 0;
  }

  .ui-shop-item small {
    overflow-wrap: anywhere;
  }

  .ui-overlay:has(.ui-panel-map) {
    position: fixed;
    inset: 0;
    z-index: 100;
    width: 100vw;
    height: 100dvh;
    padding: 8px;
    place-items: stretch;
    background: rgba(5, 10, 10, 0.96);
  }

  .ui-overlay:has(.ui-panel-map) .ui-panel-map {
    width: 100%;
    height: 100%;
    max-height: none;
  }

  .ui-overlay:has(.ui-panel-map) .ui-panel-body {
    padding: 10px;
  }

  .game-page {
    padding: 8px;
  }

  .game-shell {
    border-width: 3px;
  }

  .quest {
    max-width: calc(100vw - 52px);
  }

  .ui-panel {
    max-height: calc(100dvh - 16px);
    overflow: hidden;
  }

  .ui-menu-list,
  .ui-controls-list,
  .ui-map-list,
  .ui-stat-grid,
  .ui-codex-summary,
  .ui-quest-summary,
  .ui-quest-entry,
  .ui-codex-grid,
  .ui-status-list {
    grid-template-columns: 1fr;
  }

  .ui-codex-section > .ui-status-list {
    grid-template-columns: 1fr;
  }

  .ui-shop-list {
    grid-template-columns: 1fr;
  }

  .ui-two-column {
    grid-template-columns: 1fr;
  }

  .ui-equipment-tabs button {
    flex: 1 1 50%;
    min-width: 0;
  }

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

  .ui-pouch-strip > div:last-child {
    grid-column: 1 / -1;
  }

  .ui-inventory-layout,
  .ui-character-layout,
  .ui-weapon-layout {
    grid-template-columns: 1fr;
  }

  .ui-item-grid {
    gap: 5px;
    padding: 7px;
  }

  .ui-item-slot,
  .ui-item-slot.empty {
    min-height: 66px;
  }

  .ui-item-glyph {
    width: 34px;
    height: 34px;
  }

  .ui-item-name {
    font-size: 9px;
  }

  .ui-item-detail {
    min-height: 150px;
  }

  .ui-character-profile {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 0 12px;
  }

  .ui-character-portrait {
    grid-row: 1 / span 4;
    min-height: 128px;
    margin: 0;
  }

  .ui-character-portrait img {
    width: 112px;
    height: 112px;
  }

  .ui-character-name {
    text-align: left;
  }

  .ui-character-stats,
  .ui-ability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .ui-map-frame,
  .ui-world-map,
  .ui-location-card {
    min-height: 300px;
  }

  .title-screen {
    overflow-y: auto;
  }

  .title-copy {
    width: 100%;
    min-height: 100%;
    justify-content: flex-start;
    padding: 18px;
    background: linear-gradient(90deg, rgba(10, 17, 15, 0.82), rgba(10, 17, 15, 0.42));
  }

  .title-copy h1 {
    font-size: clamp(28px, 10vw, 42px);
  }

  .title-menu-list {
    width: min(270px, 100%);
    margin-top: 14px;
  }

  .title-menu-item {
    min-height: 36px;
    padding: 7px 10px;
  }

  .title-hedgehog {
    left: auto;
    right: 24px;
    bottom: 34px;
    width: min(26vw, 100px);
    opacity: 0.82;
  }

  .title-sword {
    left: auto;
    right: 92px;
    bottom: 34px;
    width: 76px;
  }
}

@media (max-width: 430px) {
  .ui-character-profile {
    grid-template-columns: 96px minmax(0, 1fr);
    padding: 10px;
  }

  .ui-character-portrait {
    min-height: 104px;
  }

  .ui-character-portrait img {
    width: 92px;
    height: 92px;
  }

  .ui-character-name h3 {
    font-size: 18px;
  }

  .ui-weapon-list,
  .ui-character-stats,
  .ui-ability-grid {
    grid-template-columns: 1fr;
  }

  .ui-item-name {
    display: none;
  }
}

/* Final title-screen overrides sit after legacy responsive rules. */
.ui-overlay:has(.title-screen) {
  padding: 0;
  background: #07110c;
}

.title-screen {
  overflow: hidden;
  border: 0;
  outline: 0;
  background: #07110c;
  box-shadow: none;
}

.title-art {
  background: #07110c url("assets/title/pickle-and-thisle-title-v3-neutral.png") center center / 100% 100% no-repeat;
}

.title-art > * {
  display: none;
}

.title-copy {
  position: absolute;
  inset: 0;
  display: block;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.title-kicker,
.title-copy h1,
.title-subtitle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

.title-menu-list {
  position: absolute;
  left: 39.65%;
  top: 51.55%;
  display: grid;
  grid-template-rows: 1.18fr repeat(3, 1fr);
  gap: 0;
  width: 18.3%;
  height: 26.35%;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: auto;
}

.title-menu-slot {
  min-width: 0;
  min-height: 0;
}

.title-menu-item {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: transparent;
  box-shadow: none;
  cursor: pointer;
}

.title-menu-item span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.title-menu-item:hover,
.title-menu-item:focus-visible,
.title-menu-item.pointer-hover,
.title-menu-item.selected {
  border-color: rgba(214, 236, 92, 0.96);
  outline: 2px solid rgba(255, 229, 131, 0.82);
  outline-offset: -6px;
  background: rgba(168, 211, 79, 0.18);
  box-shadow: 0 0 16px rgba(186, 221, 85, 0.64), inset 0 0 18px rgba(255, 232, 142, 0.22);
}

.title-menu-item.selected::before {
  display: none;
  content: none;
}

@media (max-width: 700px) {
  .title-art {
    background-position: center center;
  }

  .title-copy {
    width: auto;
    min-height: 0;
    padding: 0;
    background: transparent;
  }

  .title-menu-list {
    left: 39.65%;
    top: 51.55%;
    bottom: auto;
    width: 18.3%;
    height: 26.35%;
    margin: 0;
  }

  .title-menu-item {
    min-height: 0;
    padding: 0;
  }
}

/* Keep the Codex larger than standard overlay panels after legacy panel rules. */
.ui-panel.ui-panel-codex {
  width: min(1180px, calc(100% - 16px));
  max-height: calc(100% - 8px);
  border-color: #705731;
  background: #17221d;
}

.ui-panel.ui-panel-codex .ui-panel-header {
  padding-top: 9px;
  padding-bottom: 8px;
}

.ui-panel.ui-panel-codex .ui-codex-spread,
.ui-panel.ui-panel-codex .ui-codex-page {
  min-height: 410px;
}

.ui-panel.ui-panel-codex .ui-codex-discovery {
  grid-template-columns: minmax(104px, 31%) minmax(0, 1fr);
  gap: 10px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.ui-panel.ui-panel-codex .ui-codex-contents-row {
  min-height: 31px;
}

@media (max-width: 760px) {
  .ui-panel.ui-panel-codex {
    max-height: calc(100% - 8px);
  }

  .ui-panel.ui-panel-codex .ui-codex-page {
    min-height: 500px;
  }

  .ui-panel.ui-panel-codex .ui-codex-discovery {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 13px;
    padding-top: 11px;
    padding-bottom: 11px;
  }
}

/* Woodland pointer: absent during play, restored for every interactive overlay. */
:root {
  --woodland-paw-cursor: url("assets/ui/hedgehog-paw-cursor.svg") 4 2, pointer;
  --game-page-padding: 18px;
  --game-target-width: 1100px;
  --game-shell-width: 1064px;
  --ui-scale: 1;
}

.game-shell,
.game-shell * {
  cursor: none !important;
}

body:has(#uiOverlay:not([hidden])) .game-shell,
body:has(#uiOverlay:not([hidden])) .game-shell *,
body:has(#dialogue:not([hidden])) .game-shell,
body:has(#dialogue:not([hidden])) .game-shell * {
  cursor: var(--woodland-paw-cursor) !important;
}

/* Display fitting preserves the 384 x 216 canvas and its 16:9 composition. */
.game-page {
  width: min(100vw, var(--game-target-width));
  max-width: none;
  padding: var(--game-page-padding);
}

.game-page:fullscreen {
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: 0;
  background: #070b0b;
}

.game-page:fullscreen .game-shell {
  width: min(100vw, 177.777778vh, var(--game-shell-width));
  max-width: none;
  border: 0;
  outline: 0;
  box-shadow: none;
}

/* Grouped settings */
.ui-panel-settings {
  width: min(900px, calc(100% - 16px));
  max-height: min(92%, 760px);
}

.ui-settings-layout {
  display: grid;
  gap: 16px;
}

.ui-settings-group {
  min-width: 0;
}

.ui-settings-group > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 6px;
  padding: 0 2px 6px;
  border-bottom: 1px solid rgba(214, 173, 69, 0.58);
}

.ui-settings-group > header span {
  color: #ffe3a3;
  font-size: calc(15px * var(--ui-scale));
  font-weight: 900;
}

.ui-settings-group > header small {
  color: #bfc5a7;
  font-size: calc(10px * var(--ui-scale));
  font-weight: 800;
  text-align: right;
}

.ui-settings-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-setting-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.42fr);
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 8px 10px;
  border: 2px solid rgba(78, 95, 82, 0.82);
  background: rgba(24, 38, 35, 0.9);
  color: var(--ink);
}

.ui-setting-item:hover,
.ui-setting-item.selected,
.ui-setting-item:focus-within {
  border-color: var(--gold);
  background: rgba(61, 83, 54, 0.94);
}

.ui-setting-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ui-setting-copy strong {
  color: #f7edcf;
  font-size: calc(14px * var(--ui-scale));
  line-height: 1.1;
}

.ui-setting-copy small {
  color: #bcc6ab;
  font-size: calc(10px * var(--ui-scale));
  font-weight: 750;
  line-height: 1.25;
}

.ui-setting-stepper {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: stretch;
  min-height: 36px;
  border: 2px solid rgba(139, 107, 57, 0.82);
  background: rgba(14, 23, 22, 0.92);
}

.ui-setting-stepper button,
.ui-setting-toggle {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: rgba(48, 68, 51, 0.86);
  color: #ffe3a3;
  font: inherit;
}

.ui-setting-stepper button:hover,
.ui-setting-stepper button:focus-visible,
.ui-setting-toggle:hover,
.ui-setting-toggle:focus-visible {
  outline: 2px solid #ffe08a;
  outline-offset: -3px;
  background: rgba(93, 117, 62, 0.96);
}

.ui-setting-stepper output {
  display: grid;
  place-items: center;
  padding: 4px 7px;
  border-right: 1px solid rgba(139, 107, 57, 0.56);
  border-left: 1px solid rgba(139, 107, 57, 0.56);
  color: #fff0b8;
  font-size: calc(12px * var(--ui-scale));
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.ui-step-arrow {
  display: block;
  width: 0;
  height: 0;
  margin: auto;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.ui-step-arrow.left {
  border-right: 8px solid currentColor;
}

.ui-step-arrow.right {
  border-left: 8px solid currentColor;
}

.ui-setting-toggle {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  justify-self: end;
  width: 92px;
  min-height: 36px;
  padding: 4px 8px;
  border: 2px solid rgba(139, 107, 57, 0.82);
}

.ui-setting-toggle > span {
  width: 18px;
  height: 18px;
  border: 2px solid #7c765d;
  background: #252b28;
}

.ui-setting-toggle.enabled > span {
  border-color: #d6ad45;
  background: #7caf57;
  box-shadow: inset 0 0 0 3px #263a2d;
}

.ui-setting-toggle em {
  color: #ffe3a3;
  font-size: calc(11px * var(--ui-scale));
  font-style: normal;
  font-weight: 900;
}

.ui-setting-command {
  justify-self: end;
  min-width: 92px;
  padding: 8px 10px;
  border: 2px solid rgba(139, 107, 57, 0.72);
  background: rgba(14, 23, 22, 0.72);
  color: #ffe3a3;
  font-size: calc(11px * var(--ui-scale));
  font-weight: 900;
  text-align: center;
}

/* UI scaling deliberately excludes the world canvas. */
.ui-panel-title {
  font-size: clamp(calc(18px * var(--ui-scale)), 2vw, calc(24px * var(--ui-scale)));
}

.ui-panel-subtitle,
.ui-help,
.ui-menu-item,
.ui-control-item {
  font-size: clamp(calc(12px * var(--ui-scale)), 1.15vw, calc(16px * var(--ui-scale)));
}

.brand {
  font-size: clamp(calc(13px * var(--ui-scale)), 1.6vw, calc(19px * var(--ui-scale)));
}

.room-name,
.ammo,
.quest {
  font-size: clamp(calc(10px * var(--ui-scale)), 1vw, calc(13px * var(--ui-scale)));
}

.speaker {
  font-size: clamp(calc(11px * var(--ui-scale)), 1.1vw, calc(14px * var(--ui-scale)));
}

.dialogue-text {
  font-size: clamp(calc(12px * var(--ui-scale)), 1.25vw, calc(16px * var(--ui-scale)));
}

body.high-contrast-ui {
  --ink: #fff8dc;
  --muted: #e1ddc2;
  --panel-edge: #e0b85a;
  --gold: #ffdb69;
}

body.high-contrast-ui .ui-panel,
body.high-contrast-ui .dialogue,
body.high-contrast-ui .ui-setting-item,
body.high-contrast-ui .ui-menu-item,
body.high-contrast-ui .ui-control-item {
  border-color: #e0b85a;
  background-color: rgba(8, 18, 17, 0.98);
}

body.reduced-motion-ui *,
body.reduced-motion-ui *::before,
body.reduced-motion-ui *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

@media (max-width: 680px) {
  .ui-settings-group > header {
    display: grid;
    gap: 3px;
  }

  .ui-settings-group > header small {
    text-align: left;
  }

  .ui-setting-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ui-setting-stepper,
  .ui-setting-toggle,
  .ui-setting-command {
    justify-self: stretch;
    width: 100%;
  }
}
