:root {
  color-scheme: dark;
  --ink: #172e2b;
  --deep: #112420;
  --paper: #f5eed9;
  --muted: #b7c4b8;
  --gold: #e9b96b;
  --gold-light: #f6d493;
  --line: rgba(229, 236, 210, 0.16);
  --glass: rgba(19, 37, 33, 0.91);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  color: var(--paper);
  background: #173630;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  touch-action: manipulation;
}
button:hover {
  filter: brightness(1.08);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  border-radius: 8px;
}
input {
  background: rgba(5, 18, 15, 0.34);
  border: 1px solid var(--line);
  padding: 14px 13px;
  color: var(--paper);
  outline: none;
  min-width: 0;
}
input::placeholder {
  color: #879a8c;
}
input:focus {
  border-color: #cdb077;
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  touch-action: none;
}
h1,
h2,
p {
  margin: 0;
}
h2 {
  font-family: Georgia, serif;
  font-weight: normal;
}
button[hidden],
[hidden] {
  display: none !important;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.3px;
  font-weight: 650;
  color: var(--gold);
  line-height: 1.6;
}
.entry {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    90deg,
    rgba(8, 27, 25, 0.6),
    rgba(15, 33, 29, 0.1) 64%,
    rgba(12, 27, 24, 0.38)
  );
  overflow: auto;
}
.entry-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 5.5vw;
  font-size: 11px;
  letter-spacing: 1.8px;
  font-weight: 650;
}
.entry-brand a {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  color: var(--gold);
  font-size: 28px;
}
.brand-separator {
  color: #87a28d;
  font-weight: 400;
}
.entry-status {
  font-size: 11px;
  letter-spacing: 0.2px;
  color: #dae1cd;
  display: flex;
  align-items: center;
  gap: 8px;
}
.entry-status i {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #b0cb84;
  box-shadow: 0 0 12px #b0cb84;
}
.entry-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  padding: 30px 8vw 60px 9vw;
  max-width: 1580px;
  width: 100%;
  margin: 0 auto;
}
.entry-story {
  max-width: 660px;
  padding-bottom: 20px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.2);
}
.entry-story h1 {
  font:
    clamp(55px, 6.8vw, 102px) / 1.18 Georgia,
    serif;
  letter-spacing: -3px;
  margin: 22px 0;
}
.entry-story h1 span {
  color: var(--gold);
}
.entry-lead {
  font-size: clamp(19px, 2.1vw, 28px);
  line-height: 1.5;
  letter-spacing: -0.4px;
}
.entry-description {
  max-width: 420px;
  margin: 22px 0 30px;
  color: #d0dac8;
  font-size: 14px;
  line-height: 1.9;
}
.entry-tags {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: #e2e7d0;
  font-size: 12px;
}
.entry-tags span::first-letter {
  color: var(--gold);
}
.entry-card {
  flex: 0 0 360px;
  padding: 28px 30px 24px;
  background: linear-gradient(
    145deg,
    rgba(31, 52, 42, 0.97),
    rgba(15, 35, 30, 0.98)
  );
  border: 1px solid rgba(221, 222, 180, 0.23);
  border-radius: 16px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}
