@font-face {
  font-family: 'Anybody version';
  src: url(fonts/anybody-version.woff2) format('woff2');
  font-display: swap;
}

:root {
  --field-width: 512px;
  --field-height: 240px;
  --scale: 1;
  --sprite-scale: 1.5;
  --bg: #778899;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  display: grid;
  grid-template-rows: 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  background: var(--bg);
}

#stage {
  position: relative;
  width: var(--field-width);
  height: var(--field-height);
  transform: scale(var(--scale));
}

img {
  display: block;
  image-rendering: pixelated;
  -webkit-user-drag: none;
  user-select: none;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 1px dotted #000;
  outline-offset: 2px;
}

.screen img {
  width: calc(var(--w) * var(--sprite-scale) * 1px);
  height: calc(var(--h) * var(--sprite-scale) * 1px);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
}

body[data-screen="start"] .start,
body[data-screen="win"] .win {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

body[data-screen="play"] .play {
  display: block;
}

.play .hint {
  position: absolute;
  top: 9px;
  left: 201px;
}

footer {
  display: flex;
  gap: 4px;
  padding: 8px 16px 17px;
}

.pogono {
  display: block;
}

.version {
  height: 16px;
  padding: 0 5px;
  background: #4a2b16;
  color: #f8f3ea;
  font-family: 'Anybody version', sans-serif;
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 0.04em;
}

#target {
  position: absolute;
  top: calc(8px * (1 - var(--sprite-scale)));
  left: calc(8px * (1 - var(--sprite-scale)));
  will-change: transform;
}
