@font-face {
  font-family: Game;
  src: url("/pixel.ttf");
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #91bed6;
  color: #fff2cc;
  font-family: Game, ui-monospace, monospace;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
body:has(#menu:not([hidden])):before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(transparent 25%, #13292465 75%, #10241dc2);
}
.panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 27em);
  padding: clamp(0.55rem, 3vh, 1.6rem);
  background: #243a30f5;
  box-shadow:
    0 0 0 3px #16261e,
    0 0 0 6px #749274,
    0 8px 0 6px #14221c;
  display: grid;
  gap: clamp(0.25rem, 1vh, 0.75rem);
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(1.45rem, 5vw, 2.55rem);
  text-shadow: 3px 3px #15261d;
}
h1 em {
  color: #f3be67;
  font-style: normal;
}
p {
  line-height: 1.45;
  font-size: clamp(0.72rem, 2.5vh, 1rem);
}
button,
input {
  font: inherit;
  color: #fff3d8;
  border: 2px solid #14241c;
  background: #526948;
  box-shadow:
    inset 0 2px #8ba079,
    inset 0 -2px #324632;
  padding: clamp(0.24rem, 1.2vh, 0.68rem);
  cursor: pointer;
  text-align: left;
}
button:hover,
button:focus-visible {
  outline: 3px solid #ffe199;
  background: #657b4f;
}
button:disabled {
  opacity: 0.5;
}
button:active {
  transform: translateY(1px);
}
[hidden] {
  display: none !important;
}
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  font-size: clamp(0.7rem, 2vw, 0.95rem);
  text-shadow: 1px 2px #192a28;
}
#stats,
#save,
#belt {
  position: absolute;
  background: #15261fd9;
  padding: 0.45em 0.7em;
}
#stats {
  top: 1em;
  left: 1em;
}
#save {
  top: 1em;
  right: 1em;
}
#reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.35rem;
}
#belt {
  bottom: 1em;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid #ccb47c;
}
.row,
#grid {
  display: grid;
  grid-auto-flow: column;
  gap: 0.35em;
  align-items: center;
}
#grid {
  grid-auto-flow: row;
  grid-template-columns: 1fr 1fr;
}
.row button {
  text-align: center;
}
#page {
  text-align: center;
}
input {
  width: 100%;
  min-width: 0;
}
#menu button:first-of-type {
  background: #657a43;
}
@media (max-height: 360px) {
  .panel {
    font-size: 0.76rem;
    gap: 0.2rem;
  }
  #grid button {
    padding: 0.14rem;
  }
}