.card-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 2px;
  color: #c6b588;
}
.small-star {
  font-size: 20px;
  color: var(--gold);
}
.entry-card h2 {
  font-size: 32px;
  margin: 12px 0 8px;
}
.entry-card > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin: 24px 0 22px;
  gap: 20px;
}
.auth-tabs button {
  padding: 0 0 12px;
  background: none;
  border-radius: 0;
  color: #94ab9a;
  font-size: 12px;
  white-space: nowrap;
}
.auth-tabs button[aria-selected="true"] {
  color: var(--gold-light);
  border-bottom: 2px solid var(--gold);
}
#auth-form label {
  display: block;
  font-size: 11px;
  margin: 15px 0 8px;
  color: #d3dcca;
}
#auth-form input {
  width: 100%;
  font-size: 13px;
}
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 46px;
}
.password-wrap button {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 37px;
  height: 37px;
  background: none;
  color: #a9b6a1;
}
.form-error {
  color: #ffb7a4;
  line-height: 1.5;
  font-size: 12px;
  min-height: 16px;
  margin: 10px 0;
}
.primary {
  background: var(--gold);
  color: #263228;
  font-weight: 650;
  padding: 13px 18px;
  min-height: 44px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.23),
    0 3px 0 rgba(0, 0, 0, 0.14);
  border: 1px solid #ecc785;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.primary:hover {
  background: var(--gold-light);
}
.wide {
  width: 100%;
  justify-content: space-between;
}
#auth-submit span:last-child {
  font-size: 22px;
  font-weight: 400;
}
.auth-note {
  text-align: center !important;
  color: #91a591 !important;
  font-size: 10px !important;
  line-height: 1.7 !important;
  margin-top: 16px !important;
}
.text-button {
  background: none;
  color: var(--muted);
  padding: 14px;
}
.entry-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 5.5vw 26px;
  color: #c2d0b8;
  font-size: 11px;
  letter-spacing: 0.3px;
}
.entry-footer > span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tiny-diamond {
  width: 5px;
  height: 5px;
  display: inline-block;
  transform: rotate(45deg);
  background: var(--gold);
}
.entry-footer button {
  background: none;
  padding: 12px;
  color: var(--paper);
  font-size: 11px;
}
.entry-footer button span {
  color: var(--gold);
  margin-left: 8px;
}
.version-label {
  opacity: 0.7;
}
#resume-box {
  margin-top: 24px;
}
#resume-name {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.6;
}
.glass {
  background: var(--glass);
  border: 1px solid rgba(220, 228, 191, 0.2);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}
