:root {
  color-scheme: dark;
  font-family: Arial, 'Malgun Gothic', sans-serif;
  color: #d6dbcf;
  background: #111511;
  font-size: 14px;
  line-height: 1.65;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
select,
input {
  font: inherit;
}
button,
select {
  color: #dce4d4;
  background: #262e24;
  border: 1px solid #4a5845;
  border-radius: 3px;
  min-height: 38px;
  padding: 6px 12px;
}
button {
  cursor: pointer;
}
button:hover {
  background: #364430;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid #b6d87b;
  outline-offset: 3px;
}
button:disabled,
input:disabled {
  opacity: 0.4;
  cursor: default;
}
select {
  max-width: 100%;
  width: 100%;
  margin-top: 4px;
}
a {
  color: #bfd99b;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.top {
  display: flex;
  gap: 26px;
  align-items: center;
  max-width: 1500px;
  margin: auto;
  padding: 22px 32px;
  border-bottom: 1px solid #30392b;
}
.back {
  white-space: nowrap;
}
.eyebrow {
  font: 10px monospace;
  letter-spacing: 2px;
  color: #8b9b7b;
  margin: 0;
}
h1 {
  font-size: 24px;
  letter-spacing: 1px;
  margin: 3px 0 0;
}
.badge {
  font-size: 11px;
  border: 1px solid #4b5b39;
  color: #b6d28d;
  padding: 4px 10px;
  margin-left: auto;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 20px 32px;
}
.notice {
  background: #1f271b;
  border-left: 3px solid #8aab60;
  padding: 12px 16px;
  font-size: 12px;
  color: #b2bf9f;
}
.tabs {
  display: flex;
  gap: 2px;
  margin: 20px 0 0;
  border-bottom: 1px solid #566247;
}
.tabs button {
  border-radius: 0;
  border-bottom: 0;
  border-color: transparent;
  background: transparent;
  min-width: 170px;
  color: #8f9b84;
  padding: 12px 16px;
}
.tabs button[aria-selected='true'] {
  border-color: #566247;
  background: #20281c;
  color: #d5e9b3;
}
.tabs span {
  font: 11px monospace;
  color: #a2be7d;
  margin-left: 6px;
}
.panel {
  border: 1px solid #3d4834;
  border-top: 0;
  padding: 16px;
  background: #171d15;
}
.toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar label {
  font-size: 11px;
  color: #9aa98b;
  min-width: 130px;
}
.toolbar select {
  min-width: 160px;
}
.toolbar .zoom-label {
  min-width: 120px;
}
.toolbar input[type='range'] {
  display: block;
  max-width: 170px;
}
.grow {
  flex: 1;
  max-width: 520px;
}
.toolbar > span {
  font: 12px monospace;
  color: #a4b58e;
  align-self: center;
}
input[type='range'] {
  accent-color: #b8ce83;
  width: 100%;
  cursor: pointer;
}
.canvas-wrap {
  position: relative;
  height: 65vh;
  min-height: 300px;
  max-height: 800px;
  overflow: hidden;
  border: 1px solid #46523b;
  background: #060806;
}
canvas {
  display: block;
}
.canvas-wrap canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.canvas-wrap canvas:active {
  cursor: grabbing;
}
.canvas-tip {
  position: absolute;
  bottom: 8px;
  left: 10px;
  background: #10170ed9;
  padding: 3px 8px;
  color: #aabf92;
  font-size: 11px;
  pointer-events: none;
}
.info {
  font: 11px/1.8 monospace;
  color: #a5b195;
  overflow-wrap: anywhere;
  margin: 10px 0;
}
.sprite-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
}
.sprite-stage {
  height: 510px;
  overflow: hidden;
  border: 1px solid #46523b;
  background-color: #161b16;
  background-image:
    linear-gradient(45deg, #252d2566 25%, transparent 25%),
    linear-gradient(-45deg, #252d2566 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #252d2566 75%),
    linear-gradient(-45deg, transparent 75%, #252d2566 75%);
  background-size: 24px 24px;
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
}
.sprite-stage canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.sprite-controls {
  background: #20271c;
  padding: 18px;
}
.sprite-controls > label {
  display: block;
  margin: 0 0 20px;
  font-size: 12px;
  color: #b7c4a6;
}
.sprite-controls strong {
  float: right;
  color: #d9e6c3;
  font-family: monospace;
}
.sprite-controls input[type='range'] {
  display: block;
  margin-top: 10px;
}
.sprite-controls p {
  font-size: 11px;
  color: #8f9c82;
}
.sprite-controls .check {
  display: flex;
  gap: 8px;
  align-items: center;
}
.reference-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.reference-grid label,
details > label {
  display: block;
  font-size: 12px;
  color: #a8b697;
}
.reference-stage {
  margin-top: 14px;
  background: #080c08;
  padding: 14px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #46523b;
}
.reference-stage img {
  max-width: 100%;
  width: 700px;
  max-height: 540px;
  object-fit: contain;
  image-rendering: pixelated;
}
article {
  max-height: 570px;
  overflow: auto;
  background: #21281d;
  border: 1px solid #46523b;
  padding: 20px;
  margin-top: 14px;
  white-space: pre-wrap;
  color: #c6cfba;
  line-height: 1.9;
}
details {
  border-top: 1px solid #3b4632;
  padding-top: 10px;
  color: #9eac8d;
  font-size: 12px;
  margin-top: 16px;
}
summary {
  cursor: pointer;
  color: #c0d2a4;
}
details p {
  max-width: 1100px;
}
.muted {
  font-size: 12px;
  color: #8e9c7e;
}
audio {
  display: block;
  width: min(500px, 100%);
  margin-top: 12px;
}
footer {
  max-width: 1500px;
  margin: auto;
  padding: 20px 32px 30px;
  font: 10px/1.8 monospace;
  color: #66755a;
}
.error {
  background: #44251e;
  color: #f1c4ad;
  border: 1px solid #8a5343;
  padding: 14px;
}
.error[hidden],
[hidden] {
  display: none !important;
}
#unavailable {
  padding: 50px 20px;
  border: 1px solid #4e5b41;
  margin-top: 22px;
}
#unavailable h2 {
  font-size: 21px;
}
#unavailable p {
  max-width: 720px;
  color: #a5b195;
}
@media (max-width: 760px) {
  .top {
    padding: 16px;
    gap: 14px;
    flex-wrap: wrap;
  }
  .top .badge {
    display: none;
  }
  h1 {
    font-size: 21px;
  }
  main {
    padding: 14px;
  }
  .notice {
    padding: 10px;
    font-size: 11px;
  }
  .tabs {
    overflow-x: auto;
  }
  .tabs button {
    min-width: 120px;
    font-size: 12px;
    padding: 10px 8px;
  }
  .panel {
    padding: 10px;
  }
  .toolbar {
    gap: 7px;
  }
  .toolbar label {
    flex: 1;
    min-width: 120px;
  }
  .toolbar button {
    padding: 5px 9px;
  }
  .toolbar .zoom-label {
    min-width: 90px;
  }
  .canvas-wrap {
    height: 60vh;
    min-height: 300px;
  }
  .sprite-layout,
  .reference-grid {
    grid-template-columns: 1fr;
  }
  .sprite-stage {
    height: 360px;
  }
  .sprite-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
  }
  .sprite-controls > label {
    margin: 0;
  }
  .sprite-controls p {
    grid-column: 1/-1;
    margin: 0;
  }
  .reference-stage {
    min-height: 240px;
    padding: 8px;
  }
  article {
    max-height: 400px;
  }
  footer {
    padding: 16px;
    font-size: 9px;
  }
  .back {
    font-size: 12px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
}
