@font-face {
  font-family: PixelMix;
  src: url("assets/pixelmix.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #080503;
  color: #fff7cf;
  font-family: PixelMix, ui-monospace, monospace;
  letter-spacing: 0;
}

body {
  display: grid;
  place-items: center;
}

.game-shell {
  position: relative;
  width: min(100vw, calc(100vh * 1.7777778));
  max-width: 1280px;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  background: #000;
  outline: 0;
}

.hud {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  pointer-events: none;
}

.hud > div {
  min-height: 38px;
  padding: 6px 8px;
  border: 2px solid #1f1308;
  background: rgba(8, 5, 3, 0.78);
  box-shadow: inset 0 0 0 2px rgba(255, 181, 38, 0.18);
}

.hud span {
  display: block;
  margin-bottom: 3px;
  color: #ffb526;
  font-size: clamp(8px, 1.05vw, 12px);
  text-transform: uppercase;
}

.hud strong {
  display: block;
  overflow: hidden;
  color: #fff7cf;
  font-size: clamp(10px, 1.4vw, 16px);
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.touch-controls {
  position: absolute;
  inset: auto 12px 58px auto;
  z-index: 3;
  display: none;
  grid-template-columns: 44px 44px 52px 44px;
  gap: 8px;
}

.touch-controls button {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid #ffb526;
  border-radius: 6px;
  background: rgba(17, 11, 5, 0.82);
  color: #ffb526;
  font: 400 22px PixelMix, monospace;
  touch-action: none;
}

.touch-controls button[data-control="pour"] {
  color: #ffffff;
  background: rgba(173, 24, 14, 0.86);
}

.touch-controls button[data-control="show"] {
  color: #1a0d03;
  background: rgba(255, 181, 38, 0.9);
}

@media (pointer: coarse), (max-width: 760px) {
  .touch-controls {
    display: grid;
  }
}
