:root {
  color-scheme: dark;
  font:
    15px "Trebuchet MS",
    system-ui,
    sans-serif;
  color: #ebeadf;
  background: #0c111a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 65% 22%, #1c2937, transparent 62%), #0c111a;
  min-height: 100vh;
}
main {
  max-width: 1220px;
  padding: 0 4vw 32px;
  margin: auto;
}
header,
.brand,
.status,
.ledger,
.chat-head,
form,
.location {
  display: flex;
  align-items: center;
}
header,
.chat-head {
  justify-content: space-between;
}
header {
  padding: 19px 0 15px;
}
.brand {
  gap: 10px;
}
.mark {
  color: #edb56e;
  font-size: 29px;
}
h1,
h2,
.location strong {
  font-family: Georgia, serif;
}
h1 {
  font-size: clamp(20px, 3vw, 32px);
  letter-spacing: -0.045em;
  margin: 0;
}
h2 {
  font-size: 20px;
  margin: 0;
}
.status {
  gap: 7px;
  color: #b6c4be;
  font-size: 12px;
}
.status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #99ba78;
}
.game,
.chat,
.panel {
  border: 1px solid #38404b;
  background: #141c26;
  border-radius: 11px;
  overflow: hidden;
}
.scene {
  position: relative;
  aspect-ratio: 16/8.5;
  background: #141d36;
  isolation: isolate;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
.location {
  position: absolute;
  left: 2.6%;
  top: 5%;
  gap: 9px;
  background: #101525ce;
  padding: 8px 14px 8px 9px;
  border: 1px solid #8d805c77;
  border-radius: 6px;
}
.location strong,
.location small {
  display: block;
}
.location strong {
  font-size: 20px;
  line-height: 1.1;
}
.location small,
.hint,
.chat-head label {
  font-size: 12px;
  color: #b8c1c4;
}
.moon {
  font: 32px Georgia;
  color: #e6c38a;
}
.tag {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 4px 8px;
  line-height: 1.05;
  color: #fff0c9;
  background: #171b25ed;
  border: 1px solid #c0ab79;
  border-radius: 4px;
  font-weight: 700;
  font-size: clamp(10px, 1.2vw, 14px);
  box-shadow: 0 2px 4px #06080eb0;
}
.tag:after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  height: 8px;
  border-left: 1px solid #ffe0a3;
}
.tag.bridge { transform: translate(-50%, 0); }
.tag.bridge:after { top: auto; bottom: 100%; }
.tag span {
  color: #dfc18f;
  margin-left: 5px;
}
.tag.mine {
  outline: 2px solid #f5c677;
}
.ledger {
  gap: 24px;
  padding: 11px 15px;
  color: #c6c9c6;
  font-size: 13px;
  border-top: 1px solid #363938;
}
.ledger b {
  color: #faf1d1;
}
.pip {
  width: 8px;
  height: 9px;
  display: inline-block;
  margin-right: 5px;
  transform: rotate(25deg);
  border-radius: 45%;
}
.berry {
  background: #db5e59;
}
.seed {
  background: #e3b263;
}
button {
  cursor: pointer;
  border: 1px solid #45505b;
  background: #24303a;
  color: #f4efdf;
  border-radius: 5px;
  padding: 8px 12px;
  font: inherit;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:hover:enabled {
  border-color: #c5aa72;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #f8cb78;
}
.ledger button {
  margin-left: auto;
  font-size: 12px;
}
.chat {
  margin-top: 12px;
  padding: 14px 16px;
}
.chat-head label {
  cursor: pointer;
}
#log {
  margin: 8px 0;
  height: 72px;
  overflow: auto;
  scrollbar-width: thin;
  font-size: 14px;
}
#log p {
  margin: 3px 0;
  overflow-wrap: anywhere;
}
#log b {
  color: #e1be87;
  margin-right: 7px;
}
#log .command {
  color: #b2c0ae;
  font-size: 12px;
}
form {
  gap: 7px;
}
input,
select {
  font: inherit;
  border: 1px solid #46505a;
  border-radius: 5px;
  background: #101721;
  color: #eee8dc;
  padding: 9px;
  min-width: 0;
}
#name {
  width: 17%;
  max-width: 145px;
}
#message {
  flex: 1;
}
form button,
.primary {
  background: #d7af72;
  color: #201b16;
  font-weight: 700;
}
.hint {
  display: block;
  margin-top: 6px;
}
#notice {
  position: absolute;
  bottom: 3%;
  left: 50%;
  transform: translateX(-50%);
  color: #ffe8bb;
  text-align: center;
  background: #151925ec;
  border-radius: 6px;
  margin: 0;
  padding: 6px 12px;
}
#notice:empty {
  display: none;
}
.panel {
  padding: 20px;
  margin: 14px 0;
}
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin: 16px 0;
}
.controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.controls input[type="checkbox"] {
  align-self: flex-start;
}
.modline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
}
.modline span {
  flex: 1;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  main {
    padding: 0 8px 15px;
  }
  header {
    padding: 10px 2px;
  }
  .scene {
    aspect-ratio: 1.65;
  }
  .ledger {
    gap: 10px;
    font-size: 11px;
    padding: 8px;
  }
  .location {
    padding: 4px 7px;
    gap: 4px;
  }
  .location strong {
    font-size: 14px;
  }
  .location small {
    font-size: 10px;
  }
  .moon {
    font-size: 21px;
  }
  .chat {
    padding: 10px;
  }
  .chat-head label {
    font-size: 11px;
  }
  #name {
    width: 23%;
  }
  form {
    gap: 4px;
  }
  form input {
    font-size: 14px;
    padding: 9px 5px;
  }
  .tag {
    padding: 3px 4px;
  }
  #notice {
    font-size: 11px;
  }
}
@media (min-width: 900px) and (min-height: 650px) {
  main {
    max-width: min(1220px, calc((100svh - 305px) * 1.88 + 8vw));
  }
}
