* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f4f4f6;
  touch-action: none; /* bloquea el zoom de doble toque en toda la página */
  overscroll-behavior: none;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1;
  user-select: none;
}

.control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #333;
}

#colorPicker {
  width: 40px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  padding: 0;
}

#sizeSlider {
  width: 140px;
  cursor: pointer;
}

#jumpsSelect {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

.checkbox {
  cursor: pointer;
}

#clearBtn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #e94560;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

#clearBtn:hover {
  background: #c73650;
}

#canvas {
  display: block;
  width: 100%;
  height: calc(100% - 56px);
  touch-action: none; /* imprescindible para dibujar con dedo/lápiz sin scroll */
  cursor: crosshair;
}

#playBtn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #2e9e5b;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

#playBtn:hover {
  background: #268a4d;
}

#tiltBtn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #7a5af5;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

#tiltBtn:hover {
  background: #6847e0;
}

#fullscreenBtn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #4a6fa5;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

#fullscreenBtn:hover {
  background: #3d5d8a;
}

#hint {
  display: none;
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 30, 0.75);
  color: #fff;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 3;
  pointer-events: none;
  white-space: nowrap;
}

#hint.visible {
  display: block;
}

#touchControls {
  display: none;
  position: fixed;
  bottom: 18px;
  left: 0;
  right: 0;
  padding: 0 18px;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 3;
  pointer-events: none;
}

#touchControls.visible {
  display: flex;
}

#touchControls .cluster {
  display: flex;
  gap: 12px;
}

#touchControls button {
  pointer-events: auto;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 20, 30, 0.55);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#touchControls button:active {
  background: rgba(20, 20, 30, 0.85);
}
