:root {
  color-scheme: dark;
  --world-dock-height: 0px;
}
@font-face {
  font-family: "DegenHaus Classic";
  src: url("/local/title/regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DegenHaus Classic";
  src: url("/local/title/bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}
body {
  box-sizing: border-box;
  padding-bottom: var(--world-dock-height);
}
#local-app {
  font:
    14px/1.5 system-ui,
    sans-serif;
  color: #eee8dc;
}
#local-app * {
  box-sizing: border-box;
  user-select: text;
  -webkit-user-select: text;
}
#local-app button,
#local-app input,
#local-app select {
  font: inherit;
}
#local-app button {
  cursor: pointer;
  border: 1px solid #686149;
  border-radius: 7px;
  background: #282b26;
  color: #fff2d4;
  padding: 10px 16px;
  font-weight: 650;
}
#local-app button:hover {
  background: #3c4236;
}
#local-app button:disabled {
  opacity: 0.5;
  cursor: wait;
}
#local-app input,
#local-app select {
  display: block;
  width: 100%;
  border: 1px solid #494b43;
  border-radius: 6px;
  padding: 10px 12px;
  background: #111614;
  color: #fff;
  outline-offset: 3px;
}
#local-app input:focus {
  outline: 2px solid #bba571;
}
#local-app label {
  display: block;
  margin: 12px 0 6px;
  color: #d5d0c4;
}
#local-app p {
  margin: 8px 0 16px;
}
#local-app h1 {
  font:
    36px Georgia,
    serif;
  margin: 4px 0 12px;
  color: #f3e1b8;
}
#local-app h2 {
  font:
    22px Georgia,
    serif;
  margin: 0 0 12px;
  color: #f3e1b8;
}
#local-app .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: #b7a16d;
}
#local-app .muted {
  color: #a7aca4;
  font-size: 12px;
}
#local-app .primary {
  background: #ac945d;
  color: #141811;
  border-color: #c5ac74;
}
#local-app .primary:hover {
  background: #cbb279;
}
#local-app .row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#local-app .row > * {
  flex: 1;
}
#local-app .full {
  width: 100%;
  margin-top: 16px;
}
#local-app .divider {
  height: 1px;
  background: #3a4036;
  margin: 24px 0;
}
#local-app .hidden {
  display: none !important;
}
#local-app .link {
  border: 0;
  background: none;
  color: #d8c393;
  padding: 6px;
}
#local-app .toolbar {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px;
  background: #101712dd;
  border: 1px solid #495342;
  border-radius: 8px;
}
#local-app .toolbar button {
  font-size: 12px;
  padding: 5px 10px;
}
#local-app .toolbar output {
  font-size: 11px;
  padding-right: 8px;
  max-width: 220px;
}
#local-app .shade {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #070d08cc;
  backdrop-filter: blur(7px);
  overflow: auto;
}
#local-app .panel {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 30px;
  background: linear-gradient(135deg, #202920, #111914);
  border: 1px solid #626b4c;
  border-radius: 16px;
  box-shadow: 0 30px 100px #000b;
}
#local-app .close {
  position: absolute;
  right: 14px;
  top: 12px;
  font-size: 20px;
  background: none;
  border: 0;
  padding: 0 8px;
}
#local-app .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
#local-app .box {
  padding: 18px;
  border: 1px solid #3f4a37;
  border-radius: 10px;
  background: #10171177;
}
#local-app .pill {
  border: 1px solid #5c6953;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: #c8d6b5;
}
#local-app .message {
  border-radius: 7px;
  background: #363525;
  color: #eee0ac;
  padding: 11px 14px;
  margin-top: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#local-app .message:empty {
  display: none;
}
#local-app .error {
  background: #432b27;
  color: #ffd3c0;
}
#local-app .character {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  gap: 16px;
  border-bottom: 1px solid #33402f;
}
#local-app .character button {
  padding: 7px 15px;
}
#local-app .wallet-address {
  overflow-wrap: anywhere;
  font-family: monospace;
  font-size: 12px;
  color: #c7d4bc;
}
#local-app .balance {
  font-size: 27px;
  margin: 10px 0;
  color: #e5d3a4;
}
#local-app .tx-list {
  list-style: none;
  padding: 0;
  font-size: 12px;
  max-height: 150px;
  overflow: auto;
}
#local-app a {
  color: #d4c096;
}
#local-app .tx-list li {
  padding: 6px 0;
  border-bottom: 1px solid #36402f;
}
#local-app .roster {
  font-size: 12px;
  color: #bdc9b4;
}
#local-app .chat-dock {
  position: fixed;
  inset: auto 0 0;
  z-index: 9000;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(200px, 480px) auto;
  align-items: center;
  gap: 8px;
  padding: 8px max(12px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border-top: 1px solid #59634d;
  background: #101812;
}
#local-app .chat-dock input {
  min-width: 0;
  padding: 7px 10px;
  font-size: 12px;
}
#local-app .chat-dock.hidden {
  /* Keep the canvas size stable while the game interfaces load at sign-in. */
  display: grid !important;
  visibility: hidden;
  pointer-events: none;
}
#local-app .chat-dock button {
  padding: 7px 10px;
  font-size: 12px;
}
#local-app .contract-address {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 12px;
  color: #d8c393;
}
#local-app .contract-address strong {
  flex: none;
  letter-spacing: 0.04em;
}
#local-app [data-contract-address] {
  display: block;
  min-height: 24px;
  width: min(100%, 44ch);
  padding: 2px 8px;
  border: 1px solid #354332;
  border-radius: 4px;
  background: #0c120e;
  font: 11px/18px monospace;
  overflow-wrap: anywhere;
}
#local-app .login-contract {
  margin: 0 0 20px;
}
#local-app .review {
  border: 1px solid #ab8d4e;
  padding: 14px;
  border-radius: 8px;
  overflow-wrap: anywhere;
  margin-top: 12px;
}
#local-app .signed-message {
  max-height: 160px;
  overflow: auto;
  font: 11px/1.5 monospace;
  white-space: pre-wrap;
  background: #0c130e;
  padding: 12px;
  border: 1px solid #414d36;
}
#local-app details {
  margin-top: 16px;
}
#local-app summary {
  cursor: pointer;
  color: #c8bb96;
}
#local-app .chat-log {
  max-height: 90px;
  overflow: auto;
  font-size: 12px;
  margin: 8px 0;
  color: #c4cfbb;
}
#local-app .chat-log p {
  margin: 2px 0;
}
#local-app .loading-text {
  font-size: 11px;
  color: #acb799;
  margin-top: 12px;
}
#local-app #game-status[data-state="ready"] {
  color: #c0e2a6;
}
#local-app .world-notice {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 36px);
  padding: 12px 18px;
  border: 1px solid #ab8d4e;
  border-radius: 8px;
  background: #152015f2;
  color: #eee2bf;
  z-index: 9001;
  pointer-events: none;
}
@media (max-width: 650px) {
  #local-app .chat-dock {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
  }
  #local-app .chat-dock .contract-address {
    grid-column: 1 / -1;
  }
  #local-app .grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  #local-app .panel {
    padding: 24px 18px;
  }
  #local-app h1 {
    font-size: 29px;
  }
  #local-app .shade {
    padding: 12px;
  }
  #local-app .toolbar output {
    max-width: 150px;
  }
  #local-app .panel {
    max-height: calc(100dvh - 24px);
  }
}

