@font-face {
  font-family: "Silkscreen";
  src: url("../assets/fonts/Silkscreen-Regular.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Dogica";
  src: url("../assets/fonts/dogicapixel.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Pixel Pirate";
  src:
    url("../assets/fonts/pixel_pirate.woff2?v=r-kern-2") format("woff2"),
    url("../assets/fonts/pixel_pirate.ttf?v=r-kern-2") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Pirata One";
  src: url("../assets/fonts/PirataOne-Regular.ttf?v=port-assault-1") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "zpix";
  src:
    url("../assets/fonts/zpix.woff2?v=web-1") format("woff2"),
    url("../assets/fonts/zpix.ttf?v=web-1") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Galmuri11";
  src: url("../assets/fonts/Galmuri11.woff2") format("woff2");
  font-display: block;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #111712;
  overflow: hidden;
  font-family: "Silkscreen", monospace;
}

html.controller-input-active,
html.controller-input-active * {
  cursor: none !important;
}

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

.shell {
  position: relative;
  width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right));
  height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  background:
    linear-gradient(#101810, #172119 58%, #0e1410);
}

.shell:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #000;
}

canvas {
  position: absolute;
  left: 0;
  top: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #172437;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  font-family: "Silkscreen", monospace;
}

#world-view {
  z-index: 0;
  pointer-events: none;
}

#view {
  z-index: 1;
  background: transparent;
}

.loading-screen {
  position: absolute;
  z-index: 100;
  inset: 0;
  overflow: hidden;
  color: #fff;
  background: #ea4f36;
  opacity: 1;
  isolation: isolate;
  transition: opacity 420ms ease-out;
}

.loading-screen[hidden] {
  display: none;
}

.loading-screen[data-state="leaving"] {
  pointer-events: none;
  opacity: 0;
}

.loading-screen[data-state="failed"] {
  background: #1d1513;
}

.loading-screen[data-state="failed"] .loading-screen__art {
  opacity: 0.18;
}

.loading-screen__art {
  width: 100%;
  height: 100%;
  background: #ea4f36;
}

.loading-screen__status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.loading-screen__wake {
  display: inline-block;
  color: #f3aa57;
  animation: loading-wake 900ms ease-in-out infinite;
}

.loading-screen[data-state="failed"] .loading-screen__status {
  width: auto;
  height: auto;
  right: max(14px, env(safe-area-inset-right));
  left: max(14px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: block;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
  color: #f0d2be;
  font: 8px/1.5 "Silkscreen", monospace;
  line-height: 1.5;
}

.crash-copy-button {
  position: absolute;
  z-index: 200;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 14px));
  transform: translateX(-50%);
  min-width: min(260px, calc(100vw - 28px));
  min-height: 42px;
  padding: 8px 12px;
  border: 3px solid #725137;
  border-radius: 0;
  color: #2f241c;
  background: #f1ddb0;
  box-shadow: 0 0 0 2px #d0ae72;
  font: 10px/1.4 "Silkscreen", monospace;
  cursor: pointer;
}

.crash-copy-button:hover,
.crash-copy-button:focus-visible {
  outline: 2px solid #fbb954;
  outline-offset: 2px;
  background: #fbb954;
}

.crash-copy-button[data-state="failed"] {
  color: #fff1c7;
  background: #9e3e36;
}

@keyframes loading-wake {
  0% { opacity: 0.35; }
  50% { opacity: 1; }
  100% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-screen {
    transition: none;
  }

  .loading-screen__wake {
    animation: none;
  }
}

.capture-controls {
  position: fixed;
  z-index: 10;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(260px, calc(100vw - 24px));
  color: #352719;
  font-family: "Silkscreen", monospace;
  font-size: 10px;
}

.capture-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 2px solid #725137;
  background: #f1ddb0;
  box-shadow: 0 0 0 2px #d0ae72;
}

.capture-card strong,
.capture-card small,
.capture-status {
  line-height: 1.5;
}

.capture-status {
  color: #715237;
}

.capture-primary {
  min-height: 38px;
  border: 2px solid #725137;
  border-radius: 0;
  color: #fff1c7;
  background: #6c3826;
  font: inherit;
  cursor: pointer;
}

.capture-primary:disabled {
  cursor: wait;
  opacity: 0.65;
}

.capture-controls[data-state="recording"] .capture-card {
  border-color: #9a2e2e;
}

.capture-controls[data-state="recording"] .capture-status {
  color: #9a2e2e;
}