#game-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
}
#game-ui button,
#game-ui input,
#game-ui .chat-box {
  pointer-events: auto;
}
.topbar {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.player-card {
  border-radius: 12px;
  padding: 10px;
  display: flex;
  gap: 11px;
  width: 225px;
  align-items: center;
}
.player-portrait {
  background: linear-gradient(140deg, #627948, #2b4937);
  height: 43px;
  width: 43px;
  flex: 0 0 43px;
  display: grid;
  place-items: center;
  border: 1px solid #80906a;
  border-radius: 8px;
  color: #e7c17d;
  font-size: 27px;
}
.player-lines {
  flex: 1;
  min-width: 0;
}
.name-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 11px;
}
.name-row strong {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.name-row > span {
  color: var(--gold);
  white-space: nowrap;
  font-size: 10px;
}
.health-track {
  position: relative;
  height: 12px;
  background: #352c26;
  border-radius: 3px;
  overflow: hidden;
}
.health-track i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #a35b49, #d08362);
  width: 100%;
  transition: width 0.2s;
}
.health-track span {
  position: absolute;
  inset: 0;
  text-align: center;
  font-size: 8px;
  line-height: 12px;
  text-shadow: 0 1px #0008;
  color: #fff3e8;
}
.xp-track {
  height: 3px;
  background: #0d1f1b;
  margin-top: 4px;
  border-radius: 2px;
  overflow: hidden;
}
.xp-track i {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0;
  transition: width 0.3s;
}
.world-card {
  padding: 10px 23px;
  text-align: center;
  border-radius: 10px;
  min-width: 155px;
}
.world-card > span {
  display: block;
  font-family: Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.6px;
}
.world-card small {
  font-size: 9px;
  color: #b4c6ae;
  display: block;
  margin-top: 4px;
  letter-spacing: 1px;
}
.top-actions {
  display: flex;
  gap: 7px;
}
.icon-button {
  height: 44px;
  width: 44px;
  border-radius: 10px;
  font-size: 22px;
  color: #e4d6ad;
}
.icon-button[aria-pressed="true"] {
  color: #fff0af;
  border-color: var(--gold);
}
.quest-card {
  position: absolute;
  top: 100px;
  left: 18px;
  width: 260px;
  text-align: left;
  border-radius: 10px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  pointer-events: auto;
}
.quest-icon {
  font-size: 25px;
  color: var(--gold);
}
.quest-card > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.quest-card small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.6px;
  color: var(--gold);
  margin-bottom: 5px;
}
.quest-card strong {
  font-size: 12px;
  font-weight: 600;
  display: block;
  line-height: 1.5;
}
.quest-card #quest-progress {
  font-size: 10px;
  color: #b2c1ab;
  display: block;
  margin-top: 4px;
}
.quest-arrow {
  font-size: 22px;
  color: #aeb995;
}
.quest-card.ready {
  border-color: #c2a465;
}
.quest-card.ready .quest-icon {
  animation: glow 2s infinite;
}
.connection {
  position: absolute;
  left: 50%;
  top: 105px;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 8px;
  max-width: 85%;
  font-size: 12px;
  text-align: center;
  color: var(--gold-light);
  z-index: 4;
}
.bottom-ui {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}
.hotbar-label {
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: 0 1px 5px #000;
  color: #eee7cf;
}
.hotbar-label span:first-child {
  font-size: 12px;
  font-weight: 650;
}
.hotbar-label span:last-child {
  font-size: 10px;
  color: #d6deca;
}
.hotbar {
  display: flex;
  gap: 6px;
  padding: 7px;
  border-radius: 12px;
}
.hotbar button {
  height: 55px;
  width: 55px;
  position: relative;
  display: grid;
  place-items: center;
  background: rgba(71, 88, 61, 0.37);
  border: 1px solid rgba(183, 193, 146, 0.15);
  border-radius: 7px;
  transition:
    background 0.12s,
    transform 0.12s;
}
.hotbar button.selected {
  border-color: var(--gold);
  background: rgba(182, 149, 80, 0.2);
  box-shadow: inset 0 0 0 1px #ecc88d5c;
  transform: translateY(-2px);
}
.hotbar button canvas {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}
.hotbar button small {
  position: absolute;
  left: 5px;
  top: 3px;
  font-size: 8px;
  color: #a5b494;
}
.hotbar button .count {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-size: 10px;
  color: #f1ead0;
  text-shadow: 1px 1px #111;
}
.quick-links {
  display: flex;
  gap: 16px;
}
.quick-links button {
  background: none;
  color: #dce3cc;
  font-size: 10px;
  padding: 4px;
  text-shadow: 0 1px 4px #000;
}
.quick-links button kbd {
  margin-right: 3px;
}
kbd {
  font:
    9px ui-sans-serif,
    system-ui;
  background: #1b3128;
  border: 1px solid #758568;
  padding: 2px 4px;
  border-radius: 3px;
  color: #dfe8cd;
  box-shadow: 0 1px 1px #0008;
}
#online-count {
  font-size: 9px;
  padding: 1px 4px;
  background: #1c4130;
  border-radius: 3px;
  margin-left: 3px;
  color: #c4dba5;
}
.nearby {
  position: absolute;
  left: 50%;
  bottom: 155px;
  transform: translateX(-50%);
  text-align: center;
}
.nearby button {
  padding: 10px 15px;
  font-size: 12px;
  box-shadow: 0 4px 16px #0003;
}
.nearby kbd {
  background: #897442;
  color: #fff2c3;
  border-color: #ab9153;
}
.toasts {
  position: absolute;
  right: 18px;
  top: 88px;
  display: flex;
  gap: 7px;
  flex-direction: column;
  align-items: flex-end;
  max-width: min(360px, 80vw);
  z-index: 6;
}
.toast {
  background: rgba(20, 36, 29, 0.96);
  border: 1px solid #80916366;
  border-radius: 8px;
  box-shadow: 0 3px 12px #0003;
  padding: 12px 15px;
  color: #e7edda;
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 0.2s;
}
.toast.success {
  border-left: 3px solid #b0c77b;
}
.toast.error {
  border-left: 3px solid #dc9c76;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 18, 16, 0.63);
  backdrop-filter: blur(5px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
}
.panel {
  width: min(760px, 100%);
  max-height: min(790px, 90dvh);
  overflow: auto;
  background: linear-gradient(135deg, #233c31, #142b26);
  border: 1px solid #bdc2944d;
  border-radius: 16px;
  padding: 27px;
  box-shadow: 0 20px 80px #0006;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}
.panel-heading h2 {
  font-size: 32px;
  margin-top: 4px;
}
.close-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  font-size: 27px;
  line-height: 1;
  background: #ffffff09;
  color: #c1cbb1;
  border: 1px solid var(--line);
}
.panel-description {
  font-size: 13px;
  line-height: 1.8;
  color: #c4d2bd;
  margin: 0 0 20px;
}
.panel-subheading {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin: 22px 0 12px;
}
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 9px;
}
.inventory-item {
  position: relative;
  padding: 12px 8px 10px;
  display: flex;
  align-items: center;
  flex-direction: column;
  background: #071c173d;
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 105px;
}
.inventory-item canvas {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  margin-bottom: 8px;
}
.inventory-item strong {
  font-size: 11px;
  text-align: center;
  line-height: 1.4;
  font-weight: 500;
  color: #d7dfc9;
}
.inventory-item small {
  font-size: 11px;
  position: absolute;
  right: 8px;
  top: 7px;
  color: var(--gold);
}
.inventory-item button {
  font-size: 10px;
  background: #59724955;
  padding: 6px 10px;
  margin-top: 8px;
  border: 1px solid #9baa6c55;
}
.recipe-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-button {
  background: #071c173d;
  border: 1px solid var(--line);
  padding: 9px 12px;
  font-size: 11px;
  color: #b6c6ac;
}
.filter-button.active {
  background: #c6a36622;
  border-color: #d6b56a77;
  color: #f1d396;
}
.recipe-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recipe {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  background: #0c221b70;
  border: 1px solid var(--line);
  padding: 13px;
  border-radius: 10px;
}
.recipe > canvas {
  height: 40px;
  width: 40px;
  image-rendering: pixelated;
}
.recipe h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 5px;
}
.recipe p {
  font-size: 11px;
  color: #aabb9e;
  line-height: 1.5;
  margin-bottom: 5px;
}
.costs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 10px;
  color: #b9d29c;
}
.costs .missing {
  color: #e1a38a;
}
.recipe button {
  padding: 10px 13px;
  font-size: 11px;
  min-height: 40px;
  border: 1px solid #b7a16b66;
  background: #c9ac6c22;
  color: #e9d19b;
}
.recipe button:disabled {
  background: none;
  color: #91a384;
}
.recipe .recipe-tier {
  font-size: 9px;
  color: #b6be94;
}
.stat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.stat-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 18px;
  flex: 1;
  min-width: 100px;
  background: #0d241c44;
}
.stat-box small {
  font-size: 9px;
  color: #9aaf95;
  display: block;
  margin-bottom: 5px;
}
.stat-box strong {
  font-size: 18px;
  color: var(--gold-light);
  font-family: Georgia, serif;
  font-weight: 400;
}
.journal-current {
  border-left: 2px solid var(--gold);
  padding: 5px 0 5px 20px;
  margin: 15px 0 25px;
}
.journal-current h3 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 24px;
  margin: 0 0 12px;
}
.journal-current p {
  font-size: 13px;
  line-height: 1.8;
  color: #c6d2ba;
  white-space: pre-line;
}
.journal-progress {
  margin: 16px 0;
  color: var(--gold);
  font-size: 12px;
}
.journal-current button {
  margin-top: 12px;
}
.hint-box {
  background: #b5c58b0b;
  border: 1px solid #b5c58b33;
  padding: 16px;
  border-radius: 9px;
  color: #b7c8aa;
  font-size: 12px;
  line-height: 1.9;
}
.village-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}
.village-item canvas {
  height: 32px;
  width: 32px;
  image-rendering: pixelated;
}
.village-item > div {
  flex: 1;
}
.village-item strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.village-item small {
  font-size: 10px;
  color: #a5b797;
  display: block;
  margin-top: 5px;
}
.village-item input {
  width: 70px;
  padding: 9px;
  text-align: center;
}
.village-item button {
  padding: 10px 12px;
  background: #c7ad7130;
  border: 1px solid #c7ad7150;
  color: #e7cb8e;
  font-size: 11px;
}
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.menu-item {
  background: #10281f66;
  border: 1px solid var(--line);
  padding: 18px;
  display: flex;
  gap: 13px;
  align-items: center;
  text-align: left;
}
.menu-item > span {
  font-size: 22px;
  color: var(--gold);
  width: 25px;
  text-align: center;
}
.menu-item strong {
  font-size: 13px;
  display: block;
  font-weight: 500;
}
.menu-item small {
  font-size: 10px;
  display: block;
  color: #9eb395;
  margin-top: 5px;
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.help-tile {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #081f1833;
}
.help-tile h3 {
  font-size: 13px;
  margin: 0 0 9px;
  color: var(--gold-light);
  font-weight: 500;
}
.help-tile p {
  font-size: 12px;
  line-height: 1.8;
  color: #b9c9b1;
}
.dialog {
  position: fixed;
  z-index: 12;
  bottom: 160px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 36px));
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  gap: 19px;
  box-shadow: 0 12px 60px #0005;
}
.dialog-portrait {
  flex: 0 0 55px;
  height: 64px;
  display: grid;
  place-items: center;
  background: #6e7c4855;
  border: 1px solid #afad6d55;
  border-radius: 8px;
  color: var(--gold);
  font-size: 34px;
}
.dialog-body {
  flex: 1;
  min-width: 0;
}
.dialog-body > small {
  font-size: 8px;
  letter-spacing: 1.6px;
  color: #bdac78;
}
.dialog h2 {
  font-size: 23px;
  margin: 4px 0 12px;
  color: var(--gold-light);
}
.dialog p {
  font-size: 13px;
  line-height: 1.8;
  color: #dee5cf;
  white-space: pre-line;
}
.dialog .close-button {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
  height: 28px;
  font-size: 21px;
}
.dialog-options {
  margin-top: 16px;
}
#dialog-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
#dialog-options button {
  padding: 10px 14px;
  min-height: 40px;
  background: #e4be72;
  color: #283a29;
  font-size: 12px;
  font-weight: 600;
}
.chat-box {
  position: absolute;
  bottom: 22px;
  left: 18px;
  width: 315px;
  max-height: 360px;
  border-radius: 12px;
  overflow: hidden;
  z-index: 15;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  user-select: text;
}
.chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.chat-heading strong {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 17px;
  color: var(--gold-light);
}
.chat-heading .close-button {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  font-size: 22px;
}
.chat-messages {
  overflow: auto;
  min-height: 100px;
  max-height: 240px;
  padding: 12px;
  font-size: 11px;
  line-height: 1.7;
}
.chat-line {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.chat-line b {
  color: #d9bd80;
  font-weight: 600;
  margin-right: 6px;
}
.chat-line.system {
  color: #9caf94;
  font-style: italic;
}
#chat-form {
  display: flex;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding: 9px;
}
#chat-input {
  width: 100%;
  padding: 10px;
  font-size: 12px;
}
#chat-form button {
  height: 37px;
  width: 37px;
  flex: 0 0 37px;
  background: #b6a16d33;
  border: 1px solid #b6a16d66;
  color: var(--gold);
  font-size: 21px;
}
.touch-controls {
  display: none;
}
.map-canvas {
  width: 100%;
  height: 220px;
  image-rendering: pixelated;
  border: 1px solid #9da77f55;
  border-radius: 8px;
  background: #132b26;
  display: block;
}
.map-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0;
  color: #adc0a4;
  font-size: 10px;
}
.map-place {
  background: none;
  border-bottom: 1px solid var(--line);
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  color: #e1dec2;
  font-size: 12px;
  border-radius: 0;
}
.map-place span {
  color: #99ae91;
  font-size: 10px;
}
.empty-message {
  padding: 25px 0;
  text-align: center;
  color: #a4b89b;
  font-size: 13px;
  line-height: 1.8;
}
.danger-button {
  background: #894a3b22;
  border: 1px solid #bb7b6244;
  color: #d4ad98;
  padding: 12px 18px;
  margin-top: 20px;
  font-size: 12px;
}
.noscript {
  position: fixed;
  z-index: 100;
  background: #17382e;
  color: #fff;
  padding: 30px;
  inset: 20%;
  font-size: 20px;
  text-align: center;
}
@keyframes glow {
  50% {
    opacity: 0.55;
  }
}
@keyframes toast-in {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 1050px) {
  .entry-content {
    gap: 35px;
    padding: 30px 6vw;
  }
  .entry-card {
    flex-basis: 330px;
    padding: 24px;
  }
  .entry-story h1 {
    font-size: 64px;
  }
  .entry-story .eyebrow {
    font-size: 8px;
  }
  .entry-description {
    max-width: 340px;
  }
  .entry-tags {
    gap: 15px;
    font-size: 11px;
  }
  .entry-status {
    display: none;
  }
  .hotbar-label span:last-child {
    max-width: 230px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }
  .chat-box {
    bottom: 140px;
  }
}
@media (max-width: 700px) {
  .entry-brand {
    padding: 18px 24px;
    font-size: 9px;
    letter-spacing: 1.2px;
  }
  .entry-brand a {
    gap: 10px;
  }
  .brand-mark {
    font-size: 23px;
  }
  .entry-content {
    display: block;
    padding: 10px 24px 25px;
    max-width: 500px;
  }
  .entry-story {
    text-align: center;
    padding-bottom: 0;
  }
  .entry-story .eyebrow {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .entry-story h1 {
    font-size: 53px;
    letter-spacing: -2px;
    margin: 12px 0;
  }
  .entry-lead {
    font-size: 17px;
    line-height: 1.5;
  }
  .entry-description {
    display: none;
  }
  .entry-tags {
    justify-content: center;
    font-size: 10px;
    gap: 13px;
    margin: 18px 0 25px;
  }
  .entry-card {
    width: 100%;
    padding: 20px 24px;
  }
  .entry-card h2 {
    font-size: 27px;
    margin-top: 6px;
  }
  .card-topline {
    font-size: 8px;
  }
  .auth-tabs {
    margin: 20px 0 17px;
  }
  .entry-footer {
    padding: 0 24px 16px;
    justify-content: center;
  }
  .entry-footer > span:first-child,
  .version-label {
    display: none;
  }
  .topbar {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top));
    gap: 6px;
  }
  .player-card {
    width: 173px;
    padding: 7px;
    gap: 7px;
    border-radius: 9px;
  }
  .player-portrait {
    width: 31px;
    height: 35px;
    flex-basis: 31px;
    font-size: 23px;
  }
  .name-row {
    font-size: 10px;
    gap: 5px;
    margin-bottom: 5px;
  }
  .name-row > span {
    font-size: 8px;
  }
  .world-card {
    display: none;
  }
  .icon-button {
    height: 37px;
    width: 37px;
    font-size: 20px;
    border-radius: 8px;
  }
  .top-actions {
    gap: 5px;
  }
  .quest-card {
    left: 10px;
    top: 79px;
    width: 228px;
    padding: 9px 11px;
    gap: 9px;
  }
  .quest-card strong {
    font-size: 11px;
  }
  .quest-card small {
    font-size: 7px;
    margin-bottom: 3px;
  }
  .quest-card #quest-progress {
    font-size: 9px;
    margin-top: 3px;
  }
  .quest-icon {
    font-size: 21px;
  }
  .toasts {
    top: 140px;
    right: 10px;
    max-width: 75vw;
  }
  .toast {
    font-size: 11px;
    padding: 10px 12px;
  }
  .hotbar {
    gap: 4px;
    padding: 5px;
    border-radius: 10px;
  }
  .hotbar button {
    width: 43px;
    height: 45px;
  }
  .hotbar button canvas {
    width: 27px;
    height: 27px;
  }
  .hotbar button small {
    font-size: 7px;
  }
  .hotbar button .count {
    font-size: 9px;
  }
  .hotbar-label {
    gap: 0;
    justify-content: center;
  }
  .hotbar-label span:first-child {
    font-size: 10px;
  }
  .hotbar-label span:last-child {
    display: none;
  }
  .bottom-ui {
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 5px;
  }
  .quick-links {
    gap: 14px;
  }
  .quick-links button {
    font-size: 10px;
    min-height: 27px;
  }
  .quick-links kbd {
    display: none;
  }
  .nearby {
    bottom: 180px;
  }
  .nearby button {
    font-size: 11px;
    min-height: 42px;
  }
  .nearby kbd {
    display: none;
  }
  .panel {
    padding: 20px;
    max-height: 92dvh;
    border-radius: 13px;
  }
  .overlay {
    padding: 12px;
  }
  .panel-heading h2 {
    font-size: 27px;
  }
  .panel-heading {
    margin-bottom: 18px;
  }
  .help-grid {
    grid-template-columns: 1fr;
  }
  .menu-grid {
    gap: 8px;
  }
  .menu-item {
    padding: 13px;
    gap: 9px;
  }
  .menu-item strong {
    font-size: 12px;
  }
  .menu-item small {
    font-size: 9px;
  }
  .menu-item > span {
    font-size: 19px;
  }
  .inventory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .inventory-item {
    min-height: 95px;
  }
  .recipe {
    grid-template-columns: 32px 1fr auto;
    gap: 9px;
    padding: 10px;
  }
  .recipe > canvas {
    width: 30px;
    height: 30px;
  }
  .recipe h3 {
    font-size: 12px;
  }
  .recipe p {
    font-size: 10px;
  }
  .recipe button {
    padding: 9px;
    font-size: 10px;
  }
  .costs {
    font-size: 9px;
    gap: 5px;
  }
  .dialog {
    bottom: 135px;
    padding: 19px 18px;
    width: calc(100vw - 20px);
    gap: 11px;
    max-height: 60dvh;
    overflow: auto;
  }
  .dialog-portrait {
    flex-basis: 36px;
    height: 44px;
    font-size: 27px;
  }
  .dialog h2 {
    font-size: 22px;
  }
  .dialog p {
    font-size: 12px;
    line-height: 1.7;
  }
  .dialog-body > small {
    font-size: 7px;
  }
  .dialog-options button {
    font-size: 11px;
  }
  .chat-box {
    left: 10px;
    width: calc(100vw - 20px);
    bottom: 130px;
    max-height: 55dvh;
  }
  .chat-messages {
    max-height: 32dvh;
  }
  .connection {
    top: 78px;
    left: auto;
    right: 10px;
    transform: none;
    font-size: 10px;
    max-width: 155px;
    padding: 10px;
  }
  .village-item {
    gap: 8px;
  }
  .village-item input {
    width: 57px;
  }
  .village-item button {
    font-size: 10px;
    padding: 10px 8px;
  }
  .village-item strong {
    font-size: 11px;
  }
  .village-item small {
    font-size: 9px;
  }
  .map-canvas {
    height: 170px;
  }
}
body.touch-layout .icon-button,
body.touch-layout .close-button,
body.touch-layout #dialog-options button,
body.touch-layout .auth-tabs button,
body.touch-layout .inventory-item button,
body.touch-layout .recipe button,
body.touch-layout .village-item button,
body.touch-layout .filter-button {
  min-height: 44px;
  min-width: 44px;
}