/* The title art and type are decoded from the original, verified game cache. */
#title-boot, #local-app .title-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(84px, calc(env(safe-area-inset-top) + 68px)) 24px 72px;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scroll-padding-top: 84px;
  background: #5c6b62;
  backdrop-filter: none;
  isolation: isolate;
  font: 16px/1.35 "DegenHaus Classic", Georgia, serif;
  color: #fff;
  text-shadow: 1px 1px #000;
  box-sizing: border-box;
}
.title-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.title-backdrop::before, .title-backdrop::after {
  content: "";
  position: absolute;
  top: 50%;
  width: max(50vw, 76.14vh);
  height: max(100vh, 65.666vw);
  background: url("/local/title/doorway.jpg") center / 100% 100% no-repeat;
  image-rendering: pixelated;
}
.title-backdrop::before { right: 50%; transform: translateY(-50%); }
.title-backdrop::after { left: 50%; transform: translateY(-50%) scaleX(-1); }
.title-stage {
  width: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}
.title-logo {
  display: block;
  width: min(444px, 100%);
  height: auto;
  flex-shrink: 0;
  image-rendering: pixelated;
}
.title-ca {
  position: fixed;
  z-index: 2;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(440px, calc(100% - 32px));
  min-height: 46px;
  padding: 8px 18px;
  box-sizing: border-box;
  border: 6px solid transparent;
  border-image: url("/local/title/titlebutton.png") 8 fill / 8px stretch;
  color: #ffff69;
  font: 700 16px/1 "DegenHaus Classic", Georgia, serif;
  text-shadow: 1px 1px #000;
}
.title-ca span {
  display: block;
  min-width: 0;
  min-height: 22px;
  flex: 1;
  border: 1px solid #1b1b21;
  box-shadow: inset 1px 1px 3px #0008, 0 1px #797b8066;
  background: #17181c88;
  padding: 4px 8px;
  color: #e9e5d4;
  overflow-wrap: anywhere;
  font: 11px/1.35 monospace;
}
#title-boot .title-panel, #local-app .title-panel {
  position: relative;
  width: min(360px, 100%);
  min-height: 200px;
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 48px 26px 36px;
  border: 0;
  border-image: url("/local/title/titlebox.png") 30 fill / 30px stretch;
  border-radius: 0;
  background: none;
  box-shadow: none;
  box-sizing: border-box;
  text-align: center;
}
#local-app .title-panel[data-view="welcome"] { padding-top: 62px; }
#title-boot h1, #local-app .title-panel h1 {
  margin: 0 0 18px;
  color: #ffff00;
  font: 700 16px/1.25 "DegenHaus Classic", Georgia, serif;
}
#local-app .title-panel h2 {
  font: 700 16px/1.25 "DegenHaus Classic", Georgia, serif;
  color: #ffff69;
  margin-bottom: 12px;
}
#local-app .title-panel button {
  min-height: 41px;
  padding: 8px 12px;
  border: 0;
  border-image: url("/local/title/titlebutton.png") 8 fill / 8px stretch;
  border-radius: 0;
  background: none;
  color: #fff;
  font: 700 16px/1.2 "DegenHaus Classic", Georgia, serif;
  text-shadow: 1px 1px #000;
}
#local-app .title-panel button:hover { filter: brightness(1.2); color: #ffff69; }
#local-app .title-panel button:active { filter: brightness(.9); }
#local-app .title-panel button:focus-visible {
  outline: 2px solid #f1d975;
  outline-offset: 3px;
}
#local-app .title-panel button.link {
  border-image: none;
  background: none;
  color: #e5d7a6;
  font-weight: 400;
  min-height: 32px;
}
#local-app .title-panel button.link:hover { text-decoration: underline; }
#local-app .welcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#local-app .welcome-actions button { padding: 8px 6px; white-space: nowrap; }
#title-boot progress, #local-app .title-panel progress {
  display: block;
  appearance: none;
  width: 100%;
  height: 20px;
  border: 3px double #928775;
  background: #18191d;
  padding: 2px;
  accent-color: #b89550;
  box-sizing: border-box;
}
#title-boot progress::-webkit-progress-bar, #local-app .title-panel progress::-webkit-progress-bar { background: #18191d; }
#title-boot progress::-webkit-progress-value, #local-app .title-panel progress::-webkit-progress-value { background: linear-gradient(#d1b575, #8a6332); }
#title-boot progress::-moz-progress-bar, #local-app .title-panel progress::-moz-progress-bar { background: #b89550; }
#title-boot progress:indeterminate, #local-app .title-panel progress:indeterminate {
  background: repeating-linear-gradient(110deg, #18191d 0 12px, #866537 12px 24px);
}
#title-boot .boot-status, #local-app .title-panel .loading-text {
  margin: 14px 0 0;
  font: 400 16px/1.35 "DegenHaus Classic", Georgia, serif;
  color: #e3dfce;
}
#local-app .wide-title .title-logo { width: min(360px, 80%); }
#local-app .wide-title .title-panel {
  width: min(660px, 100%);
  padding: 32px;
  text-align: left;
}
#local-app .wide-title h1 { text-align: center; margin-bottom: 24px; }
#local-app .title-panel .title-back { position: absolute; top: 20px; left: 22px; padding: 0 8px; }
#local-app .title-panel .grid { gap: 26px; }
#local-app .title-panel .box {
  padding: 18px;
  border-radius: 0;
  border: 1px solid #15161b;
  box-shadow: inset 0 1px #74778166, 0 1px #74778166;
  background: #191b2380;
}
#local-app .title-panel .muted { color: #d0cfc7; font-size: 16px; line-height: 1.35; }
#local-app .title-panel label { color: #ddd4b6; margin: 10px 0 5px; }
#local-app .title-panel input, #local-app .title-panel select {
  font: 16px/1.3 "DegenHaus Classic", Georgia, serif;
  border-radius: 0;
  border: 1px solid #14151a;
  border-bottom-color: #666875;
  background: #171920da;
  box-shadow: inset 1px 1px 4px #0007;
  color: #fff;
  min-height: 39px;
  padding: 8px 10px;
}
#local-app .title-panel input::placeholder { color: #92969d; opacity: 1; }
#local-app .title-panel .pill { border-radius: 0; border-color: #6e6651; color: #dbc890; font-size: 14px; }
#local-app .title-panel .full { margin-top: 14px; }
#local-app .title-panel .character { border-bottom-color: #66666b; }
#local-app .title-panel .message { border-radius: 0; border: 1px solid #85764f; background: #24232be8; color: #e9dbb2; font-size: 16px; }
#local-app .title-panel .message.error { border-color: #aa6d60; color: #ffb4a0; }
#local-app .title-panel[data-view="loading"] .message:not(.error) { display: none; }
#local-app .title-panel .close { z-index: 1; top: 16px; right: 16px; width: 30px; min-height: 30px; padding: 2px; font-size: 24px; }
#local-app:not(.in-world) .toolbar { visibility: hidden; }
#local-app.in-world .title-screen { background: #070a0ddd; }
#local-app.in-world .title-backdrop { display: none; }
#local-app.in-world .title-logo { width: min(280px, 70%); }
@media (max-width: 650px) {
  #title-boot, #local-app .title-screen { padding: 84px 16px 32px; }
  #local-app .wide-title .title-panel { padding: 54px 24px 30px; }
  #local-app .wide-title h1 { margin-bottom: 20px; }
  #local-app .title-panel .grid { gap: 24px; }
  #local-app .title-panel .box { padding: 16px; }
  #local-app .title-panel .title-back { top: 18px; }
  #local-app .title-panel .row { gap: 8px; }
  #local-app .wide-title .title-logo { width: min(300px, 90%); }
}
@media (max-width: 360px) {
  #local-app .welcome-actions { gap: 8px; }
  #local-app .title-panel[data-view="welcome"] { padding-inline: 20px; }
}
