:root {
  font-family: Arial, "Malgun Gothic", sans-serif;
  color: #253a37;
  background: #dde5de;
  font-synthesis: none;
  --ink: #24443b;
  --green: #2b6553;
  --line: #a9b8a5;
  --paper: #f4f2db;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 20% 0, #f2f1df 0, transparent 55%),
    linear-gradient(145deg, #e2e9de, #c4d9cf);
  min-height: 100vh;
}
button,
input,
a {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: var(--ink);
  border: 1px solid #9aaa92;
  border-top-color: #fdfdec;
  border-left-color: #fdfdec;
  background: linear-gradient(#fbfae7, #dfe4cb);
  box-shadow: 1px 1px 0 #81937e;
  border-radius: 3px;
  padding: 7px 12px;
}
button:hover {
  filter: brightness(1.06);
}
button:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 3px solid #de9e38;
  outline-offset: 2px;
}
.shell {
  width: min(1060px, calc(100% - 48px));
  margin: 30px auto;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 18px;
}
.brand {
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -1px;
}
.brand span {
  display: block;
  font-size: 9px;
  letter-spacing: 1.9px;
  font-weight: 500;
  margin-top: 5px;
  color: #6b8275;
}
.build-tag {
  font-size: 11px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #637b6f;
}
.build-tag b {
  border: 1px solid #afc3b4;
  border-radius: 3px;
  padding: 5px 8px;
  font-size: 10px;
  letter-spacing: 1px;
}
.game-window {
  border: 3px solid #5b7863;
  box-shadow:
    0 0 0 1px #2a483b,
    0 16px 42px #456c5830;
  background: var(--paper);
  border-radius: 7px;
  overflow: hidden;
}
.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 42px;
  padding: 0 12px;
  background: linear-gradient(#659075, #37654e);
  border-bottom: 2px solid #254a39;
  color: #f9f8df;
  text-shadow: 1px 1px #2e533e;
}
.titlebar strong {
  font-family: Georgia, serif;
  letter-spacing: 1.5px;
  font-size: 19px;
}
.titlebar i {
  font-style: normal;
  color: #e8ce78;
  font-size: 24px;
  vertical-align: middle;
}
.titlebar strong span {
  font-family: Arial, "Malgun Gothic", sans-serif;
  font-size: 11px;
  letter-spacing: 0;
  margin-left: 9px;
  color: #caddbf;
}
.titlebar > div {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
}
.title-button {
  font-weight: bold;
  padding: 3px 8px;
  color: #ecf1d7;
  background: #31543f;
  border-color: #7e9b76;
  box-shadow: none;
}
.toolbar {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  background: linear-gradient(#f8f7df, #d9dec3);
  font-size: 11px;
  border-bottom: 2px solid #8da087;
}
.toolbar button {
  font-size: 11px;
  padding: 5px 10px;
}
.toolbar a {
  font-size: 10px;
  margin-left: 4px;
  text-decoration: none;
}
.place {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
}
.place > span {
  color: #54815f;
  font-size: 22px;
}
.place b {
  font-size: 12px;
}
#population {
  color: #758368;
  margin-right: 8px;
  white-space: nowrap;
}
.stage {
  position: relative;
  aspect-ratio: 5/3;
  background: #252b27;
  overflow: hidden;
}
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
  image-rendering: pixelated;
}
.stage-top,
.stage-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #f6f8e5;
  text-shadow: 0 1px 2px #183326;
  pointer-events: none;
}
.stage-top {
  top: 12px;
}
.stage-bottom {
  bottom: 10px;
}
.stage-top span,
.stage-bottom span {
  background: #162f2bb3;
  padding: 5px 8px;
  border: 1px solid #cadfc72e;
  border-radius: 3px;
}
.control-strip {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 8px 12px;
  border-top: 2px solid #718d6f;
  border-bottom: 1px solid #acb997;
  background: linear-gradient(#e4e8cd, #f8f5df);
}
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}
.portrait {
  font-size: 30px;
  background: #b4cba5;
  border: 2px solid #758b68;
  border-radius: 50%;
  width: 39px;
  height: 39px;
  text-align: center;
  color: #385e47;
}
.identity strong {
  font-size: 12px;
  display: block;
}
.identity small {
  font-size: 9px;
  color: #73816b;
}
.emotes {
  display: flex;
  gap: 6px;
}
.emotes button {
  padding: 5px 9px;
  font-size: 10px;
}
.movement-note {
  font-size: 9px;
  margin-left: auto;
  color: #7e896f;
}
.chat-panel {
  padding: 9px 12px 11px;
}
.chat-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
}
.chat-heading strong {
  color: #406449;
}
.chat-heading span {
  color: #8a917b;
  font-size: 9px;
}
#chat-log {
  height: 82px;
  overflow-y: auto;
  margin: 7px 0;
  padding: 7px 10px;
  list-style: none;
  background: #fffef0;
  border: 1px solid #bac4a6;
  box-shadow: inset 1px 1px 2px #0000000a;
  font-size: 11px;
  line-height: 1.8;
}
#chat-log li {
  overflow-wrap: anywhere;
}
#chat-log .name {
  color: #2b6d50;
  font-weight: bold;
  margin-right: 8px;
}
#chat-log .system {
  color: #92967e;
}
#chat-form {
  display: flex;
  gap: 7px;
}
input {
  border: 1px solid #b2bea1;
  background: #fffef1;
  border-radius: 2px;
  padding: 8px 10px;
  color: #2d4938;
  min-width: 0;
}
#chat-text {
  flex: 1;
  font-size: 11px;
}
#chat-form button {
  font-size: 11px;
  min-width: 67px;
}
.footnote {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  font-size: 10px;
  color: #748579;
}
.footnote button {
  border: 0;
  box-shadow: none;
  background: none;
  padding: 0;
  color: #5c7869;
  font-size: 10px;
  text-decoration: underline;
}
.toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  background: #203b32ee;
  border: 1px solid #a7c291;
  color: #f6f5db;
  border-radius: 4px;
  font-size: 12px;
  max-width: 90%;
  text-align: center;
  z-index: 3;
}
.joystick {
  display: none;
  position: absolute;
  left: 20px;
  bottom: 35px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid #fff7;
  background: #314c3d55;
  touch-action: none;
}
.joystick span {
  position: absolute;
  width: 40px;
  height: 40px;
  left: 26px;
  top: 26px;
  border: 2px solid #fff8;
  background: #b8d6a999;
  border-radius: 50%;
  pointer-events: none;
}
.interact {
  position: absolute;
  right: 22px;
  bottom: 40px;
  padding: 13px 20px;
  background: #e7e8c3e8;
  border: 2px solid #819875;
}
dialog {
  color: #304d3b;
  border: 3px solid #6e8c6e;
  border-radius: 6px;
  background: #f5f3df;
  padding: 0;
  box-shadow: 0 20px 80px #142d3355;
  max-width: calc(100% - 28px);
}
dialog::backdrop {
  background: #122a28aa;
  backdrop-filter: blur(3px);
}
.entry-dialog {
  width: 410px;
}
.entry-dialog form {
  padding: 30px 32px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.8px;
  color: #7a8c73;
  margin: 0 0 18px;
}
h1 {
  font-size: 42px;
  letter-spacing: -3px;
  color: #3e704c;
  margin: 0 0 22px;
  line-height: 1.1;
}
h1 span {
  display: block;
  font-size: 16px;
  letter-spacing: -0.5px;
  font-weight: 400;
  margin-top: 12px;
  color: #6d8065;
}
#entry-notice {
  font-size: 11px;
  line-height: 1.9;
  color: #6f8066;
  border-top: 1px solid #d1d8bd;
  padding-top: 16px;
}
.entry-dialog label {
  display: block;
  font-size: 11px;
  margin: 20px 0 6px;
}
.entry-dialog input {
  width: 100%;
  font-size: 13px;
  padding: 11px;
}
.primary {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 12px 15px;
  margin-top: 10px;
  background: linear-gradient(#567e50, #376140);
  color: #f6f5d9;
  border-color: #7f9b65;
  box-shadow: 0 2px #2a5135;
  font-weight: bold;
  font-size: 13px;
}
.entry-dialog small {
  display: block;
  font-size: 9px;
  line-height: 1.8;
  color: #8a927c;
  margin-top: 17px;
}
.error {
  color: #af5039;
  font-size: 11px;
  line-height: 1.7;
}
#panel {
  width: 660px;
  max-height: 85vh;
}
.panel-head {
  position: sticky;
  top: 0;
  background: #e3e8c9;
  border-bottom: 1px solid #a4b18e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  z-index: 1;
}
.panel-head h2 {
  margin: 0;
  font-size: 15px;
}
.panel-head button {
  font-size: 20px;
  padding: 0 8px;
}
#panel-body {
  padding: 18px;
  font-size: 12px;
  line-height: 1.9;
}
#panel-body h3 {
  font-size: 13px;
  margin-top: 20px;
}
#panel-body p {
  margin: 6px 0 14px;
}
#panel-body code {
  font-size: 10px;
  overflow-wrap: anywhere;
}
#panel-body .badge {
  display: inline-block;
  font-size: 9px;
  padding: 0 5px;
  color: #486851;
  border: 1px solid #b1c3a1;
  background: #e1e9ce;
  margin-right: 6px;
}
.map-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.map-list button {
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 10px;
}
.map-list small {
  font-size: 9px;
  color: #7d8e70;
}
.appearance-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.appearance-list button {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  min-height: 100px;
}
.appearance-list img {
  height: 65px;
  max-width: 70px;
  object-fit: contain;
  image-rendering: pixelated;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (pointer: coarse) {
  .joystick {
    display: block;
  }
  .stage-bottom #hint {
    display: none;
  }
}
@media (max-width: 700px) {
  .shell {
    width: 100%;
    margin: 0;
  }
  .masthead {
    padding: 13px 13px 0;
    margin-bottom: 13px;
  }
  .brand {
    font-size: 17px;
  }
  .brand span {
    font-size: 7px;
  }
  .build-tag {
    font-size: 9px;
    gap: 5px;
  }
  .build-tag b {
    display: none;
  }
  .game-window {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .titlebar {
    height: 36px;
  }
  .titlebar strong {
    font-size: 17px;
  }
  .titlebar strong span {
    display: none;
  }
  .toolbar {
    gap: 5px;
    flex-wrap: wrap;
    padding: 6px 8px;
  }
  .place {
    min-width: 65%;
    flex: 1;
  }
  .toolbar #population {
    margin: 0;
  }
  .toolbar button {
    flex: 1;
    font-size: 10px;
    padding: 5px 7px;
  }
  .toolbar a {
    font-size: 10px;
    padding: 3px 6px;
  }
  .stage {
    aspect-ratio: 4/3;
  }
  .stage-top,
  .stage-bottom {
    font-size: 8px;
    left: 8px;
    right: 8px;
  }
  .stage-bottom {
    bottom: 7px;
  }
  .control-strip {
    padding: 7px 8px;
    gap: 6px;
  }
  .identity {
    min-width: 110px;
    gap: 6px;
  }
  .portrait {
    width: 29px;
    height: 29px;
    font-size: 22px;
  }
  .identity strong {
    font-size: 10px;
  }
  .emotes {
    gap: 4px;
  }
  .emotes button {
    padding: 6px;
    font-size: 9px;
  }
  .movement-note {
    display: none;
  }
  .chat-panel {
    padding: 8px;
  }
  .chat-heading span {
    font-size: 8px;
  }
  #chat-log {
    height: 76px;
    font-size: 10px;
  }
  #chat-text {
    font-size: 12px;
    padding: 10px;
  }
  .footnote {
    margin: 12px;
    padding: 0 0 16px;
    font-size: 9px;
    gap: 15px;
  }
  .footnote > span {
    max-width: 55%;
  }
  .map-list {
    grid-template-columns: 1fr 1fr;
  }
  .appearance-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .entry-dialog form {
    padding: 25px;
  }
  .joystick {
    width: 80px;
    height: 80px;
    left: 15px;
    bottom: 29px;
  }
  .joystick span {
    left: 18px;
    top: 18px;
  }
  #panel-body {
    font-size: 11px;
    padding: 13px;
  }
}