body.touch-layout .top-actions .icon-button {
  width: 44px;
  height: 44px;
}

body.touch-layout .village-item input {
  min-height: 44px;
}

body.touch-layout .touch-controls {
  display: block;
}

body.touch-layout .joystick {
  position: absolute;
  bottom: max(145px, calc(env(safe-area-inset-bottom) + 120px));
  left: max(24px, env(safe-area-inset-left));
  width: 110px;
  height: 82px;
  border: 1px solid #dae3b73b;
  border-radius: 45px;
  background: #132e2466;
  pointer-events: auto;
  touch-action: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  color: #d3ddb88a;
  font-size: 29px;
}

body.touch-layout .joystick i {
  position: absolute;
  left: 31px;
  top: 17px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #b8c2a14d;
  border: 1px solid #d4deb76b;
  box-shadow: 0 2px 6px #0002;
  pointer-events: none;
}

body.touch-layout .touch-actions {
  position: absolute;
  bottom: max(140px, calc(env(safe-area-inset-bottom) + 120px));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

body.touch-layout .touch-actions button {
  height: 58px;
  width: 58px;
  border-radius: 50%;
  border: 1px solid #d4deb76b;
  background: #203d3099;
  color: #eef0d3;
  font-size: 29px;
  pointer-events: auto;
  touch-action: none;
}

body.touch-layout .touch-actions button:last-child {
  width: 64px;
  height: 64px;
  background: #ab8f4e77;
  border-color: #e9c77999;
  font-size: 27px;
}

body.touch-layout .touch-actions button:active {
  background: #b4a06599;
}

body.touch-layout .quick-links button {
  min-height: 44px;
}

body.touch-layout .nearby {
  bottom: 245px;
}

body.touch-layout .dialog {
  bottom: 245px;
}

body.touch-layout .hotbar button {
  min-width: 44px;
  min-height: 47px;
}
@media (max-width: 350px) {
  body.touch-layout .player-card {
    width: 148px;
  }

  body.touch-layout #btn-sound {
    display: none;
  }
}
@media (orientation: landscape) {
  body.touch-layout .topbar {
    top: max(8px, env(safe-area-inset-top));
  }

  body.touch-layout .player-card {
    width: 180px;
    padding: 6px;
  }

  body.touch-layout .player-portrait {
    height: 32px;
    width: 32px;
    flex-basis: 32px;
  }

  body.touch-layout .quest-card {
    top: 76px;
    width: 230px;
    left: max(12px, env(safe-area-inset-left));
    padding: 8px;
  }

  body.touch-layout .quest-card #quest-progress {
    display: none;
  }

  body.touch-layout .bottom-ui {
    bottom: max(8px, env(safe-area-inset-bottom));
    gap: 4px;
  }

  body.touch-layout .hotbar button {
    height: 44px;
    width: 44px;
  }

  body.touch-layout .hotbar-label {
    display: none;
  }

  body.touch-layout .quick-links {
    gap: 12px;
  }

  body.touch-layout .quick-links button {
    padding: 3px;
    font-size: 9px;
    min-height: 25px;
  }

  body.touch-layout .joystick {
    bottom: max(25px, env(safe-area-inset-bottom));
    left: max(24px, env(safe-area-inset-left));
    height: 76px;
  }

  body.touch-layout .joystick i {
    top: 14px;
  }

  body.touch-layout .touch-actions {
    bottom: max(26px, env(safe-area-inset-bottom));
    right: max(24px, env(safe-area-inset-right));
  }

  body.touch-layout .touch-actions button {
    height: 52px;
    width: 52px;
  }

  body.touch-layout .touch-actions button:last-child {
    height: 58px;
    width: 58px;
  }

  body.touch-layout .nearby {
    bottom: 116px;
  }

  body.touch-layout .nearby button {
    padding: 8px 12px;
    min-height: 38px;
  }

  body.touch-layout .dialog {
    bottom: 110px;
    width: min(580px, 75vw);
    max-height: calc(100dvh - 140px);
    padding: 14px 18px;
  }

  body.touch-layout .dialog p {
    font-size: 11px;
  }

  body.touch-layout .dialog h2 {
    font-size: 19px;
    margin-bottom: 7px;
  }

  body.touch-layout .dialog-options {
    margin-top: 9px;
  }

  body.touch-layout .dialog-portrait {
    display: none;
  }

  body.touch-layout .toasts {
    top: 65px;
    max-width: 280px;
  }

  body.touch-layout .world-card {
    display: none;
  }

  body.touch-layout .entry-content {
    padding-top: 0;
    display: flex;
    gap: 25px;
    max-width: 880px;
  }

  body.touch-layout .entry-story {
    flex: 1;
  }

  body.touch-layout .entry-story h1 {
    font-size: 45px;
  }

  body.touch-layout .entry-story .entry-lead {
    font-size: 15px;
  }

  body.touch-layout .entry-card {
    flex-basis: 300px;
    padding: 18px;
  }

  body.touch-layout .entry-brand {
    padding: 12px 24px;
  }

  body.touch-layout .entry-tags {
    font-size: 9px;
    margin: 20px 0;
  }

  body.touch-layout .entry-footer {
    padding-bottom: 8px;
  }

  body.touch-layout .entry .auth-note {
    font-size: 9px !important;
  }

  body.touch-layout .entry .entry-card h2 {
    font-size: 23px;
  }

  body.touch-layout .entry .card-topline {
    display: none;
  }

  body.touch-layout .entry .auth-tabs {
    margin: 15px 0 10px;
  }

  body.touch-layout .entry #auth-form label {
    margin: 10px 0 5px;
  }

  body.touch-layout .entry #auth-form input {
    padding: 10px;
  }

  body.touch-layout .entry .password-wrap button {
    top: 0;
  }

  body.touch-layout .chat-box {
    bottom: 110px;
    max-height: 65dvh;
    width: 310px;
  }

  body.touch-layout .chat-messages {
    max-height: 36dvh;
  }

  body.touch-layout .panel {
    max-height: 94dvh;
  }

  body.touch-layout .overlay {
    padding: 8px;
  }

  body.touch-layout .panel-heading {
    margin-bottom: 15px;
  }

  body.touch-layout .panel-heading h2 {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.control-setting {
  margin-top: 24px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}
.control-options {
  display: flex;
  gap: 8px;
}
.control-options button {
  flex: 1;
  min-height: 44px;
}
.control-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
body.touch-layout .quick-links kbd,
body.touch-layout .nearby kbd {
  display: none;
}
