:root {
  color-scheme: dark;
  background: #1f1e1c;
  font-family: system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
main {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  touch-action: none;
  user-select: none;
  background: #1f1e1c;
  overscroll-behavior: none;
}

main {
  position: relative;
  margin: 0 auto;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  background: #1f1e1c;
}

canvas[data-dragging="true"] {
  cursor: grabbing;
}

.controls {
  position: fixed;
  top: 14px;
  z-index: 10;
  display: flex;
  align-items: end;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(150, 150, 146, 0.17);
  border-radius: 4px;
  background: rgba(38, 37, 35, 0.68);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  opacity: 0.58;
  backdrop-filter: blur(8px);
  transition: opacity 160ms ease, border-color 160ms ease;
}

.controls:hover,
.controls:focus-within {
  border-color: rgba(170, 170, 166, 0.28);
  opacity: 0.96;
}

.controls--left {
  left: 14px;
}

.controls--right {
  right: 14px;
}

.control-field {
  display: grid;
  gap: 3px;
}

.control-field span {
  padding-left: 2px;
  color: #8f8e89;
  font: 600 8px/1 system-ui, sans-serif;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

select,
button {
  height: 27px;
  border: 1px solid #4a4945;
  border-radius: 3px;
  color: #b5b4af;
  background: #2a2927;
  font: 500 10px/1 system-ui, sans-serif;
  letter-spacing: 0.015em;
  outline: none;
}

select {
  width: 122px;
  padding: 0 24px 0 8px;
  color-scheme: dark;
}

.control-field--small select {
  width: 68px;
}

button {
  min-width: 56px;
  padding: 0 9px;
  cursor: pointer;
}

select:hover,
button:hover {
  border-color: #66655f;
  color: #d0cfca;
  background: #302f2c;
}

select:focus-visible,
button:focus-visible {
  border-color: #888780;
  box-shadow: 0 0 0 2px rgba(145, 144, 137, 0.16);
}

button:active {
  transform: translateY(1px);
}

@media (max-width: 620px) {
  .controls {
    top: 8px;
    gap: 4px;
    padding: 4px;
  }

  .controls--left {
    left: 8px;
  }

  .controls--right {
    right: 8px;
  }

  select {
    width: 100px;
  }

  .control-field--small select {
    width: 60px;
  }

  button {
    min-width: 44px;
    padding: 0 6px;
    font-size: 9px;
  }
}
