@font-face {
  font-family: "Toyblocks Main";
  src: url("MAIN_FONT.ttf") format("truetype");
  font-display: swap;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
}

body,
button { font-family: "Toyblocks Main", monospace; }

.game {
  --game-scale: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 480px;
  height: 360px;
  overflow: hidden;
  background: #000;
  transform: translate(-50%, -50%) scale(var(--game-scale));
  transform-origin: center;
}

.editor,
.scene {
  position: absolute;
  inset: 0;
  width: 480px;
  height: 360px;
  overflow: hidden;
}

.side-panel { display: none; }

.scene {
  cursor: crosshair;
  background: #006eff;
  outline: none;
  touch-action: none;
}

.scene canvas {
  display: block;
  width: 480px !important;
  height: 360px !important;
  image-rendering: pixelated;
}

.scene:focus-visible::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dotted #fff;
  pointer-events: none;
}

.topbar {
  position: absolute;
  left: 99px;
  top: 12px;
  z-index: 3;
  display: grid;
  width: 282px;
  height: 42px;
  grid-template-columns: 198px 42px 42px;
}

.select-readout {
  position: relative;
  min-width: 0;
  height: 42px;
}

.select-readout img,
.tool img,
.transport img {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  user-select: none;
  pointer-events: none;
}

.select-readout span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #000;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.select-readout strong { font-weight: 400; }

.toolstrip {
  position: absolute;
  left: 10px;
  top: 66px;
  z-index: 4;
  display: grid;
  width: 42px;
  grid-template-rows: repeat(3, 42px);
}

.tool,
.transport {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.tool {
  position: relative;
  width: 42px;
  height: 42px;
}

.tool.selected img { filter: brightness(.82); }

.tool.selected::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dotted #000;
  pointer-events: none;
}

.transport {
  width: 42px;
  height: 42px;
  cursor: not-allowed;
}

.tool:focus-visible,
.transport:focus-visible {
  outline: 2px dotted #ffff55;
  outline-offset: -4px;
}

