:root {
  color-scheme: only light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #78aa04;
}

body {
  display: grid;
  place-items: center;
  touch-action: none;
}

canvas {
  display: block;
  width: min(100vw, calc(100vh * 4 / 3));
  height: min(100vh, calc(100vw * 3 / 4));
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #78aa04;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.touchpad {
  position: fixed;
  width: 148px;
  height: 148px;
  margin-left: -74px;
  margin-top: -74px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.32);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), rgba(10, 8, 5, 0.16) 70%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 5;
  opacity: 1;
  transition: opacity 120ms ease;
}

.touchpad--hidden {
  opacity: 0;
}

.touchpad__stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 68px;
  margin-left: -34px;
  margin-top: -34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.14) 72%);
  border: 2px solid rgba(255, 255, 255, 0.46);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
}

.debug-console {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: min(480px, calc(100vw - 32px));
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(20, 18, 12, 0.92);
  color: #f4f0df;
  font: 14px/1.4 Consolas, "Courier New", monospace;
  z-index: 10;
}

.debug-console-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  padding: 8px 12px;
  border: 2px solid rgba(255, 255, 255, 0.32);
  background: rgba(20, 18, 12, 0.9);
  color: #f4f0df;
  font: 700 14px/1 Georgia, serif;
  cursor: pointer;
  z-index: 11;
}

.debug-console-toggle:focus-visible {
  outline: 2px solid #f1d94c;
  outline-offset: 2px;
}

.debug-console--hidden {
  display: none;
}

.debug-console__log {
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.debug-console__hint {
  margin-bottom: 8px;
  opacity: 0.72;
}

.debug-console__input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
}

.debug-console__input:focus {
  outline: 2px solid #f1d94c;
  outline-offset: 1px;
}
