@font-face {
  font-family: 'Tiny5';
  src: url('../fonts/tiny5-cyrillic.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Tiny5';
  src: url('../fonts/tiny5-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: 'Tiny5', ui-monospace, monospace;
  --text: #ffffff;
  --text-shadow: #3f3f3f;
  --yellow: #ffff55;
  --panel: rgba(0, 0, 0, 0.62);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1d1a17;
  color: var(--text);
  font-family: var(--font);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  outline: none;
}

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.dirt-bg {
  background-color: #2a2018;
  background-image: linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.62)), url('../img/dirt.png');
  background-size: auto, 64px 64px;
  image-rendering: pixelated;
}

img.icon {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
  vertical-align: middle;
}

#boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.5s ease;
}

#boot.done {
  opacity: 0;
  pointer-events: none;
}

.boot-logo {
  font: 400 clamp(36px, 8vw, 72px) var(--font);
  color: #e8e8e8;
  text-shadow: 0 4px 0 #6a6a6a, 0 8px 0 #2a2a2a;
  letter-spacing: 0.04em;
}

.boot-bar {
  width: min(360px, 70vw);
  height: 14px;
  border: 2px solid #000;
  background: #3a3a3a;
  box-shadow: inset 0 0 0 2px #1a1a1a;
  overflow: hidden;
}

.boot-bar div {
  width: 40%;
  height: 100%;
  background: #7ed957;
  animation: boot-slide 1.1s steps(12) infinite;
}

@keyframes boot-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
