* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vmin;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#canvas {
  display: block;
  width: 72vmin;
  height: 72vmin;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  background-color: #000000;
  cursor: pointer;
  touch-action: none;
  outline: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#container:focus, #container:focus-visible,
#canvas:focus, #canvas:focus-visible {
  outline: none;
  box-shadow: none;
}

body.no-log #container {
  gap: 0;
}

body.no-log #canvas {
  width: 100vmin;
  height: 100vmin;
}

body.no-log #telemetry {
  display: none;
}

#telemetry {
  width: 72vmin;
  height: 6.8vmin;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  border-top: 1px solid #f0f0f0;
  padding-top: 0.6vmin;
  gap: 2vmin;
}

#log {
  flex: 1;
  height: 100%;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 1.1vmin;
  line-height: 1.4;
  color: #555555;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.log-row {
  display: grid;
  grid-template-columns: 16ch 5ch 11ch 7ch 6ch 1fr;
  align-items: center;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.log-row .addr {
  color: #999999;
}

.log-row .worker {
  color: #666666;
}

.log-row .action-pro {
  color: #888888;
}

.log-row .action-anti {
  color: #111111;
  font-weight: 600;
}

.log-row .desc-op {
  color: #333333;
}

.log-row .desc-geom {
  color: #333333;
}

.log-row .desc-tags {
  color: #666666;
}

#system-readout {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 1.1vmin;
  line-height: 1.4;
  letter-spacing: 0.03em;
  border-left: 1px solid #f0f0f0;
  padding-left: 1.8vmin;
  white-space: nowrap;
}

#system-readout .metric-row {
  display: flex;
  justify-content: space-between;
  gap: 1.5ch;
}

#system-readout .label {
  color: #999999;
  transition: color 0.15s ease;
}

#system-readout .label.active {
  color: #111111;
  font-weight: 600;
}

#system-readout .val {
  color: #111111;
  font-weight: 600;
  text-align: right;
  min-width: 5ch;
}

#bias-row .val {
  text-align: center;
  min-width: 9ch;
}

#system-readout #tier-val {
  color: #000000;
  font-weight: 700;
}

@media (max-width: 768px) {
  #canvas {
    width: 84vmin;
    height: 84vmin;
  }

  #telemetry {
    width: 84vmin;
    height: 9vmin;
  }

  #log,
  #system-readout {
    font-size: 1.5vmin;
  }
}

