:root {
  color-scheme: dark;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: #e8e6df;
  background: #111825;
  font-size: 13px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 0, #29354b, transparent 60%);
}
header {
  height: 64px;
  border-bottom: 1px solid #394254;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(20px, calc((100% - 1160px) / 2));
  background: #111824a6;
}
a {
  color: #d6c197;
  text-decoration: none;
}
header span {
  font-size: 11px;
  color: #9aa7bb;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 34px 20px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #cbb182;
}
h1 {
  font-size: 27px;
  margin: 9px 0 18px;
}
h2 {
  font-size: 17px;
  color: #d9c69f;
  margin: 8px 0 18px;
}
.notice {
  line-height: 1.9;
  color: #bac1cc;
  max-width: 1000px;
}
#counts {
  font-size: 12px;
  color: #a7b4c5;
  margin: 20px 0;
}
button,
select,
input {
  font: inherit;
}
button,
select,
input[type="number"] {
  color: inherit;
  border: 1px solid #58667c;
  background: #243146;
  border-radius: 3px;
  padding: 8px 10px;
}
button {
  cursor: pointer;
}
button:hover {
  background: #3a4a63;
}
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
audio:focus-visible {
  outline: 2px solid #d7bb81;
  outline-offset: 3px;
}
nav {
  display: flex;
  gap: 7px;
  margin: 25px 0 0;
  border-bottom: 1px solid #536078;
  padding-bottom: 8px;
}
nav button {
  min-width: 125px;
}
nav button[aria-selected="true"] {
  border-color: #c9b080;
  background: #a18a5f2e;
  color: #f1d7a0;
}
section {
  background: #1b2535;
  border: 1px solid #3e4c62;
  padding: 20px;
  border-top: 0;
}
[hidden] {
  display: none !important;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #bac6d8;
}
.controls select {
  max-width: min(350px, 65vw);
  font-size: 12px;
}
.controls input[type="number"] {
  width: 60px;
  padding: 7px;
}
.hint {
  font-size: 11px;
  color: #9caabd;
  line-height: 1.9;
  margin: 17px 0;
}
.map-scroll {
  height: 600px;
  max-height: 65vh;
  overflow: auto;
  background: #111820;
  border: 1px solid #465269;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.map-scroll canvas {
  flex-shrink: 0;
  image-rendering: pixelated;
  display: block;
}
.sprite-stage,
.ui-stage {
  background-color: #161e2c;
  background-image:
    linear-gradient(45deg, #ffffff07 25%, transparent 25%),
    linear-gradient(-45deg, #ffffff07 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ffffff07 75%),
    linear-gradient(-45deg, transparent 75%, #ffffff07 75%);
  background-size: 24px 24px;
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
  border: 1px solid #465269;
  overflow: auto;
}
.sprite-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
  image-rendering: pixelated;
}
.frame-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 19px 0;
  font-size: 11px;
}
.frame-control input {
  width: min(100%, 600px);
}
.frame-control output {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #dac497;
}
.status {
  color: #c9bd9e;
  font-size: 11px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  min-height: 20px;
}
details {
  margin-top: 12px;
  font-size: 11px;
  color: #acb9cb;
}
summary {
  cursor: pointer;
  padding: 8px 0;
}
pre {
  font: 10px/1.7 monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #121c2b;
  padding: 14px;
  max-height: 250px;
  overflow: auto;
}
.media-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 25px;
}
.media-grid article {
  min-width: 0;
}
.ui-stage {
  height: 410px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
}
.ui-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
audio {
  width: 100%;
  margin: 20px 0;
}
#error {
  padding: 13px 16px;
  background: #693d3d4d;
  border: 1px solid #a76464;
  color: #ffd2c6;
  line-height: 1.8;
}
@media (max-width: 760px) {
  main {
    padding: 24px 12px;
  }
  h1 {
    font-size: 23px;
  }
  header {
    height: 55px;
    padding: 0 14px;
    font-size: 11px;
  }
  .notice {
    font-size: 11px;
  }
  nav {
    gap: 5px;
  }
  nav button {
    min-width: 0;
    flex: 1;
    font-size: 11px;
    padding: 9px;
  }
  section {
    padding: 13px;
  }
  .controls {
    gap: 10px;
  }
  .controls label {
    font-size: 10px;
    flex-wrap: wrap;
  }
  .controls select {
    max-width: 76vw;
    font-size: 11px;
  }
  .media-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .map-scroll {
    height: 440px;
  }
  .ui-stage {
    height: 300px;
  }
  .hint {
    font-size: 10px;
  }
  .frame-control {
    gap: 7px;
  }
  .frame-control output {
    font-size: 10px;
  }
  .status {
    font-size: 10px;
  }
  #counts {
    font-size: 11px;
    line-height: 1.8;
  }
}
